/* Aqua24 — Пульт (компьютер владельца и логиста). Стиль — по принятому макету 12.10.2026 (docs/pult-mockup/Main.dc.html)
   и docs/brand-style.md: только светлая тема, синяя шапка, белые карточки на светлом фоне, плотные таблицы, цифры моноширинно.
   Раскладка: шапка 52 px → меню слева 200 px → рабочая область; ниже 900 px меню уходит в строку под шапкой. */
:root {
  --bg: #f3f8fc; --card: #fff; --soft: #f6fafe; --line: #dbe8f3; --line2: #edf3f9; --hover: #eef4fb;
  --ink: #12304d; --ink2: #2d4a64; --muted: #557089; --navy: #0d3b8c; --brand: #0062fe; --brand-ink: #0047c2; --brand-soft: #e7f0ff;
  --green: #1faa59; --green-ink: #137a3f; --green-soft: #e7f7ee;
  --orange: #ffa51f; --orange-ink: #8a5200; --orange-soft: #fff4e0;
  --red: #a51d1d; --red-soft: #fdeaea; --grey: #8aa2b8; --grey-ink: #4a6378; --grey-soft: #eef2f6; --addr: #9cc3ec;
  --f-body: "Golos Text", -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-logo: "Montserrat", "Arial Black", sans-serif;
  --lab: 200px;
  color-scheme: light;
}
@media (max-width: 900px) { :root { --lab: 118px; } }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 13px/1.4 var(--f-body); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: #1565c0; }
.num, td, .kpi .v { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid #1e88e5; outline-offset: 2px; }
[hidden] { display: none !important; }

/* полоса макета (только в макете) */
.demo-bar { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 7px max(16px, env(safe-area-inset-right, 0px)) 7px max(16px, env(safe-area-inset-left, 0px)); background: #fff8e6; border-bottom: 1px solid #f0dca8; color: #5b4200; font-size: 12.5px; }
.demo-bar b { font-weight: 700; }
.demo-bar .seg { display: inline-flex; border: 1px solid #e3c983; border-radius: 8px; overflow: hidden; }
.demo-bar .seg button { border: 0; background: transparent; padding: 3px 10px; font-weight: 600; font-size: 12px; color: #5b4200; }
.demo-bar .seg button.on { background: #5b4200; color: #fff; }

/* шапка */
.top { height: 52px; background: var(--brand); color: #fff; display: flex; align-items: center; gap: 14px; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; }
.brand { display: flex; align-items: baseline; gap: 6px; width: 184px; flex: none; text-decoration: none; color: #fff; }
.brand .logo { font: italic 800 20px var(--f-logo); letter-spacing: .2px; white-space: nowrap; }
.brand .sub { font-weight: 700; font-size: 11.5px; letter-spacing: .12em; opacity: .9; }
.search { position: relative; flex: 0 1 440px; min-width: 0; }
.search svg { position: absolute; left: 10px; top: 9px; pointer-events: none; }
.search input { width: 100%; height: 34px; border-radius: 10px; border: 0; background: #fff; color: var(--ink); padding: 0 12px 0 32px; font-weight: 500; font-size: 13.5px; }
.search input::placeholder { color: var(--muted); opacity: 1; }
.sres { position: absolute; top: 40px; left: 0; width: min(560px, calc(100vw - 32px)); background: #fff; color: var(--ink); border: 1px solid #cfe2f4; border-radius: 12px; box-shadow: 0 14px 36px rgba(13,59,140,.22); overflow: hidden; }
.sres .grp { padding: 6px 14px 2px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.sres .it { display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 6px 14px; border: 0; background: none; text-align: left; font-size: 13px; }
.sres .it:hover, .sres .it.sel { background: var(--brand-soft); }
.sres .it b { flex: none; }
.sres .it span { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sres .foot { padding: 8px 14px; background: var(--soft); font-size: 12px; color: var(--ink2); border-top: 1px solid var(--line2); }
.hbtn { height: 30px; padding: 0 11px; border-radius: 8px; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.16); color: #fff; font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.hsel { height: 30px; border-radius: 8px; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.16); color: #fff; font-weight: 600; font-size: 12.5px; padding: 0 8px; max-width: 190px; }
.hsel option { color: var(--ink); }
.hright { margin-left: auto; display: flex; align-items: center; gap: 12px; flex: none; }
.chip-decide { background: var(--orange); color: #1a1200; border: 0; border-radius: 999px; padding: 3px 10px; font-weight: 700; font-size: 12px; white-space: nowrap; }
.clock { font-weight: 600; white-space: nowrap; }
.user { position: relative; }
.user > button { display: flex; align-items: center; gap: 8px; border: 0; background: none; color: #fff; font-weight: 600; padding: 0; }
.ava { width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.22); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.umenu { position: absolute; right: 0; top: 38px; background: #fff; color: var(--ink); border: 1px solid #cfe2f4; border-radius: 12px; box-shadow: 0 14px 36px rgba(13,59,140,.22); min-width: 260px; padding: 6px 0; }
.umenu .row { padding: 7px 14px; font-size: 12.5px; color: var(--ink2); }
.umenu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 14px; font-weight: 600; color: var(--navy); }
.umenu button:hover { background: var(--hover); }

/* каркас */
.shell { display: flex; align-items: stretch; min-height: calc(100vh - 52px); }
.nav { width: 200px; flex: none; background: #fff; border-right: 1px solid var(--line); padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.navi { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; color: var(--ink2); text-decoration: none; font-weight: 600; font-size: 13.5px; border: 0; background: none; text-align: left; width: 100%; }
.navi:hover { background: var(--hover); color: var(--navy); }
.navi.on { background: var(--brand-soft); color: var(--brand-ink); }
.navi svg { flex: none; }
.navi .cnt { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.navi .cnt.warn { color: var(--orange-ink); }
.navi .cnt.bad { color: var(--red); }
.navi .lock { margin-left: auto; font-size: 10.5px; color: var(--muted); font-weight: 600; }
.sysbox { margin-top: auto; padding: 10px; border-radius: 10px; background: var(--soft); font-size: 12px; line-height: 1.5; color: var(--ink2); }
.sysbox b { display: block; color: var(--navy); margin-bottom: 2px; }
.main { flex: 1; min-width: 0; padding: 14px max(16px, env(safe-area-inset-right, 0px)) 28px 16px; display: flex; flex-direction: column; gap: 12px; }

/* общие элементы */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.ch { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 13px; color: var(--navy); }
.ch .r { margin-left: auto; font-weight: 600; font-size: 12px; color: var(--muted); }
.ch .r button { border: 0; background: none; color: var(--brand-ink); font-weight: 600; font-size: 12px; padding: 0; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.ok { background: var(--green-soft); color: var(--green-ink); } .wait { background: var(--orange-soft); color: var(--orange-ink); }
.bad { background: var(--red-soft); color: var(--red); } .info { background: var(--brand-soft); color: var(--brand-ink); } .off { background: var(--grey-soft); color: var(--grey-ink); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.d-ok { background: var(--green); } .d-warn { background: var(--orange); } .d-bad { background: var(--red); } .d-off { background: var(--grey); } .d-info { background: var(--brand); }
.muted { color: var(--muted); }
.btn { height: 28px; padding: 0 11px; border-radius: 8px; border: 1px solid #cfe2f4; background: #fff; color: var(--navy); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.pri { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.pri:hover { background: var(--brand-ink); }
.btn.danger { color: var(--red); border-color: #f0c4c4; }
.btn:disabled { opacity: .5; cursor: default; }
.tabs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tab { display: inline-flex; align-items: center; text-decoration: none; height: 32px; padding: 0 16px; border-radius: 9px; border: 1px solid #cfe2f4; background: #fff; color: var(--ink2); font-weight: 700; font-size: 13px; }
.tab.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.tscroll { overflow-x: auto; }
.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--soft); white-space: nowrap; }
.t td { padding: 6px 10px; border-bottom: 1px solid var(--line2); white-space: nowrap; }
.t tbody tr { cursor: pointer; }
.t tbody tr:hover td { background: var(--soft); }
.bar { height: 6px; background: #e4eefa; border-radius: 3px; overflow: hidden; min-width: 60px; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.prog { display: flex; align-items: center; gap: 6px; }

/* полоса систем и цифры дня */
.sys { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); overflow: hidden; }
.sys > div { display: flex; flex-direction: column; gap: 3px; padding: 9px 12px; border-right: 1px solid var(--line2); border-bottom: 1px solid var(--line2); min-width: 0; margin: 0 -1px -1px 0; }
.sys b { font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.sys span { font-size: 11.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); overflow: hidden; }
.kpi { padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; border-right: 1px solid var(--line2); border-bottom: 1px solid var(--line2); margin: 0 -1px -1px 0; }
.kpi .l { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi .v { font-size: 28px; font-weight: 800; color: var(--navy); letter-spacing: -.5px; line-height: 1.1; }
.kpi .v small { font-size: 14px; font-weight: 700; }
.kpi .s { font-size: 12px; color: var(--muted); }
.up { color: var(--green-ink); font-weight: 700; } .down { color: var(--red); font-weight: 700; }

/* день по окнам */
.tl-axis { display: flex; height: 24px; border-bottom: 1px solid var(--line2); font-size: 11px; color: var(--muted); }
.tl-axis .pad { width: var(--lab); flex: none; }
.tl-axis .sc { position: relative; flex: 1; }
.tl-axis .sc span { position: absolute; top: 5px; transform: translateX(-50%); }
.tl-axis .sc span:last-child { transform: translateX(-100%); padding-right: 4px; }
.tl-card { overflow: hidden; }
.tl-body { position: relative; }
.tl-row { display: flex; align-items: center; height: 34px; border-bottom: 1px solid var(--line2); }
.tl-row:last-child { border-bottom: 0; }
.tl-lab { width: var(--lab); flex: none; padding: 0 12px; font-weight: 700; font-size: 12.5px; color: var(--navy); display: flex; flex-direction: column; line-height: 1.2; }
.tl-lab small { font-weight: 500; color: var(--muted); font-size: 11px; }
.tl-track { position: relative; flex: 1; height: 100%; }
.win { position: absolute; top: 6px; height: 22px; border-radius: 6px; background: #e4eefa; overflow: hidden; display: flex; align-items: center; }
.win i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand); }
.win span { position: relative; padding: 0 8px; font-size: 11.5px; font-weight: 700; color: #fff; white-space: nowrap; }
.win.sale { background: repeating-linear-gradient(135deg, #eef4fb 0 6px, #e4eefa 6px 12px); border: 1px dashed var(--addr); }
.win.sale span, .win.idle span { color: var(--navy); }
.win.idle span { color: var(--muted); }
.cut { position: absolute; top: 3px; bottom: 3px; width: 2px; background: var(--orange); }
.ev { position: absolute; top: 10px; width: 8px; height: 14px; border-radius: 3px; background: var(--navy); margin-left: -4px; }
.ev.ret { background: var(--green); }
.ev.prob { background: var(--orange); }
.now-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); pointer-events: none; }
.now-line span { position: absolute; top: -20px; left: -18px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; padding: 1px 5px; border-radius: 4px; }
.tl-note { position: absolute; top: 9px; right: 10px; font-size: 11.5px; color: var(--muted); white-space: nowrap; background: var(--card); padding-left: 6px; }

/* сетки */
.g3 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr) minmax(0, .9fr); gap: 12px; align-items: start; }
.g2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 1700px) { .g3 { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); } .g3 > :first-child { grid-column: 1 / -1; } }
@media (max-width: 900px) {
  .g3, .g2 { grid-template-columns: minmax(0, 1fr); }
  .shell { flex-direction: column; }
  .nav { width: auto; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 6px 8px; }
  .navi { width: auto; white-space: nowrap; }
  .sysbox { display: none; }
  .main { padding-left: max(16px, env(safe-area-inset-left, 0px)); }
  .brand { width: auto; }
  .brand .sub, .clock, .uname { display: none; }
}
@media (max-width: 640px) {
  .top { height: auto; flex-wrap: wrap; padding-block: 8px; }
  .search { order: 5; flex: 1 1 100%; }
  .hright { gap: 8px; }
}

/* нужно решение */
.esc { display: flex; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line2); align-items: flex-start; }
.esc:last-child { border-bottom: 0; }
.esc .dot { margin-top: 5px; }
.esc .tx { flex: 1; min-width: 0; line-height: 1.35; display: flex; flex-direction: column; gap: 2px; }
.esc .tx b { font-size: 13px; }
.esc .tx span { font-size: 12px; color: var(--muted); }
.acts { display: flex; gap: 6px; flex-wrap: wrap; }
.esc .acts { margin-top: 5px; }
.empty { padding: 14px; color: var(--muted); }

/* производства */
.plant { padding: 10px 14px; border-bottom: 1px solid var(--line2); display: flex; flex-direction: column; gap: 6px; }
.plant .hd { display: flex; justify-content: space-between; gap: 8px; }
.plant .hd b { color: var(--navy); }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; font-size: 12px; }
.trio b { font-size: 16px; display: block; }
.fc { padding: 10px 14px; font-size: 12.5px; line-height: 1.5; }

/* журнал */
.lg { display: flex; gap: 10px; padding: 5px 14px; font-size: 12.5px; line-height: 1.35; }
.lg .tm { color: var(--muted); width: 38px; flex: none; font-variant-numeric: tabular-nums; }
.lg .who { font-weight: 700; color: var(--navy); flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg .tx { min-width: 0; }

/* график по часам */
.chart { padding: 6px 10px 4px; }
.chart svg { width: 100%; height: 190px; display: block; }
.legend { display: inline-flex; gap: 10px; align-items: center; }
.lg-bar { display: inline-block; width: 10px; height: 10px; background: var(--brand); border-radius: 2px; vertical-align: -1px; }
.lg-line { display: inline-block; width: 12px; height: 2px; background: var(--orange); vertical-align: 3px; }

/* карта */
.mapwrap { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; }
.mapcard { flex: 999 1 640px; overflow: hidden; display: flex; flex-direction: column; }
#map { height: min(640px, calc(100vh - 210px)); min-height: 380px; background: #e8eef4; }
.maplegend { display: flex; gap: 6px 14px; flex-wrap: wrap; padding: 8px 14px; font-size: 12px; border-top: 1px solid var(--line2); align-items: center; }
.maplegend span { display: inline-flex; align-items: center; gap: 5px; }
.maplegend .note { margin-left: auto; color: var(--muted); }
.crewlist { flex: 1 1 300px; max-width: 380px; display: flex; flex-direction: column; }
.crewlist .list { overflow-y: auto; max-height: min(640px, calc(100vh - 210px)); }
.ml { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border: 0; border-bottom: 1px solid var(--line2); background: none; width: 100%; text-align: left; font-size: 12.5px; }
.ml:hover, .ml.on { background: var(--brand-soft); }
.ml span.muted { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk { width: 22px; height: 22px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(13,59,140,.35); }
.mk.stale { opacity: .45; }
.mk-lbl { font: 700 11.5px var(--f-body); white-space: nowrap; padding: 1px 6px; border-radius: 6px; background: rgba(255,255,255,.92); box-shadow: 0 1px 3px rgba(13,59,140,.2); }
.pl { width: 24px; height: 24px; border-radius: 6px; background: var(--navy); border: 2px solid #fff; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.leaflet-container { font-family: var(--f-body); }
.district { font: 700 12px var(--f-body); color: var(--grey); letter-spacing: .06em; white-space: nowrap; }

/* карточка справа */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: #fff; border-left: 1px solid var(--line); box-shadow: -14px 0 36px rgba(13,59,140,.16); z-index: 40; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); padding-right: env(safe-area-inset-right, 0px); }
.drawer .dh { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.drawer .dh h2 { margin: 0; font-size: 16px; color: var(--navy); }
.drawer .dh button { margin-left: auto; }
.drawer .db { overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 5px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; }
.sec { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.sec h3 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.reason { display: flex; flex-direction: column; gap: 6px; }
.reason input { height: 32px; border: 1px solid #cfe2f4; border-radius: 8px; padding: 0 10px; }
.phone { display: inline-flex; align-items: center; gap: 8px; }
.linkbtn { border: 0; background: none; color: var(--brand-ink); font-weight: 600; padding: 0; font-size: 12.5px; }

/* заглушка раздела */
.stub { padding: 22px; display: flex; flex-direction: column; gap: 8px; max-width: 720px; }
.stub h2 { margin: 0; color: var(--navy); font-size: 18px; }
.stub ul { margin: 0; padding-left: 18px; color: var(--ink2); line-height: 1.6; }

/* вход */
.login { min-height: calc(100vh - 40px); display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); background: linear-gradient(180deg, var(--brand) 0 220px, var(--bg) 220px); }
.lcard { width: min(400px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 44px rgba(13,59,140,.18); padding: 26px 26px 22px; display: flex; flex-direction: column; gap: 14px; }
.lcard .brand { color: var(--brand); width: auto; }
.lcard h1 { margin: 0; font-size: 20px; color: var(--navy); }
.lcard p { margin: 0; color: var(--ink2); }
.fld { display: flex; flex-direction: column; gap: 5px; }
.fld label { font-weight: 600; font-size: 12.5px; color: var(--ink2); }
.fld input { height: 40px; border: 1px solid #cfe2f4; border-radius: 10px; padding: 0 12px; font-size: 15px; }
.fld input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.fld .hint { font-size: 12px; color: var(--muted); }
.code { letter-spacing: .5em; text-align: center; font-size: 22px !important; font-weight: 700; }
.lbtn { height: 42px; border-radius: 10px; border: 0; background: var(--brand); color: #fff; font-weight: 700; font-size: 15px; }
.lbtn:hover { background: var(--brand-ink); }
.lerr { background: var(--red-soft); color: var(--red); border-radius: 10px; padding: 8px 12px; font-weight: 600; font-size: 12.5px; }
.lfoot { font-size: 12px; color: var(--muted); border-top: 1px solid var(--line2); padding-top: 10px; }
.qr { display: flex; gap: 14px; align-items: center; }
.qr svg { width: 132px; height: 132px; flex: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; }
.steps { margin: 0; padding-left: 18px; color: var(--ink2); line-height: 1.5; font-size: 12.5px; }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; z-index: 60; max-width: calc(100% - 32px); }
.toast.bad { background: var(--red); }
@media (prefers-reduced-motion: no-preference) { .drawer { animation: slidein .18s ease-out; } @keyframes slidein { from { transform: translateX(24px); opacity: .6; } } }
