/* ════════════════════════════════════════════════════════════════════════════
   МФЦ УТО — дизайн-система «Liquid Glass»
   Стекло поверх серверного коридора: панели, кнопки с бликом за курсором,
   «жидкие» счётчики и плавные переходы между вкладками (View Transitions).
   ════════════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #060b13;
  --ink: #eaf1f8;
  --ink-2: #b0bfd0;
  --ink-3: #7d90a6;
  --line: rgba(255, 255, 255, .085);
  --line-2: rgba(255, 255, 255, .16);
  --glass: rgba(15, 25, 39, .66);
  --glass-2: rgba(9, 16, 27, .74);
  --field: rgba(255, 255, 255, .05);
  --accent: #3ea6ff;
  --accent-hi: #8fd6ff;

  /* цвета статусов — RGB-тройки, чтобы собирать rgba(var(--x), .2) */
  --blue: 62, 146, 255;
  --cyan: 84, 200, 255;
  --orange: 245, 158, 59;
  --green: 52, 199, 123;
  --purple: 177, 99, 232;
  --slate: 142, 163, 189;
  --red: 242, 95, 92;

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.3, 1.35, .45, 1);
  --blur: blur(22px) saturate(150%);
  --shadow: 0 24px 48px -28px rgba(0, 0, 0, .75);
  --sidebar: 248px;

  /* совместимость со старыми inline-стилями шаблонов */
  --surface: rgba(6, 12, 20, .5);
  --card: rgba(255, 255, 255, .04);
  --border: var(--line);
  --text: var(--ink);
  --muted: var(--ink-3);
  --success: #34c77b;
  --warning: #f59e3b;
  --danger: #f25f5c;
  --radius: var(--r);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Golos Text', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }
code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: .92em; color: var(--accent-hi); }
b, strong { font-weight: 600; }
::selection { background: rgba(62, 166, 255, .35); }

.i {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}
.i-sm { width: 15px; height: 15px; }
.i-lg { width: 22px; height: 22px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }

/* скроллбары */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.14) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255,255,255,.22); }

/* ── Фон ─────────────────────────────────────────────────────────────────── */
.scene {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: -2; display: block;
}
.scene-veil {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120% 90% at 55% 38%, rgba(6, 11, 19, .2), rgba(6, 11, 19, .78)),
    linear-gradient(180deg, rgba(6, 11, 19, .42), rgba(6, 11, 19, .58));
}
/* Внутри панели фон — лишь атмосфера: слегка размыт, чтобы огни стоек не спорили с данными */
.scene[data-mode="app"] { filter: blur(2px) saturate(1.05); transform: scale(1.02); }

/* ── Стекло ──────────────────────────────────────────────────────────────── */
.glass, .panel, .form-card, .table-wrap, .filters {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), var(--shadow);
}

/* Блик, следующий за курсором (координаты пишет app.js) */
.btn::before, .stat::before, .nav-link::before, .tile::before, .seg-item::before,
.req-row::before, .liquid-btn::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  pointer-events: none; opacity: 0; z-index: 1;
  background: radial-gradient(180px circle at var(--mx, 50%) var(--my, 50%),
              rgba(255, 255, 255, .2), rgba(255, 255, 255, .05) 40%, transparent 70%);
  transition: opacity .3s var(--ease);
}
.btn:hover::before, .stat:hover::before, .nav-link:hover::before, .tile:hover::before,
.seg-item:hover::before, .req-row:hover::before, .liquid-btn:hover::before { opacity: 1; }

/* ════════════════════════════════════════════════════════════════════════════
   Каркас: боковое меню + верхняя панель
   ════════════════════════════════════════════════════════════════════════════ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 14px 16px;
  background: linear-gradient(180deg, rgba(8, 15, 25, .82), rgba(8, 15, 25, .7));
  -webkit-backdrop-filter: blur(26px) saturate(140%);
  backdrop-filter: blur(26px) saturate(140%);
  border-right: 1px solid var(--line);
  view-transition-name: sidebar;
  z-index: 40;
}

.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 6px 10px 18px;
  font-weight: 700; font-size: 17px; letter-spacing: .01em;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(160deg, rgba(var(--cyan), .35), rgba(var(--blue), .15));
  border: 1px solid rgba(var(--cyan), .35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 6px 18px -6px rgba(var(--cyan), .45);
  color: #dff3ff;
}
.brand-name { background: linear-gradient(180deg, #fff, #bfe3ff); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); opacity: .8;
  padding: 18px 12px 6px;
}
.nav-link {
  position: relative; isolation: isolate;
  display: flex; align-items: center; gap: 12px;
  height: 42px; padding: 0 12px;
  border-radius: 12px;
  color: var(--ink-2); font-weight: 500;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.nav-link .i { transition: color .2s var(--ease), transform .3s var(--spring); }
.nav-link:hover { color: var(--ink); background: rgba(255, 255, 255, .04); }
.nav-link:hover .i { transform: translateX(1px) scale(1.06); }
.nav-link:active .i { transform: scale(.92); }
.nav-link[aria-current="page"] { color: #fff; }
.nav-link[aria-current="page"] .i { color: var(--accent-hi); }
.nav-pill {
  position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.05));
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 8px 20px -10px rgba(0,0,0,.6);
  view-transition-name: nav-pill;
}
.nav-pill::after {
  content: ''; position: absolute; left: -1px; top: 11px; bottom: 11px; width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent-hi);
  box-shadow: 0 0 12px rgba(var(--cyan), .8);
}
.nav-badge {
  margin-left: auto;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px;
  display: none; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  background: linear-gradient(180deg, #4fb2ff, #2583e6);
  box-shadow: 0 0 0 3px rgba(8, 15, 25, .8), 0 4px 12px -2px rgba(62, 166, 255, .7);
}
.nav-badge.is-on { display: inline-flex; animation: badge-in .45s var(--spring); }
.nav-badge.is-alert { background: linear-gradient(180deg, #ff7a73, #e04843); box-shadow: 0 0 0 3px rgba(8,15,25,.8), 0 4px 12px -2px rgba(var(--red), .7); }
@keyframes badge-in { from { transform: scale(.4); opacity: 0; } }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 11px; padding: 4px 6px; min-width: 0; }
.me-name { font-size: 13px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.me-role { font-size: 12px; color: var(--ink-3); }

.avatar {
  --av: var(--blue);
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700; letter-spacing: .02em; color: #fff;
  background: linear-gradient(150deg, rgba(var(--av), .9), rgba(var(--av), .45));
  border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 4px 12px -4px rgba(var(--av), .6);
  position: relative;
}
.avatar-sm { width: 30px; height: 30px; font-size: 11px; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar .dot-online {
  position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px;
  border-radius: 50%; background: #3ddc84; border: 2px solid #0b1520;
  box-shadow: 0 0 8px rgba(61, 220, 132, .8);
}

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: 64px; padding: 0 32px;
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(180deg, rgba(7, 13, 22, .72), rgba(7, 13, 22, .38));
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  view-transition-name: topbar;
}
.topbar-title { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 600; letter-spacing: -.01em; min-width: 0; }
.topbar-title span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: linear-gradient(180deg, #fff, #cfe8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--accent-hi);
  box-shadow: 0 0 0 0 rgba(var(--cyan), .6), 0 0 10px rgba(var(--cyan), .9);
  animation: live 2.8s ease-out infinite;
}
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(var(--cyan), .55), 0 0 10px rgba(var(--cyan), .9); } 70%, 100% { box-shadow: 0 0 0 9px rgba(var(--cyan), 0), 0 0 10px rgba(var(--cyan), .9); } }
.topbar-spacer { flex: 1; }
.topbar-date { color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.topbar-date::first-letter { text-transform: uppercase; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 14px 0 5px; border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  max-width: 320px;
}
.user-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .menu-btn { display: none; }

.content {
  width: 100%; max-width: 1600px;
  margin: 0 auto;
  padding: 24px 32px 56px;
}

/* ── Появление контента страницы ─────────────────────────────────────────── */
.content > * { animation: rise .55s var(--ease) both; }
.content > *:nth-child(2) { animation-delay: .04s; }
.content > *:nth-child(3) { animation-delay: .08s; }
.content > *:nth-child(4) { animation-delay: .12s; }
.content > *:nth-child(5) { animation-delay: .16s; }
.content > *:nth-child(n+6) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.content > .dash, .dash-main > .stats { animation: none; }
.dash-main > *, .dash-rail > *, .stats > * { animation: rise .6s var(--ease) both; }
.dash-main > :nth-child(2) { animation-delay: .06s; }
.dash-main > :nth-child(3) { animation-delay: .12s; }
.dash-main > :nth-child(4) { animation-delay: .18s; }
.dash-rail > * { animation-delay: .1s; }
.stats > :nth-child(1) { animation-delay: .06s; }
.stats > :nth-child(2) { animation-delay: .1s; }
.stats > :nth-child(3) { animation-delay: .14s; }
.stats > :nth-child(4) { animation-delay: .18s; }
.stats > :nth-child(5) { animation-delay: .22s; }

/* ── Переходы между вкладками (View Transitions между документами) ──────── */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .16s ease-in both; }
::view-transition-new(root) { animation: vt-in .3s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }
::view-transition-group(nav-pill) { animation-duration: .45s; animation-timing-function: var(--spring); }
::view-transition-group(seg-pill) { animation-duration: .4s; animation-timing-function: var(--spring); }
::view-transition-group(hero) { animation-duration: .6s; animation-timing-function: cubic-bezier(.3, .9, .25, 1); }
::view-transition-old(hero), ::view-transition-new(hero) { height: 100%; object-fit: cover; animation-duration: .45s; }
::view-transition-group(sidebar), ::view-transition-group(topbar) { animation-duration: .3s; }

/* ════════════════════════════════════════════════════════════════════════════
   Кнопки — Liquid Glass
   ════════════════════════════════════════════════════════════════════════════ */
.btn {
  --tint: 255, 255, 255;
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border-radius: 12px;
  border: 1px solid rgba(var(--tint), .16);
  background:
    linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,0) 55%),
    rgba(var(--tint), .07);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .22),
    inset 0 -1px 0 rgba(0, 0, 0, .25),
    0 8px 20px -12px rgba(0, 0, 0, .8);
  color: var(--ink);
  font-size: 13.5px; font-weight: 600; line-height: 1; white-space: nowrap;
  cursor: pointer; user-select: none;
  transition:
    transform .35s var(--spring),
    background-color .25s var(--ease),
    border-color .25s var(--ease),
    box-shadow .3s var(--ease),
    color .2s var(--ease);
}
.btn > * { position: relative; z-index: 2; }
.btn .i { width: 16px; height: 16px; }
.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(var(--tint), .3);
  background-color: rgba(var(--tint), .12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .3),
    inset 0 -1px 0 rgba(0, 0, 0, .25),
    0 14px 28px -14px rgba(0, 0, 0, .9),
    0 0 0 1px rgba(var(--tint), .05);
}
.btn:active { transform: translateY(0) scale(.97); transition-duration: .08s; }
.btn:disabled, .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px; }

/* «Жидкость» поднимается внутри цветных кнопок при наведении */
.btn-primary::after, .btn-success::after, .btn-danger::after, .btn-warning::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 70%;
  z-index: 0; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 40' preserveAspectRatio='none'%3E%3Cpath d='M0 14 Q30 2 60 14 T120 14 V40 H0Z' fill='white'/%3E%3C/svg%3E") repeat-x 0 0 / 120px 100%;
  opacity: 0; transform: translateY(55%);
  transition: opacity .4s var(--ease), transform .6s var(--ease);
  animation: liquid-x 2.4s linear infinite paused;
  mix-blend-mode: overlay;
}
.btn-primary:hover::after, .btn-success:hover::after, .btn-danger:hover::after, .btn-warning:hover::after {
  opacity: .55; transform: translateY(18%); animation-play-state: running;
}
@keyframes liquid-x { to { background-position-x: 120px; } }

.btn-primary {
  --tint: 62, 166, 255;
  color: #fff;
  border-color: rgba(143, 214, 255, .5);
  background:
    linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,255,255,0) 55%),
    linear-gradient(180deg, rgba(62, 166, 255, .72), rgba(28, 108, 214, .62));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .4),
    inset 0 -1px 0 rgba(0, 30, 80, .35),
    0 10px 26px -12px rgba(62, 166, 255, .8);
  text-shadow: 0 1px 2px rgba(0, 30, 70, .35);
}
.btn-primary:hover {
  background-color: transparent;
  border-color: rgba(190, 232, 255, .75);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .5),
    inset 0 -1px 0 rgba(0, 30, 80, .35),
    0 16px 34px -12px rgba(62, 166, 255, .95),
    0 0 0 4px rgba(62, 166, 255, .12);
}
.btn-success {
  --tint: 52, 199, 123; color: #fff;
  border-color: rgba(120, 235, 175, .45);
  background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0) 55%), linear-gradient(180deg, rgba(52,199,123,.62), rgba(30,150,90,.55));
}
.btn-danger {
  --tint: 242, 95, 92; color: #fff;
  border-color: rgba(255, 150, 145, .45);
  background: linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,0) 55%), linear-gradient(180deg, rgba(242,95,92,.6), rgba(200,55,52,.52));
}
.btn-warning {
  --tint: 245, 158, 59; color: #fff;
  border-color: rgba(255, 200, 140, .45);
  background: linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,0) 55%), linear-gradient(180deg, rgba(245,158,59,.6), rgba(210,120,30,.52));
}
.btn-ghost { /* базовое стекло */ }
.btn-quiet { background: transparent; border-color: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; color: var(--ink-2); }
.btn-quiet:hover { background: rgba(255,255,255,.06); border-color: var(--line); color: var(--ink); box-shadow: none; }
.btn-danger-text { color: #ff8f8b; }
.btn-danger-text:hover { --tint: 242, 95, 92; color: #ffb1ad; }

.btn-sm { height: 32px; padding: 0 12px; border-radius: 10px; font-size: 12.5px; gap: 6px; }
.btn-sm .i { width: 14px; height: 14px; }
.btn-lg { height: 46px; padding: 0 22px; border-radius: 14px; font-size: 15px; gap: 10px; }
.btn-lg .i { width: 18px; height: 18px; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-block { width: 100%; }

.spinner {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 2px solid rgba(255, 255, 255, .3); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Большая «жидкая» кнопка (вход, отправка заявки) ─────────────────────── */
.liquid-btn {
  position: relative; isolation: isolate;
  display: block; width: 100%;
  padding: 4px;
  border-radius: 18px;
  border: 1px solid rgba(200, 232, 255, .34);
  background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.03));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .35),
    0 0 26px -4px rgba(62, 166, 255, .35),
    0 18px 36px -18px rgba(0, 0, 0, .9);
  cursor: pointer;
  transition: transform .4s var(--spring), box-shadow .35s var(--ease), border-color .3s var(--ease);
}
.liquid-btn::before { border-radius: 18px; z-index: 3; }
.liquid-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(210, 238, 255, .6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .45),
    0 0 40px -2px rgba(62, 166, 255, .6),
    0 22px 40px -18px rgba(0, 0, 0, .9);
}
.liquid-btn:active { transform: scale(.985); transition-duration: .1s; }
.liquid-btn:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 4px; }
.liquid-btn:disabled { cursor: progress; }

.liquid-fill {
  position: relative; display: block; overflow: hidden;
  height: 48px; border-radius: 14px;
  background:
    radial-gradient(80% 120% at 50% 110%, rgba(84, 200, 255, .45), rgba(84, 200, 255, 0) 70%),
    linear-gradient(180deg, #11426f 0%, #0a2a4f 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 -12px 22px rgba(0, 0, 0, .35);
}
.liquid-fill::after {
  content: ''; position: absolute; inset: 0 0 50% 0; border-radius: 14px 14px 40% 40% / 14px 14px 12px 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .24), rgba(255, 255, 255, 0));
  pointer-events: none; z-index: 2;
}
.lw {
  position: absolute; left: 0; width: 200%; height: 100%;
  animation: wave-x linear infinite;
  will-change: transform;
}
.lw1 { top: 26%; animation-duration: 7s; }
.lw1 path { fill: rgba(38, 124, 225, .6); }
.lw2 { top: 44%; animation-duration: 4.6s; animation-direction: reverse; }
.lw2 path { fill: rgba(80, 205, 255, .55); }
.lw2 { filter: drop-shadow(0 -2px 6px rgba(120, 215, 255, .55)); }
.lw3 { top: 22%; animation-duration: 3.4s; filter: drop-shadow(0 0 4px rgba(143, 214, 255, .9)); }
.lw3 path { fill: none; stroke: rgba(210, 242, 255, .85); stroke-width: 2; vector-effect: non-scaling-stroke; }
@keyframes wave-x { to { transform: translateX(-50%); } }

.liquid-label {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 16px; font-weight: 600; letter-spacing: .02em; color: #fff;
  text-shadow: 0 1px 6px rgba(0, 20, 50, .6), 0 0 18px rgba(143, 214, 255, .55);
}

/* ════════════════════════════════════════════════════════════════════════════
   Панели, заголовки страниц
   ════════════════════════════════════════════════════════════════════════════ */
.panel { position: relative; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.panel-head.no-line { border-bottom: 0; padding-bottom: 6px; }
.panel-title { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; letter-spacing: -.005em; }
.panel-title .i { color: var(--ink-3); }
.panel-title .count { color: var(--ink-3); font-weight: 500; }
.panel-body { padding: 20px; }
.stack { display: flex; flex-direction: column; gap: 20px; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.page-sub { color: var(--ink-3); margin-top: 4px; font-size: 14px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* Старые классы — теперь в стиле стекла */
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 14px; }
.section-header h2 { font-size: 16px; font-weight: 600; }
.form-card { padding: 24px; }
.container { max-width: none; padding: 0; }

/* ════════════════════════════════════════════════════════════════════════════
   Главная
   ════════════════════════════════════════════════════════════════════════════ */
.dash { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.dash.has-rail { grid-template-columns: minmax(0, 1fr) 290px; }
.dash-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.dash-rail { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 20px; }

.welcome {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 22px 24px;
  view-transition-name: hero;
}
.welcome h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.welcome p { color: var(--ink-2); margin-top: 4px; }
.welcome p b { color: var(--ink); font-weight: 600; }

/* Счётчики с «жидкостью» */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.stat {
  --c: var(--blue);
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
  min-height: 118px; padding: 16px 16px 14px;
  border-radius: 18px;
  border: 1px solid rgba(var(--c), .42);
  background:
    linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,0) 42%),
    linear-gradient(155deg, rgba(var(--c), .34), rgba(var(--c), .12) 58%, rgba(var(--c), .2));
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .28),
    inset 0 0 0 1px rgba(255, 255, 255, .03),
    0 18px 36px -22px rgba(var(--c), .7);
  transition: transform .45s var(--spring), box-shadow .35s var(--ease), border-color .3s var(--ease);
}
.stat:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--c), .7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .36),
    0 26px 44px -22px rgba(var(--c), .85),
    0 0 0 4px rgba(var(--c), .08);
}
.stat:active { transform: translateY(-1px) scale(.985); transition-duration: .1s; }
.stat-head { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; }
.stat-icon {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(160deg, rgba(var(--c), .95), rgba(var(--c), .55));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 6px 14px -6px rgba(var(--c), .9);
}
.stat-icon .i { width: 17px; height: 17px; }
.stat-label { font-size: 14.5px; font-weight: 500; color: rgba(255, 255, 255, .92); }
.stat-num {
  position: relative; z-index: 2;
  font-size: 34px; font-weight: 700; line-height: 1; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .3);
}
.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats-auto { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat-wave { position: absolute; left: 0; right: 0; bottom: 0; height: 62%; z-index: 0; pointer-events: none; overflow: hidden; }
.stat-wave svg { position: absolute; left: 0; bottom: 0; width: 200%; height: 100%; animation: wave-x 9s linear infinite paused; }
.stat-wave svg + svg { animation-duration: 6s; animation-direction: reverse; }
.stat-wave .w1 { fill: rgba(var(--c), .38); }
.stat-wave .w2 { fill: rgba(var(--c), .26); }
.stat:hover .stat-wave svg { animation-play-state: running; }
.stat--blue { --c: var(--blue); }
.stat--orange { --c: var(--orange); }
.stat--green { --c: var(--green); }
.stat--purple { --c: var(--purple); }
.stat--slate { --c: var(--slate); }
.stat--red { --c: var(--red); }

/* Вложения от инженеров */
.alert-panel { border-color: rgba(var(--red), .35); background: linear-gradient(160deg, rgba(var(--red), .14), rgba(16, 27, 42, .6) 55%); }
.alert-panel .panel-title .i { color: #ff8f8b; }

.dash-split { display: grid; grid-template-columns: minmax(300px, 4fr) minmax(0, 7fr); gap: 20px; align-items: start; }
@media (max-width: 1600px) { .dash-split { grid-template-columns: minmax(290px, 4fr) minmax(0, 7fr); } }
.cell-fill { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-split .table td, .dash-split .table th { padding-left: 14px; padding-right: 14px; }
.dash-split > .panel { min-height: 260px; }

/* Список заявок */
.req-list { display: flex; flex-direction: column; padding: 8px; }
.req-row {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 12px;
  transition: background-color .2s var(--ease), transform .3s var(--spring);
}
.req-row:hover { background: rgba(255, 255, 255, .05); }
.req-row:active { transform: scale(.99); }
.req-row + .req-row { box-shadow: 0 -1px 0 rgba(255, 255, 255, .05); }
.req-row:hover + .req-row, .req-row:hover { box-shadow: none; }
.req-main { min-width: 0; }
.req-title { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-meta { display: block; color: var(--ink-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.req-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.req-time { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.prio-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: rgba(var(--c), 1); box-shadow: 0 0 0 3px rgba(var(--c), .18), 0 0 10px rgba(var(--c), .6); }
.prio-high { --c: var(--red); }
.prio-normal { --c: var(--orange); }
.prio-low { --c: var(--green); }

/* Пустые состояния */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 36px 20px; color: var(--ink-3); }
.empty-art { width: 108px; height: 84px; margin-bottom: 8px; opacity: .9; }
.empty-art .e-line { fill: none; stroke: rgba(170, 210, 245, .55); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.empty-art .e-fill { fill: rgba(143, 214, 255, .1); }
.empty-title { color: var(--ink-2); font-weight: 600; font-size: 14.5px; }
.empty .btn { margin-top: 12px; }

/* Онлайн */
.people { display: flex; flex-direction: column; padding: 6px 8px 10px; }
.person { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; transition: background-color .2s var(--ease); }
.person:hover { background: rgba(255, 255, 255, .05); }
.person-name { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.person-sub { font-size: 12px; color: var(--ink-3); }
.person .i { margin-left: auto; color: var(--ink-3); opacity: 0; transform: translateX(-4px); transition: opacity .2s, transform .3s var(--spring); }
.person:hover .i { opacity: 1; transform: none; }

/* ════════════════════════════════════════════════════════════════════════════
   Таблицы
   ════════════════════════════════════════════════════════════════════════════ */
.table-wrap { overflow: hidden; }
.table-scroll { overflow-x: auto; }
.table-wrap table, .table { width: 100%; border-collapse: collapse; }
.table-wrap th, .table th {
  padding: 12px 16px; text-align: left; white-space: nowrap;
  font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3);
  background: rgba(255, 255, 255, .025);
  border-bottom: 1px solid var(--line);
}
.table-wrap td, .table td { padding: 13px 16px; border-bottom: 1px solid rgba(255, 255, 255, .05); vertical-align: middle; }
.table-wrap tr:last-child td, .table tr:last-child td { border-bottom: 0; }
.table-wrap tbody tr, .table tbody tr { transition: background-color .18s var(--ease); }
.table-wrap tbody tr:hover td, .table tbody tr:hover td { background: rgba(120, 180, 255, .055); }
tr[data-href] { cursor: pointer; }
.table .id-link { color: var(--accent-hi); font-weight: 600; font-variant-numeric: tabular-nums; }
.table .id-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.cell-sub { display: block; color: var(--ink-3); font-size: 12.5px; margin-top: 1px; }
.cell-strong { font-weight: 600; }
.cell-clip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 1680px) { .cell-clip { max-width: 360px; } }
.row-go { color: var(--ink-3); transition: transform .3s var(--spring), color .2s; }
tr:hover .row-go { color: var(--accent-hi); transform: translateX(3px); }
.unread-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ff6b66; box-shadow: 0 0 8px rgba(var(--red), .9); margin-left: 6px; vertical-align: middle; }

/* ── Бейджи ──────────────────────────────────────────────────────────────── */
.badge {
  --c: var(--slate);
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  color: rgb(var(--c));
  background: rgba(var(--c), .13);
  border: 1px solid rgba(var(--c), .28);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.badge.no-dot::before { display: none; }
.badge-new { --c: 110, 185, 255; }
.badge-in_progress { --c: 255, 180, 95; }
.badge-done { --c: 95, 220, 150; }
.badge-rejected { --c: 255, 128, 124; }
.badge-high { --c: 255, 128, 124; }
.badge-normal { --c: 255, 180, 95; }
.badge-low { --c: 95, 220, 150; }
.badge-attach { --c: 200, 140, 245; }
.badge-admin { --c: 200, 140, 245; }
.badge-lg { height: 30px; padding: 0 14px; font-size: 13px; }

/* ════════════════════════════════════════════════════════════════════════════
   Формы
   ════════════════════════════════════════════════════════════════════════════ */
.form-group, .field { margin-bottom: 18px; }
.form-group > label, .field-label {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.field-label .opt { color: var(--ink-3); font-weight: 400; }
.field-hint { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.field-error { display: none; font-size: 12.5px; color: #ff9b97; margin-top: 6px; }
.field.has-error .field-error { display: block; }
.field.has-error .form-control, .field.has-error .tiles { border-color: rgba(var(--red), .7); box-shadow: 0 0 0 4px rgba(var(--red), .12); }

.form-control {
  width: 100%; height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--field);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25);
  color: var(--ink);
  font-size: 14px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);
  appearance: none; -webkit-appearance: none;
}
.form-control::placeholder { color: rgba(176, 191, 208, .5); }
.form-control:hover { border-color: rgba(255, 255, 255, .2); }
.form-control:focus {
  outline: none;
  border-color: rgba(143, 214, 255, .75);
  background-color: rgba(255, 255, 255, .075);
  box-shadow: 0 0 0 4px rgba(62, 166, 255, .16), inset 0 1px 2px rgba(0, 0, 0, .2);
}
.form-control:disabled { opacity: .5; cursor: not-allowed; }
textarea.form-control { height: auto; min-height: 92px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
select.form-control {
  padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b0bfd0' 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 12px center; background-size: 16px;
}
select.form-control option { background: #0f1a28; color: var(--ink); }
input[type="date"].form-control { color-scheme: dark; }
input[type="file"] { font-size: 13px; }

.input-wrap { position: relative; }
.input-wrap > .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; transition: color .2s; }
.input-wrap > .form-control { padding-left: 42px; }
.input-wrap:focus-within > .i { color: var(--accent-hi); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }

/* Сегменты (приоритет, статус, вкладки фильтра) */
.seg {
  display: inline-flex; gap: 4px; padding: 4px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .22);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .35);
  max-width: 100%; overflow-x: auto;
}
.seg-full { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
.seg-item { position: relative; isolation: isolate; }
.seg-item input { position: absolute; opacity: 0; pointer-events: none; }
.seg-btn {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border-radius: 10px;
  font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
  cursor: pointer;
  transition: color .2s var(--ease), background-color .25s var(--ease), box-shadow .25s var(--ease), transform .3s var(--spring);
}
.seg-item::before { border-radius: 10px; }
.seg-item:hover .seg-btn { color: var(--ink); }
.seg-item:active .seg-btn { transform: scale(.96); }
.seg-item input:checked + .seg-btn, .seg-btn.is-active {
  color: #fff;
  background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.06));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 0 0 1px rgba(255,255,255,.12), 0 6px 16px -8px rgba(0,0,0,.8);
}
.seg-btn.is-active { view-transition-name: seg-pill; }
.seg-item input:focus-visible + .seg-btn { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.seg-btn .prio-dot { width: 8px; height: 8px; }
.seg-count { font-size: 11.5px; color: var(--ink-3); font-weight: 500; }

/* Плитки выбора (типовые проблемы, статусы) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 10px; border-radius: 14px; border: 1px solid transparent; transition: border-color .2s, box-shadow .2s; }
.tile { position: relative; isolation: isolate; border-radius: 13px; }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile-body {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 10px 12px;
  border-radius: 13px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .1);
  color: var(--ink-2); font-size: 13px; font-weight: 500; line-height: 1.3;
  cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s, transform .35s var(--spring), box-shadow .25s var(--ease);
}
.tile-body .i { color: var(--ink-3); transition: color .2s, transform .35s var(--spring); }
.tile:hover .tile-body { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .18); color: var(--ink); }
.tile:active .tile-body { transform: scale(.97); }
.tile input:checked + .tile-body {
  color: #fff;
  background: linear-gradient(160deg, rgba(62, 166, 255, .32), rgba(62, 166, 255, .12));
  border-color: rgba(143, 214, 255, .6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 0 0 3px rgba(62, 166, 255, .14);
}
.tile input:checked + .tile-body .i { color: var(--accent-hi); transform: scale(1.1); }
.tile input:focus-visible + .tile-body { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.tiles-status { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tiles-status .tile-body { --c: var(--slate); }
.tiles-status .tile input:checked + .tile-body {
  background: linear-gradient(160deg, rgba(var(--c), .3), rgba(var(--c), .1));
  border-color: rgba(var(--c), .6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 0 0 3px rgba(var(--c), .14);
}
.tiles-status .tile input:checked + .tile-body .i { color: rgb(var(--c)); }

/* Загрузка файла */
.dropzone {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 132px; padding: 22px;
  border-radius: 16px;
  border: 1.5px dashed rgba(170, 210, 245, .28);
  background: rgba(255, 255, 255, .025);
  text-align: center; cursor: pointer;
  transition: border-color .25s var(--ease), background-color .25s var(--ease), transform .35s var(--spring);
}
.dropzone:hover, .dropzone.is-drag { border-color: rgba(143, 214, 255, .7); background: rgba(62, 166, 255, .07); }
.dropzone.is-drag { transform: scale(1.01); }
.dropzone-icon {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 4px;
  background: rgba(62, 166, 255, .14); border: 1px solid rgba(143, 214, 255, .3); color: var(--accent-hi);
  transition: transform .4s var(--spring);
}
.dropzone:hover .dropzone-icon { transform: translateY(-3px); }
.dropzone-title { font-weight: 600; }
.dropzone-sub { font-size: 12.5px; color: var(--ink-3); }
.kbd { display: inline-block; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line-2); background: rgba(255,255,255,.06); font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.file-chip {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  background: rgba(var(--green), .1); border: 1px solid rgba(var(--green), .35);
  animation: pop .4s var(--spring);
}
.file-chip-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(var(--green), .2); color: #8ff0bb; flex: none; }
.file-chip-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip-size { font-size: 12px; color: var(--ink-3); }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }

/* Прогресс */
.progress { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.progress-bar {
  height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, #3ea6ff, #8fd6ff);
  box-shadow: 0 0 12px rgba(var(--cyan), .8);
  transition: width .3s var(--ease);
}
.progress.is-indeterminate .progress-bar { width: 35%; animation: indet 1.1s var(--ease) infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

/* Сообщения */
.notice {
  --c: var(--blue);
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 16px; border-radius: 14px;
  background: rgba(var(--c), .1);
  border: 1px solid rgba(var(--c), .3);
  color: var(--ink);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.notice .i { color: rgb(var(--c)); margin-top: 1px; }
.notice-title { font-weight: 600; margin-bottom: 2px; }
.notice-body { color: var(--ink-2); font-size: 13px; line-height: 1.6; }
.notice--warn { --c: var(--orange); }
.notice--error { --c: var(--red); }
.notice--ok { --c: var(--green); }
.flash-list { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }

/* ════════════════════════════════════════════════════════════════════════════
   Карточка заявки, формы заявки
   ════════════════════════════════════════════════════════════════════════════ */
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.split-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.sticky-col { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 20px; }

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.detail-field label, .kv-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 5px;
}
.detail-field label .i { width: 14px; height: 14px; }
.detail-field .val, .kv-val { font-size: 15px; font-weight: 500; }
.detail-field.wide { grid-column: 1 / -1; }
.problem-text { font-size: 20px; font-weight: 600; letter-spacing: -.01em; line-height: 1.35; }
.quote { padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--ink-2); line-height: 1.6; }
.quote--ok { background: rgba(var(--green), .08); border-color: rgba(var(--green), .28); color: #b5f0cf; }
.divider { height: 1px; background: var(--line); margin: 20px 0; border: 0; }

.kv { display: flex; flex-direction: column; }
.kv-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.kv-row:last-child { border-bottom: 0; }
.kv-row .kv-label { margin: 0; }
.kv-row .kv-val { font-size: 13.5px; text-align: right; }

.attach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.attach {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px; border-radius: 14px;
  background: rgba(255,255,255,.035); border: 1px solid var(--line);
}
.attach-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.attach-img { width: 100%; height: 160px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in; transition: transform .4s var(--spring), filter .3s; }
.attach-img:hover { transform: scale(1.02); filter: brightness(1.08); }
.attach-name { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.form-panel { padding: 8px 24px 24px; }
.form-section { padding: 18px 0 6px; }
.form-section + .form-section { border-top: 1px solid var(--line); }
.form-section-title { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; margin-bottom: 16px; }
.step {
  width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--accent-hi);
  background: rgba(62, 166, 255, .14); border: 1px solid rgba(143, 214, 255, .3);
}
.form-actions { display: flex; flex-direction: column; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-actions-row { display: flex; gap: 12px; align-items: center; }
.form-actions-row .liquid-btn { flex: 1; }

.emp-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.emp-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  padding: 10px 12px; border-radius: 12px; text-align: left;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1);
  cursor: pointer; transition: background-color .2s, border-color .2s, transform .3s var(--spring);
}
.emp-btn:hover { background: rgba(62,166,255,.1); border-color: rgba(143,214,255,.45); }
.emp-btn:active { transform: scale(.98); }
.emp-btn .emp-fio { font-weight: 600; }
.emp-btn .emp-phone { color: var(--ink-3); font-size: 12.5px; }
.emp-found { font-size: 12.5px; color: var(--ink-3); margin-top: 12px; }
.emp-chosen { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(62,166,255,.1); border: 1px solid rgba(143,214,255,.3); animation: pop .35s var(--spring); }
.emp-chosen .grow { flex: 1; min-width: 0; }

/* Предпросмотр сообщения инженеру */
.tg-preview { padding: 16px; }
.tg-bubble {
  padding: 14px 16px; border-radius: 16px 16px 16px 6px;
  background: linear-gradient(180deg, rgba(40, 70, 105, .75), rgba(26, 48, 74, .75));
  border: 1px solid rgba(143, 214, 255, .18);
  font-size: 13px; line-height: 1.65;
}
.tg-bubble .tg-head { font-weight: 700; margin-bottom: 6px; display: flex; justify-content: space-between; gap: 8px; }
.tg-bubble .tg-line { display: flex; gap: 8px; color: var(--ink-2); }
.tg-bubble .tg-line .i { width: 14px; height: 14px; margin-top: 4px; color: var(--ink-3); }
.tg-bubble .tg-line.is-empty { color: rgba(176,191,208,.4); }
.tg-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 10px; display: flex; align-items: center; gap: 6px; }

/* ════════════════════════════════════════════════════════════════════════════
   Фильтры списка заявок
   ════════════════════════════════════════════════════════════════════════════ */
.filters { padding: 16px; margin-bottom: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.6fr) auto; gap: 12px; align-items: end; }
.filters .form-group { margin: 0; }
.filters .form-group > label { font-size: 11.5px; margin-bottom: 6px; }
.filters .form-control { height: 40px; }
.filters-actions { display: flex; gap: 8px; }
.filters-actions .btn { height: 40px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.result-count { color: var(--ink-3); font-size: 13px; margin-top: 12px; }

/* ════════════════════════════════════════════════════════════════════════════
   Чат
   ════════════════════════════════════════════════════════════════════════════ */
.chat-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; height: calc(100vh - 64px - 24px - 40px); min-height: 520px; }
.chat-side { display: flex; flex-direction: column; overflow: hidden; }
.chat-side-scroll { overflow-y: auto; padding: 8px; flex: 1; }
.chat-side .nav-label { padding: 14px 12px 6px; }
.chat-link {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 12px;
  color: var(--ink-2); font-size: 13.5px; font-weight: 500;
  transition: background-color .2s var(--ease), color .2s;
}
.chat-link:hover { background: rgba(255,255,255,.05); color: var(--ink); }
.chat-link.active { background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.05)); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.chat-link .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff6b66; box-shadow: 0 0 8px rgba(var(--red), .9); flex: none; }
.chat-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(62,166,255,.16); border: 1px solid rgba(143,214,255,.3); color: var(--accent-hi); flex: none; }
.chat-icon .i { width: 15px; height: 15px; }

.chat-box { display: flex; flex-direction: column; overflow: hidden; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.chat-head-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chat-head-name { font-weight: 600; font-size: 15px; }
.chat-head-sub { font-size: 12px; color: var(--ink-3); }
.chat-messages { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.msg {
  max-width: min(70%, 560px);
  padding: 10px 14px 8px;
  border-radius: 18px 18px 18px 6px;
  font-size: 14px; line-height: 1.5;
  align-self: flex-start;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  animation: msg-in .35s var(--ease) both;
  overflow-wrap: anywhere;
}
.msg-engineer { background: rgba(var(--green), .1); border-color: rgba(var(--green), .25); }
.msg.msg-own, .msg-admin {
  align-self: flex-end;
  border-radius: 18px 18px 6px 18px;
  color: #fff;
  background: linear-gradient(180deg, rgba(62,166,255,.62), rgba(30,112,215,.55));
  border-color: rgba(143,214,255,.45);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 10px 22px -14px rgba(62,166,255,.9);
}
.msg-dispatcher:not(.msg-own) { align-self: flex-start; }
.msg-sender { font-size: 12px; font-weight: 600; opacity: .75; margin-bottom: 2px; }
.msg-time { font-size: 11px; opacity: .6; margin-top: 4px; text-align: right; font-variant-numeric: tabular-nums; }
.msg img { max-width: 100%; max-height: 320px; border-radius: 12px; margin-top: 6px; cursor: zoom-in; }
.msg a.file-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.18); color: inherit; }
.msg a.file-link:hover { background: rgba(0,0,0,.28); }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.chat-messages > .msg:nth-last-child(n+8) { animation: none; }

.chat-input-area { display: flex; align-items: flex-end; gap: 10px; padding: 14px; border-top: 1px solid var(--line); background: rgba(0,0,0,.12); }
.chat-input-area textarea {
  flex: 1; min-height: 42px; max-height: 160px; height: 42px;
  padding: 10px 14px; border-radius: 14px; resize: none;
  background: var(--field); border: 1px solid rgba(255,255,255,.12); color: var(--ink);
  line-height: 1.45; transition: border-color .2s, box-shadow .2s;
}
.chat-input-area textarea:focus { outline: none; border-color: rgba(143,214,255,.7); box-shadow: 0 0 0 4px rgba(62,166,255,.14); }
.attach-btn { position: relative; }
.attach-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-preview { display: none; align-items: center; gap: 8px; margin: 0 14px 12px; padding: 6px 10px; border-radius: 10px; background: rgba(62,166,255,.12); border: 1px solid rgba(143,214,255,.3); font-size: 12.5px; color: var(--accent-hi); width: fit-content; max-width: calc(100% - 28px); }
.file-preview.is-on { display: inline-flex; }

/* ════════════════════════════════════════════════════════════════════════════
   Тосты, лайтбокс, мобильное меню
   ════════════════════════════════════════════════════════════════════════════ */
.toast-container { position: fixed; top: 76px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 40px)); pointer-events: none; }
.toast {
  --c: var(--green);
  position: relative; pointer-events: auto;
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 14px 14px 16px; border-radius: 16px;
  background: rgba(14, 24, 38, .82);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(var(--c), .35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 20px 40px -16px rgba(0,0,0,.8), 0 0 24px -10px rgba(var(--c), .6);
  cursor: pointer;
  animation: toast-in .5s var(--spring) both;
}
.toast.is-leaving { animation: toast-out .28s var(--ease) forwards; }
.toast-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; background: rgba(var(--c), .18); color: rgb(var(--c)); }
.toast-title { font-weight: 600; font-size: 13.5px; margin-bottom: 2px; }
.toast-body { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.toast-close { margin-left: auto; background: none; border: 0; color: var(--ink-3); cursor: pointer; padding: 2px; border-radius: 6px; }
.toast-close:hover { color: var(--ink); background: rgba(255,255,255,.08); }
.toast--info { --c: var(--blue); }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px) scale(.96); } }

.lightbox-overlay {
  display: none; position: fixed; inset: 0; z-index: 10000;
  align-items: center; justify-content: center; cursor: zoom-out;
  background: rgba(4, 8, 14, .82);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.lightbox-overlay.open { display: flex; animation: fade .2s ease; }
.lightbox-overlay img { max-width: 92vw; max-height: 90vh; border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: zoom-in .35s var(--spring); cursor: default; }
.lightbox-close { position: absolute; top: 18px; right: 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes zoom-in { from { opacity: 0; transform: scale(.94); } }

.scrim { display: none; }

/* ════════════════════════════════════════════════════════════════════════════
   Адаптив
   ════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1600px) {
  .dash.has-rail { grid-template-columns: minmax(0, 1fr) 250px; }
}
@media (max-width: 1400px) {
  .table-hide-md { display: none; }
}
@media (max-width: 1320px) {
  .dash.has-rail { grid-template-columns: minmax(0, 1fr); }
  .dash-rail { position: static; }
  .dash-rail .people { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters .fg-search { grid-column: span 2; }
}
@media (max-width: 1200px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash .stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .dash .stat { grid-column: span 2; }
  .dash .stat:nth-child(n+4) { grid-column: span 3; }
  .dash-split { grid-template-columns: minmax(0, 1fr); }
  .dash-split > .panel { min-height: 0; }
  .detail-layout, .form-layout, .split-2 { grid-template-columns: minmax(0, 1fr); }
  .sticky-col { position: static; }
}
@media (max-width: 1023px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 280px;
    transform: translateX(-104%);
    transition: transform .45s var(--ease);
    box-shadow: 30px 0 60px -20px rgba(0,0,0,.7);
  }
  .nav-open .sidebar { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(3,7,12,.5); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
  .nav-open .scrim { opacity: 1; pointer-events: auto; }
  .topbar .menu-btn { display: inline-flex; }
  .topbar { padding: 0 20px; }
  .content { padding: 20px 20px 48px; }
  .topbar-date { display: none; }
  .chat-layout { grid-template-columns: minmax(0, 1fr); height: auto; }
  .chat-side-scroll { display: flex; gap: 6px; overflow-x: auto; padding: 8px; }
  .chat-side .nav-label { display: none; }
  .chat-link { flex: none; }
  .chat-box { height: calc(100vh - 64px - 150px); min-height: 460px; }
}
@media (max-width: 720px) {
  .stats, .dash .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .dash .stat, .dash .stat:nth-child(n+4) { grid-column: auto; }
  .stats .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .stat { min-height: 104px; }
  .stat-num { font-size: 30px; }
  .welcome { padding: 18px; }
  .welcome h1, .page-title { font-size: 22px; }
  .welcome .btn { width: 100%; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters .fg-search, .filters-actions { grid-column: 1 / -1; }
  .filters-actions .btn { flex: 1; }
  .user-chip span:last-child { display: none; }
  .user-chip { padding: 0 3px; }
  .topbar { padding: 0 16px; }
  .content { padding: 16px 16px 40px; }
  .form-panel { padding: 4px 16px 18px; }
  .panel-head, .panel-body { padding-left: 16px; padding-right: 16px; }
  .table-hide-sm { display: none; }
  .msg { max-width: 86%; }
  .form-actions-row { flex-direction: column-reverse; align-items: stretch; }
  .page-actions .btn { flex: 1; }
  .page-actions { width: 100%; }
}

/* ── Меньше движения ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .lw, .stat-wave svg, .live-dot { animation: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}


/* ════════════════════════════════════════════════════════════════════════════
   Переключатель темы (тумблер в стиле iOS)
   ════════════════════════════════════════════════════════════════════════════ */
.theme-toggle {
  flex: none; position: relative;
  width: 52px; height: 30px; padding: 0;
  border: 0; border-radius: 999px;
  background: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.theme-toggle:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px; }
.tt-track {
  position: absolute; inset: 0; border-radius: inherit;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .04);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: background .45s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.theme-toggle:hover .tt-track { border-color: rgba(255, 255, 255, .26); }
.tt-glyph {
  position: absolute; top: 50%; width: 12px; height: 12px; margin-top: -6px;
  fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
  transition: opacity .3s var(--ease);
}
/* Подсказка: видна та тема, на которую переключит тумблер */
.tt-glyph-sun { right: 9px; color: #ffd36a; opacity: .7; }
.tt-glyph-moon { left: 9px; color: #5a6f96; opacity: 0; }
.tt-knob {
  position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 999px;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #f4f7fb, #cfd9e6);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4), inset 0 -1px 1px rgba(0, 0, 0, .1), inset 0 1px 0 #fff;
  transition: transform .5s var(--spring), width .22s var(--ease), background .4s var(--ease);
}
.theme-toggle:active .tt-knob { width: 27px; }
.tt-icon {
  position: absolute; width: 13px; height: 13px;
  fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
  transition: opacity .3s var(--ease), transform .5s var(--spring);
}
.tt-moon { color: #3f5178; }
.tt-sun { color: #f29d12; opacity: 0; transform: rotate(-120deg) scale(.4); }

.theme-toggle[aria-checked="true"] .tt-track {
  background: linear-gradient(135deg, #8fd0ff, #3e8ef7);
  border-color: rgba(255, 255, 255, .6);
  box-shadow: inset 0 1px 3px rgba(20, 80, 160, .35), 0 4px 14px -6px rgba(62, 142, 247, .8);
}
.theme-toggle[aria-checked="true"] .tt-knob { transform: translateX(22px); background: linear-gradient(180deg, #ffffff, #f1f5fa); }
.theme-toggle[aria-checked="true"]:active .tt-knob { transform: translateX(17px); }
.theme-toggle[aria-checked="true"] .tt-moon { opacity: 0; transform: rotate(120deg) scale(.4); }
.theme-toggle[aria-checked="true"] .tt-sun { opacity: 1; transform: none; }
.theme-toggle[aria-checked="true"] .tt-glyph-sun { opacity: 0; }
.theme-toggle[aria-checked="true"] .tt-glyph-moon { opacity: .85; color: #ffffff; }

.topbar .theme-toggle { margin-left: 2px; }
.login-theme { position: fixed; top: 20px; right: 20px; z-index: 5; opacity: .8; transition: opacity .2s; }
.login-theme:hover, .login-theme:focus-visible { opacity: 1; }

/* Смена темы: вместо обычного перехода между страницами — круг от тумблера */
:root.theme-vt * { view-transition-name: none !important; }
:root.theme-vt::view-transition-old(root),
:root.theme-vt::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ════════════════════════════════════════════════════════════════════════════
   Светлая тема — «дневной» дата-центр и белое стекло
   ════════════════════════════════════════════════════════════════════════════ */
:root[data-theme="light"] {
  --bg: #eef3f8;
  --ink: #0f1b2a;
  --ink-2: #435368;
  --ink-3: #6a7a8f;
  --line: rgba(20, 45, 80, .1);
  --line-2: rgba(20, 45, 80, .16);
  --glass: rgba(255, 255, 255, .6);
  --glass-2: rgba(255, 255, 255, .78);
  --field: rgba(255, 255, 255, .7);
  --accent: #1f7ae0;
  --accent-hi: #1a6fd1;
  --shadow: 0 24px 48px -26px rgba(40, 70, 110, .3);
  --blur: blur(22px) saturate(180%);
  --surface: rgba(255, 255, 255, .6);
  --card: rgba(255, 255, 255, .55);
  --success: #1c9a5c;
  --warning: #c77a14;
  --danger: #d8433e;
  color-scheme: light;
}
:root[data-theme="light"] ::selection { background: rgba(31, 122, 224, .22); }
:root[data-theme="light"] * { scrollbar-color: rgba(20, 45, 80, .2) transparent; }
:root[data-theme="light"] ::-webkit-scrollbar-thumb { background-color: rgba(20, 45, 80, .18); }

:root[data-theme="light"] .scene-veil {
  background:
    radial-gradient(120% 90% at 55% 38%, rgba(244, 248, 252, .1), rgba(226, 234, 243, .55)),
    linear-gradient(180deg, rgba(246, 249, 252, .35), rgba(236, 242, 248, .45));
}

/* Стекло */
:root[data-theme="light"] .glass,
:root[data-theme="light"] .panel,
:root[data-theme="light"] .form-card,
:root[data-theme="light"] .table-wrap,
:root[data-theme="light"] .filters {
  border-color: rgba(255, 255, 255, .75);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 0 0 1px rgba(20, 45, 80, .05), var(--shadow);
}

/* Боковое меню и верхняя панель */
:root[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, rgba(250, 252, 254, .78), rgba(242, 246, 250, .7));
  border-right-color: rgba(20, 45, 80, .08);
}
:root[data-theme="light"] .brand-name,
:root[data-theme="light"] .topbar-title span:first-child {
  background: linear-gradient(180deg, #0f1b2a, #27466d);
  -webkit-background-clip: text; background-clip: text;
}
:root[data-theme="light"] .brand-mark { color: #1a6fd1; background: linear-gradient(160deg, rgba(255,255,255,.95), rgba(210,232,255,.8)); border-color: rgba(26,111,209,.25); box-shadow: inset 0 1px 0 #fff, 0 6px 16px -8px rgba(26,111,209,.5); }
:root[data-theme="light"] .nav-link:hover { background: rgba(20, 45, 80, .05); }
:root[data-theme="light"] .nav-link[aria-current="page"] { color: var(--ink); }
:root[data-theme="light"] .nav-pill {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.78));
  border-color: rgba(255, 255, 255, .95);
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 0 0 1px rgba(20,45,80,.06), 0 8px 20px -10px rgba(40,70,110,.35);
}
:root[data-theme="light"] .nav-badge { box-shadow: 0 0 0 3px rgba(250, 252, 254, .95), 0 4px 12px -2px rgba(62, 146, 255, .6); }
:root[data-theme="light"] .avatar .dot-online { border-color: #fff; }
:root[data-theme="light"] .topbar {
  background: linear-gradient(180deg, rgba(248, 251, 254, .82), rgba(244, 248, 252, .5));
  border-bottom-color: rgba(20, 45, 80, .07);
}
:root[data-theme="light"] .user-chip { background: rgba(255, 255, 255, .7); border-color: rgba(255, 255, 255, .9); box-shadow: 0 0 0 1px rgba(20,45,80,.06), 0 4px 12px -8px rgba(40,70,110,.4); }
:root[data-theme="light"] .scrim { background: rgba(200, 212, 226, .45); }

/* Кнопки — белое стекло */
:root[data-theme="light"] .btn:not(.btn-primary):not(.btn-success):not(.btn-danger):not(.btn-warning) {
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.62));
  border-color: rgba(20, 45, 80, .11);
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(20,45,80,.06), 0 8px 18px -12px rgba(40,70,110,.45);
}
:root[data-theme="light"] .btn:not(.btn-primary):not(.btn-success):not(.btn-danger):not(.btn-warning):hover {
  border-color: rgba(26, 111, 209, .3);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 4px rgba(31, 122, 224, .08), 0 14px 26px -14px rgba(40,70,110,.5);
}
:root[data-theme="light"] .btn::before { background: radial-gradient(180px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.75), rgba(255,255,255,.2) 40%, transparent 70%); }
:root[data-theme="light"] .btn-quiet { background: transparent !important; border-color: transparent !important; box-shadow: none !important; }
:root[data-theme="light"] .btn-quiet:hover { background: rgba(20,45,80,.05) !important; }
:root[data-theme="light"] .btn-danger-text { color: #c93a35; }
/* Цветные кнопки на светлом фоне — плотные, иначе белый текст теряется */
:root[data-theme="light"] .btn-primary {
  background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0) 55%), linear-gradient(180deg, #3d9bf7, #1f6fd6);
  border-color: rgba(20, 95, 200, .55);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), inset 0 -1px 0 rgba(0,40,100,.2), 0 10px 24px -10px rgba(31,122,224,.75);
}
:root[data-theme="light"] .btn-primary:hover { border-color: rgba(20, 95, 200, .8); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 14px 30px -12px rgba(31,122,224,.85), 0 0 0 4px rgba(31,122,224,.14); }
:root[data-theme="light"] .btn-success { background: linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,0) 55%), linear-gradient(180deg, #2fbf74, #1a9a58); border-color: rgba(20, 130, 75, .5); }
:root[data-theme="light"] .btn-danger { background: linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,0) 55%), linear-gradient(180deg, #f0625d, #d23f3a); border-color: rgba(190, 50, 45, .5); }
:root[data-theme="light"] .btn-warning { background: linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,0) 55%), linear-gradient(180deg, #f5a142, #d9821f); border-color: rgba(190, 110, 20, .5); }

/* Большая «жидкая» кнопка — светлая вода */
:root[data-theme="light"] .liquid-btn {
  border-color: rgba(255, 255, 255, .9);
  background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,.45));
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(26,111,209,.12), 0 0 26px -6px rgba(62,146,255,.45), 0 16px 30px -18px rgba(40,70,110,.6);
}
:root[data-theme="light"] .liquid-btn:hover {
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(26,111,209,.2), 0 0 36px -4px rgba(62,146,255,.6), 0 20px 34px -18px rgba(40,70,110,.6);
}
:root[data-theme="light"] .liquid-fill {
  background:
    radial-gradient(80% 120% at 50% 110%, rgba(150, 225, 255, .6), rgba(150, 225, 255, 0) 70%),
    linear-gradient(180deg, #3d9bf7 0%, #1d6fd8 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -10px 20px rgba(0, 40, 110, .2);
}
:root[data-theme="light"] .lw1 path { fill: rgba(20, 90, 200, .45); }
:root[data-theme="light"] .lw2 path { fill: rgba(140, 220, 255, .55); }
:root[data-theme="light"] .lw3 path { stroke: rgba(255, 255, 255, .95); }

/* Счётчики — пастельное стекло */
:root[data-theme="light"] .stat {
  border-color: rgba(var(--c), .35);
  background:
    linear-gradient(180deg, rgba(255,255,255,.7), rgba(255,255,255,0) 45%),
    linear-gradient(155deg, rgba(var(--c), .26), rgba(var(--c), .08) 58%, rgba(var(--c), .16)),
    rgba(255, 255, 255, .5);
  box-shadow: inset 0 1px 0 #fff, 0 16px 32px -20px rgba(var(--c), .7);
}
:root[data-theme="light"] .stat:hover { border-color: rgba(var(--c), .6); box-shadow: inset 0 1px 0 #fff, 0 22px 40px -20px rgba(var(--c), .8), 0 0 0 4px rgba(var(--c), .08); }
:root[data-theme="light"] .stat-label { color: var(--ink); }
:root[data-theme="light"] .stat-num { text-shadow: none; color: var(--ink); }
:root[data-theme="light"] .stat-wave .w1 { fill: rgba(var(--c), .3); }
:root[data-theme="light"] .stat-wave .w2 { fill: rgba(var(--c), .2); }
:root[data-theme="light"] .alert-panel { background: linear-gradient(160deg, rgba(var(--red), .12), rgba(255,255,255,.62) 55%); }

/* Списки и таблицы */
:root[data-theme="light"] .req-row:hover,
:root[data-theme="light"] .person:hover,
:root[data-theme="light"] .chat-link:hover { background: rgba(20, 45, 80, .045); }
:root[data-theme="light"] .req-row + .req-row { box-shadow: 0 -1px 0 rgba(20, 45, 80, .06); }
:root[data-theme="light"] .table-wrap th, :root[data-theme="light"] .table th { background: rgba(255, 255, 255, .45); }
:root[data-theme="light"] .table-wrap td, :root[data-theme="light"] .table td { border-bottom-color: rgba(20, 45, 80, .06); }
:root[data-theme="light"] .table-wrap tbody tr:hover td, :root[data-theme="light"] .table tbody tr:hover td { background: rgba(31, 122, 224, .05); }
:root[data-theme="light"] .empty-art .e-line { stroke: rgba(40, 95, 160, .45); }
:root[data-theme="light"] .empty-art .e-fill { fill: rgba(31, 122, 224, .08); }

/* Бейджи — насыщеннее, чтобы читались на светлом */
:root[data-theme="light"] .badge { --c: 90, 105, 125; }
:root[data-theme="light"] .badge-new { --c: 25, 110, 215; }
:root[data-theme="light"] .badge-in_progress, :root[data-theme="light"] .badge-normal { --c: 190, 110, 15; }
:root[data-theme="light"] .badge-done, :root[data-theme="light"] .badge-low { --c: 20, 140, 80; }
:root[data-theme="light"] .badge-rejected, :root[data-theme="light"] .badge-high { --c: 205, 55, 50; }
:root[data-theme="light"] .badge-attach, :root[data-theme="light"] .badge-admin { --c: 135, 70, 200; }
:root[data-theme="light"] .badge { background: rgba(var(--c), .1); border-color: rgba(var(--c), .25); }
:root[data-theme="light"] .badge::before { box-shadow: none; }

/* Формы */
:root[data-theme="light"] .form-control { border-color: rgba(20, 45, 80, .13); box-shadow: inset 0 1px 2px rgba(20, 45, 80, .06); }
:root[data-theme="light"] .form-control:hover { border-color: rgba(20, 45, 80, .22); }
:root[data-theme="light"] .form-control:focus { border-color: rgba(31, 122, 224, .6); background-color: #fff; box-shadow: 0 0 0 4px rgba(31, 122, 224, .14); }
:root[data-theme="light"] .form-control::placeholder { color: rgba(67, 83, 104, .5); }
:root[data-theme="light"] select.form-control option { background: #fff; color: var(--ink); }
:root[data-theme="light"] select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23435368' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
:root[data-theme="light"] .seg { background: rgba(20, 45, 80, .06); border-color: rgba(20, 45, 80, .06); box-shadow: inset 0 1px 2px rgba(20, 45, 80, .08); }
:root[data-theme="light"] .seg-item input:checked + .seg-btn,
:root[data-theme="light"] .seg-btn.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 2px rgba(20,45,80,.1), 0 4px 12px -6px rgba(40,70,110,.45);
}
:root[data-theme="light"] .tile-body { background: rgba(255, 255, 255, .6); border-color: rgba(20, 45, 80, .1); }
:root[data-theme="light"] .tile:hover .tile-body { background: rgba(255, 255, 255, .9); border-color: rgba(31, 122, 224, .25); }
:root[data-theme="light"] .tile input:checked + .tile-body { color: var(--ink); background: linear-gradient(160deg, rgba(31,122,224,.16), rgba(255,255,255,.8)); border-color: rgba(31, 122, 224, .5); }
:root[data-theme="light"] .tiles-status .tile input:checked + .tile-body { color: var(--ink); background: linear-gradient(160deg, rgba(var(--c), .22), rgba(255,255,255,.8)); }
:root[data-theme="light"] .dropzone { border-color: rgba(31, 122, 224, .3); background: rgba(255, 255, 255, .4); }
:root[data-theme="light"] .dropzone:hover, :root[data-theme="light"] .dropzone.is-drag { background: rgba(31, 122, 224, .06); border-color: rgba(31, 122, 224, .6); }
:root[data-theme="light"] .kbd { background: #fff; border-color: rgba(20, 45, 80, .15); }
:root[data-theme="light"] .file-chip-icon { color: #178a52; }
:root[data-theme="light"] .progress { background: rgba(20, 45, 80, .08); }
:root[data-theme="light"] .quote { background: rgba(255, 255, 255, .6); }
:root[data-theme="light"] .quote--ok { background: rgba(var(--green), .1); color: #11643c; }
:root[data-theme="light"] .kv-row { border-bottom-color: rgba(20, 45, 80, .07); }
:root[data-theme="light"] .attach, :root[data-theme="light"] .emp-btn { background: rgba(255, 255, 255, .6); border-color: rgba(20, 45, 80, .1); }
:root[data-theme="light"] .tg-bubble { background: linear-gradient(180deg, rgba(232, 243, 255, .95), rgba(214, 232, 252, .9)); border-color: rgba(31, 122, 224, .18); }
:root[data-theme="light"] .tg-bubble .tg-line.is-empty { color: rgba(67, 83, 104, .45); }
:root[data-theme="light"] .notice { background: rgba(var(--c), .09); }

/* Чат */
:root[data-theme="light"] .chat-link.active { background: #fff; color: var(--ink); box-shadow: 0 0 0 1px rgba(20,45,80,.06), 0 6px 16px -10px rgba(40,70,110,.45); }
:root[data-theme="light"] .msg { background: rgba(255, 255, 255, .8); border-color: rgba(20, 45, 80, .08); box-shadow: 0 2px 8px -4px rgba(40,70,110,.25); }
:root[data-theme="light"] .msg-engineer { background: rgba(var(--green), .12); }
:root[data-theme="light"] .msg.msg-own, :root[data-theme="light"] .msg-admin { background: linear-gradient(180deg, #3d9bf7, #1f74dc); border-color: rgba(31,122,224,.4); }
:root[data-theme="light"] .chat-input-area { background: rgba(255, 255, 255, .45); }
:root[data-theme="light"] .chat-input-area textarea { border-color: rgba(20, 45, 80, .13); }

/* Тосты */
:root[data-theme="light"] .toast { background: rgba(255, 255, 255, .88); box-shadow: inset 0 1px 0 #fff, 0 20px 40px -16px rgba(40,70,110,.45); }

/* Тумблер на светлом фоне */
:root[data-theme="light"] .tt-track { box-shadow: inset 0 1px 3px rgba(20, 60, 120, .3); }
