@font-face { font-family: Inter; src: url(fonts/inter-cyrillic.woff2) format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Inter; src: url(fonts/inter-cyrillic-ext.woff2) format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: Inter; src: url(fonts/inter-latin-ext.woff2) format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02AF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Inter; src: url(fonts/inter-latin.woff2) format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: light;
  --bg: #f5f5f2;
  --surface: #ffffff;
  --ink: #1a2126;
  --ink-2: #4a5258;
  --ink-3: #6b7378;
  --line: #e6e6e1;
  --line-2: #d4d4cd;
  --accent: #1f2a30;
  --accent-dark: #0e1113;
  --accent-soft: #fdf3cf;
  --ok: #157347;
  --ok-bg: #e8f5ee;
  --ok-line: #bfe3cf;
  --warn: #a35407;
  --warn-bg: #fdf3e4;
  --warn-line: #f3d9ad;
  --bad: #c0281f;
  --bad-bg: #fdecea;
  --bad-line: #f6c6c2;
  --neutral-bg: #efefea;
  --on-accent: #fff;
  --accent-mid: #f1c134;
  --side-bg: var(--surface);
  --side-line: var(--line);
  --side-ink: var(--ink);
  --side-ink-2: var(--ink-2);
  --side-ink-3: var(--ink-3);
  --side-hover: var(--bg);
  --side-on-bg: transparent;
  --side-on-ink: var(--ink);
  --side-on-icon: #a87b00;
  --side-w: 236px;
  --r: 10px;
  --r-s: 8px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.45 Inter, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-feature-settings: "tnum" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1 { font-size: 22px; line-height: 1.25; font-weight: 650; letter-spacing: -.015em; margin: 0; }
h2 { font-size: 15px; line-height: 1.3; font-weight: 600; letter-spacing: -.005em; margin: 0 0 12px; }
h3.cat { font-size: 12px; color: var(--ink-3); margin: 18px 0 4px; font-weight: 600; }
p { margin: 0 0 10px; }
a { color: var(--accent); }
.muted { color: var(--ink-3); font-size: 13px; }
.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.text-bad { color: var(--bad); }
.icon { width: 18px; height: 18px; flex: none; }

/* Каркас */
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); display: flex; flex-direction: column;
  background: var(--side-bg); border-right: 1px solid var(--side-line); padding: 14px 10px 10px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; color: var(--side-ink); text-decoration: none; font-weight: 650; line-height: 1.15; }
.brand small { display: block; font-size: 11px; font-weight: 450; color: var(--side-ink-3); margin-top: 2px; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.side nav { flex: 1; overflow-y: auto; display: grid; align-content: start; gap: 2px; }
.side nav a {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--r-s);
  color: var(--side-ink-2); text-decoration: none; font-weight: 500;
}
.side nav a .icon { color: var(--side-ink-3); }
.side nav a:hover { background: var(--side-hover); color: var(--side-ink); }
.side nav a.on { background: var(--side-on-bg); color: var(--side-on-ink); font-weight: 600; }
.side nav a.on .icon { color: var(--side-on-icon); }
.side-foot { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid var(--side-line); margin-top: 8px; color: var(--side-ink); }
.avatar {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: var(--neutral-bg); color: var(--ink-2); font-size: 12px; font-weight: 600;
}
.side-who { min-width: 0; display: flex; flex-direction: column; font-size: 12px; line-height: 1.3; }
.side-who strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-who span { color: var(--ink-3, var(--ink-2)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.side-foot { text-decoration: none; border-radius: 0 0 var(--r-s) var(--r-s); }
a.side-foot:hover { background: var(--side-hover); }
a.side-foot[aria-current="page"] { box-shadow: inset 3px 0 0 #f1c134; }

/* Шапка: на телефоне слева логотип и название, справа кружок — сразу ведёт в профиль */
.top-brand { display: none; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; min-width: 0; }
.top-brand img { flex: none; }
.top-brand span { display: flex; flex-direction: column; font-weight: 700; font-size: 15px; line-height: 1.1; }
.top-brand small { font-weight: 500; font-size: 11px; color: var(--ink-2); }
.top-profile { display: flex; align-items: center; gap: 8px; margin-left: auto; padding: 2px 2px 2px 10px; border-radius: 999px; color: var(--ink-2); text-decoration: none; min-width: 0; }
.top-profile:hover, .top-profile.on { background: var(--neutral-bg); }
.top-profile:focus-visible { outline: 2px solid #f1c134; outline-offset: 2px; }
.top-profile .avatar { width: 36px; height: 36px; font-size: 14px; }
.top-profile.on .avatar { box-shadow: 0 0 0 2px #f1c134; }

/* Мой профиль */
.profile-top { text-align: center; padding-top: 22px; }
.profile-top .avatar.big { margin: 0 auto 10px; }
.profile-top h2 { margin: 0; font-size: 19px; }
.profile-top > p { margin: 2px 0 6px; }
.profile-top .facts { text-align: left; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.section-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); margin: 20px 2px 8px; }
.profile-form { max-width: 420px; }
.profile-exit { margin: 22px 0 8px; }
.profile-exit .btn { gap: 8px; background: var(--surface); color: var(--bad); border: 1px solid var(--line-2); }
.profile-exit .btn:hover { background: var(--bad-bg, #fdecec); border-color: var(--bad); }
.avatar.big { width: 64px; height: 64px; font-size: 22px; }
@media (max-width: 860px) {
  .top-brand { display: flex; }
  .top-profile { padding: 0; }
  .top-profile:hover, .top-profile.on { background: none; }
  .profile-exit .btn { width: 100%; justify-content: center; height: 48px; }
  .profile-form .btn, .install-box .btn { width: 100%; }
}

.main { margin-left: var(--side-w); min-height: 100vh; }
.main.full { margin-left: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 28px 0;
}
.demo-tag { font-size: 12px; color: var(--ink-3); }
.top { display: flex; align-items: center; gap: 12px; padding: 8px 28px 6px; }
.back { display: inline-flex; align-items: center; gap: 2px; height: 32px; padding: 0 10px 0 4px; border-radius: var(--r-s); color: var(--ink-2); text-decoration: none; font-weight: 500; background: var(--surface); border: 1px solid var(--line); }
.back:hover { border-color: var(--line-2); }
.content { padding: 10px 28px 48px; max-width: 1480px; }

/* Блоки */
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin-bottom: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.card-head h2 { margin-bottom: 2px; }
.card-head p { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

/* Разбор главного экрана: критично, внимание, норма */
.triage { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.triage-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.triage-col.bad { border-color: var(--bad-line); }
.triage-col.warn { border-color: var(--warn-line); }
.triage-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-weight: 600; font-size: 13px; }
.triage-col.bad .triage-head { background: var(--bad-bg); color: var(--bad); }
.triage-col.warn .triage-head { background: var(--warn-bg); color: var(--warn); }
.triage-col.ok .triage-head { background: var(--ok-bg); color: var(--ok); }
.triage-count { margin-left: auto; font-variant-numeric: tabular-nums; }
.triage-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 10px; align-items: center;
  padding: 10px 14px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none;
}
.triage-item:first-of-type { border-top: 0; }
a.triage-item:hover { background: #fafbfc; }
.triage-item strong { font-weight: 600; font-size: 15px; grid-column: 1; }
.triage-item span { font-size: 12px; color: var(--ink-3); grid-column: 1; }
.triage-item .icon { grid-column: 2; grid-row: 1 / span 2; color: var(--line-2); width: 16px; height: 16px; }
.triage-empty { padding: 14px; color: var(--ink-3); font-size: 13px; }

/* Показатели */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat {
  display: flex; flex-direction: column; gap: 3px; padding: 13px 16px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); color: inherit; text-decoration: none;
}
a.stat:hover { border-color: var(--line-2); }
.stat strong { font-size: 21px; line-height: 1.2; font-weight: 650; letter-spacing: -.02em; }
.stat-label { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.stat-hint { font-size: 12px; color: var(--ink-3); }
.stat.ok strong { color: var(--ok); }
.stat.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.stat.warn strong { color: var(--warn); }
.stat.bad { background: var(--bad-bg); border-color: var(--bad-line); }
.stat.bad strong { color: var(--bad); }
.stat.warn .stat-label, .stat.bad .stat-label, .stat.warn .stat-hint, .stat.bad .stat-hint { color: var(--ink-2); }
.plan-fact { grid-column: span 2; }
.plan-main { display: flex; align-items: baseline; gap: 10px; }
.plan-fact .meter { margin: 6px 0 2px; }
.delta { font-weight: 600; font-size: 13px; }
.delta.ok { color: var(--ok); }
.delta.warn { color: var(--warn); }
.delta.bad { color: var(--bad); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 550; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info, .badge.mute { background: var(--neutral-bg); color: var(--ink-2); }

/* Управление */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 7px 16px;
  background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); border-radius: var(--r-s);
  font: inherit; font-weight: 550; text-decoration: none; cursor: pointer; transition: background-color .12s;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn:disabled { background: var(--neutral-bg); border-color: var(--neutral-bg); color: var(--ink-3); cursor: not-allowed; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--bg); }
.btn.danger { background: var(--surface); color: var(--bad); border-color: var(--bad-line); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.small { min-height: 30px; padding: 3px 10px; font-size: 13px; }
.btn.scanned, .btn.scanned:hover { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.wide-mobile { margin-bottom: 14px; }
.link { font-weight: 550; white-space: nowrap; text-decoration: none; }
.link:hover { text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.actions.tight { margin-top: 0; gap: 6px; flex-wrap: nowrap; }
form.inline { display: inline; margin: 0; }

input, select {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-s);
  padding: 6px 10px; min-height: 38px; max-width: 100%;
}
input::placeholder { color: var(--ink-3); }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.qty-input { width: 88px; }
.cell-input { width: 100px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.filters label, .form-grid label, .field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.field { margin-bottom: 12px; }
.field input, .field select, .form-grid input, .form-grid select { font-size: 14px; font-weight: 400; width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; margin-top: 10px; }
.search { flex: 1 1 220px; }
.assign { display: flex; gap: 6px; align-items: center; margin: 0; }

/* Таблицы */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 500; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #fafbfc; }
.tbl .right { text-align: right; }
.tbl strong { font-weight: 600; }
.card .tbl th:first-child, .card .tbl td:first-child { padding-left: 0; }
.card .tbl th:last-child, .card .tbl td:last-child { padding-right: 0; }
.content > .table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }

.empty { padding: 24px 16px; text-align: center; color: var(--ink-3); background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r); }
.card .empty { background: transparent; }
.empty strong { display: block; color: var(--ink); margin-bottom: 6px; }
.empty p { margin: 0; }
.flash { padding: 10px 14px; border-radius: var(--r-s); margin-bottom: 12px; border: 1px solid; font-weight: 500; }
.flash.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.flash.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.flash.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.note { padding: 10px 14px; border-radius: var(--r-s); margin: 10px 0; }
.note.bad { background: var(--bad-bg); color: var(--bad); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 20px; margin: 10px 0 4px; }
.facts dt { font-size: 12px; color: var(--ink-3); margin-bottom: 1px; }
.facts dd { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.chip { background: var(--neutral-bg); color: var(--ink-2); border-radius: 6px; padding: 3px 9px; font-size: 13px; }

/* Выбор роли */
.role-group { margin-bottom: 26px; }
.role-group h2 { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-bottom: 10px; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.role-card { margin: 0; }
.role-card button {
  width: 100%; height: 100%; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 1px 12px; text-align: left; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); font: inherit; color: inherit; cursor: pointer; transition: border-color .12s;
}
.role-card button:hover { border-color: var(--accent); }
.role-card .role-icon { grid-row: 1 / span 2; width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r-s); background: var(--accent-soft); color: var(--accent); }
.role-card strong { font-size: 14px; font-weight: 600; }
.role-card span.role-text { color: var(--ink-2); font-size: 13px; line-height: 1.4; }

/* Заявка */
.product-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 8px; border-bottom: 1px solid var(--line); border-radius: 0; }
.product-row.picked { background: var(--accent-soft); }
.product-name { display: flex; flex-direction: column; min-width: 0; }
.product-name strong { font-weight: 550; }
.stepper { display: flex; align-items: center; flex: none; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--surface); overflow: hidden; }
.stepper button { width: 38px; height: 38px; border: 0; background: none; font-size: 18px; color: var(--ink-2); cursor: pointer; }
.stepper button:hover { background: var(--bg); }
.stepper input { width: 46px; min-height: 38px; text-align: center; padding: 4px 0; border: 0; border-radius: 0; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.order-total {
  position: sticky; bottom: 12px; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 14px 10px 18px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r);
  box-shadow: 0 6px 20px rgba(20, 24, 31, .1);
}
.order-total > div { display: flex; flex-direction: column; }
.order-total strong { font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.order-total .text-bad { font-size: 12px; }
.route-item.ok { background: #fafbfc; }
.route-item.ok h2 { color: var(--ink-2); }
.route-item.bad { border-color: var(--bad-line); }
.route-item.warn { border-color: var(--warn-line); }
.route-item.active { border-color: var(--accent); }
.badge.active { background: var(--accent-soft); color: var(--accent); }
.visit-times { margin: 0 0 4px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.reason { display: block; font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.reason::before { content: '• '; }
.route-item.bad .reason { color: var(--bad); }
.route-item .reason:last-of-type { margin-bottom: 6px; }

/* Идущий визит и таймер */
.active-visit { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.active-visit h2 { margin-top: 6px; }
.timer { text-align: right; }
.timer span { display: block; font-size: 12px; }
.timer strong { font-size: 28px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--accent); }

/* Демо-переключатели GPS */
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-s); overflow: hidden; background: var(--surface); }
.seg form { display: flex; }
.seg form + form button { border-left: 1px solid var(--line-2); }
.seg button { border: 0; background: none; padding: 8px 14px; min-height: 38px; font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.seg button:hover { background: var(--bg); }
.seg button.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }

/* Схема маршрута */
.route-map { display: block; width: 100%; height: auto; max-height: 300px; }
.map-bg { fill: #eef0f3; }
.map-street { fill: none; stroke: #fff; stroke-width: 9; }
.map-street.wide { stroke-width: 15; }
.route-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 5; opacity: .55; }
.route-pt circle { stroke: #fff; stroke-width: 2.5; }
.route-pt.ok circle { fill: var(--ok); }
.route-pt.bad circle { fill: var(--bad); }
.route-pt.warn circle { fill: var(--warn); }
.route-pt.active circle { fill: var(--accent); }
.route-pt.plan circle { fill: #fff; stroke: var(--ink-3); stroke-width: 2; }
.route-pt text { font-size: 11px; font-weight: 700; text-anchor: middle; fill: #fff; }
.route-pt.plan text { fill: var(--ink-2); }
.route-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink-3); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }
.dot.warn { background: var(--warn); }
.dot.active { background: var(--accent); }
.dot.plan { background: #fff; border: 2px solid var(--ink-3); }

/* Окно проверки местоположения */
.geo-overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(20, 24, 31, .45); }
.geo-overlay[hidden] { display: none; }
.geo-box { width: 100%; max-width: 540px; padding: 20px; background: var(--surface); border-radius: 14px; box-shadow: 0 20px 50px rgba(20, 24, 31, .25); }
.geo-head h2 { margin: 0 0 2px; }
.geo-head p { margin: 0; }
.geo-body { display: flex; gap: 18px; align-items: center; margin: 14px 0; }
.geo-mini { width: 150px; height: 150px; flex: none; }
.geo-zone { fill: rgba(21, 115, 71, .1); stroke: var(--ok); stroke-width: 1.5; stroke-dasharray: 4 3; }
.geo-line { stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 3 3; }
.geo-store { fill: var(--ink); }
.geo-phone.ok circle { fill: var(--ok); }
.geo-phone.bad circle { fill: var(--bad); }
.geo-pulse { opacity: .22; }
.geo-label { font-size: 10px; fill: var(--ok); text-anchor: middle; }
.geo-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; flex: 1; min-width: 0; }
.geo-step { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; }
.geo-mark { position: relative; width: 18px; height: 18px; border-radius: 50%; flex: none; margin-top: 1px; box-sizing: border-box; }
.geo-mark::after { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; }
.geo-step.ok .geo-mark { background: var(--ok); }
.geo-step.ok .geo-mark::after { content: '✓'; }
.geo-step.bad .geo-mark { background: var(--bad); }
.geo-step.bad .geo-mark::after { content: '✕'; }
.geo-step.bad .geo-text { color: var(--bad); font-weight: 550; }
.geo-step.wait { color: var(--ink-3); }
.geo-step.wait .geo-mark { border: 2px solid var(--line-2); border-top-color: var(--accent); animation: geo-spin .8s linear infinite; }
.geo-final { padding: 10px 12px; margin-bottom: 14px; border: 1px solid; border-radius: var(--r-s); font-weight: 500; }
.geo-final.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.geo-final.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.geo-overlay .pending { visibility: hidden; }
.geo-mini .pending { opacity: 0; }
.geo-phone, .geo-line { transition: opacity .3s; }
.geo-phone.located .geo-pulse { animation: geo-pulse 1.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes geo-spin { to { transform: rotate(360deg); } }
@keyframes geo-pulse { from { transform: scale(.6); opacity: .4; } to { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .geo-step.wait .geo-mark, .geo-phone.located .geo-pulse { animation: none; }
}

/* Графики */
.chart-head { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: -4px 0 10px; font-size: 13px; color: var(--ink-3); }
.chart-head strong { color: var(--ink); font-weight: 600; }
.chart { display: flex; align-items: stretch; gap: 2px; height: 190px; }
.bar-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; cursor: default; border-radius: 4px; }
.bar-track { flex: 1; min-height: 0; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--line-2); }
.bar { width: 100%; max-width: 22px; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 1px; }
.bar-col.today .bar { background: var(--accent-mid); }
.bar-col:hover .bar, .bar-col:focus .bar { background: var(--accent-dark); }
.bar-col > span { text-align: center; font-size: 11px; color: var(--ink-3); padding-top: 5px; height: 21px; }
.chart.dense .bar-col:nth-child(even) > span { visibility: hidden; }
.chart-tip {
  position: fixed; z-index: 40; padding: 5px 9px; background: var(--ink); color: #fff; border-radius: 6px;
  font-size: 12px; font-weight: 500; white-space: nowrap; pointer-events: none;
}
.chart-table { margin-top: 10px; font-size: 13px; }
.chart-table summary { cursor: pointer; color: var(--accent); padding: 4px 0; font-weight: 500; }
.meter-row { margin-bottom: 12px; }
.meter-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 4px; }
.meter { display: block; height: 6px; background: var(--neutral-bg); border-radius: 3px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

.bottom, .sheet { display: none; }

@media (max-width: 1000px) {
  .triage { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  body { font-size: 15px; }
  .side { display: none; }
  .main { margin-left: 0; padding-bottom: 72px; }
  .main.full { padding-bottom: 0; }
  .topbar { padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 15; }
  .demo-tag { flex: none; }
  .top { padding: 12px 16px 2px; }
  .back span { display: none; }
  .back { width: 34px; height: 34px; padding: 0; justify-content: center; flex: none; }
  h1 { font-size: 20px; }
  .content { padding: 10px 16px 24px; }
  .card { padding: 14px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 11px 13px; }
  .stat strong { font-size: 18px; }
  .wide-mobile, .form-grid .btn { width: 100%; }
  .filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .filters input, .filters select { width: 100%; }
  .filters .btn.ghost.small { display: none; }
  .filters .btn:not(.ghost) { grid-column: 1 / -1; }
  .card-head .search { width: 100%; }
  .order-total { bottom: 72px; padding: 8px 10px 8px 14px; }
  .order-total strong { font-size: 18px; }
  .actions .btn, .actions form.inline { flex: 1 1 auto; }
  .actions form.inline .btn { width: 100%; }
  .actions.tight { flex-wrap: wrap; }
  .seg { display: flex; width: 100%; }
  .seg form { flex: 1 1 0; }
  .seg button { width: 100%; padding: 8px 6px; }
  .geo-body { flex-direction: column; gap: 12px; }
  .geo-mini { width: 130px; height: 130px; }
  .geo-steps { width: 100%; }
  .timer strong { font-size: 24px; }
  .role-grid { grid-template-columns: minmax(0, 1fr); }

  /* Таблица становится карточками: первый столбец — заголовок, дальше подпись и значение. */
  .table-wrap { overflow: visible; }
  .content > .table-wrap { background: transparent; border: 0; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl thead { display: none; }
  .tbl tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 8px; padding: 12px 14px; }
  .card .tbl tr { border-color: var(--line); }
  .tbl tbody tr:hover td { background: none; }
  .tbl td, .card .tbl td:first-child, .card .tbl td:last-child { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 3px 0; border: 0; }
  .tbl td .cell { min-width: 0; text-align: right; overflow-wrap: anywhere; }
  .tbl td::before { content: attr(data-label); color: var(--ink-3); font-size: 13px; flex: none; max-width: 45%; }
  .tbl td:first-child { padding-bottom: 6px; }
  .tbl td:first-child::before { display: none; }
  .tbl td:first-child .cell { text-align: left; font-weight: 600; }
  .tbl td[data-label=""]::before { display: none; }
  .tbl td[data-label=""]:last-child { padding-top: 8px; }
  .tbl td[data-label=""]:last-child .cell { width: 100%; }
  .tbl td[data-label=""]:last-child .link {
    display: flex; align-items: center; justify-content: center; min-height: 38px; border: 1px solid var(--line-2); border-radius: var(--r-s); color: var(--ink);
  }
  .tbl td input[type="date"] { width: 160px; }
  .assign { justify-content: flex-end; flex-wrap: wrap; }

  .bottom {
    display: flex; position: fixed; inset: auto 0 0 0; z-index: 20; height: 62px;
    background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom a, .bottom button {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    padding: 4px 2px; font: inherit; font-size: 11px; font-weight: 500; line-height: 1.1; color: var(--ink-3); background: none; border: 0; text-decoration: none; cursor: pointer;
  }
  .bottom .icon { width: 21px; height: 21px; }
  .bottom a.on { color: var(--accent); font-weight: 600; }
  .sheet { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(20, 24, 31, .45); }
  .sheet-body {
    position: absolute; inset: auto 0 0 0; display: grid; gap: 2px; padding: 14px 12px 18px;
    background: var(--surface); border-radius: 16px 16px 0 0;
  }
  .sheet-body a { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px; color: var(--ink); text-decoration: none; border-radius: var(--r-s); font-weight: 500; }
  .sheet-body a .icon { color: var(--ink-3); }
  .sheet-body a.on { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
  .sheet-body .btn { margin-top: 8px; }
  .plan-fact { grid-column: 1 / -1; }
}

/* Карта маршрута на OpenStreetMap */
.route-map-box { position: relative; }
.route-osm { height: 380px; border-radius: 10px; overflow: hidden; z-index: 0; }
.route-osm-line { stroke: var(--accent); stroke-width: 4; fill: none; opacity: .75; }
.route-osm-line.straight { stroke-width: 2.5; stroke-dasharray: 6 6; opacity: .6; }
.route-osm-pt { display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); font: 700 12px/1 system-ui, sans-serif; color: #fff; }
.route-osm-pt.ok { background: var(--ok); }
.route-osm-pt.bad { background: var(--bad); }
.route-osm-pt.warn { background: var(--warn); }
.route-osm-pt.active { background: var(--accent); }
.route-osm-pt.plan { background: #fff; color: var(--ink-2); border-color: var(--ink-3); }
.leaflet-popup-content { font-size: 13px; line-height: 1.4; }
.leaflet-popup-content strong { display: block; margin-bottom: 2px; }
@media (max-width: 640px) { .route-osm { height: 300px; } }

/* Логистика: загрузка машины и цвета линий рейсов */
.meter span.warn { background: var(--warn); }
.meter span.bad { background: var(--bad); }
.route-osm-line.g1 { stroke: #d9822b; }
.route-osm-line.g2 { stroke: #2f9e6f; }
.route-osm-line.g3 { stroke: #8e5bd0; }
.route-osm-line.g4 { stroke: #c2410c; }
.assign select option:disabled { color: var(--ink-3); }

/* Вход в стиле мобильного приложения */
body.app-login { background: var(--surface); min-height: 100vh; }
.login { max-width: 440px; margin: 0 auto; padding: max(36px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom)); }
.login-head { text-align: center; padding: 18px 0 26px; }
.login-logo { display: block; width: 96px; height: 96px; margin: 0 auto 14px; }
.login-head h1 { font-size: 26px; letter-spacing: -.02em; margin: 0 0 4px; }
.login-head p { color: var(--ink-3); margin: 0; font-size: 15px; }
.login-form { display: grid; gap: 8px; }
.login-form label { font-size: 13px; font-weight: 550; color: var(--ink-2); }
.login-form input { min-height: 52px; font-size: 18px; padding: 10px 16px; border-radius: 14px; background: var(--bg); border-color: transparent; width: 100%; }
.login-form input:focus { background: var(--surface); border-color: var(--accent); }
.login-btn { min-height: 52px; border-radius: 14px; font-size: 16px; margin-top: 4px; }
.login-hint { margin: 2px 0 0; text-align: center; color: var(--ink-3); font-size: 13px; }
.login-form input + label { margin-top: 6px; }
.login-foot { text-align: center; color: var(--ink-3); font-size: 12px; margin: 22px 0 0; }
@media (min-width: 600px) {
  body.app-login { background: var(--bg); padding: 32px 0; }
  .login { background: var(--surface); border-radius: 28px; box-shadow: 0 20px 60px rgba(20, 24, 31, .08); padding: 32px 22px 26px; }
}

.top-who { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* Сотрудники и пароль */
.card.narrow { max-width: 420px; }
.card form h2 { margin-top: 20px; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 14px; }
.check input { width: 18px; height: 18px; min-height: 0; }
.flash .inline { display: inline-block; margin-left: 8px; }

@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; row-gap: 6px; }
  .top-who { display: none; }
}

/* Боковое меню: выбранный пункт — золотая полоска слева. */
.side nav a.on { box-shadow: inset 3px 0 0 #f1c134; border-radius: 0 var(--r-s) var(--r-s) 0; }
.side-who a { color: var(--ink-2); }
.bottom a.on { color: var(--ink); }
.bottom a.on .icon { color: #a87b00; }
.filters label.check { flex-direction: row; align-items: center; gap: 8px; min-height: 38px; margin: 0; font-size: 13px; }
