/* CRM аутсорс · v25 design system (dark + light themes) */

:root {
  color-scheme: light;
  --bg: #dfe4ed;
  --surface: #ffffff;
  --surface-hi: #ffffff;
  --surface-2: #f2f4f8;
  --surface-3: #e8ecf3;
  --glass: rgba(238, 242, 248, 0.8);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --glass-weak: rgba(255, 255, 255, 0.62);
  --glass-border: rgba(255, 255, 255, 0.7);
  --text: #0b1222;
  --text-2: #263247;
  --muted: #4a5468;
  --faint: #7c879b;
  --line: rgba(15, 23, 42, 0.11);
  --line-2: rgba(15, 23, 42, 0.17);
  --line-strong: #b4bfcf;
  --hover: rgba(15, 23, 42, 0.05);
  --check-border: #9aa6b8;
  --accent-tint: #f7f7ff;
  --head-grad: linear-gradient(180deg, #f6f6ff 0%, #ffffff 100%);
  --warn-tint: linear-gradient(135deg, #fff7ed, #fffbeb);
  --warn-line: #fdba74;
  --warn-text: #7c2d12;
  --danger-line: #fca5a5;
  --now-bg: linear-gradient(135deg, #e9edff 0%, #f1edff 100%);
  --now-line: #d6dcff;
  --call-bg: #e7f8ef; --call-line: #a7e8c3; --call-fg: #047857; --call-bg-hover: #d1fae5;
  --halo-warn: #ffedd5; --halo-ok: #dcfce7;
  --cell-came: #dcfce7; --cell-came-fg: #166534;
  --cell-no: #fee2e2;
  --cell-left: #ffedd5; --cell-left-fg: #9a3412;
  --cell-wait: #e6efff; --cell-wait-fg: #1e40af;
  --cell-lock: #e2e8f0; --cell-lock-fg: #475569;
  --skeleton: rgba(203, 213, 225, 0.9);
  --skeleton-shine: rgba(255, 255, 255, 0.75);
  --grid-line: rgba(15, 23, 42, 0.06);
  --aurora-base: linear-gradient(160deg, #e0e5f3 0%, #dbe1eb 45%, #e3deed 100%);
  --a1: rgba(99, 102, 241, 0.42);
  --a2: rgba(56, 189, 248, 0.34);
  --a3: rgba(236, 72, 153, 0.22);
  --a4: rgba(45, 212, 191, 0.26);
  --a5: rgba(167, 139, 250, 0.2);
  --toast-bg: rgba(15, 23, 42, 0.94);
  --toast-fg: #f8fafc;

  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-ink: #4338ca;
  --accent-soft: #e9ecff;
  --accent-soft-2: #d9defe;
  --accent-ring: rgba(79, 70, 229, 0.28);
  --accent-grad: linear-gradient(135deg, #6366f1 0%, #4f46e5 55%, #7c3aed 100%);

  --danger: #dc2626;
  --danger-ink: #b91c1c;
  --danger-soft: #fef2f2;
  --danger-solid-hover: #b91c1c;
  --warn: #c2410c;
  --warn-soft: #fff7ed;
  --ok: #15803d;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 24px;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;

  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --radius: var(--r-lg);

  --sh-xs: 0 1px 2px rgba(15, 23, 42, 0.07);
  --sh-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 2px 8px -2px rgba(15, 23, 42, 0.09);
  --sh-md: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px -6px rgba(15, 23, 42, 0.14);
  --sh-lg: 0 2px 4px rgba(15, 23, 42, 0.06), 0 24px 56px -12px rgba(15, 23, 42, 0.28);
  --shadow: var(--sh-sm);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-fast: 150ms;
  --t: 200ms;
  --t-slow: 260ms;

  --gutter: max(24px, calc((100vw - 1280px) / 2));
  --ctl-h: 40px;
  --focus: 0 0 0 3px var(--accent-ring);
}

/* Status tokens (badges, avatars, board) */
.st-avito  { --st: #3b82f6; --st-ink: #1d4ed8; --st-bg: #eff6ff; }
.st-recall { --st: #f43f5e; --st-ink: #be123c; --st-bg: #fff1f2; }
.st-call   { --st: #f59e0b; --st-ink: #b45309; --st-bg: #fffbeb; }
.st-push   { --st: #8b5cf6; --st-ink: #6d28d9; --st-bg: #f5f3ff; }
.st-shift  { --st: #10b981; --st-ink: #047857; --st-bg: #ecfdf5; }
.st-hired  { --st: #059669; --st-ink: #047857; --st-bg: #ecfdf5; }
.st-fb1    { --st: #0ea5e9; --st-ink: #0369a1; --st-bg: #f0f9ff; }
.st-fb3    { --st: #22c55e; --st-ink: #15803d; --st-bg: #f0fdf4; }
.st-fb14   { --st: #16a34a; --st-ink: #166534; --st-bg: #ecfdf3; }
.st-refuse { --st: #94a3b8; --st-ink: #475569; --st-bg: #f1f5f9; }

/* Base */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 160px; }
body {
  font-family: var(--font);
  font-size: var(--fs-md);
  font-feature-settings: "cv11", "ss01", "ss03";
  color: var(--text);
  line-height: 1.5;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
}

/* Aurora background: CSS only, transform-animated */
body::before {
  content: "";
  position: fixed;
  inset: -25vmax;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(30vmax 26vmax at 30% 30%, var(--a1), transparent 70%),
    radial-gradient(28vmax 24vmax at 72% 27%, var(--a2), transparent 70%),
    radial-gradient(30vmax 26vmax at 68% 72%, var(--a3), transparent 70%),
    radial-gradient(28vmax 26vmax at 31% 73%, var(--a4), transparent 70%),
    radial-gradient(22vmax 20vmax at 50% 50%, var(--a5), transparent 70%),
    var(--aurora-base);
  animation: aurora 38s ease-in-out infinite alternate;
  will-change: transform;
}
/* Crisp hairline grid fading out from the top */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 75%);
}
@keyframes aurora {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  33%  { transform: translate3d(4vmax, -3vmax, 0) rotate(8deg) scale(1.06); }
  66%  { transform: translate3d(-3vmax, 3vmax, 0) rotate(-6deg) scale(1.03); }
  100% { transform: translate3d(2vmax, 4vmax, 0) rotate(4deg) scale(1.08); }
}

::selection { background: var(--accent-soft-2); color: var(--text); }

button, input, select, textarea { font-family: inherit; font-size: var(--fs-md); color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-ink); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

* { scrollbar-width: thin; scrollbar-color: rgba(100, 116, 139, 0.35) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, 0.32); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(100, 116, 139, 0.55); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.hidden { display: none !important; pointer-events: none !important; }

/* Form controls */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
  background-color: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  color: var(--text);
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease, background-color var(--t-fast) ease;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:not([type="checkbox"]):not([type="radio"]):hover,
select:hover, textarea:hover { border-color: var(--line-strong); }
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--focus);
  outline: none;
}
input:read-only:not([type="checkbox"]), input:disabled, select:disabled, textarea:disabled {
  background-color: var(--surface-2);
  color: var(--muted);
}
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 32px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  text-overflow: ellipsis;
  cursor: pointer;
}
input[type="date"], input[type="time"] { font-variant-numeric: tabular-nums; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator { opacity: 0.55; cursor: pointer; }

input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1.5px solid var(--check-border);
  border-radius: 5px;
  background: var(--surface) center / 12px no-repeat;
  cursor: pointer;
  transition: background-color var(--t-fast) ease, border-color var(--t-fast) ease, box-shadow var(--t-fast) ease, transform 120ms ease;
}
input[type="checkbox"]:hover { border-color: var(--accent); }
input[type="checkbox"]:active { transform: scale(0.92); }
input[type="checkbox"]:focus-visible { box-shadow: var(--focus); border-color: var(--accent); }
input[type="checkbox"]:checked {
  background-color: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
input[type="checkbox"]:indeterminate {
  background-color: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E");
}
input[type="checkbox"]:disabled { opacity: 0.5; cursor: not-allowed; }

/* Buttons: primary / secondary / ghost / danger */
.btn, label.btn {
  --btn-bg: var(--surface);
  --btn-bd: var(--line-2);
  --btn-fg: var(--text-2);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--ctl-h);
  padding: 0 14px;
  margin: 0;
  border-radius: var(--r-md);
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-md);
  font-weight: 550;
  line-height: 1;
  letter-spacing: -0.005em;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  box-shadow: var(--sh-xs);
  transition: background-color var(--t-fast) ease, border-color var(--t-fast) ease, color var(--t-fast) ease, box-shadow var(--t-fast) ease, transform 120ms ease, filter var(--t-fast) ease;
}
.btn:hover { --btn-bg: var(--surface-2); --btn-bd: var(--line-strong); --btn-fg: var(--text); }
.btn:active { transform: translateY(1px) scale(0.985); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled, .btn[disabled] { opacity: 0.55; cursor: default; transform: none; }
.btn-primary, .btn-cta {
  --btn-bg: var(--accent);
  --btn-bd: transparent;
  --btn-fg: #fff;
  background: var(--accent-grad);
  box-shadow: 0 1px 2px rgba(49, 46, 129, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 6px 16px -6px rgba(79, 70, 229, 0.55);
}
.btn-primary:hover, .btn-cta:hover {
  --btn-fg: #fff;
  --btn-bd: transparent;
  filter: brightness(1.07) saturate(1.05);
  box-shadow: 0 1px 2px rgba(49, 46, 129, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 10px 22px -8px rgba(79, 70, 229, 0.6);
}
.btn-primary:focus-visible, .btn-cta:focus-visible { box-shadow: var(--focus), 0 6px 16px -6px rgba(79, 70, 229, 0.55); }
.btn-cta { padding: 0 18px; }
.btn-block { width: 100%; height: 44px; font-size: var(--fs-lg); }
.btn-danger { --btn-fg: var(--danger-ink); --btn-bd: var(--danger-line); }
.btn-danger:hover { --btn-bg: var(--danger-soft); --btn-bd: var(--danger-ink); --btn-fg: var(--danger-ink); }
.btn-danger-solid { --btn-bg: var(--danger); --btn-bd: var(--danger); --btn-fg: #fff; box-shadow: 0 1px 2px rgba(127, 29, 29, 0.25), 0 6px 16px -8px rgba(220, 38, 38, 0.6); }
.btn-danger-solid:hover { --btn-bg: var(--danger-solid-hover); --btn-bd: var(--danger-solid-hover); --btn-fg: #fff; }
.icon-btn { width: var(--ctl-h); padding: 0; gap: 0; display: inline-grid; place-items: center; font-size: 20px; line-height: 1; }
.icon-btn svg { width: 18px; height: 18px; }
.drawer-head .icon-btn { --btn-bd: transparent; box-shadow: none; color: var(--muted); }
.drawer-head .icon-btn:hover { --btn-bg: var(--surface-3); }

/* Icons through CSS masks: survive JS textContent updates */
#admin-btn::before, #notify-btn::before, #logout-btn::before,
#paste-toggle::before, #export-btn::before, #ecosource-export-btn::before, label[for="avito-import-file"]::before, label[for="import-file"]::before,
#call-link::before, #wa-link::before, #tg-link::before,
#bulk-delete::before, #delete-btn::before {
  content: "";
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat;
  mask: var(--ico) center / contain no-repeat;
  opacity: 0.9;
}
#admin-btn { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }
#notify-btn { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9'/%3E%3Cpath d='M10.3 21a1.94 1.94 0 0 0 3.4 0'/%3E%3C/svg%3E"); }
#logout-btn { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpath d='m16 17 5-5-5-5M21 12H9'/%3E%3C/svg%3E"); }
#paste-toggle { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8' y='2' width='8' height='4' rx='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Cpath d='M9 12h6M9 16h4'/%3E%3C/svg%3E"); }
#export-btn { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpath d='m7 10 5 5 5-5M12 15V3'/%3E%3C/svg%3E"); }
#ecosource-export-btn { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='m8 11 4 4 4-4'/%3E%3Cpath d='M4 19h16'/%3E%3C/svg%3E"); }
label[for="avito-import-file"], label[for="import-file"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpath d='m17 8-5-5-5 5M12 3v12'/%3E%3C/svg%3E"); }
#call-link { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.8 19.8 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.12 4.18 2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.36 1.9.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E"); }
#wa-link { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7.9 20A9 9 0 1 0 4 16.1L2 22z'/%3E%3C/svg%3E"); }
#tg-link { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m22 2-7 20-4-9-9-4z'/%3E%3Cpath d='M22 2 11 13'/%3E%3C/svg%3E"); }
#bulk-delete, #delete-btn { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m3 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6'/%3E%3Cpath d='M10 11v6M14 11v6'/%3E%3C/svg%3E"); }

/* Brand mark */
.logo {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent-grad);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 12px -4px rgba(79, 70, 229, 0.6);
}
.logo svg { width: 17px; height: 17px; }

/* Login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: var(--s6); }
.login-card {
  width: min(400px, 100%);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 36px 32px 32px;
  box-shadow: var(--sh-lg), inset 0 1px 0 var(--glass-border);
  animation: rise 420ms var(--ease) both;
}
.login-card .logo { width: 44px; height: 44px; border-radius: 13px; margin-bottom: 22px; }
.login-card .logo svg { width: 24px; height: 24px; }
.eyebrow {
  margin: 0 0 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.login-card h1 { margin: 0 0 6px; font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -0.03em; }
.sub { margin: 0 0 24px; color: var(--muted); font-size: var(--fs-md); }
.login-card label { display: block; font-weight: 550; font-size: var(--fs-sm); color: var(--text-2); margin-bottom: 6px; }
.login-card input { width: 100%; height: 44px; padding: 0 14px; margin-bottom: 14px; font-size: 15px; }
.login-error { color: var(--danger-ink); font-size: var(--fs-sm); min-height: 1.4em; margin: -4px 0 10px; }

/* App shell */
.app { min-height: 100dvh; animation: fade-in 300ms ease both; }
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: var(--s2);
  align-items: center;
  min-height: 60px;
  padding: 10px var(--gutter);
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.8);
  backdrop-filter: blur(18px) saturate(1.8);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  color: var(--text);
}
.brand { margin-right: auto; display: flex; gap: 10px; align-items: center; min-width: 0; }
.brand strong { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.who-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass-weak);
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease, border-color var(--t-fast) ease;
}
.who-btn::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18); flex: 0 0 auto; }
.who-btn:hover { color: var(--text); background: var(--surface-hi); border-color: var(--line-2); }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap::before {
  content: "";
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  background: var(--faint);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
  pointer-events: none;
  z-index: 1;
}
.search {
  height: 38px;
  width: min(340px, 36vw);
  padding: 0 14px 0 36px;
  background-color: var(--glass-strong) !important;
}
.top .btn { height: 38px; --btn-bg: var(--glass-weak); --btn-bd: var(--line); box-shadow: none; }
.top .btn:hover { --btn-bg: var(--surface-hi); --btn-bd: var(--line-2); }
.top .btn:disabled { opacity: 0.7; }

/* Page sections share one centered column */
.roles, .quick, .site-panel, .metrics, .tabs, .filters, .bulk-bar, .main { padding-left: var(--gutter); padding-right: var(--gutter); }
.due-bar { margin-left: var(--gutter); margin-right: var(--gutter); }

/* Role switch: segmented control */
.roles { display: flex; gap: 0; padding-top: var(--s6); }
.role {
  position: relative;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: var(--glass-weak);
  color: var(--muted);
  font-weight: 550;
  font-size: var(--fs-md);
  transition: background-color var(--t) ease, color var(--t) ease, box-shadow var(--t) ease;
}
.role:first-of-type { border-radius: var(--r-md) 0 0 var(--r-md); }
.role:last-of-type { border-radius: 0 var(--r-md) var(--r-md) 0; margin-left: -1px; }
.role.hidden + .role, .role:has(+ .role.hidden) { border-radius: var(--r-md); margin-left: 0; }
.role:hover { color: var(--text); background: var(--glass-strong); }
.role.is-on { z-index: 1; background: var(--surface-hi); color: var(--text); border-color: var(--line-2); box-shadow: var(--sh-sm); }
.role.is-on::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent-grad); }

/* Quick add card: form + import toolbar as one surface */
.quick { padding-top: var(--s4); padding-bottom: 0; }
.quick-form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: var(--s5) var(--s5) var(--s4);
  box-shadow: var(--sh-md);
}
.quick-form-head { display: flex; flex-direction: column; gap: 4px; }
.quick-form-head .eyebrow { margin: 0; font-size: var(--fs-xs); font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-ink); }
.quick-sub { margin: 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.35; }
.quick-fields {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: flex-end;
}
#site-panel .quick-form { border-radius: var(--r-xl); border-bottom: 1px solid var(--line); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.grow { flex: 1 1 200px; }
.phone-field { width: 190px; flex: 0 1 190px; }
.quick-fields .field { flex: 1 1 140px; }
.quick-fields .field.grow { flex: 1 1 220px; }
.quick-fields .phone-field { flex: 0 1 190px; }
.field label { font-size: var(--fs-xs); font-weight: 550; color: var(--muted); letter-spacing: 0.01em; }
.field input, .field select { height: var(--ctl-h); padding: 0 12px; background-color: var(--surface-2); }
.field input:focus, .field select:focus { background-color: var(--surface-hi); }
.field > .btn { align-self: flex-start; height: 32px; font-size: var(--fs-sm); }
.quick-submit { flex-shrink: 0; min-width: 132px; height: var(--ctl-h); }
.import-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  align-items: center;
  padding: var(--s3) var(--s5);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  box-shadow: var(--sh-md);
}
.import-row .btn { height: 34px; padding: 0 12px; font-size: var(--fs-sm); }
.import-row .btn-cta { padding: 0 14px; }
.quick-hint { margin: 0 0 0 auto; color: var(--muted); font-size: var(--fs-xs); line-height: 1.4; max-width: 46ch; }
.import-row .quick-hint { padding-left: var(--s2); }
.quick:has(#paste-box:not(.hidden)) #paste-toggle { --btn-bg: var(--accent-soft); --btn-bd: var(--accent-soft-2); --btn-fg: var(--accent-ink); }

/* «Вставить список» panel */
.paste-box {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  margin-top: var(--s3);
  max-width: 760px;
  padding: var(--s5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  animation: pop-in var(--t-slow) var(--ease) both;
  transform-origin: top left;
}
.paste-head { display: flex; align-items: flex-start; gap: var(--s3); }
.paste-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent-ink); flex: 0 0 auto; }
.paste-ico svg { width: 18px; height: 18px; }
.paste-head strong { display: block; font-size: var(--fs-lg); font-weight: 650; letter-spacing: -0.01em; }
.paste-head p { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.paste-box textarea {
  width: 100%;
  min-height: 150px;
  padding: 12px 14px;
  resize: vertical;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  line-height: 1.7;
  background-color: var(--surface-2);
}
.paste-box textarea:focus { background-color: var(--surface-hi); }
.paste-box .btn { align-self: flex-end; }

/* Metrics */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s3);
  padding-top: var(--s4);
  padding-bottom: 0;
}
.metric {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 2px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  box-shadow: var(--sh-sm);
}
.metric::before {
  content: "";
  position: absolute;
  top: 16px;
  right: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.metric b { display: block; font-size: 26px; font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--text); }
.metric span { color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
.metric.warn::before { background: #f97316; box-shadow: 0 0 0 4px var(--halo-warn); }
.metric.warn b { color: var(--warn); }
.metric.ok::before { background: #22c55e; box-shadow: 0 0 0 4px var(--halo-ok); }
.metric.ok b { color: var(--ok); }

/* Due bar («Сейчас») */
.due-bar {
  position: relative;
  margin-top: var(--s4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 0 var(--s4) var(--s1);
  box-shadow: var(--sh-md);
  max-height: 300px;
  overflow: auto;
}
.due-bar > .eyebrow {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 calc(-1 * var(--s4));
  padding: 12px var(--s4) 8px;
  background: var(--surface);
  color: var(--warn);
}
.due-bar > .eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #f97316; animation: pulse 2s ease-in-out infinite; }
.due-item { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; padding: 10px 0; }
.due-item + .due-item { border-top: 1px solid var(--line); }
.due-item strong { font-size: var(--fs-md); font-weight: 600; }
.due-item p { margin: 1px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.due-item .grow { flex: 1; min-width: 180px; }
.due-item .btn { height: 32px; padding: 0 12px; font-size: var(--fs-sm); }
.due-item .btn-primary {
  min-width: 108px;
  --btn-bg: var(--accent-soft);
  --btn-bd: var(--accent-soft-2);
  --btn-fg: var(--accent-ink);
  background: var(--btn-bg);
  box-shadow: none;
  filter: none;
}
.due-item .btn-primary:hover { --btn-bg: var(--accent-soft-2); --btn-fg: var(--accent-press, #3730a3); box-shadow: none; filter: none; }

/* Sticky chrome: tabs + filters + bulk */
.sticky-chrome {
  position: sticky;
  top: var(--top-h, 60px);
  z-index: 19;
  margin-top: var(--s5);
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.8);
  backdrop-filter: blur(18px) saturate(1.8);
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  padding-bottom: var(--s3);
}
.tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  padding-top: var(--s1);
  box-shadow: inset 0 -1px 0 var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  flex: 0 0 auto;
  height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  background: transparent;
  color: var(--muted);
  font-weight: 550;
  font-size: var(--fs-md);
  white-space: nowrap;
  transition: color var(--t-fast) ease, background-color var(--t-fast) ease;
}
.tab::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent-grad);
  transform: scaleX(0);
  transition: transform var(--t) var(--ease);
}
.tab:hover { color: var(--text); background: var(--hover); }
.tab.is-on { color: var(--text); font-weight: 600; }
.tab.is-on::after { transform: scaleX(1); }
.tab:focus-visible { outline-offset: -2px; }

.me-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--fs-sm); font-weight: 550; }
.me-name { height: 38px; width: 160px; padding: 0 12px; font-weight: 550; }

.filters { display: flex; gap: var(--s2); flex-wrap: wrap; padding-top: var(--s3); }
.filters select {
  height: 36px;
  padding: 0 12px 0 14px;
  font-size: var(--fs-sm);
  font-weight: 500;
  background-color: var(--glass-strong);
  border-radius: 999px;
  box-shadow: var(--sh-xs);
  max-width: 100%;
}

/* Bulk selection bar */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: var(--s2) var(--s3);
  flex-wrap: wrap;
  padding-top: var(--s2);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 550;
}
.bulk-bar.hidden { display: none; }
.bulk-all {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  margin-left: -2px;
  padding: 0 12px 0 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color var(--t-fast) ease;
}
.bulk-all:hover { background: var(--hover); }
.bulk-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.bulk-bar .btn { height: 34px; font-size: var(--fs-sm); }
.bulk-bar:has(#bulk-delete:not(.hidden)) .bulk-count {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 650;
  animation: pop-in var(--t) var(--ease);
}
.bulk-bar:has(#bulk-delete:not(.hidden)) #bulk-clear { margin-left: auto; }
#bulk-clear, #bulk-delete { animation: fade-in var(--t) ease; }

/* Main / list */
.main { padding-top: var(--s4); padding-bottom: 64px; }
.list { display: flex; flex-direction: column; gap: var(--s2); }

.owner-tag { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: var(--fs-xs); font-weight: 550; color: var(--accent-ink); }
.owner-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.owner-tag.free { color: var(--warn); }
.owner-tag.other { color: var(--muted); }

.card-row { display: flex; align-items: stretch; gap: var(--s2); }
.card-row .card { flex: 1; min-width: 0; }
.card-check {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-xs);
  cursor: pointer;
  transition: background-color var(--t-fast) ease, border-color var(--t-fast) ease;
}
.card-check:hover { border-color: var(--line-strong); }
.card-row.is-selected .card { border-color: rgba(79, 70, 229, 0.45); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12), var(--sh-sm); background: var(--accent-tint); }
.card-row.is-selected .card-check { background: var(--accent-soft); border-color: rgba(79, 70, 229, 0.4); }

.card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px var(--s4);
  width: 100%;
  margin: 0;
  text-align: left;
  font: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 16px 14px 18px;
  cursor: pointer;
  color: inherit;
  box-shadow: var(--sh-sm);
  overflow: hidden;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t-fast) ease, background-color var(--t-fast) ease;
}
.card::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: transparent; }
.card.fresh::before { background: #3b82f6; }
.card.overdue::before { background: #f97316; }
.card:hover { transform: translateY(-1px); box-shadow: var(--sh-md); border-color: var(--line-2); }
.card:active { transform: translateY(0) scale(0.997); }
.card:focus-visible { outline: none; box-shadow: var(--focus), var(--sh-sm); }
.card > div:not(.card-right) { min-width: 0; }
.avatar {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--st-bg, var(--accent-soft));
  color: var(--st-ink, var(--accent-ink));
  font-size: var(--fs-sm);
  font-weight: 650;
  letter-spacing: 0.01em;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--st, #6366f1) 22%, transparent);
  flex: 0 0 auto;
}
.avatar:empty::before {
  content: "";
  width: 17px;
  height: 17px;
  background: currentColor;
  -webkit-mask: var(--ico-phone) center / contain no-repeat;
  mask: var(--ico-phone) center / contain no-repeat;
  --ico-phone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.8 19.8 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.12 4.18 2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.36 1.9.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E");
}
.card-name { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-phone { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-note { margin: 6px 0 0; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.card-open {
  position: absolute;
  right: 12px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: -14px;
  border-radius: 8px;
  color: var(--faint);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity var(--t) ease, transform var(--t) var(--ease), color var(--t) ease;
}
.card-open svg { width: 16px; height: 16px; }
.card:has(.card-open svg) { padding-right: 48px; }
.card:hover .card-open, .card:focus-visible .card-open { opacity: 1; transform: none; color: var(--accent-ink); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
  background: var(--st-bg, var(--accent-soft));
  color: var(--st-ink, var(--accent-ink));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--st, #6366f1) 26%, transparent);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--st, var(--accent)); flex: 0 0 auto; }
.when { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 500; }
.when.hot { color: var(--warn); font-weight: 650; }
.when.hot::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #f97316; vertical-align: 1px; }

.req-card { background: var(--warn-tint); border: 1px solid var(--warn-line); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--sh-xs); }
.req-card strong { font-weight: 650; }
.req-card p { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--text-2); }

/* Loading skeleton (list visible but not filled yet) */
.main:has(#empty.hidden) #list-view:not(.hidden):empty::before {
  content: "";
  display: block;
  height: 232px;
  border-radius: var(--r-lg);
  background:
    linear-gradient(90deg, transparent 0, var(--skeleton-shine) 50%, transparent 100%) -150% 0 / 40% 100% no-repeat,
    repeating-linear-gradient(to bottom, var(--skeleton) 0 70px, transparent 70px 78px);
  animation: shimmer 1.4s linear infinite;
}

/* Board (kanban) */
.board {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--s2);
  overflow-x: hidden;
  padding-bottom: var(--s2);
  align-items: start;
  width: 100%;
}
.col {
  background: var(--glass-weak);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 8px;
  min-height: 180px;
  min-width: 0;
  box-shadow: var(--sh-xs);
}
.col h3 {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 2px 2px 8px;
  font-size: 12px;
  color: var(--text);
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.col h3::before { content: ""; width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: var(--st, var(--accent)); box-shadow: 0 0 0 3px var(--st-bg, var(--accent-soft)); flex: 0 0 auto; }
.col > .when { margin: 8px 4px; color: var(--faint); font-size: var(--fs-xs); }
.mini {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 8px 10px;
  margin: 0 0 6px;
  cursor: pointer;
  border: 1px solid var(--line);
  color: inherit;
  box-shadow: var(--sh-xs);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t-fast) ease;
  overflow: hidden;
}
.mini strong, .mini span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini:hover { transform: translateY(-1px); box-shadow: var(--sh-md); border-color: var(--line-2); }
.mini strong { display: block; font-size: var(--fs-md); font-weight: 600; line-height: 1.3; }
.mini span { color: var(--muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.mini em { display: none; }

/* Empty */
.empty {
  text-align: center;
  padding: 56px 16px 48px;
  color: var(--muted);
  font-size: var(--fs-md);
  background: var(--glass-weak);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-xl);
}
.empty::before {
  content: "";
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 14px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E") center / 24px no-repeat,
    var(--accent-soft);
}
p.empty { margin: 0; }

/* Drawers & modals */
.drawer-back.hidden { display: none !important; }
.drawer-back {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  z-index: 40;
  display: flex;
  justify-content: flex-end;
  animation: fade-in var(--t) ease both;
}
.drawer {
  width: min(520px, 100%);
  height: 100%;
  max-height: 100vh;
  max-height: 100dvh;
  background: var(--surface);
  padding: var(--s6);
  overflow: auto;
  box-shadow: -1px 0 0 var(--line), -24px 0 64px -16px rgba(15, 23, 42, 0.28);
  animation: slide-in var(--t-slow) var(--ease) both;
}
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s3); margin-bottom: var(--s5); }
.drawer-head h2 { margin: 0; font-size: var(--fs-xl); font-weight: 650; letter-spacing: -0.02em; line-height: 1.25; }
.drawer-form { display: flex; flex-direction: column; gap: var(--s3); }
.drawer-form label { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); font-weight: 550; color: var(--text-2); }
.drawer-form input:not([type="checkbox"]), .drawer-form select, .drawer-form textarea {
  min-width: 0;
  width: 100%;
  height: var(--ctl-h);
  padding: 0 12px;
  font-weight: 400;
  font-size: var(--fs-md);
}
.drawer-form textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.drawer-actions { display: flex; justify-content: space-between; gap: var(--s2); margin-top: var(--s2); }
.drawer-actions .btn { min-width: 112px; }
.drawer-actions .hidden + .btn-primary { margin-left: auto; }
.when-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { flex-direction: row !important; align-items: center; gap: 10px !important; font-weight: 500 !important; cursor: pointer; }
.drawer.wide { width: min(720px, 100%); }

/* Card drawer: compact, fits one screen, scrolls only if needed */
.card-drawer { display: flex; flex-direction: column; width: min(560px, 100%); padding: 0; overflow: hidden; }
.card-drawer .drawer-head {
  margin: 0;
  padding: 16px 20px 14px;
  align-items: center;
  gap: var(--s2);
  border-bottom: 1px solid var(--line);
  background: var(--head-grad);
}
.card-drawer .drawer-head > div { min-width: 0; }
.card-drawer .drawer-head h2 { font-size: 19px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-drawer .drawer-head .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  padding: 3px 9px 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 10.5px;
  letter-spacing: 0.05em;
}
.card-drawer .drawer-head .eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.card-drawer .drawer-head .eyebrow:empty { display: none; }
.card-drawer .icon-btn { width: 34px; height: 34px; flex: 0 0 auto; }
.card-drawer .drawer-form {
  flex: 1;
  min-height: 0;
  gap: 10px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px 20px 0;
  overscroll-behavior: contain;
}
.card-drawer .drawer-form > label,
.card-drawer .form-row label,
.card-drawer .field-lab { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: var(--fs-xs); font-weight: 550; color: var(--muted); }
.card-drawer .drawer-form input:not([type="checkbox"]),
.card-drawer .drawer-form select,
.card-drawer .drawer-form textarea { height: 36px; padding: 0 10px; border-radius: var(--r-sm); font-size: var(--fs-md); color: var(--text); }
.card-drawer .drawer-form textarea { height: auto; min-height: 44px; max-height: 72px; padding: 8px 10px; resize: none; overflow-y: auto; line-height: 1.4; }
.form-row { display: grid; gap: 10px; }
.form-row > * { min-width: 0; }
.form-row.two { grid-template-columns: 1fr 1fr; }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }
.lab-inline { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.card-drawer .check { flex-direction: row !important; gap: 4px !important; font-size: 11px !important; font-weight: 600 !important; white-space: nowrap; margin: 0; }
.card-drawer .check input { width: 16px; height: 16px; border-radius: 4px; background-size: 11px; }
.card-drawer .drawer-form > * { flex-shrink: 0; }
.card-drawer .now-action { display: flex; align-items: center; gap: var(--s3); padding: 10px 10px 10px 14px; border-radius: var(--r-lg); min-height: 52px; }
.card-drawer .now-action-copy { flex: 1; min-width: 0; }
.card-drawer .now-action .eyebrow { margin: 0 0 1px; font-size: 10.5px; }
.card-drawer .now-action-label { margin: 0; font-size: var(--fs-md); font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-drawer #next-step-btn {
  display: block;
  width: auto;
  flex: 1.2;
  min-width: 0;
  height: 34px;
  padding: 0 12px;
  font-size: var(--fs-sm);
  line-height: 34px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-drawer .call-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.card-drawer .call-row .btn {
  height: 34px;
  padding: 0 6px;
  gap: 6px;
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: none;
}
.card-drawer .call-row .btn::before { width: 14px; height: 14px; }
.card-drawer #call-link { --btn-bg: var(--call-bg); --btn-bd: var(--call-line); --btn-fg: var(--call-fg); }
.card-drawer #call-link:hover { --btn-bg: var(--call-bg-hover); --btn-fg: var(--call-fg); }
.attend-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card-drawer .meta-line { font-size: var(--fs-xs); line-height: 1.35; }
.card-drawer .meta-line:empty { display: none; }
.card-drawer .history { font-size: var(--fs-xs); line-height: 1.4; max-height: 3em; overflow: hidden; color: var(--muted); }
.card-drawer .history p { margin: 0; display: inline; font-size: inherit; }
.card-drawer .history p + p::before { content: " · "; }
.card-drawer .drawer-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: auto -20px 0;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}

.now-action {
  background: var(--now-bg);
  color: var(--text);
  border: 1px solid var(--now-line);
  border-radius: var(--r-lg);
  padding: 14px;
}
.now-action .eyebrow { color: var(--accent-ink); }
.now-action-label { margin: 0 0 12px; font-size: var(--fs-xl); font-weight: 650; letter-spacing: -0.02em; }
.call-row { display: flex; gap: var(--s2); }
.call-row .btn { flex: 1; text-align: center; text-decoration: none; }
.meta-line { margin: 0; color: var(--muted); font-size: var(--fs-sm); }

.person-shifts { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 12px; font-size: var(--fs-sm); color: var(--text-2); }
.person-shifts p { margin: 2px 0; }
.person-shifts p:first-child b { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.assign-row { display: flex; gap: var(--s2); align-items: center; }
.assign-row select { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border-radius: var(--r-sm); }
.card-drawer .assign-row .btn { height: 36px; border-radius: var(--r-sm); font-size: var(--fs-sm); }

/* Conflict */
.conflict-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  align-items: center;
  justify-content: space-between;
  background: var(--warn-soft);
  border: 1px solid var(--warn-line);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--warn-text);
  animation: pop-in var(--t) var(--ease);
}
.conflict-bar p { margin: 0; width: 100%; }
.conflict-diff { width: 100%; font-size: var(--fs-xs); font-weight: 500; color: var(--warn); }
.conflict-diff p { margin: 2px 0; }
.conflict-acts { display: flex; gap: var(--s2); flex-wrap: wrap; }
.conflict-acts .btn { height: 32px; font-size: var(--fs-sm); }
.conflict-bar.hidden { display: none !important; }
.field-warn { border-color: #f97316 !important; box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.22) !important; }

#import-preview-back { z-index: 43; }
#site-form-back { z-index: 42; }
#admin-back { z-index: 41; }
#profile-back { z-index: 40; }

/* Import preview: centered modal */
#import-preview-back { align-items: center; justify-content: center; padding: var(--s6); }
#import-preview-back .drawer {
  display: flex;
  flex-direction: column;
  width: min(640px, 100%);
  height: auto;
  max-height: min(760px, calc(100dvh - 48px));
  border-radius: 20px;
  box-shadow: var(--sh-lg), 0 0 0 1px var(--line);
  animation: modal-in var(--t-slow) var(--ease) both;
}
#import-preview-back .drawer-head { margin-bottom: var(--s4); }
#import-preview-stats { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
#import-preview-stats > div { padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); }
#import-preview-stats > div:first-child { background: var(--accent-soft); border-color: var(--accent-soft-2); }
#import-preview-stats > div:first-child b { color: var(--accent-ink); }
#import-preview-stats b { display: block; font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
#import-preview-stats p { margin: 2px 0 0; font-size: var(--fs-xs); color: var(--muted); line-height: 1.35; }
.preview-list {
  flex: 1 1 auto;
  margin: var(--s4) 0 0;
  padding: 2px 14px;
  max-height: 40vh;
  overflow: auto;
  font-size: var(--fs-sm);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.preview-list p { margin: 0; padding: 8px 0; font-variant-numeric: tabular-nums; color: var(--text-2); }
.preview-list p + p { border-top: 1px solid var(--line); }
.preview-list p b { color: var(--text); font-weight: 600; }
.preview-list .preview-bad { color: var(--danger-ink); }
#import-preview-back .drawer-actions { margin-top: var(--s5); justify-content: flex-end; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(440px, calc(100vw - 32px));
  background: var(--toast-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--toast-fg);
  padding: 12px 16px 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: var(--fs-md);
  font-weight: 500;
  line-height: 1.4;
  z-index: 60;
  box-shadow: 0 16px 40px -12px rgba(15, 23, 42, 0.5);
  opacity: 0;
  transform: translate(-50%, 12px) scale(0.98);
  pointer-events: none;
  transition: opacity var(--t) ease, transform var(--t-slow) var(--ease);
}
.toast::before {
  content: "";
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #6366f1 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4L18 8.5'/%3E%3C/svg%3E") center / 11px no-repeat;
}
.toast:empty { visibility: hidden; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Site panel / funnel / tables */
.site-panel { padding-top: var(--s4); padding-bottom: 0; }
.panel-title { color: var(--text); margin: var(--s5) 0 var(--s2); font-size: var(--fs-lg); font-weight: 650; letter-spacing: -0.01em; }
#site-panel .quick-hint { margin: 0; max-width: none; }
.funnel { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: var(--s5); box-shadow: var(--sh-md); }
.funnel-grid { display: grid; gap: var(--s2); }
.funnel .funnel-grid > div { padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); }
.funnel .funnel-grid b { font-weight: 600; }
.funnel .funnel-grid p { margin: 4px 0 0; color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.funnel-range, .sites-toolbar .seg { display: inline-flex; gap: 2px; margin-bottom: var(--s4); padding: 3px; background: var(--surface-3); border-radius: var(--r-md); }
.sites-toolbar .seg { margin-bottom: 0; }
.funnel-range .btn, .sites-toolbar .seg .btn { height: 32px; --btn-bg: transparent; --btn-bd: transparent; box-shadow: none; font-size: var(--fs-sm); border-radius: 8px; }
.funnel-range .btn.btn-primary, .sites-toolbar .seg .btn.btn-primary { --btn-fg: var(--text); background: var(--surface-hi); filter: none; box-shadow: var(--sh-sm); }

.pay-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  font-variant-numeric: tabular-nums;
}
.pay-table th, .pay-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); cursor: pointer; vertical-align: middle; }
.pay-table th { background: var(--surface-2); color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.pay-table tbody tr { transition: background-color var(--t-fast) ease; }
.pay-table tbody tr:hover { background: var(--accent-tint); }
.pay-table tr:last-child td { border-bottom: 0; }
.sites-view { padding: 0; overflow: auto; }
.sites-toolbar { display: flex; gap: var(--s2); align-items: center; justify-content: space-between; margin-bottom: var(--s3); }
.sites-view > .quick-hint { margin: 0 0 var(--s3); max-width: none; }
.site-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.site-acts .btn { height: 30px; padding: 0 10px; font-size: var(--fs-xs); }
.admin-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px; margin-bottom: 8px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.admin-row input:not([type="checkbox"]), .admin-row select { height: 36px; padding: 0 10px; border-radius: var(--r-sm); min-width: 0; }
.admin-row .check { display: flex; font-size: var(--fs-sm); color: var(--text-2); }
#admin-back .drawer > .meta-line { margin-top: var(--s4); font-size: var(--fs-xs); }
.history p { margin: 4px 0; font-size: var(--fs-xs); color: var(--muted); }

/* Shifts & timesheet */
.shifts-view, .sheet { display: flex; flex-direction: column; gap: var(--s3); }
.shift-toolbar, .sheet-toolbar { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.shift-toolbar select, .shift-toolbar input:not([type="checkbox"]), .sheet-toolbar select, .sheet-toolbar input:not([type="checkbox"]) {
  height: 36px; padding: 0 12px; background-color: var(--surface); font-size: var(--fs-sm); min-width: 0;
}
.shift-toolbar .btn, .sheet-toolbar .btn { height: 36px; font-size: var(--fs-sm); }
#shift-form { padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); }
.shift-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: var(--s4) var(--s5); box-shadow: var(--sh-sm); }
.shift-card header { display: flex; justify-content: space-between; gap: var(--s2); align-items: baseline; }
.shift-card h3 { margin: 0; font-size: var(--fs-lg); font-weight: 650; letter-spacing: -0.01em; }
.shift-counts { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0 10px; font-size: var(--fs-sm); font-weight: 550; color: var(--text-2); font-variant-numeric: tabular-nums; }
.shift-counts p { margin: 0; }
.shifts-view > .shift-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--s2); margin: 0; }
.shifts-view > .shift-counts > p { padding: 10px 14px; background: var(--glass-strong); border: 1px solid var(--line); border-radius: var(--r-md); }
.shift-counts .short, .short { color: var(--danger-ink); }
.shift-person { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: var(--fs-md); }
.shift-person .grow { flex: 1; min-width: 140px; }
.shift-person .btn { height: 30px; font-size: var(--fs-xs); }
.shift-card > .shift-toolbar { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.shift-card > .shift-toolbar .btn { height: 32px; font-size: var(--fs-xs); }
.cell-came { background: var(--cell-came); color: var(--cell-came-fg); }
.cell-no { background: var(--cell-no); color: var(--danger-ink); font-weight: 700; }
.cell-left { background: var(--cell-left); color: var(--cell-left-fg); }
.cell-wait { background: var(--cell-wait); color: var(--cell-wait-fg); }
.cell-lock { background: var(--cell-lock); color: var(--cell-lock-fg); }
.sheet-table td, .sheet-table th { text-align: center; min-width: 36px; }
.sheet-table td:first-child, .sheet-table th:first-child { text-align: left; min-width: 160px; }

#tomorrow-list .card { grid-template-columns: minmax(0, 1fr) auto; }

/* Motion */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes modal-in { from { transform: translateY(12px) scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop-in { from { transform: translateY(-4px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.45); } 50% { box-shadow: 0 0 0 5px rgba(249, 115, 22, 0); } }
@keyframes shimmer { to { background-position: 250% 0, 0 0; } }

/* Responsive */
@media (max-width: 1100px) {
  .import-row .quick-hint { flex-basis: 100%; margin: 4px 0 0; padding-left: 2px; max-width: none; }
}

@media (max-width: 860px) {
  :root { --gutter: 16px; }
  html { scroll-padding-top: 180px; }
  .metrics { grid-template-columns: 1fr 1fr; gap: var(--s2); }
  .metric { padding: 12px 14px; }
  .metric b { font-size: 22px; }
  .quick-form { flex-direction: column; align-items: stretch; padding: var(--s4); }
  .phone-field { width: auto; }
  .quick-submit { height: 44px; }
  .import-row { padding: var(--s3) var(--s4); }
  .top { position: relative; flex-wrap: wrap; row-gap: 10px; padding-top: 12px; padding-bottom: 12px; }
  .top .search-wrap { order: 5; flex: 1 1 100%; }
  .brand { flex: 1 1 0; }
  .who-btn { min-width: 0; flex: 0 1 auto; }
  .search { width: 100%; max-width: none; height: 42px; }
  .top .btn { width: 38px; padding: 0; font-size: 0; gap: 0; }
  .top .btn::before { width: 18px; height: 18px; }
  .sticky-chrome { top: 0; }
  .card { grid-template-columns: auto minmax(0, 1fr); padding: 12px 14px 12px 16px; gap: 8px 12px; align-items: start; }
  .card-right { grid-column: 2; text-align: left; align-items: center; flex-direction: row; flex-wrap: wrap; gap: 6px 10px; }
  .card:has(.card-open svg) { padding-right: 14px; }
  .card-open { display: none; }
  .avatar { width: 36px; height: 36px; border-radius: 10px; font-size: var(--fs-xs); }
  .card-name { white-space: normal; }
  .me-label { display: none; }
  .card-drawer .call-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-x: hidden;
  }
  .col h3 { font-size: 12px; }
  #tomorrow-list .card { grid-template-columns: 1fr; }
  #tomorrow-list .card-right { grid-column: 1; }
}

@media (max-width: 640px) {
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px; }
  .btn, label.btn { font-size: 15px; }
  .brand strong { font-size: 15px; }
  .who-btn { max-width: 150px; }
  .roles { padding-top: var(--s4); }
  .roles .role { flex: 1; padding: 0 10px; font-size: var(--fs-sm); }
  #quick-form .quick-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; }
  #quick-form .quick-fields .field, #quick-form .quick-submit { width: auto; flex: none; }
  #quick-form .field.grow, #quick-form .quick-submit { grid-column: 1 / -1; }
  .brand { gap: 8px; }
  .brand .logo { width: 28px; height: 28px; }
  .top .btn { width: 36px; height: 36px; }
  .import-row { display: grid; grid-template-columns: 1fr 1fr; }
  .import-row .btn, .import-row .btn-cta { width: 100%; height: 40px; padding: 0 8px; font-size: var(--fs-sm); }
  .import-row .quick-hint { grid-column: 1 / -1; }
  .paste-box { padding: var(--s4); }
  .paste-box .btn { align-self: stretch; height: 44px; }
  .due-bar { max-height: 340px; }
  .due-item .btn { flex: 1 1 auto; height: 38px; font-size: var(--fs-sm); }
  .due-item .grow { flex-basis: 100%; }
  .tabs { padding-left: 8px; padding-right: 8px; -webkit-mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 24px), transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 24px), transparent 100%); }
  .tab { padding: 0 12px; font-size: 15px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-top: 10px; padding-bottom: 2px; }
  .filters::-webkit-scrollbar { display: none; }
  .filters select { flex: 0 0 auto; height: 38px; font-size: 15px; max-width: 72vw; }
  .bulk-bar { padding-top: 8px; gap: 8px; }
  .bulk-all { min-height: 40px; }
  .bulk-bar .btn { flex: 1 1 auto; height: 40px; font-size: var(--fs-sm); }
  .bulk-bar:has(#bulk-delete:not(.hidden)) #bulk-clear { margin-left: 0; }
  .card-check { flex-basis: 40px; border-radius: var(--r-md); }
  .card-check input { width: 20px; height: 20px; }
  .main { padding-top: var(--s3); }
  .drawer { padding: var(--s5) var(--s4); }
  .card-drawer { padding: 0; }
  .card-drawer .drawer-head { padding: 14px 16px 12px; }
  .card-drawer .drawer-form { padding: 12px 16px 0; }
  .card-drawer .drawer-actions { margin: auto -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .card-drawer .drawer-form input:not([type="checkbox"]), .card-drawer .drawer-form select { height: 40px; font-size: 16px; }
  .card-drawer .drawer-form textarea { font-size: 16px; }
  .card-drawer .call-row .btn { height: 38px; font-size: var(--fs-sm); }
  .card-drawer .now-action { flex-wrap: wrap; }
  .card-drawer #next-step-btn { flex: 1 1 100%; height: 38px; line-height: 38px; }
  .form-row.three { grid-template-columns: 1fr 1fr; }
  .drawer-actions .btn { flex: 1; min-width: 0; height: 44px; }
  #import-preview-back { padding: 0; align-items: flex-end; }
  #import-preview-back .drawer { border-radius: 20px 20px 0 0; max-height: 92dvh; animation-name: sheet-up; }
  .toast { left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); max-width: none; transform: translateY(12px) scale(0.98); }
  .toast.show { transform: none; }
  .shift-card { padding: var(--s4); }
}

/* ===================== Dark theme (default) ===================== */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0f1d;
  --surface: #121a2c;
  --surface-hi: #18213a;
  --surface-2: #161f34;
  --surface-3: #1c2640;
  --glass: rgba(13, 19, 34, 0.74);
  --glass-strong: rgba(20, 28, 48, 0.88);
  --glass-weak: rgba(22, 31, 52, 0.62);
  --glass-border: rgba(255, 255, 255, 0.07);
  --text: #e8ecf5;
  --text-2: #c5cddc;
  --muted: #98a3b8;
  --faint: #6b7791;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(255, 255, 255, 0.24);
  --hover: rgba(255, 255, 255, 0.06);
  --check-border: #56627c;

  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-ink: #a5b4fc;
  --accent-soft: rgba(99, 102, 241, 0.17);
  --accent-soft-2: rgba(129, 140, 248, 0.32);
  --accent-ring: rgba(129, 140, 248, 0.42);
  --accent-tint: rgba(99, 102, 241, 0.08);

  --danger: #dc2626;
  --danger-ink: #fca5a5;
  --danger-soft: rgba(239, 68, 68, 0.14);
  --danger-line: rgba(248, 113, 113, 0.4);
  --danger-solid-hover: #ef4444;
  --warn: #fdba74;
  --ok: #4ade80;

  --head-grad: linear-gradient(180deg, #171f37 0%, #121a2c 100%);
  --warn-tint: linear-gradient(135deg, rgba(249, 115, 22, 0.12), rgba(234, 179, 8, 0.08));
  --warn-line: rgba(251, 146, 60, 0.35);
  --warn-text: #fed7aa;
  --now-bg: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(124, 58, 237, 0.14) 100%);
  --now-line: rgba(129, 140, 248, 0.3);
  --call-bg: rgba(16, 185, 129, 0.14); --call-line: rgba(52, 211, 153, 0.35); --call-fg: #6ee7b7; --call-bg-hover: rgba(16, 185, 129, 0.24);
  --halo-warn: rgba(249, 115, 22, 0.2); --halo-ok: rgba(34, 197, 94, 0.2);
  --cell-came: rgba(34, 197, 94, 0.18); --cell-came-fg: #86efac;
  --cell-no: rgba(239, 68, 68, 0.2);
  --cell-left: rgba(249, 115, 22, 0.18); --cell-left-fg: #fdba74;
  --cell-wait: rgba(59, 130, 246, 0.18); --cell-wait-fg: #93c5fd;
  --cell-lock: rgba(148, 163, 184, 0.16); --cell-lock-fg: #cbd5e1;
  --skeleton: rgba(255, 255, 255, 0.06);
  --skeleton-shine: rgba(255, 255, 255, 0.08);
  --grid-line: rgba(255, 255, 255, 0.045);
  --aurora-base: linear-gradient(160deg, #0b1122 0%, #0a0f1d 50%, #100c1f 100%);
  --a1: rgba(79, 70, 229, 0.42);
  --a2: rgba(14, 165, 233, 0.24);
  --a3: rgba(192, 38, 211, 0.2);
  --a4: rgba(20, 184, 166, 0.18);
  --a5: rgba(124, 58, 237, 0.24);
  --toast-bg: rgba(30, 41, 66, 0.94);
  --toast-fg: #f1f5f9;

  --sh-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --sh-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 12px -4px rgba(0, 0, 0, 0.4);
  --sh-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 28px -8px rgba(0, 0, 0, 0.55);
  --sh-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 28px 64px -12px rgba(0, 0, 0, 0.7);
}
html[data-theme="dark"] .st-avito  { --st: #60a5fa; --st-ink: #93c5fd; --st-bg: rgba(59, 130, 246, 0.16); }
html[data-theme="dark"] .st-recall { --st: #fb7185; --st-ink: #fda4af; --st-bg: rgba(244, 63, 94, 0.16); }
html[data-theme="dark"] .st-call   { --st: #fbbf24; --st-ink: #fcd34d; --st-bg: rgba(245, 158, 11, 0.15); }
html[data-theme="dark"] .st-push   { --st: #a78bfa; --st-ink: #c4b5fd; --st-bg: rgba(139, 92, 246, 0.17); }
html[data-theme="dark"] .st-shift  { --st: #34d399; --st-ink: #6ee7b7; --st-bg: rgba(16, 185, 129, 0.15); }
html[data-theme="dark"] .st-hired  { --st: #34d399; --st-ink: #6ee7b7; --st-bg: rgba(5, 150, 105, 0.18); }
html[data-theme="dark"] .st-fb1    { --st: #38bdf8; --st-ink: #7dd3fc; --st-bg: rgba(14, 165, 233, 0.15); }
html[data-theme="dark"] .st-fb3    { --st: #4ade80; --st-ink: #86efac; --st-bg: rgba(34, 197, 94, 0.15); }
html[data-theme="dark"] .st-fb14   { --st: #22c55e; --st-ink: #86efac; --st-bg: rgba(22, 163, 74, 0.17); }
html[data-theme="dark"] .st-refuse { --st: #94a3b8; --st-ink: #cbd5e1; --st-bg: rgba(148, 163, 184, 0.14); }
html[data-theme="dark"] .card-row.is-selected .card { border-color: rgba(129, 140, 248, 0.55); }
html[data-theme="dark"] .card-row.is-selected .card-check { border-color: rgba(129, 140, 248, 0.5); }
html[data-theme="dark"] .when.hot, html[data-theme="dark"] .owner-tag.free { color: #fdba74; }
html[data-theme="dark"] .btn-primary, html[data-theme="dark"] .btn-cta { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 8px 22px -8px rgba(99, 102, 241, 0.7); }
html[data-theme="dark"] .due-item .btn-primary { box-shadow: none; }
html[data-theme="dark"] .drawer-back { background: rgba(2, 6, 18, 0.55); }
html[data-theme="dark"] .drawer { box-shadow: -1px 0 0 var(--line), -24px 0 64px -16px rgba(0, 0, 0, 0.8); }
html[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2398a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
html[data-theme="dark"] select option { background: #121a2c; color: #e8ecf5; }
html[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
html[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(0.8); opacity: 0.7; }
html[data-theme="dark"] .empty::before {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a5b4fc' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E") center / 24px no-repeat,
    var(--accent-soft);
}
html[data-theme="dark"] ::selection { background: rgba(129, 140, 248, 0.4); color: #fff; }
html[data-theme="dark"] * { scrollbar-color: rgba(148, 163, 184, 0.3) transparent; }

/* Smooth theme switch (class set for ~350ms by JS) */
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color 320ms ease, border-color 320ms ease, color 320ms ease, box-shadow 320ms ease, fill 320ms ease !important;
}

/* Theme toggle */
.theme-btn { position: relative; overflow: hidden; }
.theme-btn svg { position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; transition: transform 360ms var(--ease), opacity 240ms ease; }
.theme-btn .ico-sun { opacity: 0; transform: rotate(-90deg) scale(0.6); }
.theme-btn .ico-moon { opacity: 1; transform: none; }
html[data-theme="dark"] .theme-btn .ico-sun { opacity: 1; transform: none; color: #fcd34d; }
html[data-theme="dark"] .theme-btn .ico-moon { opacity: 0; transform: rotate(90deg) scale(0.6); }
.top .theme-btn { width: 38px; padding: 0; }
.login-theme { position: fixed; top: 16px; right: 16px; z-index: 5; width: 40px; --btn-bg: var(--glass-strong); --btn-bd: var(--line); }

/* ===================== Vacancy picker ===================== */
.vac-wrap { position: relative; display: block; width: 100%; min-width: 0; }
.vac-wrap > input { width: 100%; }
.vac-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  min-width: 100%;
  width: max(100%, 260px);
  max-width: min(360px, calc(100vw - 32px));
  max-height: 300px;
  overflow-y: auto;
  padding: 6px;
  background: var(--surface-hi);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  animation: pop-in 180ms var(--ease) both;
  transform-origin: top left;
  overscroll-behavior: contain;
}
.vac-menu.vac-right { left: auto; right: 0; transform-origin: top right; }
.vac-head { padding: 6px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.vac-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: var(--fs-md);
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: background-color 120ms ease, color 120ms ease;
}
.vac-opt::before {
  content: "";
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  background: var(--faint);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='7' width='20' height='14' rx='2'/%3E%3Cpath d='M16 7V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='7' width='20' height='14' rx='2'/%3E%3Cpath d='M16 7V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2'/%3E%3C/svg%3E") center / contain no-repeat;
}
.vac-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vac-opt mark { background: none; color: var(--accent-ink); font-weight: 650; }
.vac-opt:hover { background: var(--hover); color: var(--text); }
.vac-opt.is-active { background: var(--accent-soft); color: var(--text); }
.vac-opt.is-active::before { background: var(--accent-ink); }
.vac-opt.is-current::after { content: "✓"; margin-left: auto; color: var(--accent-ink); font-weight: 700; }
.vac-opt .vac-tag { margin-left: auto; font-size: 11px; color: var(--faint); font-weight: 500; }
.card-drawer .vac-menu { max-height: 240px; }

@media (max-width: 640px) {
  .vac-menu { max-height: 280px; }
  .vac-opt { min-height: 44px; font-size: 16px; }
  .top .theme-btn { width: 36px; height: 36px; }
}
@media (max-width: 420px) {
  .brand strong { display: none; }
}


.site-managers { display: flex; flex-direction: column; gap: .35rem; margin: .4rem 0 0; }
.site-managers .check { display: flex; align-items: center; gap: .45rem; }
