/* Развозка — светлый интерфейс по образцу панелей управления парком: серый фон, белые скруглённые карточки,
   зелёный акцент «Мой город», тёмная «таблетка» активного пункта. Без :has, вложенности и color-mix (старые браузеры). */
:root {
  --bg: #f3f4f6;
  --panel: #ffffff;
  --panel-2: #f7f8fa;
  --line: #e6e8ec;
  --line-2: #d6d9df;
  --text: #15181d;
  --muted: #6c727c;
  --faint: #9aa0a9;
  --accent: #15744f;
  --accent-soft: #e2f1ea;
  --accent-dark: #0f5a3d;
  --dark: #0a2f26;
  --ok: #17a05b;
  --ok-soft: #e3f6ec;
  --red: #d63a2f;
  --red-soft: #fdeceb;
  --warn: #c7801a;
  --warn-soft: #fff3e0;
  --blue: #2f6fe4;
  --blue-soft: #e8f0fd;
  --r: 16px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 20, 28, .05), 0 6px 18px rgba(16, 20, 28, .05);
  --font: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.45 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--text); text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 26px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.red { color: var(--red); }
.ok { color: var(--ok); }
.hidden { display: none !important; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -4px; }
.ic.sm { width: 15px; height: 15px; vertical-align: -3px; }

/* ---------- шапка ---------- */
.top { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); }  /* 09.11.2026: без размытия — оно перерисовывало шапку на каждой прокрутке */
.top-in { max-width: 1360px; margin: 0 auto; padding: 0 24px; height: 64px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; letter-spacing: -.01em; justify-self: start; }
.brand .mark { width: 46px; height: 34px; display: flex; align-items: center; flex: none; }
.brand .mark img { width: 46px; height: 34px; display: block; }
.brand .t { line-height: 1.15; white-space: nowrap; }
.brand small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.nav { display: flex; gap: 2px; background: var(--bg); border-radius: 12px; padding: 4px; }
.nav a { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--muted); white-space: nowrap; }
.nav a:hover { color: var(--text); background: rgba(255,255,255,.7); }
.nav a.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(16,20,28,.1); }
.nav a.on .ic { color: var(--accent); }
.nav a .ic { width: 16px; height: 16px; }
.me { justify-self: end; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 4px 0 4px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.me .avatar { width: 34px; height: 34px; border-radius: 9px; }
.me .who { font-weight: 600; font-size: 13px; line-height: 1.15; white-space: nowrap; }
.me .who small { display: block; color: var(--muted); font-size: 11px; font-weight: 500; }
.me form { margin: 0; }
.me .out { width: 34px; height: 34px; border: 0; border-left: 1px solid var(--line); border-radius: 0 8px 8px 0; background: transparent; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.me .out:hover { color: var(--red); background: var(--red-soft); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; flex: none; }
.content { max-width: 1360px; margin: 0 auto; padding: 22px 24px 48px; }
.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .lead { margin-right: auto; }
.page-head .sub { color: var(--muted); margin-top: 3px; }
.messages { margin-bottom: 14px; }
.alert { padding: 11px 14px; border-radius: var(--r-sm); margin-bottom: 8px; font-weight: 500; }
.alert.success { background: var(--ok-soft); color: #0f6b3b; }
.alert.error { background: var(--red-soft); color: #9c2a21; }
.alert.warning { background: var(--warn-soft); color: #7a4d0b; }

/* ---------- кнопки, формы ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; color: var(--text); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--panel-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.dark { background: var(--dark); border-color: var(--dark); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(0,0,0,.05); }
.btn.danger { color: var(--red); border-color: #f1c6c2; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12px; }
.btn.icon { width: 38px; padding: 0; }
.btn.icon.sm { width: 32px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.input, select.input, textarea.input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; font: inherit; color: var(--text); }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field { min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field .lbl { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field .req { color: var(--accent); }
.field .help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field .err { font-size: 12px; color: var(--red); margin-top: 4px; }
.field.has-err .input { border-color: var(--red); }
.form-section { grid-column: 1 / -1; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-top: 6px; }
.check-card { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); cursor: pointer; }
.check-card.on { border-color: var(--accent); background: var(--accent-soft); }
.check-card .check { width: 18px; height: 18px; accent-color: var(--accent); }
.check-card b { font-weight: 600; }
.form-actions { margin-top: 16px; display: flex; gap: 8px; }
.form-errors { background: var(--red-soft); color: #9c2a21; border-radius: var(--r-sm); padding: 10px 14px; margin-bottom: 12px; }

/* ---------- карточки ---------- */
.card { background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-head h2 { margin-right: auto; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.card + .card { margin-top: 16px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-2 > .card + .card { margin-top: 0; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #eceef2; color: var(--muted); white-space: nowrap; }
.tag.warn { background: var(--warn-soft); color: #8a5300; }
.tag.live { background: var(--accent); color: #fff; }
.tag.green { background: var(--ok-soft); color: #0f6b3b; }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.blue { background: var(--blue-soft); color: var(--blue); }
.tag.grey { background: #eceef2; color: var(--muted); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr.link { cursor: pointer; }
.table tr.link:hover td { background: #fbfbfc; }
.table .sub { font-size: 12px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.pager { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* ---------- плитки показателей ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; display: flex; gap: 12px; align-items: center; }
.tile-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--panel-2); color: var(--text); display: flex; align-items: center; justify-content: center; flex: none; }
.tile-ic .ic { width: 20px; height: 20px; }
.tile .label { font-size: 12px; color: var(--muted); }
.tile .value { font-size: 24px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.delta { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--ok-soft); color: #0f6b3b; }
.delta.bad { background: var(--red-soft); color: var(--red); }
.delta.warn { background: var(--warn-soft); color: var(--warn); }
.tile.warn { box-shadow: inset 0 0 0 2px #f2c58a, var(--shadow); }
.tile.warn .tile-ic { background: var(--warn-soft); color: var(--warn); }
.tile .value small.of { font-size: 14px; font-weight: 600; color: var(--muted); }
.warn-text { color: #8a5300; }

/* ---------- обзор: машина и заявка ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; margin-bottom: 16px; align-items: stretch; }
.hero-main { background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); position: relative; overflow: hidden; display: flex; flex-direction: column; }
.hero-img { flex: 1; background: linear-gradient(180deg, #f6f7f9 0%, #eef0f3 100%); display: flex; align-items: center; justify-content: center; padding: 10px 20px 0; }
/* машина крупно, как на примере: кузов во всю ширину блока, кабина уходит за правый край; карточка рейса поверх кузова */
.hero-img.wide { padding: 0; aspect-ratio: 1.48; overflow: hidden; background: #e1e0e5; }  /* ровно цвет фона фото — без полосы сверху */
.hero-img.wide img { position: absolute; left: -3%; top: 0; width: 132%; height: 100%; object-fit: cover; object-position: 0% 75%; max-width: none; max-height: none; display: block; }
/* грузовики и фура длиннее Газели — показываем целиком, стоят на нижнем крае (фон картинки совпадает с фоном блока) */
.hero-img.wide.long img { left: 0; width: 100%; object-fit: contain; object-position: 50% 100%; }
.hero-info { z-index: 2; position: absolute; left: 18px; top: 18px; width: 280px; background: rgba(255,255,255,.96); border-radius: 14px; box-shadow: var(--shadow); padding: 14px; }
.hero-info .h { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 8px; }
.hero-info .h .ic { color: var(--accent); }
.hero-info .big { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.kv span { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.kv b { text-align: right; font-weight: 600; }
.hero-side { display: flex; flex-direction: column; gap: 16px; }
.hero-side .card { flex: none; }
.driver { display: flex; align-items: center; gap: 12px; }
.driver .label { font-size: 12px; color: var(--muted); }
.driver > div { min-width: 0; }
.driver .btn-row { margin-left: auto; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts .label { font-size: 12px; color: var(--muted); }
.facts b { display: block; font-size: 15px; }
.line { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.line .pt { font-size: 13px; font-weight: 700; }
.line .track { flex: 1; height: 6px; border-radius: 3px; background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 10px); position: relative; }
.line .track i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 3px; }
.line .track em { position: absolute; top: 50%; width: 0; height: 0; border-left: 10px solid var(--accent); border-top: 6px solid transparent; border-bottom: 6px solid transparent; transform: translate(-2px, -50%); }
.line-cap { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- заявки ---------- */
.route-row { display: flex; align-items: center; gap: 16px; padding: 13px 18px; border-bottom: 1px solid var(--line); color: inherit; }
.route-row:last-child { border-bottom: 0; }
.route-row:hover { background: #fbfbfc; }
.route-row .main { flex: 1; min-width: 0; }
.route-row .main b { font-size: 14px; }
.route-row .sub { font-size: 12px; color: var(--muted); }
.route-row .prog { width: 170px; flex: none; }
.route-row > .prog + .tag { width: 132px; justify-content: center; flex: none; } /* статусы разной длины — полосы хода стоят ровно */
.bar { height: 8px; border-radius: 4px; background: #e9ebef; overflow: hidden; margin-bottom: 4px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.bar.green i { background: var(--ok); }
.chart { display: flex; align-items: flex-end; gap: 10px; height: 120px; padding-top: 10px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .col i { display: block; width: 100%; max-width: 44px; background: var(--accent); border-radius: 6px 6px 2px 2px; min-height: 3px; }
.chart .col.empty i { background: #e9ebef; }
.chart .col small { font-size: 11px; color: var(--muted); }
.chart .col b { font-size: 11px; }
.day { display: flex; align-items: center; gap: 8px; }
.day b { font-size: 15px; }

/* ---------- карточка заявки ---------- */
.two { display: grid; grid-template-columns: minmax(320px, .9fr) minmax(0, 1.3fr); gap: 16px; align-items: start; }
.two > .card + .card { margin-top: 0; }
.money { grid-column: 1 / -1; display: flex; gap: 22px; flex-wrap: wrap; align-items: baseline; background: var(--panel-2); border-radius: var(--r-sm); padding: 12px 16px; }
.money .label { display: block; font-size: 12px; color: var(--muted); }
.money b { font-size: 16px; }
.stop { display: flex; gap: 12px; align-items: flex-start; padding: 11px 18px; border-bottom: 1px solid var(--line); }
.stop:last-child { border-bottom: 0; }
.stop.cur { background: #f1faf5; }
.stop-n { width: 30px; height: 30px; border-radius: 50%; background: #eceef2; color: var(--muted); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; flex: none; }
.stop.done .stop-n { background: var(--ok-soft); color: var(--ok); }
.stop.fail .stop-n { background: var(--red-soft); color: var(--red); }
.stop.cur .stop-n { background: var(--accent); color: #fff; }
.stop-b { flex: 1; min-width: 0; }
.stop-b .sub { font-size: 12px; color: var(--muted); }
.stop-b .tag { margin-right: 4px; }
.photo img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
.stop-act { display: flex; gap: 2px; flex: none; margin-left: auto; }
.add { border-top: 1px solid var(--line); }
.add .form-grid .field { margin: 0; }
.more { margin-top: 12px; }
.more > summary { cursor: pointer; color: var(--accent-dark); font-weight: 600; font-size: 13px; margin-bottom: 10px; list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.linkbox { background: var(--panel-2); border-radius: var(--r-sm); padding: 12px 14px; }
.linkbox .label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.linkbox .row { display: flex; gap: 8px; }
.linkbox .input { background: #fff; font-size: 12px; }

/* ---------- вход ---------- */
/* вход: слева крупная зелёная Газель, справа форма; на телефоне машина сверху */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr); gap: 16px; padding: 16px; }
.login-art { position: relative; border-radius: 28px; background: linear-gradient(180deg, #dddee2 0%, #e6e8ec 100%); overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 300px; }
/* края фото растворяются в фоне панели — не видно прямоугольника картинки */
.login-art img { width: 86%; max-width: 980px; height: auto; display: block; animation: drive-in 1.2s cubic-bezier(.2,.8,.2,1) .1s both;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 7%, #000 93%, transparent 100%); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 7%, #000 93%, transparent 100%); mask-composite: intersect; }
.login-art .brand { position: absolute; left: 24px; top: 22px; }
.login-form { display: flex; align-items: center; justify-content: center; }
.login .card { width: 100%; max-width: 380px; padding: 30px; border-radius: 24px; }
.login h1 { font-size: 26px; margin-bottom: 18px; }
.login .field { margin-bottom: 12px; }
.login .btn.primary { height: 48px; font-size: 15px; margin-top: 6px; }
@keyframes drive-in { 0% { opacity: 0; transform: translateX(-28%); } 70% { opacity: 1; transform: translateX(1.5%); } 100% { transform: none; } }
@media (max-width: 860px) {
  .login { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .login-art { min-height: 0; padding: 64px 12px 18px; }
  .login-art img { width: 92%; }
  .login .card { max-width: none; padding: 22px; }
}
.login-art .brand img { animation: none; width: 46px; }  /* логотип стоит на месте, едет только машина */
@media (prefers-reduced-motion: reduce) { .login-art img { animation: none; } }

@media (max-width: 980px) {
  .top-in { grid-template-columns: 1fr auto; height: auto; padding: 10px 16px; row-gap: 10px; }
  .nav { grid-column: 1 / -1; grid-row: 2; overflow-x: auto; }
  .content { padding: 16px 16px 40px; }
  .hero, .two, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .hero-info { position: static; width: auto; margin: 14px 14px 0; }
  .hero-main { min-height: 0; }
  .hero-img.wide { aspect-ratio: 1.45; margin-top: 12px; }
  .hero-main { min-height: 0; }
  .route-row { flex-wrap: wrap; }
  .route-row .prog { width: 100%; }
  .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 22px; }
}
@media (max-width: 1180px) {
  .me .who { display: none; }
  .route-row .prog { width: 150px; }
}
@media (max-width: 600px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 10px 12px; gap: 8px; }
  .tile .value { font-size: 20px; }
  .tile-ic { width: 34px; height: 34px; }
}

/* ---------- движение ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .55s cubic-bezier(.2,.8,.2,1) both; }
.tile, .card, .btn, .route-row { transition: transform .18s ease, box-shadow .18s ease; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16,20,28,.08); }
.btn.primary:hover, .btn.dark:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(19,97,77,.25); }
.btn:active { transform: translateY(0) scale(.98); }
.nav a { transition: background .18s, color .18s; }
.tag.warn { animation: pulse 2.2s ease-in-out 3; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(199,128,26,.3); } 50% { box-shadow: 0 0 0 6px rgba(199,128,26,0); } }
@media (prefers-reduced-motion: reduce) { .rise { animation: none; } .tag.warn { animation: none; } }

/* строка фильтров над таблицей */
.filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filters .input { height: 40px; }
.filters input.input { flex: 1; min-width: 200px; max-width: 360px; }
.filters select.input { width: 190px; }

/* ---------- телефон, как в примере: шапка с профилем, меню значками внизу, карточка рейса с машиной целиком ---------- */
@media (max-width: 600px) {
  /* размытие шапки делает её «рамкой» для fixed-элементов — меню прилипало бы к шапке, а не к низу экрана */
  .top { -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff; }
  .top-in { grid-template-columns: 1fr auto; padding: 10px 16px; }
  .nav { position: fixed; z-index: 30; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); grid-row: auto; grid-column: auto;
         justify-content: space-around; background: #fff; border-radius: 22px; padding: 8px; box-shadow: 0 10px 30px rgba(16,20,28,.16); overflow: visible; }
  .nav a { height: auto; padding: 0; background: transparent !important; box-shadow: none !important; font-size: 0; gap: 0; }
  .nav a .ic { width: 44px; height: 44px; padding: 12px; border-radius: 50%; background: var(--bg); color: var(--muted); }
  .nav a.on .ic { background: var(--accent); color: #fff; }
  .content { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 14px; }
  .tile { border-radius: 18px; }
  .tile-ic { background: #fff; box-shadow: 0 1px 4px rgba(16,20,28,.08); }

  .hero-main { display: flex; flex-direction: column; padding: 16px; border-radius: 20px; }
  .hero-info { display: contents; }
  .hero-info .h { order: 1; margin-bottom: 4px; }
  .hero-info .big { order: 2; font-size: 22px; }
  .hero-img.wide { order: 3; aspect-ratio: auto; background: transparent; margin: 10px -4px 6px; flex: none; }
  .hero-img.wide img { position: static; width: 100%; height: auto; object-fit: contain; border-radius: 14px; }
  .hero-kvs { order: 4; }
  .hero-kvs .kv { background: var(--panel-2); border: 0; border-radius: 10px; padding: 9px 12px; margin-top: 6px; }
  /* строка рейса: название на всю ширину, ниже полоса и статус */
  .route-row { padding: 14px 16px; gap: 8px 12px; }
  .route-row .main { flex: 1 1 100%; }
  .route-row .prog { flex: 1; width: auto; }
  /* кнопки в заголовке рейса — одной строкой, компактно */
  .page-head { gap: 8px; }
  .page-head .lead { flex: 1 1 100%; }
  .page-head > .btn, .page-head .btn-row .btn { height: 34px; padding: 0 12px; font-size: 12px; }
  .page-head .btn-row { gap: 6px; }
}

/* правая карточка: водитель, ход, точки; кнопка прижата к низу */
.card-body.side { display: flex; flex-direction: column; gap: 12px; height: 100%; }
.card-body.side .btn { margin-top: auto; align-self: flex-start; }
.pts { display: flex; flex-direction: column; }
.pt-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; position: relative; }
.pt-row i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line-2); background: #fff; flex: none; position: relative; z-index: 1; }
.pt-row:not(:last-child)::after { content: ''; position: absolute; left: 4px; top: 19px; bottom: -7px; width: 2px; background: var(--line); }
.pt-row span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-row small { color: var(--muted); white-space: nowrap; }
.pt-row.done i { background: var(--ok); border-color: var(--ok); }
.pt-row.fail i { background: var(--red); border-color: var(--red); }
.pt-row.fail small { color: var(--red); }
.pt-row.cur i { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pt-row.cur span { font-weight: 700; }
.pt-more { font-size: 12px; color: var(--muted); padding: 4px 0 0 20px; }
.kvs-mini { margin-top: 12px; }
.kvs-mini .kv b { max-width: 60%; }
.add .field .lbl { margin-bottom: 4px; }
@media (max-width: 600px) {
  .card-body.side .btn { align-self: stretch; }
}

/* выбор машины картинкой: от тоннажа зависит, какая машина нарисована везде (07.11.2026) */
.vpick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.vp { position: relative; display: block; cursor: pointer; }
.vp input { position: absolute; opacity: 0; pointer-events: none; }
.vp-in { display: flex; flex-direction: column; align-items: center; gap: 1px; height: 100%; padding: 6px 6px 9px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--panel); text-align: center; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.vp:hover .vp-in { transform: translateY(-1px); }
.vp input:checked + .vp-in { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.vp input:focus-visible + .vp-in { box-shadow: 0 0 0 3px var(--accent-soft); }
.vp-img { display: block; width: 100%; border-radius: 9px; overflow: hidden; background: #e1e0e5; margin-bottom: 5px; }
.vp-img img { display: block; width: 100%; height: auto; }
.vp b { font-size: 14px; }
.vp small { font-size: 11px; color: var(--muted); line-height: 1.2; }
@media (max-width: 600px) { .vpick { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* машина водителя в списке «Водители» */
.v-thumb { display: block; width: 92px; height: auto; border-radius: 9px; background: #e1e0e5; flex: none; }
.vcell { display: flex; align-items: center; gap: 12px; }

/* кабинет клиента: крупная плитка «Новая заявка» с машиной, рядом показатели 2×2 (07.11.2026) */
.c-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 16px; }
.c-top .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.new-tile { position: relative; display: flex; align-items: flex-end; min-height: 200px; padding: 20px 22px; border-radius: var(--r); background: linear-gradient(180deg, #dddee2 0%, #e6e8ec 100%); overflow: hidden; color: var(--text); box-shadow: var(--shadow); }
.new-tile img { position: absolute; right: -2%; bottom: -4%; height: 108%; width: auto; max-width: none; transition: transform .35s cubic-bezier(.2,.8,.2,1);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 8%, #000 92%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 8%, #000 92%, transparent 100%); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0, #000 8%, #000 92%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 8%, #000 92%, transparent 100%); mask-composite: intersect; }
.new-tile:hover img { transform: translateX(-3%); }
.nt-text { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.nt-plus { width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 18px rgba(21, 116, 79, .3); }
.nt-plus .ic { width: 22px; height: 22px; stroke-width: 2.2; }
.nt-text b { font-size: 24px; line-height: 1.12; letter-spacing: -.01em; }
@media (max-width: 860px) { .c-top { grid-template-columns: minmax(0, 1fr); } .new-tile { min-height: 170px; } }
@media (max-width: 600px) { .new-tile { min-height: 158px; padding: 16px 18px; } .new-tile img { height: 86%; right: -7%; bottom: 0; } .nt-text b { font-size: 21px; } .nt-plus { width: 44px; height: 44px; } }

/* виды груза (07.11.2026): цвет плашки по температуре — серый без холода, оранжевый «боится мороза»,
   синий охлаждённый, фиолетовый заморозка, зелёный овощи и фрукты */
.t-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.tone-grey { background: #eef0f2; color: #4a5059; }
.tone-orange { background: #fff1dc; color: #9a5b00; }
.tone-blue { background: #e6f0fd; color: #1f5fc4; }
.tone-violet { background: #efe9fd; color: #5b3cc4; }
.tone-green { background: #e3f4ea; color: #12703f; }
.cpick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cp { position: relative; display: block; cursor: pointer; }
.cp input { position: absolute; opacity: 0; pointer-events: none; }
.cp-in { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; height: 100%; padding: 6px 6px 10px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--panel); transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.cp:hover .cp-in { transform: translateY(-1px); }
.cp input:checked + .cp-in { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cp input:focus-visible + .cp-in { box-shadow: 0 0 0 3px var(--accent-soft); }
.cp-img { display: block; width: 100%; aspect-ratio: 1.5; border-radius: 10px; overflow: hidden; background: #e4e4e8; margin-bottom: 6px; }
.cp-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cp b { font-size: 13px; padding: 0 4px; }
.cp small { font-size: 11px; color: var(--muted); line-height: 1.25; padding: 0 4px; }
.cp .t-badge { margin: 4px 4px 0; }
@media (max-width: 600px) { .cpick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Точки маршрута (09.11.2026): линия от склада, метки окна и мест, три способа добавить вкладками */
.stops-card .card-head { gap: 12px; }
.stops-sum { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 13px; color: var(--muted); }
.stops-sum > span { background: #f1f3f5; border-radius: 999px; padding: 4px 10px; font-weight: 600; }
.rt { padding: 6px 0; }
.rt-row { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 12px 18px; border: 0; }
.rt-row::before { content: ''; position: absolute; left: 32px; top: 0; bottom: 0; width: 2px; background: #e3e7ea; }
.rt-row:first-child::before { top: 26px; }
.rt-row:last-child::before { bottom: calc(100% - 26px); }
.rt-n { position: relative; z-index: 1; width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 2px solid #d5dbe0; color: var(--muted); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; flex: none; }
.rt-start .rt-n { background: var(--accent); border-color: var(--accent); color: #fff; }
.rt-row.done .rt-n { background: var(--ok-soft); border-color: var(--ok-soft); color: var(--ok); }
.rt-row.fail .rt-n { background: var(--red-soft); border-color: var(--red-soft); color: var(--red); }
.rt-row.cur { background: #f1faf5; }
.rt-row.cur .rt-n { background: var(--accent); border-color: var(--accent); color: #fff; }
.rt-b { flex: 1; min-width: 0; padding-top: 4px; }
.rt-b b { display: block; font-size: 15px; }
.rt-b .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.rt-start .rt-b b { font-size: 13px; color: var(--muted); font-weight: 600; }
.rt-start .rt-b .sub { color: var(--ink, #111); font-size: 14px; }
.rt-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; padding-top: 4px; }
.chip { display: inline-flex; align-items: center; gap: 5px; background: #f1f3f5; border-radius: 8px; padding: 4px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip .ic { width: 13px; height: 13px; color: var(--muted); }
.chip.red { background: var(--red-soft); color: var(--red); }
.rt-row .stop-act { opacity: .35; transition: opacity .15s; padding-top: 2px; }
.rt-row:hover .stop-act { opacity: 1; }
.rt-empty { display: grid; justify-items: center; gap: 4px; padding: 30px 18px; margin: 14px 18px; border: 1.5px dashed #d5dbe0; border-radius: 16px; text-align: center; color: var(--muted); font-size: 13px; }
.rt-empty .ic { width: 26px; height: 26px; color: var(--accent); margin-bottom: 4px; }
.rt-empty b { color: var(--ink, #111); font-size: 15px; }
.seg { display: inline-flex; background: #f1f3f5; border-radius: 12px; padding: 4px; gap: 2px; margin-bottom: 14px; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink, #111); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.add-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.add-row + .add-row { margin-top: 12px; }
.add-row2 { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.add-row2 > .field:first-child { grid-column: 1 / -1; }
.win .input { flex: 1; }
.add-row .field { margin: 0; }
.win { display: flex; align-items: center; gap: 8px; }
.win .input { min-width: 0; }
.win span { color: var(--muted); }
.add-row2 .btn { height: 44px; white-space: nowrap; }
.drop { display: grid; justify-items: center; gap: 4px; padding: 26px 18px; border: 1.5px dashed #cdd5db; border-radius: 16px; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; }
.drop .ic { width: 24px; height: 24px; color: var(--accent); }
.drop b { color: var(--ink, #111); font-size: 14px; }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
@media (max-width: 760px) {
  .add-row, .add-row2 { grid-template-columns: minmax(0, 1fr); }
  .rt-row { flex-wrap: wrap; }
  .rt-tags { width: 100%; justify-content: flex-start; padding-left: 44px; }
  .rt-row .stop-act { opacity: 1; }
}

/* Кабинет клиента (09.11.2026): машина в пути, расходы, график, уведомления */
.cx-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.cx-main { display: grid; gap: 16px; min-width: 0; }
.cx-main > .card { margin: 0; }
.cx-live { display: block; background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px; color: inherit; overflow: hidden; }
.cx-live-top { display: flex; align-items: center; gap: 10px; }
.cx-live-top .muted { margin-left: auto; }
.live-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 6px; animation: cxpulse 1.6s ease-in-out 3; }
@keyframes cxpulse { 50% { opacity: .25; } }
.cx-live-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: center; }
.cx-live-body img { width: 100%; height: auto; }
.cx-big { font-size: 44px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.cx-big small { font-size: 18px; color: var(--muted); font-weight: 600; }
.cx-live-info .bar { margin: 12px 0; }
.cx-now { display: flex; gap: 6px; align-items: center; background: #f1faf5; border-radius: 10px; padding: 8px 10px; font-size: 14px; margin-bottom: 8px; }
.cx-now .ic { color: var(--accent); }
.cx-money-top { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr); gap: 20px; align-items: start; }
.cx-sum { font-size: 38px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.cx-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-left: 1px solid var(--line); }
.cx-kpis > div { padding: 6px 14px 10px; }
.cx-kpis > div:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
.cx-kpis span { display: block; font-size: 12px; color: var(--muted); }
.cx-kpis b { font-size: 18px; font-variant-numeric: tabular-nums; }
.cx-kpis b.red { color: var(--red); }
.cx-chart { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; align-items: end; height: 120px; margin: 20px 0 8px; }
.cx-col { display: grid; grid-template-rows: 1fr auto; height: 100%; text-align: center; gap: 4px; }
.cx-col i { align-self: end; display: block; min-height: 3px; border-radius: 6px 6px 3px 3px; background: #cfe7db; }
.cx-col.today i { background: var(--accent); }
.cx-col span { font-size: 11px; color: var(--muted); }
.cx-price { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cx-feed { position: sticky; top: 84px; margin: 0; }
.cx-feed .card-body { max-height: calc(100vh - 160px); overflow: auto; }
.ev { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: inherit; align-items: flex-start; }
.ev:last-child { border-bottom: 0; }
.ev:hover { background: #fbfbfc; }
.ev-ic { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; background: #eef1f4; color: var(--muted); }
.ev.ok .ev-ic { background: var(--ok-soft); color: var(--ok); }
.ev.bad .ev-ic { background: var(--red-soft); color: var(--red); }
.ev.go .ev-ic, .ev.fin .ev-ic { background: #e6f2ec; color: var(--accent); }
.ev-b { flex: 1; min-width: 0; }
.ev-b b { display: block; font-size: 14px; }
.ev-b .sub { font-size: 12px; color: var(--muted); }
.ev-t { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ev-ph { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; }
@media (max-width: 1100px) { .cx-grid { grid-template-columns: minmax(0, 1fr); } .cx-feed { position: static; } .cx-feed .card-body { max-height: 420px; } }
@media (max-width: 760px) {
  .cx-live-body, .cx-money-top { grid-template-columns: minmax(0, 1fr); }
  .cx-kpis { border-left: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cx-kpis > div:nth-child(-n+3) { border-bottom: 0; }
  .cx-chart { gap: 3px; height: 96px; }
  .cx-sum { font-size: 32px; }
}
.tag.live-dot { background: var(--ok-soft); color: var(--ok); }
@media (max-width: 1100px) { .cx-grid { display: flex; flex-direction: column; } .cx-feed { order: -1; width: 100%; } .cx-feed .card-body { max-height: 260px; } .cx-main { width: 100%; } }

/* Ставки клиента (09.11.2026) */
.rate-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.rate-row:last-child { border-bottom: 0; }
.rate-row.old { opacity: .5; }
.rate-main { flex: 1; min-width: 0; }
.rate-main .sub { font-size: 13px; color: var(--muted); }
.rate-empty { padding: 16px 18px; color: var(--red); font-size: 13px; }
.rate-warn { background: var(--red-soft); color: var(--red); border-radius: 10px; padding: 8px 12px; font-size: 13px; margin-top: 8px; }
.cx-terms .rate-row { padding: 10px 16px; }
