/* Модуль «Работа с закупками» — premium B2B kanban */

#tab-tenders-work.ws-page {
  display: none;
  flex-direction: column;
  min-height: 0;
  gap: 0;
  overflow: hidden;
  max-width: 100%;
}
#tab-tenders-work.ws-page.active {
  display: flex;
  min-height: calc(100dvh - 128px);
}

/* Prevent page-level horizontal scroll when kanban scrolls */
#tab-tenders-work.ws-page.active ~ *,
main:has(#tab-tenders-work.active) {
  overflow-x: hidden;
  max-width: 100%;
}

.ws-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 4px 0 12px;
  flex-shrink: 0;
}
.ws-hero-main h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.ws-hero-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
  max-width: 520px;
}
.ws-hero-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.ws-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.15s;
}
.ws-icon-btn:hover { border-color: rgba(45, 212, 168, 0.35); background: rgba(45, 212, 168, 0.08); }
.ws-icon-btn.is-spinning { animation: wsSpin 0.8s linear infinite; pointer-events: none; opacity: 0.7; }
@keyframes wsSpin { to { transform: rotate(360deg); } }

/* ── Sub-tabs ── */
.ws-module-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px 0 12px;
  flex-shrink: 0;
}
.ws-module-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  color: var(--muted);
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, color 0.18s, transform 0.15s;
}
.ws-module-tabs button:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 25%, var(--line));
}
.ws-module-tabs button.active {
  border-color: rgba(45, 212, 168, 0.45);
  background: rgba(45, 212, 168, 0.12);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(45, 212, 168, 0.08);
}
.ws-tab-ico { font-size: 14px; opacity: 0.85; }

.ws-notif-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  font-size: 17px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}
.ws-notif-btn:hover { border-color: rgba(45, 212, 168, 0.35); }
.ws-notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #f59e0b;
  color: #111;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Board panel layout ── */
.ws-board-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}
.ws-sub-panel { padding-top: 0; }

/* ── Toolbar ── */
.ws-board-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  flex-shrink: 0;
}
.ws-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 200px;
}
.ws-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.ws-filter-select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  min-width: 150px;
  transition: border-color 0.18s;
}
.ws-filter-select:focus { outline: none; border-color: rgba(45, 212, 168, 0.4); }
.ws-filter-check {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  color: var(--muted);
  cursor: pointer;
}
.ws-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 160px;
  max-width: 320px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.ws-search-ico { opacity: 0.5; font-size: 14px; }
.ws-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 8px 0;
  color: var(--text);
  font-size: 13px;
}
.ws-search-input:focus { outline: none; }
.ws-tool-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.ws-tool-btn:hover { color: var(--text); border-color: rgba(45, 212, 168, 0.3); }
.ws-tool-btn.on {
  border-color: rgba(45, 212, 168, 0.45);
  color: var(--accent);
  background: rgba(45, 212, 168, 0.1);
}
.ws-view-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.ws-view-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  width: 34px;
  height: 34px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.ws-view-btn.on {
  background: rgba(45, 212, 168, 0.14);
  color: var(--accent);
}

/* ── Kanban scroll container ── */
.ws-board-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  margin: 0 -2px;
  padding: 0 2px 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(45, 212, 168, 0.35) transparent;
}
.ws-board-scroll::-webkit-scrollbar { height: 8px; }
.ws-board-scroll::-webkit-scrollbar-thumb {
  background: rgba(45, 212, 168, 0.28);
  border-radius: 999px;
}
.ws-loading { padding: 24px; text-align: center; color: var(--muted); }

.ws-kanban {
  display: flex;
  gap: 12px;
  align-items: stretch;
  min-height: min(520px, calc(100dvh - 340px));
  padding-bottom: 4px;
  width: max-content;
  min-width: 100%;
}
.ws-kanban.ws-kanban-list {
  flex-direction: column;
  width: 100%;
  min-height: 0;
}
.ws-kanban.ws-kanban-list .ws-column {
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
}

/* ── Columns ── */
.ws-column {
  flex: 0 0 272px;
  width: 272px;
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 300px);
}
.ws-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px 14px 0 0;
  background: color-mix(in srgb, var(--surface) 92%, #0a1628);
  border: 1px solid var(--line);
  border-bottom: none;
}
.ws-column-head-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.ws-column-title {
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-column-count {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  background: rgba(45, 212, 168, 0.12);
  border: 1px solid rgba(45, 212, 168, 0.22);
  padding: 2px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.ws-column-actions { display: flex; gap: 4px; flex-shrink: 0; }
.ws-col-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.ws-col-btn:hover {
  color: var(--accent);
  border-color: rgba(45, 212, 168, 0.35);
  background: rgba(45, 212, 168, 0.08);
}

.ws-column-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 0 0 14px 14px;
  background: color-mix(in srgb, var(--bg) 94%, #060d14);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  scrollbar-width: thin;
}
.ws-column-body.ws-drop-target {
  border-color: rgba(45, 212, 168, 0.55);
  box-shadow: inset 0 0 0 2px rgba(45, 212, 168, 0.2);
  background: color-mix(in srgb, var(--bg) 88%, rgba(45, 212, 168, 0.06));
}
.ws-drop-indicator {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #18b894, #20d9b0);
  margin: 2px 4px;
  box-shadow: 0 0 8px rgba(45, 212, 168, 0.45);
  pointer-events: none;
  animation: wsDropPulse 0.9s ease-in-out infinite alternate;
}
@keyframes wsDropPulse {
  from { opacity: 0.55; transform: scaleX(0.92); }
  to { opacity: 1; transform: scaleX(1); }
}

.ws-add-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed color-mix(in srgb, var(--line) 90%, var(--accent));
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.ws-add-card:hover {
  color: var(--accent);
  border-color: rgba(45, 212, 168, 0.45);
  background: rgba(45, 212, 168, 0.06);
}
.ws-show-all {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  padding: 6px;
  cursor: pointer;
  text-align: center;
  transition: opacity 0.18s;
}
.ws-show-all:hover { opacity: 0.85; }

/* ── Cards ── */
.ws-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 10px 9px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  cursor: grab;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.ws-card:hover {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}
.ws-card:active { cursor: grabbing; }
.ws-card.ws-dragging {
  opacity: 0.45;
  transform: scale(0.98) rotate(1deg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.ws-card-overdue { border-color: rgba(248, 113, 113, 0.5); }
.ws-card-overdue-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #f87171;
  border-radius: 12px 0 0 12px;
}
.ws-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}
.ws-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}
.ws-law {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.ws-law-44 {
  color: #7dd3fc;
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.25);
}
.ws-law-223 {
  color: #5eead4;
  background: rgba(45, 212, 168, 0.12);
  border-color: rgba(45, 212, 168, 0.25);
}
.ws-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}
.ws-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.ws-status-overdue { color: #f87171; background: rgba(248, 113, 113, 0.12); }
.ws-status-today { color: #fbbf24; background: rgba(251, 191, 36, 0.12); }
.ws-status-progress { color: #93c5fd; background: rgba(96, 165, 250, 0.1); }
.ws-status-submitted { color: #2dd4a8; background: rgba(45, 212, 168, 0.12); }
.ws-status-review { color: #c4b5fd; background: rgba(167, 139, 250, 0.12); }
.ws-status-done { color: #2dd4a8; background: rgba(45, 212, 168, 0.12); }
.ws-status-lost { color: #f87171; background: rgba(248, 113, 113, 0.1); }
.ws-card-menu {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.ws-card-menu:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.ws-card-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ws-card-reg {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.ws-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}
.ws-card-deadline {
  font-size: 11px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ws-card-price { font-size: 12px; font-weight: 800; color: var(--accent); }
.ws-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.ws-card-assignee {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 11px;
  color: var(--muted);
}
.ws-card-assignee span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Footer stats ── */
.ws-board-footer {
  flex-shrink: 0;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ws-stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  flex: 1;
  min-width: 200px;
}
.ws-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 72px;
}
.ws-stat-val {
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.ws-stat-lbl {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ws-stat-warn .ws-stat-val { color: #f87171; }
.ws-stat-gold .ws-stat-val { color: #fbbf24; }
.ws-stat-purple .ws-stat-val { color: #c4b5fd; }
.ws-stat-ok .ws-stat-val { color: var(--accent); }
.ws-footer-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.ws-footer-refresh {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s;
}
.ws-footer-refresh:hover { color: var(--accent); border-color: rgba(45, 212, 168, 0.35); }

/* ── Avatars / deadlines (shared) ── */
.ws-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2dd4a8, #5b9cff);
  color: #0b1220;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
}
.ws-avatar-sm { width: 22px; height: 22px; font-size: 9px; }
.ws-avatar-empty { background: var(--line); color: var(--muted); }

.ws-deal-kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}
.ws-deal-kv span:nth-child(odd) { color: var(--muted); }
.ws-deal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}
.ws-deal-assign-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
}
.ws-hist-row { font-size: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.ws-notif-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.ws-notif-row.unread strong { color: var(--accent); }

/* ── Tasks / calendar panels ── */
.ws-tasks-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.ws-tasks-list { display: grid; gap: 8px; }
.ws-task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 0.18s;
}
.ws-task-row:hover { border-color: rgba(45, 212, 168, 0.25); }
.ws-task-row.done { opacity: 0.65; }
.ws-task-main { flex: 1; min-width: 0; }
.ws-task-title { font-weight: 600; font-size: 14px; }
.ws-task-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 2px; }
.ws-task-done { flex-shrink: 0; min-width: 36px; }
.ws-task-done-lbl { font-size: 12px; color: var(--accent); }
.ws-task-add {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  margin-top: 10px;
}
.ws-task-add input[type="text"],
.ws-task-add input[type="date"] {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}
.ws-deal-tasks-wrap { margin-top: 14px; }

.ws-cal-panel-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Calendar premium grid ── */
.ws-cal-toolbar {
  flex-wrap: wrap;
  gap: 12px;
}
.ws-cal-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: center;
  min-width: 220px;
}
.ws-cal-period {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  min-width: 140px;
  text-align: center;
}
.ws-cal-nav-btn,
.ws-cal-today-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}
.ws-cal-nav-btn { width: 34px; padding-inline: 0; }
.ws-cal-today-btn { padding-inline: 12px; }
.ws-cal-nav-btn:hover,
.ws-cal-today-btn:hover {
  border-color: rgba(45, 212, 168, 0.35);
  background: rgba(45, 212, 168, 0.08);
}
.ws-cal-view-toggle .ws-cal-view-btn {
  width: auto;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
}
.ws-cal-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-bottom: 8px;
}
.ws-cal-grid {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}
.ws-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface2) 70%, transparent);
}
.ws-cal-weekdays span {
  padding: 8px 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ws-cal-cells {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: minmax(108px, 1fr);
}
.ws-cal-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 6px;
  min-height: 108px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}
.ws-cal-cell:nth-child(7n) { border-right: none; }
.ws-cal-cell.muted { opacity: 0.45; }
.ws-cal-cell.today { background: rgba(45, 212, 168, 0.04); }
.ws-cal-cell-head { display: flex; justify-content: flex-end; }
.ws-cal-day-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}
.ws-cal-day-num.is-today {
  background: rgba(45, 212, 168, 0.22);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(45, 212, 168, 0.35);
}
.ws-cal-cell-events {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
}
.ws-cal-card {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 1px solid color-mix(in srgb, var(--line) 90%, transparent);
  border-radius: 8px;
  padding: 5px 6px;
  background: color-mix(in srgb, var(--surface2) 82%, #0d1117 18%);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.16s, transform 0.15s, box-shadow 0.16s;
}
.ws-cal-card:hover {
  border-color: rgba(45, 212, 168, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.ws-cal-card-overdue {
  border-color: rgba(239, 68, 68, 0.35);
  background: color-mix(in srgb, rgba(239, 68, 68, 0.12) 40%, var(--surface2));
}
.ws-cal-overdue-tag {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f87171;
}
.ws-cal-card-head {
  display: flex;
  align-items: center;
  gap: 5px;
}
.ws-cal-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex-shrink: 0;
}
.ws-cal-dot-red { background: #ef4444; box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25); }
.ws-cal-dot-orange { background: #f59e0b; box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25); }
.ws-cal-dot-purple { background: #a78bfa; box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.25); }
.ws-cal-dot-blue { background: #60a5fa; box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.25); }
.ws-cal-dot-green { background: #34d399; box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.25); }
.ws-cal-time {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}
.ws-cal-card-title {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ws-cal-law {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.03em;
  opacity: 0.85;
}
.ws-cal-more {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  padding: 2px 4px;
}
.ws-cal-grid-week .ws-cal-week-cols {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-height: 360px;
}
.ws-cal-week-col {
  border-right: 1px solid var(--line);
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 360px;
}
.ws-cal-week-col:last-child { border-right: none; }
.ws-cal-week-col.today { background: rgba(45, 212, 168, 0.04); }
.ws-cal-week-col-head { display: flex; justify-content: center; margin-bottom: 4px; }
.ws-cal-empty-day { font-size: 12px; color: var(--muted); text-align: center; padding: 8px 0; }
.ws-cal-day-view {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}
.ws-cal-day-view.today { box-shadow: inset 0 0 0 1px rgba(45, 212, 168, 0.2); }
.ws-cal-day-view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface2) 70%, transparent);
}
.ws-cal-day-view-date { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }
.ws-cal-day-view-count { font-size: 12px; color: var(--muted); font-weight: 700; }
.ws-cal-day-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}
.ws-cal-day-list .ws-cal-card { padding: 10px 12px; }
.ws-cal-day-list .ws-cal-card-title { font-size: 13px; -webkit-line-clamp: 3; }

/* legacy list styles removed */

/* ── Responsive ── */
@media (max-width: 899px) {
  .ws-kanban { min-height: 420px; }
  .ws-column { flex: 0 0 min(260px, 78vw); width: min(260px, 78vw); }
  .ws-board-toolbar { padding: 8px 10px; }
  .ws-search-wrap { max-width: none; flex: 1 1 100%; }
  .ws-cal-nav { order: 3; width: 100%; }
  .ws-cal-cells { grid-auto-rows: minmax(92px, auto); }
  .ws-cal-cell { min-height: 92px; }
}

@media (max-width: 640px) {
  #tab-tenders-work.ws-page.active { min-height: calc(100dvh - 112px); }
  .ws-hero-main h2 { font-size: 19px; }
  .ws-kanban:not(.ws-kanban-list) {
    flex-direction: column;
    width: 100%;
    overflow: visible;
    min-height: 0;
  }
  .ws-board-scroll {
    overflow-x: visible;
    overflow-y: auto;
  }
  .ws-kanban:not(.ws-kanban-list) .ws-column {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    max-height: none;
  }
  .ws-column-body { max-height: 320px; }
  .ws-stats-grid { gap: 6px 12px; }
  .ws-stat { min-width: 64px; }
  .ws-footer-meta { width: 100%; justify-content: flex-end; }
}

@media (min-width: 900px) {
  .ws-kanban { min-height: min(560px, calc(100dvh - 320px)); }
  .ws-column { flex: 0 0 280px; width: 280px; }
}

@media (prefers-reduced-motion: reduce) {
  .ws-card,
  .ws-module-tabs button,
  .ws-icon-btn,
  .ws-drop-indicator {
    transition: none !important;
    animation: none !important;
  }
  .ws-card:hover { transform: none; }
}
