/* ==========================================================================
   Fast Logistic Group CRM — дизайн-система
   Основа: фирменный стиль компании (логотип красный; интерфейс в спокойном синем, красный только для
   тревожных состояний), наклонные параллелограммы, градиентные заголовки.
   ========================================================================== */

:root {
  --red: #e62229;
  --red-600: #cf1f26;
  --red-700: #a8171d;
  --red-800: #7d1015;
  --red-100: #fde9ea;
  --red-50: #fff5f5;
  --red-line: #f4b9bb;
  /* основной цвет интерфейса: спокойный синий; красный (--red*) — только для тревожных состояний и логотипа */
  --acc: #2f66d0;
  --acc-600: #2756b5;
  --acc-700: #1f4491;
  --acc-800: #16336e;
  --acc-100: #e6eefc;
  --acc-50: #f4f8fe;
  --acc-line: #bccff2;
  --ink: #1f1f21;
  --ink-2: #2d2d2f;
  --muted: #6c6c75;
  --line: #e7e7ea;
  --line-2: #efeff2;
  --bg: #f3f3f5;
  --card: #ffffff;
  --green: #11a05a;
  --green-bg: #e4f6ec;
  --amber: #d98e00;
  --amber-bg: #fff3d4;
  --blue: #2c6be0;
  --blue-bg: #e7efff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(25, 25, 35, .05), 0 6px 20px rgba(25, 25, 35, .05);
  --shadow-2: 0 2px 4px rgba(25, 25, 35, .06), 0 14px 38px rgba(25, 25, 35, .10);
  --shadow-red: 0 8px 24px rgba(230, 34, 41, .32);
  --shadow-acc: 0 8px 24px rgba(47, 102, 208, .26);
  --grad-head: linear-gradient(90deg, #1f2f55 0%, #2f66d0 70%, #7ea3e8 100%);
  --grad-red: linear-gradient(135deg, #f0343b 0%, #e62229 45%, #b81a21 100%);
  --grad-acc: linear-gradient(135deg, #4b86ec 0%, #2f66d0 45%, #234fa6 100%);
  --font-head: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --font-ui: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --sidebar-w: 264px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-ui); font-size: 15px; line-height: 1.5; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased; min-height: 100vh;
}
body::before { /* лёгкая сотовая текстура фона, как на слайде «Наши услуги» */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background:
    radial-gradient(900px 500px at 105% -10%, rgba(47,102,208, .07), transparent 60%),
    radial-gradient(700px 420px at -10% 110%, rgba(47,102,208, .05), transparent 60%);
}
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-head); line-height: 1.15; }
p { margin: 0; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid rgba(47,102,208, .45); outline-offset: 2px; border-radius: 6px; }

.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.sm { width: 16px; height: 16px; }
.icon.lg { width: 26px; height: 26px; }

/* ---------- каркас ---------- */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 16px 16px;
  background: #fff; border-right: 1px solid var(--line); overflow: hidden;
}
.sidebar::before { /* красный косой акцент на сайдбаре */
  content: ""; position: absolute; left: -40px; bottom: -60px; width: 260px; height: 260px; z-index: 0;
  background: linear-gradient(135deg, rgba(47,102,208, .10), rgba(47,102,208, 0)); transform: skewX(-18deg) rotate(8deg);
  border-radius: 30px; pointer-events: none;
}
.brand { display: flex; align-items: center; padding: 0 8px 18px; position: relative; z-index: 1; }
.brand img { width: 150px; height: auto; display: block; }
.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; position: relative; z-index: 1; }
.nav-label { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #a3a3ab; padding: 14px 14px 6px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px;
  font-weight: 700; color: #4a4a52; transition: color .2s, background .2s, transform .2s var(--ease);
}
.nav a:hover { background: var(--acc-50); color: var(--acc-600); transform: translateX(2px); }
.nav a.active { color: #fff; background: var(--grad-acc); box-shadow: var(--shadow-acc); }
.nav a.active::after { /* «скорость» — косые штрихи справа, как в логотипе */
  content: ""; position: absolute; right: 12px; top: 50%; width: 22px; height: 12px; transform: translateY(-50%) skewX(-24deg);
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.55) 0 3px, transparent 3px 7px); opacity: .8;
}
.nav .badge-count { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 99px; font-weight: 800; }
.nav a.active .badge-count { background: #fff; color: var(--red); }
.sidebar-foot { margin-top: auto; position: relative; z-index: 1; }
.me {
  display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff;
  box-shadow: var(--shadow-1);
}
.avatar {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; color: #fff;
  font-family: var(--font-head); font-weight: 800; background: var(--grad-acc); transform: skewX(-6deg);
}
.avatar.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 12px; }
.avatar.alt { background: linear-gradient(135deg, #3b3b40, #1f1f21); }
.me b { display: block; font-size: 14px; line-height: 1.2; }
.me small { color: var(--muted); font-size: 12px; }
.me form { margin-left: auto; }
.icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: #fff;
  cursor: pointer; color: #55555d; transition: all .2s var(--ease); position: relative;
}
.icon-btn:hover { color: var(--acc); border-color: var(--acc-line); background: var(--acc-50); transform: translateY(-1px); }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--red); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff; }

.scrim { display: none; }
.main { min-width: 0; padding: 0 clamp(16px, 2.6vw, 40px) 90px; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 22px 0 18px; position: relative; z-index: 5; flex-wrap: wrap; }
.menu-btn { display: none; }
.page-title {
  font-size: clamp(24px, 3.2vw, 38px); font-weight: 900; letter-spacing: -.01em; text-transform: uppercase;
  background: var(--grad-head); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 2px;
}
.page-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.topbar .spacer { flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; height: 40px;
  min-width: 240px; transition: all .2s; box-shadow: var(--shadow-1);
}
.search:focus-within { border-color: var(--acc); box-shadow: 0 0 0 4px rgba(47,102,208, .12); }
.search input { border: 0; outline: 0; background: transparent; width: 100%; }
.search .icon { color: var(--muted); }

/* ---------- кнопки ---------- */
.btn {
  position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 22px;
  border: 0; background: transparent; color: #fff; font-weight: 800; letter-spacing: .01em; cursor: pointer; white-space: nowrap;
  transition: transform .2s var(--ease), filter .2s; overflow: visible;
}
.btn::before { /* наклонная «плашка» как в фирменном стиле */
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--grad-acc); border-radius: 8px; transform: skewX(-12deg);
  box-shadow: var(--shadow-acc); transition: box-shadow .25s, filter .25s;
}
.btn::after { /* блик */
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 8px; transform: skewX(-12deg); overflow: hidden;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%); background-size: 250% 100%; background-position: 160% 0; opacity: 0;
}
.btn:hover { transform: translateY(-1px); }
.btn:hover::after { opacity: 1; animation: shine .9s var(--ease); }
.btn:active { transform: translateY(1px); }
.btn.ghost { color: var(--ink); }
.btn.ghost::before { background: #fff; box-shadow: inset 0 0 0 1.5px var(--line), var(--shadow-1); }
.btn.ghost:hover { color: var(--acc); }
.btn.ghost:hover::before { box-shadow: inset 0 0 0 1.5px var(--acc-line), var(--shadow-1); }
.btn.dark::before { background: linear-gradient(135deg, #3a3a3f, #1c1c1e); box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.btn.sm { height: 34px; padding: 0 16px; font-size: 13px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
@keyframes shine { from { background-position: 160% 0; } to { background-position: -60% 0; } }
.link { color: var(--acc-600); font-weight: 700; }
.link:hover { text-decoration: underline; }

/* ---------- карточки ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); position: relative; }
.card.pad { padding: 22px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px 0; }
.card-title { font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); display: flex; align-items: center; gap: 10px; }
.card-title::before { content: ""; width: 12px; height: 16px; background: var(--acc); transform: skewX(-18deg); border-radius: 2px; flex: none; }
.card-body { padding: 16px 22px 22px; }
.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }

/* ---------- hero дашборда ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; color: #fff; min-height: 188px; padding: 28px 32px; margin-bottom: 22px;
  background: linear-gradient(120deg, #2f66d0 0%, #244d9e 55%, #16336e 100%); box-shadow: 0 18px 50px rgba(36,77,158, .30);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.hero::before { /* косые «скоростные» полосы */
  content: ""; position: absolute; inset: -20% -10%; opacity: .16; pointer-events: none;
  background: repeating-linear-gradient(115deg, #fff 0 2px, transparent 2px 46px);
  animation: slide-bg 18s linear infinite;
}
.hero::after { /* светлая диагональ справа */
  content: ""; position: absolute; right: -80px; top: -40px; bottom: -40px; width: 340px; background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0)); transform: skewX(-18deg);
  pointer-events: none;
}
@keyframes slide-bg { to { transform: translateX(-46px); } }
.hero-routes { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .9; }
.hero-routes path.arc { fill: none; stroke: rgba(255,255,255,.55); stroke-width: 1.6; stroke-dasharray: 3 9; animation: dash 2.2s linear infinite; }
.hero-routes path.arc.b { stroke: rgba(255,255,255,.3); animation-duration: 3.4s; }
.hero-routes circle { fill: #fff; filter: drop-shadow(0 0 6px rgba(255,255,255,.9)); }
@keyframes dash { to { stroke-dashoffset: -48; } }
.hero-text { position: relative; z-index: 2; max-width: 620px; }
.hero h1 { font-size: clamp(26px, 3.4vw, 42px); font-weight: 900; text-transform: uppercase; letter-spacing: -.01em; text-shadow: 0 2px 20px rgba(0,0,0,.2); }
.hero p { margin-top: 8px; opacity: .92; max-width: 520px; }
.hero-side { position: relative; z-index: 2; display: flex; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; background: rgba(255,255,255,.16); border-radius: 12px; padding: 4px; backdrop-filter: blur(8px); gap: 2px; flex-wrap: wrap; }
.seg a, .seg button {
  border: 0; background: transparent; color: rgba(255,255,255,.88); padding: 7px 14px; border-radius: 9px; font-weight: 700; font-size: 13px; cursor: pointer; transition: all .2s;
}
.seg a:hover { background: rgba(255,255,255,.18); }
.seg a.on, .seg button.on { background: #fff; color: var(--acc-600); box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.seg.light { background: #ececf0; backdrop-filter: none; }
.seg.light a, .seg.light button { color: #55555d; }
.seg.light a:hover { background: #fff; }
.seg.light a.on, .seg.light button.on { background: #fff; color: var(--acc-600); box-shadow: var(--shadow-1); }

/* ---------- KPI ---------- */
.kpi { padding: 20px 22px; overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s, border-color .3s; }
.kpi:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); border-color: var(--acc-line); }
.kpi::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; background: linear-gradient(135deg, rgba(47,102,208,.10), transparent 70%); transform: skewX(-18deg); border-radius: 22px; transition: transform .5s var(--ease); }
.kpi:hover::after { transform: skewX(-18deg) scale(1.4); }
.kpi-top { display: flex; align-items: center; gap: 12px; }
.kpi-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--acc-100); color: var(--acc); transform: skewX(-8deg); }
.kpi-ic .icon { transform: skewX(8deg); }
.kpi-label { font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.kpi-value { font-family: var(--font-head); font-weight: 900; font-size: clamp(26px, 2.4vw, 36px); letter-spacing: -.02em; margin-top: 14px; line-height: 1.05; }
.kpi-value small { font-size: .5em; font-weight: 800; color: var(--muted); margin-left: 4px; }
.kpi-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; min-height: 28px; }
.delta { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: 12px; padding: 3px 8px; border-radius: 8px; }
.delta.up { color: var(--green); background: var(--green-bg); }
.delta.down { color: var(--red-600); background: var(--red-100); }
.delta.flat { color: var(--muted); background: #eee; }
.spark { width: 96px; height: 28px; margin-left: auto; overflow: visible; }
.spark path { fill: none; stroke: var(--acc); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark .area { fill: url(#sparkfill); stroke: none; opacity: .5; }

/* ---------- графики ---------- */
.chart { width: 100%; height: 260px; position: relative; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .bar { fill: url(#barfill); transition: filter .2s; }
.chart .bar:hover { filter: brightness(1.08); }
.chart .axis text { font-size: 11px; fill: var(--muted); font-weight: 600; }
.chart .grid line { stroke: var(--line); stroke-dasharray: 3 5; }
.chart .line { fill: none; stroke: var(--ink-2); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chart .dotp { fill: #fff; stroke: var(--ink-2); stroke-width: 2.4; }
.tooltip {
  position: absolute; pointer-events: none; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 10px; font-size: 12px; line-height: 1.45; z-index: 20;
  opacity: 0; transform: translateY(6px); transition: opacity .15s, transform .15s; box-shadow: var(--shadow-2); white-space: nowrap;
}
.tooltip.on { opacity: 1; transform: none; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); font-weight: 600; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.rank { display: flex; flex-direction: column; gap: 14px; }
.rank-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.rank-row .name { font-weight: 700; display: flex; justify-content: space-between; gap: 10px; }
.rank-row .meta { color: var(--muted); font-size: 12px; font-weight: 600; }
.bar-track { height: 8px; background: #efeff2; border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar-fill { height: 100%; width: 0; border-radius: 99px; background: var(--grad-acc); transition: width 1.1s var(--ease); position: relative; }
.bar-fill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.55) 50%, transparent 80%); background-size: 200% 100%; animation: shimmer 2.8s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -100% 0; } }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; flex: none; }
.donut circle.seg { fill: none; stroke-width: 20; transition: stroke-dasharray 1.1s var(--ease); }
.donut-legend { display: flex; flex-direction: column; gap: 10px; min-width: 150px; flex: 1; }
.donut-legend div { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 13px; }
.donut-legend i { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.donut-legend small { margin-left: auto; color: var(--muted); font-weight: 700; padding-left: 10px; }

/* ---------- чипы и статусы ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 12px; border-radius: 6px; font-size: 12px; font-weight: 800; white-space: nowrap;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); padding-inline: 16px;
}
.chip.new { background: #efeff2; color: #55555d; }
.chip.transit { background: var(--grad-acc); color: #fff; }
.chip.delivered { background: var(--green-bg); color: var(--green); }
.chip.transit .pulse { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.8); } 100% { box-shadow: 0 0 0 9px rgba(255,255,255,0); } }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 7px; font-size: 11.5px; font-weight: 800; background: #efeff2; color: #55555d; white-space: nowrap; }
.tag.ok { background: var(--green-bg); color: var(--green); }
.tag.bad { background: var(--red-100); color: var(--red-600); }
.tag.warn { background: var(--amber-bg); color: var(--amber); }
.tag.info { background: var(--blue-bg); color: var(--blue); }
.tag.dark { background: var(--ink-2); color: #fff; }
.stars { display: inline-flex; gap: 2px; color: #e3a008; vertical-align: middle; }
.stars .icon { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.stars .off { color: #d9d9de; }

/* ---------- таблицы ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
table.t th {
  position: sticky; top: 0; background: #fafafb; text-align: left; font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
  padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 2;
}
table.t th a { display: inline-flex; align-items: center; gap: 4px; }
table.t th a:hover, table.t th a.on { color: var(--acc-600); }
table.t td { padding: 13px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tbody tr { transition: background .15s, box-shadow .15s; cursor: pointer; }
table.t tbody tr:hover { background: var(--acc-50); box-shadow: inset 4px 0 0 var(--acc); }
table.t td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t .id { font-family: var(--font-head); font-weight: 800; color: var(--ink-2); }
.route { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.route .arrow { color: var(--acc); display: inline-flex; }
.margin-pos { color: var(--green); font-weight: 800; }
.margin-low { color: var(--red-600); font-weight: 800; }
.cell-sub { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.cell-sub.margin-pos { color: var(--green); font-weight: 800; }
.cell-sub.margin-low { color: var(--red-600); font-weight: 800; }
.pay-dots { display: inline-flex; gap: 5px; }
.pay-dot { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; font-size: 11px; font-weight: 900; background: #efeff2; color: #a0a0a8; }
.pay-dot.ok { background: var(--green); color: #fff; }
.pay-dot.wait { background: #ffc928; color: #5c3d00; }
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty svg { width: 54px; height: 54px; stroke: var(--acc-line); margin-bottom: 10px; }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* ---------- фильтры ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); margin-bottom: 16px; }
.filters .search { box-shadow: none; flex: 1; min-width: 200px; background: #fafafb; }
.filters select, .filters input[type=date] { height: 40px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; background: #fafafb; cursor: pointer; font-weight: 600; }
.filters select:focus, .filters input:focus { outline: 0; border-color: var(--acc); box-shadow: 0 0 0 4px rgba(47,102,208,.12); }
.summary-strip { display: flex; gap: 22px; flex-wrap: wrap; padding: 4px 4px 14px; color: var(--muted); font-weight: 600; font-size: 13px; }
.summary-strip b { color: var(--ink); font-family: var(--font-head); font-weight: 800; }
.pager { display: flex; gap: 6px; justify-content: center; padding: 18px; }
.pager a, .pager span { min-width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; font-weight: 800; border: 1px solid var(--line); background: #fff; padding: 0 12px; }
.pager a:hover { border-color: var(--acc-line); color: var(--acc); }
.pager .cur { background: var(--grad-acc); color: #fff; border-color: transparent; }

/* ---------- канбан ---------- */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(280px, 1fr)); gap: 16px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: #ececf0; border-radius: 18px; padding: 12px; min-height: 200px; }
.kcol-head { display: flex; align-items: center; gap: 10px; padding: 6px 8px 12px; font-weight: 800; }
.kcol-head .n { margin-left: auto; background: #fff; border-radius: 99px; padding: 1px 10px; font-size: 12px; }
.kcard { display: block; background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 10px; border: 1px solid transparent; box-shadow: var(--shadow-1); transition: all .25s var(--ease); position: relative; overflow: hidden; }
.kcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line); }
.kcol.transit .kcard::before { background: var(--acc); }
.kcol.delivered .kcard::before { background: var(--green); }
.kcard:hover { transform: translateY(-3px) rotate(-.3deg); box-shadow: var(--shadow-2); border-color: var(--acc-line); }
.kcard .k-id { font-family: var(--font-head); font-weight: 800; font-size: 12px; color: var(--muted); }
.kcard .k-route { font-weight: 800; margin: 6px 0 4px; }
.kcard .k-client { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.kcard .k-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ---------- формы ---------- */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px 18px; }
.f { display: flex; flex-direction: column; gap: 6px; grid-column: span 4; min-width: 0; position: relative; }
.f.s2 { grid-column: span 2; } .f.s3 { grid-column: span 3; } .f.s6 { grid-column: span 6; } .f.s8 { grid-column: span 8; } .f.s12 { grid-column: span 12; }
.f label, .lbl { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.f label .req { color: var(--red); }
.f input:not([type=checkbox]):not([type=radio]), .f select, .f textarea {
  width: 100%; height: 44px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 14px; background: #fff; transition: all .18s; font-weight: 600;
}
.f textarea { height: auto; min-height: 84px; padding: 11px 14px; resize: vertical; line-height: 1.5; }
.f input:hover, .f select:hover, .f textarea:hover { border-color: #d3d3da; }
.f input:focus, .f select:focus, .f textarea:focus { outline: 0; border-color: var(--acc); box-shadow: 0 0 0 4px rgba(47,102,208, .12); }
.f input[readonly] { background: #f6f6f8; color: #77777f; }
.f .err { color: var(--red-600); font-size: 12.5px; font-weight: 700; display: flex; align-items: center; gap: 5px; }
.f.has-err input, .f.has-err select, .f.has-err textarea { border-color: var(--red); background: var(--red-50); animation: shake .35s; }
@keyframes shake { 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.f .hint { font-size: 12px; color: var(--muted); font-weight: 600; }
.input-unit { position: relative; }
.input-unit input { padding-right: 56px; }
.input-unit span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-weight: 800; color: var(--muted); font-size: 13px; pointer-events: none; }
.section { margin-bottom: 18px; overflow: visible; }
.section-head { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.section-no { width: 34px; height: 34px; display: grid; place-items: center; color: #fff; font-family: var(--font-head); font-weight: 900; position: relative; isolation: isolate; }
.section-no::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--grad-acc); transform: skewX(-12deg); border-radius: 8px; box-shadow: var(--shadow-acc); }
.section-head h3 { font-size: 16px; text-transform: uppercase; letter-spacing: .04em; font-weight: 800; }
.section-head p { color: var(--muted); font-size: 13px; }
.section-body { padding: 22px; }
.owner-only { border: 1.5px dashed var(--acc-line); background: linear-gradient(180deg, var(--acc-50), #fff); }
.owner-only .section-head { border-bottom-color: var(--acc-line); }
.lock-tag { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 800; color: var(--acc-600); background: var(--acc-100); padding: 4px 10px; border-radius: 8px; }
.radio-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-pills label { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink); cursor: pointer; }
.radio-pills input { position: absolute; opacity: 0; pointer-events: none; }
.radio-pills span { display: inline-flex; align-items: center; padding: 9px 16px; border: 1.5px solid var(--line); border-radius: 12px; font-weight: 700; transition: all .18s; background: #fff; }
.radio-pills input:checked + span { background: var(--acc-100); border-color: var(--acc); color: var(--acc-700); box-shadow: 0 4px 14px rgba(47,102,208, .15); }
.radio-pills span:hover { border-color: var(--acc-line); }
.cur-select { display: grid; grid-template-columns: 1fr 92px; gap: 8px; }
.sticky-bar {
  position: fixed; left: var(--sidebar-w); right: 0; bottom: 0; z-index: 30; padding: 12px clamp(16px, 2.6vw, 40px);
  background: rgba(255,255,255,.88); backdrop-filter: blur(14px); border-top: 1px solid var(--line); display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.live { display: flex; gap: 26px; flex-wrap: wrap; align-items: center; }
.live div { line-height: 1.1; }
.live small { display: block; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.live b { font-family: var(--font-head); font-size: 20px; font-weight: 900; transition: color .3s; }
.live b.neg { color: var(--red-600); } .live b.pos { color: var(--green); }
.live .fxnote { font-size: 12px; font-weight: 600; color: var(--muted); max-width: 260px; }

/* combobox */
.cb-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-2); max-height: 280px; overflow: auto; padding: 6px; display: none; }
.cb-list.open { display: block; animation: pop .16s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.cb-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; cursor: pointer; font-weight: 600; }
.cb-item small { color: var(--muted); margin-left: auto; font-weight: 600; }
.cb-item:hover, .cb-item.act { background: var(--acc-50); color: var(--acc-700); }
.cb-item.add { color: var(--acc-600); font-weight: 800; border-bottom: 1px dashed var(--line); margin-bottom: 4px; border-radius: 10px 10px 0 0; }
.cb-empty { padding: 12px; color: var(--muted); font-size: 13px; }
.cb-clear { position: absolute; right: 10px; bottom: 9px; border: 0; background: #efeff2; width: 26px; height: 26px; border-radius: 8px; cursor: pointer; display: none; color: #666; }
.cb-clear.show { display: grid; place-items: center; }
.cb-clear:hover { background: var(--acc-100); color: var(--acc); }

/* ---------- карточка сделки ---------- */
.deal-hero { padding: 26px; overflow: hidden; margin-bottom: 18px; }
.deal-hero::before { content: ""; position: absolute; right: -60px; top: -60px; width: 300px; height: 300px; background: linear-gradient(135deg, rgba(47,102,208,.09), transparent 70%); transform: skewX(-18deg); border-radius: 40px; }
.deal-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; position: relative; }
.deal-title h2 { font-size: clamp(22px, 2.4vw, 30px); font-weight: 900; }
.deal-no { font-family: var(--font-head); font-weight: 900; color: var(--acc); font-size: 14px; letter-spacing: .08em; }
.route-vis { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; margin: 26px 0 8px; }
.pt { display: flex; flex-direction: column; gap: 2px; position: relative; z-index: 2; }
.pt b { font-family: var(--font-head); font-size: clamp(18px, 2vw, 26px); font-weight: 900; }
.pt span { color: var(--muted); font-size: 13px; font-weight: 700; display: flex; gap: 6px; align-items: center; }
.pt.end { text-align: right; align-items: flex-end; }
.pt.end span { justify-content: flex-end; }
.road { position: relative; height: 54px; }
.road::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; transform: translateY(-50%); background: repeating-linear-gradient(90deg, #d9d9de 0 12px, transparent 12px 22px); border-radius: 4px; }
.road .done { position: absolute; left: 0; top: 50%; height: 4px; transform: translateY(-50%); background: var(--grad-acc); border-radius: 4px; width: 0; transition: width 1.4s var(--ease); box-shadow: 0 0 14px rgba(47,102,208,.5); }
.road .node { position: absolute; top: 50%; width: 16px; height: 16px; background: #fff; border: 4px solid var(--acc); border-radius: 50%; transform: translate(-50%, -50%); z-index: 2; }
.road .node.a { left: 0; } .road .node.b { left: 100%; border-color: #c9c9d0; }
.road .node.b.on { border-color: var(--green); }
.truck { position: absolute; top: 50%; left: 0; transform: translate(-50%, -62%); color: var(--acc); z-index: 3; transition: left 1.4s var(--ease); filter: drop-shadow(0 6px 8px rgba(47,102,208,.35)); }
.truck svg { width: 46px; height: 30px; }
.truck.moving { animation: bob .7s ease-in-out infinite; }
@keyframes bob { 0%, 100% { margin-top: 0; } 50% { margin-top: -2px; } }
.stepper { display: flex; gap: 0; margin-top: 26px; position: relative; }
.step { flex: 1; position: relative; padding: 12px 18px 12px 34px; font-weight: 800; color: #a0a0a8; background: #efeff2; clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%, 16px 50%); margin-left: -8px; text-align: center; font-size: 13.5px; letter-spacing: .02em; transition: all .3s; }
.step:first-child { margin-left: 0; clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%); }
.step.done { background: var(--green-bg); color: var(--green); }
.step.now { background: var(--grad-acc); color: #fff; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px 24px; }
.info .k { font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.info .v { font-weight: 700; word-break: break-word; }
.big-money { font-family: var(--font-head); font-weight: 900; font-size: 34px; letter-spacing: -.02em; }
.money-line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-weight: 700; }
.money-line:last-child { border-bottom: 0; }
.money-line span:first-child { color: var(--muted); font-weight: 600; }
.margin-box { margin: 14px 0 6px; padding: 18px; border-radius: 16px; color: #fff; background: var(--grad-acc); position: relative; overflow: hidden; box-shadow: var(--shadow-acc); }
.margin-box.low { background: linear-gradient(135deg, #3a3a3f, #1c1c1e); }
.margin-box::after { content: ""; position: absolute; right: -20px; top: -20px; bottom: -20px; width: 120px; transform: skewX(-18deg); background: linear-gradient(180deg, rgba(255,255,255,.2), transparent); }
.margin-box small { opacity: .85; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: 11px; }
.margin-box .big-money { margin-top: 4px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); font-weight: 700; }
.switch-row:last-child { border-bottom: 0; }
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 2; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: #d9d9de; transition: all .25s var(--ease); }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: all .25s var(--ease); }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 3px solid rgba(47,102,208,.45); outline-offset: 2px; }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl { position: relative; padding: 0 0 16px; font-size: 13.5px; }
.tl::before { content: ""; position: absolute; left: -22px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--acc); }
.tl small { color: var(--muted); font-weight: 600; display: block; }
.soon { position: relative; padding: 18px; border-radius: 14px; border: 1.5px dashed var(--acc-line); background: repeating-linear-gradient(135deg, #fff 0 12px, var(--acc-50) 12px 24px); }
.soon h4 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.soon .btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- модальные, тосты ---------- */
dialog { border: 0; border-radius: 22px; padding: 0; box-shadow: var(--shadow-2); width: min(520px, calc(100vw - 32px)); animation: pop .2s var(--ease); }
dialog::backdrop { background: rgba(20, 20, 28, .55); backdrop-filter: blur(4px); }
.dlg-head { padding: 22px 26px 6px; }
.dlg-head h3 { font-size: 20px; font-weight: 900; text-transform: uppercase; background: var(--grad-head); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dlg-body { padding: 10px 26px 22px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 12px; padding: 0 26px 24px; }
.star-input { display: flex; gap: 6px; direction: rtl; justify-content: flex-end; }
.star-input input { position: absolute; opacity: 0; }
.star-input label { cursor: pointer; color: #d4d4da; transition: transform .15s, color .15s; text-transform: none; letter-spacing: 0; }
.star-input label .icon { width: 34px; height: 34px; fill: currentColor; stroke: none; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: #f0b100; }
.star-input label:hover { transform: scale(1.18) rotate(-6deg); }
.star-input input:focus-visible + label { outline: 3px solid rgba(47,102,208,.45); border-radius: 6px; }
.toasts { position: fixed; right: 20px; top: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; background: #fff; border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow-2); border-left: 5px solid var(--green); font-weight: 700; animation: toast-in .45s var(--ease); }
.toast.err { border-left-color: var(--red); } .toast.warn { border-left-color: var(--amber); }
.toast .icon { margin-top: 1px; }
.toast.ok .icon { color: var(--green); } .toast.err .icon { color: var(--red); } .toast.warn .icon { color: var(--amber); }
.toast.out { animation: toast-out .35s forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px); } }
.pop { position: absolute; right: 0; top: calc(100% + 10px); width: 360px; max-width: calc(100vw - 32px); background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-2); display: none; z-index: 60; overflow: hidden; }
.pop.open { display: block; animation: pop .18s var(--ease); }
.pop-head { padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; font-weight: 800; border-bottom: 1px solid var(--line); }
.pop a.n { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line-2); font-weight: 600; font-size: 13.5px; }
.pop a.n:hover { background: var(--acc-50); }
.pop a.n.unread { background: #fffafa; box-shadow: inset 3px 0 0 var(--acc); }
.pop a.n small { display: block; color: var(--muted); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.reveal.is-in { opacity: 1; transform: none; }
.page-enter { animation: page-in .5s var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- вход ---------- */
.login { display: grid; grid-template-columns: minmax(380px, 520px) 1fr; min-height: 100vh; background: #fff; }
.login-form { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(28px, 5vw, 72px); position: relative; z-index: 2; background: #fff; }
.login-form img.logo { width: 190px; margin-bottom: 44px; }
.login-form h1 { font-size: clamp(30px, 3.2vw, 42px); font-weight: 900; text-transform: uppercase; background: var(--grad-head); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-form .lead { color: var(--muted); margin: 10px 0 30px; max-width: 360px; }
.login-form .f { grid-column: auto; margin-bottom: 16px; }
.login-hero { position: relative; overflow: hidden; background: #1a2230 url('../img/hero.jpg') center/cover no-repeat; clip-path: polygon(70px 0, 100% 0, 100% 100%, 0 100%); margin-left: -70px; }
.login-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(22,51,110,.92) 0%, rgba(47,102,208,.55) 38%, rgba(20,28,45,.15) 75%); }
.login-hero::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255,255,255,.06) 0 2px, transparent 2px 60px); animation: slide-bg 20s linear infinite; }
.login-hero .hero-routes { opacity: .8; }
.login-copy { position: absolute; left: clamp(90px, 9vw, 150px); right: 40px; bottom: 56px; z-index: 3; color: #fff; }
.login-copy h2 { font-size: clamp(26px, 3.4vw, 46px); font-weight: 900; text-transform: uppercase; line-height: 1.05; text-shadow: 0 4px 30px rgba(0,0,0,.35); }
.login-copy h2 em { font-style: normal; color: #fff; background: var(--acc); padding: 0 12px; display: inline-block; transform: skewX(-12deg); }
.login-copy h2 em span { display: inline-block; transform: skewX(12deg); }
.login-stats { display: flex; gap: 34px; margin-top: 26px; flex-wrap: wrap; }
.login-stats b { display: block; font-family: var(--font-head); font-size: 34px; font-weight: 900; }
.login-stats small { font-weight: 700; opacity: .85; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.alert { padding: 12px 14px; border-radius: 12px; font-weight: 700; font-size: 14px; margin-bottom: 16px; background: var(--red-100); color: var(--red-700); display: flex; gap: 10px; align-items: center; }

/* ---------- прочее ---------- */
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px 14px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 700; } .kv dd { margin: 0; font-weight: 700; }
.rating-big { font-family: var(--font-head); font-weight: 900; font-size: 54px; line-height: 1; }
.dist-row { display: grid; grid-template-columns: 22px 1fr 28px; gap: 10px; align-items: center; font-size: 13px; font-weight: 700; margin: 6px 0; }
.review { padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.review:last-child { border-bottom: 0; }
.review p { margin-top: 6px; }
.flow-list { display: flex; flex-direction: column; }
.flow-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.flow-item:last-child { border-bottom: 0; }
.flow-item:hover .route { color: var(--acc-600); }
.days { padding: 2px 9px; border-radius: 7px; font-size: 12px; font-weight: 800; background: #efeff2; }
.days.late { background: var(--red-100); color: var(--red-600); }
.callout { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 14px; background: var(--amber-bg); color: #7a5300; font-weight: 600; }
.callout.red { background: var(--red-100); color: var(--red-800); }
.pw-box { font-family: ui-monospace, Menlo, monospace; font-size: 18px; font-weight: 800; background: #1f1f21; color: #fff; padding: 12px 16px; border-radius: 12px; user-select: all; display: inline-block; letter-spacing: .04em; }
.two-line { line-height: 1.25; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---------- адаптив ---------- */
@media (max-width: 1280px) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-main { grid-template-columns: 1fr; } }
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 80; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .35s var(--ease); box-shadow: var(--shadow-2); }
  .sidebar.open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(20,20,28,.5); z-index: 70; opacity: 0; pointer-events: none; transition: opacity .3s; }
  .scrim.on { opacity: 1; pointer-events: auto; }
  .menu-btn { display: grid; }
  .sticky-bar { left: 0; }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login { grid-template-columns: 1fr; } .login-hero { display: none; }
  .f, .f.s3, .f.s2 { grid-column: span 6; } .f.s8 { grid-column: span 12; }
}
@media (max-width: 680px) {
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .f, .f.s2, .f.s3, .f.s6 { grid-column: span 12; }
  .hero { padding: 22px; min-height: 160px; }
  .route-vis { grid-template-columns: 1fr; gap: 6px; } .pt.end { text-align: left; align-items: flex-start; } .road { height: 40px; }
  .search { min-width: 0; flex: 1; }
  .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 10px; }
  .stepper .step { font-size: 12px; padding-left: 26px; padding-right: 10px; }
  .btn { height: 46px; }
  .sticky-bar { padding: 10px 16px; gap: 10px; }
  .live { gap: 16px; flex: 1 1 100%; }
  .live div:nth-child(1), .live div:nth-child(2) { display: none; }
  .live b { font-size: 16px; }
  .sticky-bar .row { flex: 1 1 100%; margin-left: 0 !important; }
  .sticky-bar .row .btn { flex: 1; }
  .main { padding-bottom: 150px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
@media print { .sidebar, .topbar, .sticky-bar, .toasts { display: none !important; } .app { display: block; } }

/* дополнительные контакты */
.contact-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr 1.2fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.contact-row input { width: 100%; }
@media (max-width: 760px) { .contact-row { grid-template-columns: 1fr 1fr; } .contact-row button { grid-column: span 2; } }

/* лиды */
.seg { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.seg a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line, #e6e6ea); color: var(--ink); font-weight: 700; font-size: 13.5px; text-decoration: none; transition: background .15s, border-color .15s; }
.seg a b { font-weight: 800; color: var(--muted); }
.seg a:hover { border-color: var(--acc); }
.seg a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.seg a.on b { color: #fff; opacity: .8; }
.seg a.alert { background: var(--amber-bg); border-color: var(--amber); color: #8a5a00; }
.seg a.alert b { color: #8a5a00; }
.due-bad { color: var(--red-600); font-weight: 800; }
.due-today { color: var(--amber, #b26a00); font-weight: 800; }
.lead-note { padding: 10px 0; border-bottom: 1px solid var(--line, #eee); }
.lead-note:last-child { border-bottom: 0; }
.lead-note small { color: var(--muted); font-weight: 600; }
.lead-note.system { color: var(--muted); font-size: 13px; }
.quick-row { display: flex; flex-wrap: wrap; gap: 8px; }
.quote-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-items: end; }
.quote-grid .f { margin: 0; }
@media (max-width: 760px) { .quote-grid { grid-template-columns: 1fr 1fr; } }

.bar { height: 10px; border-radius: 999px; background: var(--acc); min-width: 4px; }
.bar-wrap { background: #f0f0f3; border-radius: 999px; }


/* всплывающие напоминания о звонках */
.remind-box { position: fixed; right: 16px; bottom: 16px; z-index: 60; width: min(360px, calc(100vw - 32px)); max-height: 70vh; overflow: auto;
  background: #fff; border-radius: 16px; box-shadow: 0 18px 50px rgba(20, 30, 60, .28); border: 1px solid var(--acc-line); animation: remindIn .35s var(--ease); }
.remind-head { padding: 12px 16px; font-weight: 800; background: var(--grad-acc); color: #fff; border-radius: 16px 16px 0 0; }
.remind-item { padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.remind-top { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.remind-x { border: 0; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); }
.remind-sub { color: var(--muted); font-size: 13.5px; margin: 2px 0 8px; }
.remind-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.remind-ask { width: 100%; border: 0; background: var(--acc-50); color: var(--acc-700); padding: 10px 12px; cursor: pointer; font-weight: 700; border-radius: 0 0 16px 16px; }
@keyframes remindIn { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

/* телефоны в списке лидов: каждый номер целиком в одну строку, несколько номеров — столбиком */
.phone-line { white-space: nowrap; color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.45; }

/* Левое меню на широком экране само прячется: остаётся узкая полоска у края, выезжает при наведении мыши
   и уезжает, когда мышь ушла (решение Сергея 15.10.2026: меню мешало обзору сделок). Планшеты и узкие окна — прежнее меню по кнопке. */
@media (min-width: 1025px) and (hover: hover) and (pointer: fine) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 80; width: var(--sidebar-w);
    transform: translateX(calc(-100% + 14px)); transition: transform .28s var(--ease) .18s, box-shadow .28s .18s;
  }
  .sidebar:hover, .sidebar:focus-within { transform: none; box-shadow: var(--shadow-2); transition-delay: 0s; }
  .sidebar::after { /* стрелка на видимой полоске: подсказка, что здесь меню */
    content: "›"; position: absolute; right: 0; top: 50%; width: 14px; margin-top: -14px; text-align: center; z-index: 2;
    font: 800 22px/28px var(--font-head); color: var(--acc); background: var(--acc-50); border-radius: 8px 0 0 8px; transition: opacity .15s;
  }
  .sidebar:hover::after, .sidebar:focus-within::after { opacity: 0; }
  .main { padding-left: calc(clamp(16px, 2.6vw, 40px) + 14px); }
  .sticky-bar { left: 0; padding-left: calc(clamp(16px, 2.6vw, 40px) + 14px); }
}
#f-driver_name ~ .cb-list { min-width: 380px; max-width: 90vw; }
#f-driver_name ~ .cb-list .cb-item { flex-wrap: wrap; row-gap: 2px; }
.prepay-row { margin: -4px 0 12px; padding: 10px 12px; background: var(--acc-50); border-radius: 12px; display: grid; gap: 6px; }
.prepay-row[hidden] { display: none; }
.prepay-row label { font-size: 12px; font-weight: 700; color: var(--muted); }
.req-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: end; }
.req-grid .f { margin: 0; }
@media (max-width: 900px) { .req-grid { grid-template-columns: 1fr 1fr; } }
.req-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 10px; align-items: end; }
.req-grid .f.span2 { grid-column: span 2; }
.req-grid .f label { font-size: 11px; }
.req-grid input, .req-grid select { padding: 8px 10px; font-size: 14px; min-height: 0; }
dialog.rq-dlg { width: min(760px, calc(100vw - 24px)); overflow: visible; }
dialog.rq-dlg .dlg-body { padding-top: 12px; }
.cell-comment { max-width: 220px; color: var(--muted); font-size: 13px; }
@media (max-width: 700px) { .req-grid { grid-template-columns: 1fr 1fr; } }
/* заявки: две колонки (слева/справа), окно уже */
.req-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.req-grid .f, .req-grid .f.span2 { grid-column: span 1; }
dialog.rq-dlg { width: min(560px, calc(100vw - 24px)); }
@media (max-width: 700px) { .req-grid { grid-template-columns: 1fr 1fr; } }
.more-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.more-row .cb-list { top: 100%; }
.addr-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.addr-in { position: relative; min-width: 0; }
.addr-in .cb-list { top: 100%; }
@media (max-width: 760px) { .addr-row { grid-template-columns: 1fr; } }
.btn.green::before { background: linear-gradient(135deg, #14b866, #0e9150); box-shadow: 0 8px 18px -8px rgba(17, 160, 90, .6); }
table.t th.right { text-align: right; }
.contract-item { padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.contract-item:last-child { border-bottom: 0; }
.contract-edit summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--acc-600); }
.ct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin-top: 8px; }
.ct-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.ct-grid input, .ct-grid select { padding: 8px 10px; font-size: 14px; }
/* защищённая база водителей: нельзя выделить/скопировать текст и напечатать (менеджерам; руководителям — можно) */
body.is-manager .protected { -webkit-user-select: none; user-select: none; }
@media print { body.is-manager .protected { display: none !important; } }
body.is-manager .protected input, body.is-manager .protected textarea, body.is-manager .protected select { -webkit-user-select: text; user-select: text; }

table.t th.date-th a { display: block; line-height: 1.25; }
.pay-state { font-weight: 800; font-size: 12px; padding: 3px 12px; border-radius: 99px; }
.pay-state.yes { background: #e3f6ea; color: #1c7a3f; }
.pay-state.no { background: #fff1d6; color: #9a5b00; }
