/* Поиск.Лаб — оформление.
   Палитра заказчика (17.11.2026): тёмно-синий #162B4D, акцентный синий #3478F6, бирюзовый #17B8A6,
   светлый фон #F3F6FB, успех #22C55E, предупреждение #E9A23B, ошибка #EF4444.
   Всё оформление — через переменные ниже; тёмная тема переопределяет только их. */

@font-face { font-family:"Golos Text"; font-style:normal; font-weight:400 900; font-display:swap;
  src:url("../fonts/golos-text-cyrillic.a2d088854119.woff2") format("woff2-variations");
  unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family:"Golos Text"; font-style:normal; font-weight:400 900; font-display:swap;
  src:url("../fonts/golos-text-latin.9b970339a047.woff2") format("woff2-variations");
  unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: light;
  --navy:#162B4D; --navy-2:#1D3863; --navy-ink:#E8EEF8; --navy-muted:#9DB0CF;
  --accent:#3478F6; --accent-hover:#1F63E0; --accent-soft:#E8F0FE; --accent-ink:#1A56C9; --on-accent:#fff;
  --teal:#17B8A6; --teal-soft:#E2F6F3; --teal-ink:#0B7F72;
  --bg:#F3F6FB; --surface:#FFFFFF; --surface-2:#F7F9FD; --surface-3:#EDF1F8;
  --ink:#0F1B2E; --ink-2:#33415A; --muted:#5D6B84; --line:#E1E7F0; --line-strong:#C9D3E3;
  --ok:#22C55E; --ok-soft:#E5F8EC; --ok-ink:#15803D;
  --warn:#E9A23B; --warn-soft:#FDF3E2; --warn-ink:#93570A;
  --bad:#EF4444; --bad-soft:#FDEBEB; --bad-ink:#C42B2B;
  --shadow-1:0 1px 2px rgba(22,43,77,.05), 0 2px 8px rgba(22,43,77,.05);
  --shadow-2:0 2px 6px rgba(22,43,77,.06), 0 10px 28px rgba(22,43,77,.10);
  --shadow-3:0 12px 48px rgba(10,22,44,.22);
  --r-sm:8px; --r:12px; --r-lg:16px;
  --font:"Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --t-fast:150ms; --t:200ms; --t-slow:300ms; --ease:cubic-bezier(.2,.7,.2,1);
  --sidebar-w:248px; --topbar-h:60px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --navy:#0C1729; --navy-2:#15253F; --navy-ink:#E6ECF6; --navy-muted:#8A9BB8;
  --accent:#5B93FA; --accent-hover:#7AA8FB; --accent-soft:#16294A; --accent-ink:#8DB5FC; --on-accent:#08142A;
  --teal:#2CCDB9; --teal-soft:#0F3634; --teal-ink:#5EE0CF;
  --bg:#0A1322; --surface:#111D31; --surface-2:#15233B; --surface-3:#1B2B47;
  --ink:#E7EDF7; --ink-2:#C3CEE0; --muted:#8E9DB7; --line:#22324F; --line-strong:#2E4266;
  --ok:#34D399; --ok-soft:#0F3326; --ok-ink:#5EE3A6;
  --warn:#F0B354; --warn-soft:#3A2A10; --warn-ink:#F5C677;
  --bad:#F87171; --bad-soft:#3A1717; --bad-ink:#FCA5A5;
  --shadow-1:0 1px 2px rgba(0,0,0,.30);
  --shadow-2:0 4px 20px rgba(0,0,0,.35);
  --shadow-3:0 16px 56px rgba(0,0,0,.55);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    color-scheme: dark;
    --navy:#0C1729; --navy-2:#15253F; --navy-ink:#E6ECF6; --navy-muted:#8A9BB8;
    --accent:#5B93FA; --accent-hover:#7AA8FB; --accent-soft:#16294A; --accent-ink:#8DB5FC; --on-accent:#08142A;
    --teal:#2CCDB9; --teal-soft:#0F3634; --teal-ink:#5EE0CF;
    --bg:#0A1322; --surface:#111D31; --surface-2:#15233B; --surface-3:#1B2B47;
    --ink:#E7EDF7; --ink-2:#C3CEE0; --muted:#8E9DB7; --line:#22324F; --line-strong:#2E4266;
    --ok:#34D399; --ok-soft:#0F3326; --ok-ink:#5EE3A6;
    --warn:#F0B354; --warn-soft:#3A2A10; --warn-ink:#F5C677;
    --bad:#F87171; --bad-soft:#3A1717; --bad-ink:#FCA5A5;
    --shadow-1:0 1px 2px rgba(0,0,0,.30);
    --shadow-2:0 4px 20px rgba(0,0,0,.35);
    --shadow-3:0 16px 56px rgba(0,0,0,.55);
  }
}

/* ---------- основа ---------- */
*, *::before, *::after { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body { margin:0; background:var(--bg); color:var(--ink); font:400 15px/1.55 var(--font); font-feature-settings:"tnum" 0;
  -webkit-font-smoothing:antialiased; transition:background-color var(--t) var(--ease), color var(--t) var(--ease); }
a { color:var(--accent-ink); text-decoration-thickness:1px; text-underline-offset:2px; }
a:hover { color:var(--accent); }
h1 { font-size:26px; line-height:1.2; font-weight:700; letter-spacing:-.02em; margin:0 0 16px; }
h2 { font-size:18px; line-height:1.3; font-weight:650; letter-spacing:-.01em; margin:0 0 12px; }
h3 { font-size:15px; font-weight:650; margin:0 0 6px; }
p { margin:0 0 12px; }
.muted { color:var(--muted); font-size:14px; }
.num, .tnum { font-variant-numeric:tabular-nums; }
::selection { background:var(--accent-soft); color:var(--ink); }
:focus-visible { outline:2px solid var(--accent); outline-offset:2px; border-radius:4px; }
svg.i { width:18px; height:18px; flex:none; fill:none; stroke:currentColor; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round; }
svg.i.sm { width:16px; height:16px; } svg.i.lg { width:22px; height:22px; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

/* ---------- оболочка: боковое меню + верхняя панель ---------- */
.shell { min-height:100vh; }
.sidebar { position:fixed; inset:0 auto 0 0; width:var(--sidebar-w); background:var(--navy); color:var(--navy-ink);
  display:flex; flex-direction:column; z-index:40; transition:transform var(--t-slow) var(--ease); }
.sidebar .brand { display:flex; align-items:center; gap:12px; padding:18px 18px 14px; color:#fff; text-decoration:none; }
.sidebar .brand .mark { width:38px; height:38px; border-radius:10px; background:#fff; display:grid; place-items:center; flex:none; }
.sidebar .brand .mark img { width:28px; height:27px; }
.sidebar .brand b { display:block; font-size:16px; font-weight:700; letter-spacing:-.01em; }
.sidebar .brand small { display:block; color:var(--navy-muted); font-size:12.5px; line-height:1.3; max-width:170px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.nav { flex:1; overflow-y:auto; padding:8px 12px 16px; }
.nav .group { color:var(--navy-muted); font-size:12.5px; margin:18px 10px 6px; }
.nav a { position:relative; display:flex; align-items:center; gap:12px; padding:9px 12px; margin:2px 0; border-radius:10px;
  color:var(--navy-ink); text-decoration:none; font-size:14.5px; opacity:.86;
  transition:background-color var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.nav a:hover { background:rgba(255,255,255,.07); opacity:1; }
.nav a:active { transform:scale(.98); }
.nav a.active { background:rgba(23,184,166,.16); opacity:1; font-weight:600; color:#fff; }
.nav a.active::before { content:""; position:absolute; left:-12px; top:9px; bottom:9px; width:3px; border-radius:0 3px 3px 0; background:var(--teal);
  animation:navbar-in var(--t) var(--ease); }
.nav a.active svg { color:var(--teal); }
.nav a .count { margin-left:auto; background:var(--teal); color:#062521; font-size:12px; font-weight:700; border-radius:999px; padding:1px 8px; }
@keyframes navbar-in { from { transform:scaleY(.3); opacity:0; } }
.sidebar .me { display:flex; align-items:center; gap:10px; padding:14px 18px; border-top:1px solid rgba(255,255,255,.08); }
.avatar { width:34px; height:34px; border-radius:50%; display:grid; place-items:center; font-weight:700; font-size:14px; flex:none;
  background:var(--teal); color:#062521; }
.sidebar .me-link { display:flex; align-items:center; gap:10px; flex:1; min-width:0; color:var(--navy-ink); text-decoration:none; border-radius:10px; padding:4px; margin:-4px; transition:background-color var(--t-fast) var(--ease); }
.sidebar .me-link:hover { background:rgba(255,255,255,.07); color:#fff; }
.sidebar .me .who { display:block; flex:1; min-width:0; font-size:13.5px; line-height:1.3; }
.sidebar .me .who span { display:block; color:var(--navy-muted); font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sidebar .me form { margin:0; }
.sidebar .me button { background:none; color:var(--navy-muted); padding:8px; border-radius:8px; box-shadow:none; }
.sidebar .me button:hover { background:rgba(255,255,255,.08); color:#fff; }

.main-col { margin-left:var(--sidebar-w); min-height:100vh; display:flex; flex-direction:column; }
.topbar { position:sticky; top:0; z-index:30; height:var(--topbar-h); display:flex; align-items:center; gap:12px; padding:0 28px;
  background:color-mix(in srgb, var(--bg) 88%, transparent); border-bottom:1px solid transparent;
  transition:border-color var(--t) var(--ease), background-color var(--t) var(--ease); }
.topbar.scrolled { border-bottom-color:var(--line); background:var(--bg); }
.topbar .crumb { font-size:14px; color:var(--muted); flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.topbar .crumb b { color:var(--ink); font-weight:600; }
.search-trigger { display:flex; align-items:center; gap:10px; min-width:280px; height:40px; padding:0 10px 0 12px; border-radius:10px;
  background:var(--surface); color:var(--muted); border:1px solid var(--line); box-shadow:var(--shadow-1); font-weight:400; font-size:14px; }
.search-trigger:hover { background:var(--surface); border-color:var(--line-strong); color:var(--ink-2); }
.search-trigger kbd, kbd { margin-left:auto; font:inherit; font-size:12px; color:var(--muted); background:var(--surface-3); border-radius:6px; padding:1px 7px; }
.icon-button { display:inline-grid; place-items:center; width:40px; height:40px; padding:0; border-radius:10px; background:transparent; color:var(--ink-2); box-shadow:none; }
.icon-button:hover { background:var(--surface-3); color:var(--ink); }
.menu-button { display:none; }
.theme-toggle .i-sun, .theme-toggle .i-moon, .theme-toggle .i-auto { display:none; }
:root[data-theme="light"] .theme-toggle .i-sun, :root[data-theme="dark"] .theme-toggle .i-moon, :root[data-theme="auto"] .theme-toggle .i-auto { display:block; }
.theme-toggle svg { animation:spin-in var(--t-slow) var(--ease); }
@keyframes spin-in { from { transform:rotate(-90deg) scale(.6); opacity:0; } }

main.page { width:100%; max-width:880px; margin:8px auto 64px; padding:0 28px; animation:page-in var(--t-slow) var(--ease) both; }
main.page.wide { max-width:1320px; }
@keyframes page-in { from { opacity:0; transform:translateY(8px); } }
.page-head { display:flex; align-items:flex-end; justify-content:space-between; gap:12px 20px; flex-wrap:wrap; margin:8px 0 20px; }
.page-head h1 { margin:0; }
.page-head p { margin:6px 0 0; color:var(--muted); }

.scrim { position:fixed; inset:0; background:rgba(8,16,32,.45); z-index:35; opacity:0; pointer-events:none; transition:opacity var(--t) var(--ease); }

/* без входа: страница по центру */
.bare { min-height:100vh; display:grid; place-items:center; padding:24px 16px; }
.bare main.page { margin:0; padding:0; max-width:440px; }
.bare .brand-bare { display:flex; align-items:center; gap:12px; justify-content:center; margin-bottom:20px; color:var(--ink); font-weight:700; font-size:18px; }
.bare .brand-bare img { width:36px; height:35px; }
:root[data-theme="dark"] .bare .brand-bare img, :root[data-theme="dark"] .inv-head img { filter:invert(1); }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .bare .brand-bare img { filter:invert(1); } }
.login-wrap { max-width:420px; margin:0 auto; }

/* ---------- карточки и блоки ---------- */
.card { background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); padding:22px; margin-bottom:16px; box-shadow:var(--shadow-1); }
.card > h2:first-child { margin-top:0; }
.card-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; }
.card-head h2 { margin:0; }
.row { display:flex; gap:12px; flex-wrap:wrap; align-items:center; }
.row.between { justify-content:space-between; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:0 14px; }
.tiles { display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:16px; margin-bottom:20px; }
.tiles-5 { grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); }
.tile { display:flex; flex-direction:column; gap:10px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg);
  padding:20px; box-shadow:var(--shadow-1); color:inherit; text-decoration:none;
  transition:transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease); }
a.tile:hover { transform:translateY(-2px); box-shadow:var(--shadow-2); border-color:var(--line-strong); color:inherit; }
a.tile:active { transform:translateY(0) scale(.99); }
.tile .tile-top { display:flex; align-items:center; gap:10px; color:var(--muted); font-size:14px; }
.tile .tile-top svg { color:var(--accent); }
.tile .figure { font-size:34px; line-height:1; font-weight:700; letter-spacing:-.03em; font-variant-numeric:tabular-nums; color:var(--ink); }
.tile .figure small { font-size:15px; font-weight:500; color:var(--muted); letter-spacing:0; margin-left:4px; }
.tile .sub { color:var(--muted); font-size:13.5px; margin-top:auto; }
.tile .go { display:flex; align-items:center; gap:6px; color:var(--accent-ink); font-size:14px; font-weight:600; margin-top:4px; }
.tile .go svg { transition:transform var(--t) var(--ease); }
a.tile:hover .go svg { transform:translateX(3px); }

.kv { display:grid; grid-template-columns:minmax(120px, 190px) 1fr; gap:8px 18px; margin:0; }
.kv dt { color:var(--muted); font-size:14px; }
.kv dd { margin:0; }
.stat-strip { display:flex; flex-wrap:wrap; gap:10px 28px; margin:0 0 18px; }
.stat-strip div { display:flex; flex-direction:column; }
.stat-strip b { font-size:24px; font-weight:700; letter-spacing:-.02em; font-variant-numeric:tabular-nums; line-height:1.15; }
.stat-strip span { color:var(--muted); font-size:13px; }
.stat-strip b span { color:inherit; font-size:inherit; }
.stat-strip .ok b { color:var(--ok-ink); } .stat-strip .bad b { color:var(--bad-ink); } .stat-strip .warn b { color:var(--warn-ink); }

/* ---------- кнопки ---------- */
button, .button { display:inline-flex; align-items:center; justify-content:center; gap:8px; background:var(--accent); color:var(--on-accent);
  border:0; border-radius:10px; padding:10px 18px; font:inherit; font-weight:600; font-size:15px; line-height:1.3; cursor:pointer; text-decoration:none;
  box-shadow:0 1px 2px rgba(22,43,77,.12);
  transition:background-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
button:hover, .button:hover { background:var(--accent-hover); color:var(--on-accent); box-shadow:0 4px 14px rgba(52,120,246,.28); }
button:active, .button:active { transform:scale(.97); }
button:disabled { opacity:.55; cursor:not-allowed; transform:none; box-shadow:none; }
.button.big, button.big { padding:13px 22px; font-size:16px; }
button.secondary, .button.secondary { background:var(--surface); color:var(--ink); border:1px solid var(--line-strong); box-shadow:var(--shadow-1); }
button.secondary:hover, .button.secondary:hover { background:var(--surface-2); color:var(--ink); border-color:var(--muted); box-shadow:var(--shadow-1); }
button.ghost, .button.ghost { background:transparent; color:var(--ink-2); box-shadow:none; }
button.ghost:hover, .button.ghost:hover { background:var(--surface-3); color:var(--ink); box-shadow:none; }
button.teal, .button.teal { background:var(--teal); color:#062521; }
button.teal:hover, .button.teal:hover { background:color-mix(in srgb, var(--teal) 86%, #000); color:#062521; box-shadow:0 4px 14px rgba(23,184,166,.3); }
button.danger, .button.danger { background:var(--bad-soft); color:var(--bad-ink); box-shadow:none; }
button.danger:hover, .button.danger:hover { background:var(--bad); color:#fff; box-shadow:0 4px 14px rgba(239,68,68,.28); }
button.small, .button.small { padding:6px 12px; font-size:14px; border-radius:8px; }
button.link { background:none; color:var(--accent-ink); padding:0; font-weight:500; box-shadow:none; }
button.link:hover { background:none; color:var(--accent); text-decoration:underline; box-shadow:none; }

/* ---------- формы ---------- */
label { display:block; font-weight:600; font-size:14px; margin:14px 0 6px; color:var(--ink-2); }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=search], input[type=tel], select, textarea {
  width:100%; padding:10px 12px; font:inherit; color:var(--ink); background:var(--surface); border:1px solid var(--line-strong); border-radius:10px;
  transition:border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
input:hover, select:hover, textarea:hover { border-color:var(--muted); }
input:focus, select:focus, textarea:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
textarea { min-height:76px; resize:vertical; }
select { appearance:none; padding-right:36px; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235D6B84' 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:18px; }
.check { display:flex; gap:10px; align-items:flex-start; font-weight:400; font-size:15px; color:var(--ink); }
.check input { margin-top:3px; width:18px; height:18px; flex:none; accent-color:var(--accent); }
.errorlist, .error { color:var(--bad-ink); list-style:none; padding:0; margin:6px 0; font-size:14px; }
.helptext, .helptext ul { color:var(--muted); font-size:13px; padding-left:18px; margin:4px 0; }
.alert { display:flex; gap:10px; align-items:flex-start; background:var(--bad-soft); color:var(--bad-ink); padding:12px 16px; border-radius:var(--r); margin-bottom:16px; }
.alert.info { background:var(--accent-soft); color:var(--accent-ink); }
.alert.warn { background:var(--warn-soft); color:var(--warn-ink); }
.consent-text { max-height:50vh; overflow:auto; border:1px solid var(--line); border-radius:var(--r); padding:16px; white-space:pre-wrap; background:var(--surface-2); }
.searchbox { position:relative; }
.searchbox svg { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--muted); pointer-events:none; }
.searchbox input { padding-left:40px; }

/* сегменты: вкладки городов, смен, филиалов */
.tabs, .segmented { display:inline-flex; flex-wrap:wrap; gap:4px; padding:4px; background:var(--surface-3); border-radius:12px; margin-bottom:14px; }
.tabs a, .segmented a { text-decoration:none; padding:7px 14px; border-radius:9px; color:var(--muted); font-size:14px; font-weight:500;
  transition:background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.tabs a:hover, .segmented a:hover { color:var(--ink); }
.tabs a.active, .segmented a.active { background:var(--surface); color:var(--ink); font-weight:600; box-shadow:var(--shadow-1); }
.tabs a .count, .segmented a .count { display:inline-block; margin-left:6px; min-width:18px; padding:0 6px; border-radius:999px; background:var(--warn-soft); color:var(--warn-ink); font-size:12px; font-weight:700; text-align:center; }

.choices { display:flex; gap:8px; flex-wrap:wrap; }
.choices label { position:relative; margin:0; font-weight:500; font-size:15px; border:1px solid var(--line-strong); border-radius:10px; padding:10px 14px; cursor:pointer;
  background:var(--surface); color:var(--ink); transition:border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.choices label:hover { border-color:var(--accent); }
.choices label:active { transform:scale(.98); }
.choices input { position:absolute; opacity:0; pointer-events:none; }
.choices input:checked + span { color:var(--accent-ink); font-weight:650; }
.choices label:has(input:checked) { border-color:var(--accent); background:var(--accent-soft); }
.choices label:has(input:focus-visible) { outline:2px solid var(--accent); outline-offset:2px; }

/* ---------- значки статусов ---------- */
.badge { display:inline-flex; align-items:center; gap:5px; border-radius:999px; padding:2px 10px; font-size:12.5px; font-weight:600; white-space:nowrap;
  background:var(--surface-3); color:var(--ink-2); }
.badge::before { content:""; width:6px; height:6px; border-radius:50%; background:currentColor; opacity:.85; }
.badge.plain::before { display:none; }
.badge.assigned, .badge.ok, .badge.done { background:var(--ok-soft); color:var(--ok-ink); }
.badge.new, .badge.warn, .badge.partial { background:var(--warn-soft); color:var(--warn-ink); }
.badge.cancelled, .badge.waiting { background:var(--surface-3); color:var(--muted); }
.badge.urgent, .badge.false, .badge.bad { background:var(--bad-soft); color:var(--bad-ink); }
.badge.info { background:var(--accent-soft); color:var(--accent-ink); }
.badge.teal { background:var(--teal-soft); color:var(--teal-ink); }
.tags span { display:inline-block; background:var(--surface-3); color:var(--ink-2); border-radius:999px; padding:3px 12px; margin:0 6px 6px 0; font-size:13.5px; }
.progress { height:6px; border-radius:999px; background:var(--surface-3); overflow:hidden; }
.progress i { display:block; height:100%; border-radius:inherit; background:var(--teal); width:var(--p, 0%); transition:width var(--t-slow) var(--ease); }
.progress.has-issues i { background:var(--warn); }

/* ---------- списки ---------- */
.list-item { display:block; text-decoration:none; color:inherit; border:1px solid var(--line); border-radius:var(--r); padding:14px 16px; margin-bottom:10px;
  background:var(--surface); transition:border-color var(--t-fast) var(--ease), box-shadow var(--t) var(--ease), transform var(--t) var(--ease); }
.list-item:hover { border-color:var(--line-strong); box-shadow:var(--shadow-2); transform:translateY(-1px); color:inherit; }
.list-item .title { font-weight:650; }

/* ---------- таблицы ---------- */
table.data { width:100%; border-collapse:separate; border-spacing:0; font-size:14px; }
table.data th { text-align:left; font-size:12.5px; font-weight:600; color:var(--muted); padding:10px 12px; border-bottom:1px solid var(--line); white-space:nowrap; background:var(--surface); }
table.data td { padding:12px; border-bottom:1px solid var(--line); vertical-align:top; transition:background-color var(--t-fast) var(--ease); }
table.data tbody tr:last-child td { border-bottom:0; }
table.data tbody tr:hover td { background:var(--surface-2); }
table.data tr.cancelled td { color:var(--muted); text-decoration:line-through; }
table.data tr.cancelled td.keep { text-decoration:none; }
table.data tr.rejected td { color:var(--muted); }
table.data tr.rejected td.num { text-decoration:line-through; }
table.data .num { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
table.data a.rowlink { font-weight:650; text-decoration:none; }
.table-wrap { overflow-x:auto; margin:0 -22px; padding:0 22px; }
.table-card { padding:6px 22px 8px; }
.strike { text-decoration:line-through; color:var(--muted); }

/* ---------- состав заказа, форма заявки ---------- */
.patient { border:1px solid var(--line); border-radius:var(--r); padding:16px; margin-bottom:12px; background:var(--surface-2); }
.card.patient { background:var(--surface); padding:22px; margin-bottom:16px; }
.patient .head { display:flex; justify-content:space-between; align-items:center; }
.tube-row { display:grid; grid-template-columns:1fr 84px 40px; gap:8px; margin-bottom:8px; }
.icon-btn { background:var(--surface-3); color:var(--muted); padding:0; width:40px; height:44px; border-radius:10px; font-size:20px; line-height:1; box-shadow:none; }
.icon-btn:hover { background:var(--bad-soft); color:var(--bad-ink); box-shadow:none; }
.picker { position:relative; }
.picker .results { position:absolute; z-index:5; left:0; right:0; top:100%; background:var(--surface); border:1px solid var(--line); border-radius:var(--r);
  box-shadow:var(--shadow-2); max-height:300px; overflow:auto; margin-top:6px; animation:pop-in var(--t) var(--ease); }
.picker .results button { display:flex; justify-content:space-between; gap:12px; width:100%; text-align:left; background:var(--surface); color:var(--ink);
  font-weight:400; border-radius:0; padding:10px 12px; border-bottom:1px solid var(--line); box-shadow:none; }
.picker .results button:hover, .picker .results button:focus { background:var(--accent-soft); color:var(--ink); box-shadow:none; }
.picker .results .dept { color:var(--muted); font-size:12px; display:block; }
.picker .results .price { white-space:nowrap; color:var(--muted); }
.chips { display:flex; flex-direction:column; gap:6px; margin-top:8px; }
.chip { display:flex; justify-content:space-between; align-items:center; gap:8px; background:var(--surface-3); border-radius:10px; padding:8px 8px 8px 12px; font-size:14.5px;
  animation:pop-in var(--t) var(--ease); }
.chip button { background:none; color:var(--muted); padding:0 6px; font-size:20px; line-height:1; box-shadow:none; }
.chip button:hover { background:none; color:var(--bad-ink); box-shadow:none; }
.total { font-size:18px; font-weight:700; font-variant-numeric:tabular-nums; }
.sticky-submit { position:sticky; bottom:0; background:color-mix(in srgb, var(--bg) 92%, transparent); border-top:1px solid var(--line); padding:12px 0; z-index:5; }
details.action { border-top:1px solid var(--line); padding-top:12px; margin-top:12px; }
details.action summary { cursor:pointer; font-weight:600; color:var(--accent-ink); }
.actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:18px; }

/* ---------- приём проб ---------- */
.scan { display:flex; gap:8px; align-items:center; }
.scan .searchbox { flex:1; min-width:300px; }
.rq { padding:0; overflow:hidden; scroll-margin-top:calc(var(--topbar-h) + 12px); }
.rq-head { display:flex; gap:16px; align-items:flex-start; justify-content:space-between; padding:18px 22px 14px; flex-wrap:wrap; }
.rq-head h2 { margin:0 0 2px; font-size:17px; }
.rq-head .meta { color:var(--muted); font-size:13.5px; }
.rq-side { display:flex; flex-direction:column; align-items:flex-end; gap:8px; min-width:220px; }
.rq-side .progress { width:220px; }
.rq-body { padding:0 22px 18px; }
.rq-patient { padding:12px 0; border-top:1px solid var(--line); }
.rq-patient .who { display:flex; flex-wrap:wrap; gap:4px 12px; align-items:baseline; margin-bottom:8px; }
.rq-patient .who b { font-size:15px; }
.rq-patient .tests { color:var(--muted); font-size:13px; }
.sample { display:grid; grid-template-columns:120px minmax(140px, 1fr) auto; gap:8px 14px; align-items:center; padding:8px 10px; border-radius:10px;
  transition:background-color var(--t) var(--ease); scroll-margin-top:calc(var(--topbar-h) + 60px); }
.sample + .sample { margin-top:2px; }
.sample:hover { background:var(--surface-2); }
.sample .no { font-weight:650; font-variant-numeric:tabular-nums; }
.sample .tube { font-size:14px; }
.sample .tube small { display:block; color:var(--muted); font-size:12.5px; }
.sample form { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; margin:0; }
.sample .note-field { flex-basis:100%; }
.js .sample .note-field { display:none; }
.js .sample.show-note .note-field { display:block; animation:pop-in var(--t) var(--ease); }
.seg-btn { padding:6px 11px; font-size:13.5px; font-weight:600; border-radius:8px; background:var(--surface); color:var(--ink-2); border:1px solid var(--line-strong); box-shadow:none; }
.seg-btn:hover { box-shadow:none; color:var(--ink); background:var(--surface-2); }
.seg-btn.received.on, .seg-btn.received:hover { background:var(--ok-soft); border-color:var(--ok); color:var(--ok-ink); }
.seg-btn.problem.on, .seg-btn.problem:hover { background:var(--warn-soft); border-color:var(--warn); color:var(--warn-ink); }
.seg-btn.missing.on, .seg-btn.missing:hover { background:var(--bad-soft); border-color:var(--bad); color:var(--bad-ink); }
.seg-btn.on { box-shadow:inset 0 0 0 1px currentColor; }
.seg-btn .short { display:none; }
.sample.st-received { background:color-mix(in srgb, var(--ok-soft) 55%, transparent); }
.sample.st-problem { background:color-mix(in srgb, var(--warn-soft) 60%, transparent); }
.sample.st-missing { background:color-mix(in srgb, var(--bad-soft) 55%, transparent); }
.sample .st-note { grid-column:2 / -1; font-size:13px; color:var(--muted); margin-top:-4px; }
.sample.flash { animation:flash 1.6s var(--ease); }
@keyframes flash { 0%, 40% { box-shadow:0 0 0 3px var(--accent); } 100% { box-shadow:0 0 0 0 transparent; } }
.rq.busy { opacity:.6; pointer-events:none; transition:opacity var(--t-fast); }
.sample-list { display:flex; flex-wrap:wrap; gap:6px; margin:6px 0 10px; }
.sample-pill { white-space:nowrap; display:inline-flex; align-items:center; gap:6px; padding:3px 10px; border-radius:999px; font-size:13px; background:var(--surface-3); color:var(--ink-2); }
.sample-pill.received { background:var(--ok-soft); color:var(--ok-ink); }
.sample-pill.problem { background:var(--warn-soft); color:var(--warn-ink); }
.sample-pill.missing { background:var(--bad-soft); color:var(--bad-ink); }

.lab-result { margin-top:8px; padding:10px 12px; border-radius:10px; background:var(--teal-soft); color:var(--ink); }
.lab-result p { margin:0 0 8px; } .lab-result p:last-child { margin:0; }
input[type=file] { display:block; width:100%; padding:10px; border:1px dashed var(--line-strong); border-radius:10px; background:var(--surface-2); color:var(--ink-2); font:inherit; }

dialog.modal.wide { width:min(820px, calc(100vw - 32px)); }
dialog.modal .m-body { max-height:calc(100vh - 190px); overflow-y:auto; }
.small-choices label { padding:7px 11px; font-size:14px; }
.org-row { display:grid; grid-template-columns:1fr 210px; gap:8px; margin-bottom:8px; }
.phrase-picker { margin-top:10px; border:1px solid var(--line); border-radius:12px; padding:10px; background:var(--surface-2); }
.phrase-list { max-height:240px; overflow-y:auto; margin-top:8px; display:flex; flex-direction:column; gap:6px; }
.phrase { display:block; width:100%; text-align:left; background:var(--surface); color:var(--ink); border:1px solid var(--line); border-radius:10px;
  padding:9px 11px; font-weight:400; font-size:14px; box-shadow:none; animation:pop-in var(--t) var(--ease); }
.phrase:hover { background:var(--accent-soft); color:var(--ink); border-color:var(--accent); box-shadow:none; }
.phrase .phrase-text { display:block; color:var(--ink-2); font-size:13px; margin-top:3px; }
@media (max-width:600px) { .org-row { grid-template-columns:1fr; } }

.day-switch { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-bottom:8px; }
.day-switch .segmented a .muted { font-size:12px; margin-left:2px; }
.day-switch .segmented a.active .muted { color:var(--ink-2); }
.day-note { margin:0 0 14px; }

details.news { border-top:1px solid var(--line); padding:10px 0; }
details.news:first-of-type { border-top:0; padding-top:0; }
details.news summary { cursor:pointer; }
details.news p { margin:8px 0 0; }

/* ---------- графики выручки ---------- */
.legend { display:flex; gap:14px; color:var(--ink-2); font-size:13px; }
.legend > span { display:inline-flex; align-items:center; gap:6px; }
.legend-dot { display:inline-block; width:10px; height:10px; border-radius:3px; }
.legend-dot.partners, .chart-days rect.partners, .dep-bar i.partners { background:var(--accent); fill:var(--accent); }
.legend-dot.walkin, .chart-days rect.walkin, .dep-bar i.walkin { background:var(--teal); fill:var(--teal); }
.chart-days { position:relative; padding-left:64px; }
.chart-days svg { width:100%; display:block; overflow:visible; }
.chart-days line.grid { stroke:var(--line); stroke-width:1; }
.chart-days line.base { stroke:var(--line-strong); stroke-width:1; }
.chart-days rect.partners, .chart-days rect.walkin { transform-box:fill-box; shape-rendering:crispEdges; }
.chart-days g.bar rect.hit { fill:transparent; }
.chart-days g.bar:hover rect.hit { fill:var(--surface-3); }
.chart-days g.bar rect.partners, .chart-days g.bar rect.walkin { stroke:var(--surface); stroke-width:0.25; }
.chart-axis { position:absolute; left:0; top:0; width:56px; height:100%; }
.chart-axis span { position:absolute; right:0; transform:translateY(-50%); font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums; }
.chart-dates { display:flex; margin-top:6px; }
.chart-dates span { flex:1; font-size:12px; color:var(--muted); white-space:nowrap; overflow:visible; }
.dep-row { display:grid; grid-template-columns:170px 1fr 120px 80px; gap:12px; align-items:center; padding:7px 0; border-top:1px solid var(--line); }
.dep-row:first-of-type { border-top:0; }
.dep-bar { display:flex; gap:2px; height:12px; }
.dep-bar i { display:block; height:100%; border-radius:0 4px 4px 0; transition:width var(--t-slow) var(--ease); }
.dep-bar i.partners:not(:last-child) { border-radius:0; }
.dep-row b, .dep-row .muted { text-align:right; }
@media (max-width:600px) { .dep-row { grid-template-columns:1fr auto; } .dep-bar { grid-column:1 / -1; order:3; } .dep-row .muted { display:none; } .chart-days { padding-left:0; } .chart-axis { display:none; } }

/* ---------- уведомления, окна, поиск ---------- */
.toasts { position:fixed; right:20px; bottom:20px; z-index:80; display:flex; flex-direction:column; gap:10px; width:min(400px, calc(100vw - 32px)); list-style:none; margin:0; padding:0; }
.toast { display:flex; gap:12px; align-items:flex-start; background:var(--surface); color:var(--ink); border:1px solid var(--line); border-left:4px solid var(--ok);
  border-radius:var(--r); padding:12px 12px 12px 14px; box-shadow:var(--shadow-2); font-size:14.5px; animation:toast-in var(--t-slow) var(--ease) both; }
.toast > svg { margin-top:2px; color:var(--ok); }
.toast.error { border-left-color:var(--bad); } .toast.error > svg { color:var(--bad); }
.toast.warning, .toast.info { border-left-color:var(--warn); } .toast.warning > svg, .toast.info > svg { color:var(--warn); }
.toast .t-text { flex:1; }
.toast button { background:none; color:var(--muted); padding:2px; box-shadow:none; }
.toast button:hover { background:var(--surface-3); color:var(--ink); box-shadow:none; }
.toast.out { animation:toast-out var(--t) var(--ease) forwards; }
@keyframes toast-in { from { opacity:0; transform:translateY(12px) scale(.98); } }
@keyframes toast-out { to { opacity:0; transform:translateX(24px); } }
@keyframes pop-in { from { opacity:0; transform:translateY(-4px) scale(.99); } }

dialog.modal { border:0; padding:0; border-radius:var(--r-lg); background:var(--surface); color:var(--ink); box-shadow:var(--shadow-3); width:min(520px, calc(100vw - 32px)); max-height:calc(100vh - 48px); }
dialog.modal[open] { animation:modal-in var(--t) var(--ease); }
dialog.modal::backdrop { background:rgba(8,16,32,.5); animation:fade-in var(--t) var(--ease); }
dialog.modal .m-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:18px 20px 0; }
dialog.modal .m-head h2 { margin:0; }
dialog.modal .m-body { padding:12px 20px 4px; }
dialog.modal .m-foot { display:flex; justify-content:flex-end; gap:8px; padding:16px 20px 20px; }
dialog.modal.danger .m-head h2 { color:var(--bad-ink); }
@keyframes modal-in { from { opacity:0; transform:translateY(10px) scale(.98); } }
@keyframes fade-in { from { opacity:0; } }

dialog.palette { border:0; padding:0; margin:12vh auto auto; border-radius:var(--r-lg); background:var(--surface); color:var(--ink); box-shadow:var(--shadow-3); width:min(640px, calc(100vw - 24px)); }
dialog.palette[open] { animation:modal-in var(--t) var(--ease); }
dialog.palette::backdrop { background:rgba(8,16,32,.45); animation:fade-in var(--t) var(--ease); }
.palette .p-input { display:flex; align-items:center; gap:10px; padding:14px 16px; border-bottom:1px solid var(--line); }
.palette .p-input svg { color:var(--muted); }
.palette .p-input input { border:0; padding:4px 0; font-size:17px; box-shadow:none; background:transparent; }
.palette .p-input input:focus { box-shadow:none; }
.palette .p-results { max-height:min(420px, 60vh); overflow-y:auto; padding:8px; }
.palette .p-group { color:var(--muted); font-size:12.5px; padding:10px 10px 4px; }
.palette .p-item { display:flex; align-items:center; gap:12px; padding:9px 10px; border-radius:10px; color:var(--ink); text-decoration:none; }
.palette .p-item svg { color:var(--muted); }
.palette .p-item .p-sub { color:var(--muted); font-size:13px; margin-left:auto; text-align:right; max-width:50%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.palette .p-item.sel, .palette .p-item:hover { background:var(--accent-soft); color:var(--ink); }
.palette .p-item.sel svg { color:var(--accent); }
.palette .p-empty { padding:24px 12px; text-align:center; color:var(--muted); }
.palette .p-foot { display:flex; gap:14px; padding:10px 16px; border-top:1px solid var(--line); color:var(--muted); font-size:12.5px; }
.skeleton { display:block; height:14px; border-radius:6px; background:linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%);
  background-size:200% 100%; animation:shimmer 1.2s linear infinite; }
.p-skel { display:flex; gap:12px; align-items:center; padding:12px 10px; }
.p-skel .skeleton:first-child { width:18px; height:18px; border-radius:5px; flex:none; }
@keyframes shimmer { to { background-position:-200% 0; } }

/* ---------- 403 и пустые состояния ---------- */
.empty { text-align:center; padding:36px 16px; color:var(--muted); }
.empty svg { width:36px; height:36px; color:var(--line-strong); margin-bottom:8px; }

/* ---------- телефон ---------- */
@media (max-width: 960px) {
  .sidebar { transform:translateX(-100%); visibility:hidden; transition:transform var(--t-slow) var(--ease), visibility 0s linear var(--t-slow); }
  body.nav-open .sidebar { transform:none; visibility:visible; box-shadow:var(--shadow-3); transition:transform var(--t-slow) var(--ease), visibility 0s; }
  body.nav-open .scrim { opacity:1; pointer-events:auto; }
  .main-col { margin-left:0; }
  .menu-button { display:inline-grid; }
  .topbar { padding:0 12px; }
  .search-trigger { min-width:0; width:40px; padding:0; justify-content:center; box-shadow:none; border:0; background:transparent; }
  .search-trigger span, .search-trigger kbd { display:none; }
  main.page { padding:0 16px; }
}
@media (max-width: 600px) {
  h1 { font-size:22px; }
  .grid2 { grid-template-columns:1fr; }
  .card { padding:18px 16px; border-radius:var(--r); }
  .table-wrap { margin:0 -16px; padding:0 16px; }
  .kv { grid-template-columns:1fr; gap:2px 0; } .kv dd { margin-bottom:8px; }
  .card.rq { padding:0; }
  .rq-head, .rq-body { padding-left:16px; padding-right:16px; }
  .scan { width:100%; } .scan .searchbox { min-width:0; }
  .sample form { display:grid; grid-template-columns:repeat(3, 1fr); }
  .sample form .seg-btn { padding:9px 4px; font-size:13.5px; gap:4px; }
  .seg-btn .long { display:none; } .seg-btn .short { display:inline; }
  .sample form .seg-btn[value="expected"] { grid-column:1 / -1; }
  .sample form .note-field { grid-column:1 / -1; }
  .rq-patient .row { flex-wrap:wrap !important; }
  .rq-side { align-items:stretch; width:100%; } .rq-side .progress { width:100%; }
  .sample { grid-template-columns:1fr; gap:6px; } .sample form { justify-content:flex-start; } .sample .st-note { grid-column:1; }
  .toasts { right:16px; left:16px; bottom:16px; width:auto; }
  .tile .figure { font-size:30px; }
  .day-switch .segmented { order:-1; flex-basis:100%; }
  .day-switch form { flex:1; } .day-switch input[type=date] { width:100% !important; }
  table.data.stack thead { display:none; }
  table.data.stack, table.data.stack tbody, table.data.stack tr, table.data.stack td { display:block; width:100%; }
  table.data.stack tr { padding:12px 0; border-bottom:1px solid var(--line); }
  table.data.stack tbody tr:last-child { border-bottom:0; }
  table.data.stack td { border:0; padding:3px 0; max-width:none !important; }
  table.data.stack td[data-label]::before { content:attr(data-label); display:block; color:var(--muted); font-size:12px; }
  table.data.stack td.row-actions { text-align:left !important; padding-top:8px; }
  table.data.stack tbody tr:hover td { background:none; }
}

/* ---------- меньше движения ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration:1ms !important; animation-iteration-count:1 !important; transition-duration:1ms !important; scroll-behavior:auto !important; }
  .skeleton { animation:none; }
}
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration:var(--t); }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation:none !important; } }

/* ----- счёт («детализация») в оформлении заказчика: всегда на белом, как документ ----- */
.doc-card { background:#fff; color:#111; }
.invoice-doc { color:#111; }
.inv-head { display:flex; align-items:flex-end; gap:14px; padding-bottom:8px; border-bottom:3px solid #3d8fd6; }
.inv-head img { width:64px; height:62px; flex:none; }
:root[data-theme="dark"] .doc-card .inv-head img { filter:none; }
.inv-name { color:#3d8fd6; font-weight:800; font-size:21px; letter-spacing:.01em; flex:1; }
.inv-mail { font-weight:700; }
.inv-meta { display:grid; grid-template-columns:max-content 1fr; gap:4px 14px; margin:18px 0 0; font-size:14px; }
.inv-meta dt { color:#444; } .inv-meta dd { margin:0; }
.inv-title { text-align:center; font-size:15px; margin:28px 0 14px; color:#111; }
.inv-table { width:100%; border-collapse:collapse; font-size:14px; }
.inv-table th, .inv-table td { border:1px solid #111; padding:4px 6px; vertical-align:bottom; text-align:left; }
.inv-table th { font-weight:700; }
.inv-table .num { text-align:right; white-space:nowrap; }
.inv-table tfoot td { background:#e3effa; font-weight:700; }
.inv-table tr.inv-rejected td { color:#9aa3ad; }
.inv-table tr.inv-rejected td:nth-child(5) { text-decoration:line-through; }
.inv-note { font-size:12px; color:#9aa3ad; }
.inv-table form { margin:0; }
.inv-table button.link { color:#1a56c9; }
@media (max-width:700px) { .inv-name { font-size:15px; } .inv-table { font-size:12px; } .inv-mail { display:none; } }
@media print {
  .sidebar, .topbar, .no-print, .toasts, .scrim { display:none !important; }
  .main-col { margin:0; } body { background:#fff; } main.page, main.page.wide { max-width:none; margin:0; padding:0; animation:none; }
  .card { border:0; padding:0; margin:0; box-shadow:none; }
}

.plain-list { list-style:none; margin:10px 0 0; padding:0; display:grid; gap:8px; }
.doc-view { max-width:900px; margin:0 auto; padding:40px 48px; line-height:1.55; font-size:15px; }
.doc-view p { margin:0 0 8px; white-space:pre-wrap; }
.doc-view ul { list-style:none; padding-left:0; }
.doc-view ol { padding-left:22px; }
.doc-view table { width:100%; border-collapse:collapse; margin:12px 0 18px; font-size:13.5px; }
.doc-view td, .doc-view th { border:1px solid var(--line); padding:6px 8px; vertical-align:top; }
.doc-view td p { margin:0; white-space:normal; }
@media (max-width:700px) { .doc-view { padding:20px 16px; } }

table.data tr.part td:first-child { padding-left:28px; }
