:root{
  /* фирменные цвета CaravanGo (из логотипа): тёмно-зелёный #1E7848, зелёный #2A9C54, оранжевый #F67200 */
  --bg:#f3f6f4; --surface:#ffffff; --ink:#16251c; --muted:#5a6b61; --line:#d8e2db;
  --accent:#1E7848; --accent-ink:#ffffff; --accent-soft:#e4f2e9;
  --brand:#2A9C54; --orange:#F67200; --orange-ink:#2A1300; --orange-soft:#fff0e2;
  --ok:#2e8a57; --warn:#c2412d; --warn-bg:#fbe8e3;
  --c0:#2f7d4f; --c1:#2a5fa8; --c2:#b0362b; --c3:#7a4fb0; --c4:#1f7f86; --c5:#8a5a1c; --c6:#b03a78; --c7:#4a5b6e;
  --chart:#2A9C54; --chart-track:#e3ebe6; --pay:#b35400; --pay-bg:#fff1e3;
  --top-bg:#ffffff; --top-ink:#16251c;
  --shadow:0 1px 2px rgba(18,40,26,.06),0 4px 14px rgba(18,40,26,.05);
  --font-display:'Montserrat','Segoe UI',system-ui,sans-serif;
  --font-body:'IBM Plex Sans',system-ui,-apple-system,'Segoe UI',sans-serif;
  --font-mono:'IBM Plex Mono',ui-monospace,Menlo,monospace;
  color-scheme:light;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#0d1410; --surface:#152019; --ink:#e3eee7; --muted:#93a69a; --line:#26352c;
    --accent:#3DBB6A; --accent-ink:#06210f; --accent-soft:#163323;
    --brand:#4CC47A; --orange:#FF8A1E; --orange-ink:#2A1300; --orange-soft:#3a2410;
    --ok:#53c287; --warn:#f07a64; --warn-bg:#3a1f1a;
    --c0:#5cbf84; --c1:#6c9ee8; --c2:#ec7a6c; --c3:#b393e6; --c4:#5cc4cc; --c5:#d9a25c; --c6:#e77fb6; --c7:#9fb0c4;
    --chart:#3DAA62; --chart-track:#23302a; --pay:#ffa04d; --pay-bg:#3a2410;
    --top-bg:#121a15; --top-ink:#e3eee7;
    --shadow:none; color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#0d1410; --surface:#152019; --ink:#e3eee7; --muted:#93a69a; --line:#26352c;
  --accent:#3DBB6A; --accent-ink:#06210f; --accent-soft:#163323;
  --brand:#4CC47A; --orange:#FF8A1E; --orange-ink:#2A1300; --orange-soft:#3a2410;
  --ok:#53c287; --warn:#f07a64; --warn-bg:#3a1f1a;
  --c0:#5cbf84; --c1:#6c9ee8; --c2:#ec7a6c; --c3:#b393e6; --c4:#5cc4cc; --c5:#d9a25c; --c6:#e77fb6; --c7:#9fb0c4;
  --chart:#3DAA62; --chart-track:#23302a; --pay:#ffa04d; --pay-bg:#3a2410;
  --top-bg:#121a15; --top-ink:#e3eee7;
  --shadow:none; color-scheme:dark;
}
*{box-sizing:border-box}
html,body{margin:0}
body{background:var(--bg);color:var(--ink);font-family:var(--font-body);font-size:15px;line-height:1.45;-webkit-font-smoothing:antialiased}
body.locked{overflow:hidden}
h1,h2,h3{font-family:var(--font-display);font-weight:600;letter-spacing:.01em;text-wrap:balance;margin:0}
button,input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
svg.i{width:15px;height:15px;flex:none;vertical-align:-2px}
.wrap{max-width:860px;margin:0 auto;padding:16px 16px 120px;display:flex;flex-direction:column;gap:14px}

/* header */
.top{position:sticky;top:0;z-index:5;background:#151c22;color:#eef1f3;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px;border-bottom:3px solid var(--accent)}
.brand{display:flex;align-items:center;gap:10px;min-width:0}
.brand-mark{width:32px;height:32px;border-radius:5px;background:repeating-linear-gradient(135deg,var(--accent) 0 6px,#1d1300 6px 12px);flex:none}
.brand-name{font-family:var(--font-display);font-size:18px;line-height:1.1;text-transform:uppercase;letter-spacing:.05em}
.brand-sub{font-size:13px;opacity:.75;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.top .btn{background:transparent;color:#eef1f3;border-color:rgba(238,241,243,.3)}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--line);background:var(--surface);border-radius:9px;padding:10px 15px;font-weight:500;cursor:pointer;white-space:nowrap}
.btn:hover{border-color:var(--muted)}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink);font-weight:600}
.btn.primary:hover{filter:brightness(1.05)}
.btn.ghost{background:transparent}
.btn.danger{color:var(--warn);border-color:color-mix(in srgb,var(--warn) 45%,transparent)}
.btn.wide{width:100%}
.btn.mini{padding:7px 12px;font-size:13.5px}
.icon{width:36px;height:36px;border-radius:9px;border:1px solid var(--line);background:var(--surface);cursor:pointer;flex:none;font-size:18px;line-height:1}
.linkbtn{border:0;background:none;color:var(--muted);text-decoration:underline;cursor:pointer;padding:0;font-size:13px}

/* summary */
.summary{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.tile{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:10px 13px;box-shadow:var(--shadow)}
.tile b{display:block;font-family:var(--font-display);font-size:28px;line-height:1.1;font-variant-numeric:tabular-nums}
.tile span{font-size:12.5px;color:var(--muted)}
.tile.warn{border-color:color-mix(in srgb,var(--warn) 45%,transparent);background:var(--warn-bg)}
.tile.warn b{color:var(--warn)}

/* tabs + toolbar */
.tabs{display:flex;gap:4px;border-bottom:1px solid var(--line)}
.tab{border:0;background:none;padding:10px 14px;cursor:pointer;color:var(--muted);font-weight:500;border-bottom:3px solid transparent;margin-bottom:-1px}
.tab[aria-selected="true"]{color:var(--ink);border-bottom-color:var(--accent)}
.tab .n{font-size:12px;color:var(--muted);margin-left:4px}
.toolbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.chips{display:flex;flex-wrap:wrap;gap:6px;width:100%}
.chip{border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:6px 13px;font-size:13.5px;cursor:pointer}
.chip[aria-pressed="true"]{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.search{flex:1 1 220px;min-width:0;border:1px solid var(--line);background:var(--surface);border-radius:9px;padding:10px 12px}

/* cards */
#list{display:flex;flex-direction:column;gap:10px}
.card{background:var(--surface);border:1px solid var(--line);border-left:5px solid var(--line);border-radius:12px;padding:12px 14px;display:flex;flex-direction:column;gap:8px;cursor:pointer;box-shadow:var(--shadow)}
.card:hover{border-color:var(--muted)}
.card.co-l-c0{border-left-color:var(--c0)}.card.co-l-c1{border-left-color:var(--c1)}.card.co-l-c2{border-left-color:var(--c2)}.card.co-l-c3{border-left-color:var(--c3)}.card.co-l-c4{border-left-color:var(--c4)}.card.co-l-c5{border-left-color:var(--c5)}.card.co-l-c6{border-left-color:var(--c6)}.card.co-l-c7{border-left-color:var(--c7)}
.card.is-stale{background:linear-gradient(90deg,var(--warn-bg),var(--surface) 55%)}
.card-top{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.pick{display:flex;align-items:center;padding:4px;margin:-4px 0 -4px -4px;cursor:pointer}
.pick input{width:19px;height:19px;accent-color:var(--accent);cursor:pointer}
.plate{font-family:var(--font-mono);font-weight:600;font-size:14px;letter-spacing:.05em;background:#fff;color:#111;border:2px solid #111;border-radius:4px;padding:0 6px;white-space:nowrap}
.co{font-size:12px;font-weight:600;border:1px solid currentColor;border-radius:4px;padding:1px 6px;white-space:nowrap}
.co-c0{color:var(--c0)}.co-c1{color:var(--c1)}.co-c2{color:var(--c2)}.co-c3{color:var(--c3)}.co-c4{color:var(--c4)}.co-c5{color:var(--c5)}.co-c6{color:var(--c6)}.co-c7{color:var(--c7)}
.upd{margin-left:auto;font-size:12.5px;color:var(--muted);white-space:nowrap}
.upd.warn{color:var(--warn);font-weight:600}
.st-name{font-family:var(--font-display);font-size:19px;line-height:1.25;font-weight:500}
.st-loc{display:flex;gap:5px;align-items:baseline;color:var(--muted);font-size:14px}
.card-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;border-top:1px dashed var(--line);padding-top:8px}
.meta{font-size:13px;color:var(--muted);min-width:0}
.meta b{color:var(--ink);font-weight:500}
.days{font-size:12px;font-weight:600;background:var(--accent-soft);color:var(--ink);border-radius:999px;padding:2px 9px;white-space:nowrap}
.done{font-size:12px;font-weight:600;color:var(--ok);white-space:nowrap}
.empty{text-align:center;color:var(--muted);padding:40px 16px;border:1px dashed var(--line);border-radius:12px}

/* bulk bar */
.bulk{position:fixed;left:0;right:0;bottom:0;z-index:6;background:#151c22;color:#eef1f3;padding:12px 16px;display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap}
.bulk .btn.ghost{color:#eef1f3;border-color:rgba(238,241,243,.3)}

/* sheet / modal */
.overlay{position:fixed;inset:0;z-index:20;background:rgba(10,14,18,.55);display:flex;align-items:flex-end;justify-content:center}
.sheet{background:var(--bg);width:100%;max-width:640px;max-height:94%;border-radius:16px 16px 0 0;display:flex;flex-direction:column;overflow:hidden}
@media (min-width:700px){.overlay{align-items:center}.sheet{border-radius:16px;max-height:88%}}
.sheet-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 16px;border-bottom:1px solid var(--line);background:var(--surface)}
.sheet-head h2{font-size:19px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.sheet-body{overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:16px}
.now{background:var(--surface);border:1px solid var(--line);border-top:4px solid var(--accent);border-radius:12px;padding:13px 15px;display:flex;flex-direction:column;gap:6px}
.now.closed{border-top-color:var(--ok)}
.now .label{font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);display:flex;gap:8px;align-items:center}
.now .val{font-family:var(--font-display);font-size:23px;line-height:1.2}
.now .com{font-size:14px;color:var(--muted)}
.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px;background:var(--line);border:1px solid var(--line);border-radius:12px;overflow:hidden}
.grid div{background:var(--surface);padding:8px 12px}
.grid dt{font-size:12px;color:var(--muted)}
.grid dd{margin:0;font-weight:500;overflow-wrap:anywhere}
.grid .full{grid-column:1/-1}
h3.sec{font-size:14px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}
.timeline{list-style:none;margin:0;padding:0 0 0 6px;display:flex;flex-direction:column}
.timeline li{position:relative;padding:0 0 16px 22px;border-left:2px solid var(--line)}
.timeline li:last-child{border-left-color:transparent;padding-bottom:0}
.timeline li::before{content:"";position:absolute;left:-7px;top:4px;width:12px;height:12px;border-radius:50%;background:var(--bg);border:2px solid var(--muted)}
.timeline li:first-child::before{background:var(--accent);border-color:var(--accent);box-shadow:0 0 0 4px var(--accent-soft)}
.tl-head{display:flex;gap:8px;align-items:baseline;justify-content:space-between}
.tl-time{font-size:12.5px;color:var(--muted);font-variant-numeric:tabular-nums}
.tl-st{font-weight:600;font-size:15.5px}
.tl-loc{font-size:14px;color:var(--muted);display:flex;gap:5px;align-items:baseline}
.tl-com{font-size:13.5px;margin-top:2px;padding:6px 9px;background:var(--surface);border:1px solid var(--line);border-radius:8px}
.actions{display:flex;flex-wrap:wrap;gap:8px}
.actions .btn{flex:1 1 auto}
.closed-tag{font-size:11.5px;font-weight:600;color:var(--ok);border:1px solid currentColor;border-radius:4px;padding:0 6px;letter-spacing:0;text-transform:none}

/* forms */
form.f{display:flex;flex-direction:column;gap:12px}
.field{display:flex;flex-direction:column;gap:5px;min-width:0}
.field label{font-size:13px;font-weight:500;color:var(--muted)}
.field input,.field select,.field textarea{border:1px solid var(--line);background:var(--surface);border-radius:9px;padding:10px 12px;width:100%;min-width:0}
.field textarea{resize:vertical}
.field.big textarea{font-size:16.5px;font-weight:500}
.sugg{display:flex;gap:6px;overflow-x:auto;padding-bottom:2px;scrollbar-width:thin}
.sugg button{flex:none;border:1px dashed var(--line);background:var(--surface);border-radius:999px;padding:5px 11px;font-size:13px;cursor:pointer;color:var(--ink)}
.sugg button:hover{border-color:var(--accent);border-style:solid}
.sugg-label{font-size:12px;color:var(--muted)}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.row3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px}
.check{display:flex;align-items:center;gap:9px;font-size:14px;padding:10px 12px;border:1px solid var(--line);border-radius:9px;background:var(--surface);cursor:pointer}
.check input{width:19px;height:19px;accent-color:var(--ok)}
.err{color:var(--warn);font-size:13.5px;margin:0}
.hint{color:var(--muted);font-size:13.5px;margin:0}
fieldset{border:1px solid var(--line);border-radius:12px;padding:12px;margin:0;display:flex;flex-direction:column;gap:10px;background:var(--surface);min-width:0}
legend{font-family:var(--font-display);font-size:14px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);padding:0 6px}
fieldset .field input,fieldset .field textarea,fieldset .field select{background:var(--bg)}
.co-fixed{display:flex;align-items:center;gap:8px;font-size:14px}
.pick-co{display:flex;flex-direction:column;gap:10px}
.co-btn{justify-content:space-between;padding:18px 16px;font-family:var(--font-display);font-size:20px;border-left:6px solid currentColor;box-shadow:var(--shadow)}
.co-btn small{font-family:var(--font-body);font-size:13px;color:var(--muted);font-weight:400}
.thumbs{display:flex;flex-wrap:wrap;gap:8px}
.thumb{position:relative;width:84px;height:84px;border:1px solid var(--line);border-radius:9px;overflow:hidden;padding:0;background:var(--surface);cursor:pointer;display:block}
.thumb img{width:100%;height:100%;object-fit:cover;display:block}
.thumb-x{position:absolute;top:3px;right:3px;width:24px;height:24px;border-radius:50%;border:0;background:rgba(0,0,0,.65);color:#fff;cursor:pointer;line-height:1}
.photo-big{max-width:100%;border-radius:9px;border:1px solid var(--line)}

/* login */
.login{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px 16px}
.login-card{width:100%;max-width:380px;background:var(--surface);border:1px solid var(--line);border-top:4px solid var(--accent);border-radius:16px;padding:24px;display:flex;flex-direction:column;gap:18px;box-shadow:var(--shadow)}
.login-card .brand-sub{opacity:1;color:var(--muted)}
.login-card .field input{background:var(--bg)}

#toast{position:fixed;left:50%;bottom:84px;transform:translateX(-50%);z-index:30;background:#151c22;color:#eef1f3;padding:10px 16px;border-radius:9px;font-size:14px;pointer-events:none;opacity:0;transition:opacity .2s;max-width:calc(100% - 32px);text-align:center}
#toast.show{opacity:1}
@media (prefers-reduced-motion:reduce){#toast{transition:none}}
@media (max-width:420px){.row3{grid-template-columns:1fr 1fr}.tile b{font-size:23px}.st-name{font-size:18px}}

/* --- серверная версия --- */
.top .btn.mini{color:#eef1f3}
.loading{min-height:60vh;display:flex;align-items:center;justify-content:center;color:var(--muted)}
.btn[disabled]{opacity:.6;cursor:progress}
.btn.danger:hover{border-color:var(--warn)}
.menu{display:flex;flex-direction:column;gap:8px}
.menu .btn{justify-content:flex-start;padding:14px 16px}
.who{font-size:13.5px;color:var(--muted)}
.who b{color:var(--ink)}
.list{background:var(--surface);border:1px solid var(--line);border-radius:12px;overflow:hidden}
.list-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 12px;border-top:1px solid var(--line)}
.list-row:first-child{border-top:0}
.list-row .grow{flex:1 1 140px;min-width:0;overflow-wrap:anywhere}
.list-row .sub{font-size:12.5px;color:var(--muted)}
.inline{display:flex;gap:8px;align-items:flex-end;flex-wrap:wrap}
.inline .field{flex:1 1 160px}
.pw-wrap{display:flex;gap:6px}
.pw-wrap input{flex:1}
.toolbar .btn{flex:none}
.sync{font-size:12px;color:var(--muted);text-align:right}
/* блоки в окне не сжимаются (иначе таблица «Данные машины» схлопывалась в 2px) */
.sheet-body>*{flex-shrink:0}
a.btn{text-decoration:none;color:inherit}

/* --- готовые статусы (этапы) --- */
.stages{display:grid;grid-template-columns:repeat(auto-fill,minmax(155px,1fr));gap:6px}
.stage-btn{display:flex;gap:8px;align-items:flex-start;text-align:left;border:1px solid var(--line);background:var(--surface);border-radius:9px;padding:10px 11px;font-size:14px;line-height:1.25;cursor:pointer;min-height:44px}
.stage-btn:hover{border-color:var(--muted)}
.stage-btn .num{flex:none;min-width:18px;font-family:var(--font-mono);font-size:12.5px;color:var(--muted);padding-top:1px}
.stage-btn.done{color:var(--muted);background:transparent}
.stage-btn.done .num{color:var(--ok)}
.stage-btn.next{border:2px dashed var(--accent);padding:9px 10px}
.stage-btn.final{border-left:4px solid var(--ok)}
.stage-btn[aria-pressed="true"]{background:var(--accent);border-color:var(--accent);color:var(--accent-ink);font-weight:600;border-style:solid}
.stage-btn[aria-pressed="true"] .num{color:var(--accent-ink)}
fieldset .stage-btn{background:var(--bg)}
.progress{display:flex;flex-direction:column;gap:5px}
.bar{display:flex;gap:3px}
.bar span{flex:1;height:6px;border-radius:3px;background:var(--line)}
.bar span.on{background:var(--accent)}
.progress.done .bar span{background:var(--ok)}
.pg-txt{font-size:12.5px;color:var(--muted)}
.now .pg-txt{font-size:13.5px;color:var(--ink)}
button.tile{text-align:left;font:inherit;color:inherit;cursor:pointer;width:100%}
button.tile:hover{border-color:var(--muted)}
.tile[aria-pressed="true"]{outline:2px solid var(--warn);outline-offset:-2px}
.pr-row{flex-wrap:nowrap;gap:8px}
.pr-row .num{font-family:var(--font-mono);color:var(--muted);min-width:18px;text-align:right}
.pr-row input[type=text]{flex:1 1 auto;min-width:0;border:1px solid var(--line);background:var(--bg);border-radius:8px;padding:8px 10px}
.pr-final{display:flex;align-items:center;gap:5px;font-size:13px;color:var(--muted);white-space:nowrap;cursor:pointer}
.pr-final input{accent-color:var(--ok);width:17px;height:17px}
.pr-btns{display:flex;gap:4px}
.pr-btns .icon{width:32px;height:32px;font-size:15px}
.icon[disabled]{opacity:.35;cursor:default}
@media (max-width:520px){.pr-row{flex-wrap:wrap}.pr-row input[type=text]{flex-basis:calc(100% - 30px)}.pr-final{margin-left:26px}.pr-btns{margin-left:auto}}

/* --- сводка (дашборд) --- */
.views{display:flex;gap:4px;background:var(--surface);border:1px solid var(--line);border-radius:11px;padding:4px;align-self:flex-start}
.views button{border:0;background:none;border-radius:8px;padding:8px 18px;font-weight:600;cursor:pointer;color:var(--muted)}
.views button[aria-pressed="true"]{background:var(--ink);color:var(--bg)}
.kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
@media (max-width:560px){.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:13px 14px;display:flex;flex-direction:column;gap:10px;box-shadow:var(--shadow)}
.panel .list{box-shadow:none}
.hbars{display:flex;flex-direction:column;gap:2px}
.hbar{position:relative;display:grid;grid-template-columns:minmax(110px,38%) 1fr 28px;align-items:center;gap:10px;border:0;background:none;padding:5px 4px;border-radius:7px;cursor:pointer;text-align:left;font-size:13.5px}
.hbar:hover:not([disabled]),.hbar:focus-visible{background:var(--bg)}
.hbar[disabled]{cursor:default}
.hbar.zero .hb-label{color:var(--muted)}
.hb-track{height:12px;background:var(--chart-track);border-radius:4px;overflow:hidden}
.hb-fill{display:block;height:100%;background:var(--chart);border-radius:0 4px 4px 0}
.hb-val{font-family:var(--font-mono);font-weight:600;text-align:right;font-variant-numeric:tabular-nums}
.hbar.zero .hb-val{color:var(--muted);font-weight:400}
.cols{display:grid;grid-template-columns:repeat(8,1fr);gap:6px;align-items:end;height:150px}
.col{position:relative;display:flex;flex-direction:column;align-items:center;gap:4px;height:100%;outline:none}
.col-val{font-family:var(--font-mono);font-size:12.5px;font-weight:600;min-height:16px}
.col-track{flex:1;width:100%;max-width:34px;display:flex;align-items:flex-end;border-bottom:1px solid var(--line)}
.col-fill{display:block;width:100%;background:var(--chart);border-radius:4px 4px 0 0}
.col-lbl{font-size:11px;color:var(--muted);white-space:nowrap}
.col:focus-visible .col-track{outline:2px solid var(--accent);outline-offset:2px}
.tip{position:absolute;left:50%;bottom:calc(100% + 4px);transform:translateX(-50%);background:#151c22;color:#eef1f3;font-size:12.5px;padding:5px 9px;border-radius:7px;white-space:nowrap;pointer-events:none;opacity:0;transition:opacity .12s;z-index:3}
.hbar .tip{left:auto;right:0;transform:none}
.hbar:hover .tip,.hbar:focus-visible .tip,.col:hover .tip,.col:focus-visible .tip{opacity:1}
@media (prefers-reduced-motion:reduce){.tip{transition:none}}
.tbl{width:100%;border-collapse:collapse;font-size:14px}
.tbl th,.tbl td{padding:8px 6px;border-top:1px solid var(--line);text-align:right;font-variant-numeric:tabular-nums}
.tbl thead th{border-top:0;font-size:12px;color:var(--muted);font-weight:500}
.tbl th[scope=row],.tbl thead th:first-child{text-align:left}
.tbl .warn-num{color:var(--pay);font-weight:600}
.linkrow{border:0;background:none;padding:0;cursor:pointer;text-align:left;color:inherit;font:inherit;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
button.list-row{width:100%;background:none;border:0;border-top:1px solid var(--line);cursor:pointer;text-align:left;color:inherit;font:inherit}
button.list-row:first-child{border-top:0}
button.list-row:hover{background:var(--bg)}
.ev-time{font-size:12.5px;color:var(--muted);min-width:96px}
/* --- оплата --- */
.pay-wait{color:var(--pay);font-weight:600}
.card.is-unpaid{background:linear-gradient(90deg,var(--pay-bg),var(--surface) 55%)}
.pay-tag{font-size:11.5px;font-weight:600;color:var(--pay);border:1px solid currentColor;border-radius:4px;padding:0 6px;letter-spacing:0;text-transform:none}
.now.unpaid{border-top-color:var(--pay)}
.tab .n.n-warn{color:var(--pay);font-weight:700}
.opt{font-weight:400;color:var(--muted)}
.pr-kind{border:1px solid var(--line);background:var(--bg);border-radius:8px;padding:8px;font-size:13px;max-width:190px}
@media (max-width:520px){.pr-kind{margin-left:26px;max-width:none;flex:1}}
@media (max-width:420px){.tabs .tab{padding:10px 9px}.hbar{grid-template-columns:minmax(96px,44%) 1fr 24px}}
button.list-row.linkrow{padding:10px 12px;gap:4px 10px;align-items:baseline}
@media (max-width:560px){button.list-row.linkrow .grow{flex-basis:100%}.ev-time{min-width:0}}
.tile.pay{border-color:color-mix(in srgb,var(--pay) 45%,transparent);background:var(--pay-bg)}
.tile.pay b{color:var(--pay)}

/* --- маршрут с машинкой (понятно клиенту без объяснений) --- */
.route{display:flex;flex-direction:column;gap:4px;padding:4px 0 2px}
.route-line{position:relative;height:6px;background:var(--chart-track);border-radius:3px;margin:14px 14px 0 4px}
.route-fill{position:absolute;left:0;top:0;bottom:0;background:var(--chart);border-radius:3px}
.route.done .route-fill{background:var(--ok)}
.route-truck{position:absolute;top:50%;width:30px;height:19px;transform:translate(-50%,-78%)}
.route-truck svg{width:100%;height:100%;display:block}
.route-ends{display:flex;justify-content:space-between;gap:10px;font-size:12.5px;color:var(--muted)}
.route-ends span:last-child{text-align:right;font-weight:600;color:var(--ink)}
.route-next{font-size:13px;color:var(--muted)}
.route-next b{color:var(--ink);font-weight:500}
/* --- отслеживание по этапам --- */
.tracker{list-style:none;margin:0;padding:0;background:var(--surface);border:1px solid var(--line);border-radius:12px;overflow:hidden}
.tracker li{position:relative;display:grid;grid-template-columns:22px 1fr auto;gap:10px;align-items:center;padding:9px 13px;font-size:14.5px}
.tracker li+li{border-top:1px solid var(--line)}
.tr-dot{width:20px;height:20px;border-radius:50%;border:2px solid var(--line);display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700}
.tracker .done .tr-dot{background:var(--ok);border-color:var(--ok);color:#fff}
.tracker .cur{background:var(--accent-soft)}
.tracker .cur .tr-dot{border-color:var(--accent);background:var(--accent);box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 25%,transparent)}
.tracker .cur.pay{background:var(--pay-bg)}
.tracker .cur.pay .tr-dot{border-color:var(--pay);background:var(--pay)}
.tracker .cur .tr-label{font-weight:600}
.tracker .todo{color:var(--muted)}
.tr-now{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--accent-ink);background:var(--accent);border-radius:4px;padding:1px 5px;margin-left:4px;vertical-align:1px}
.tracker .cur.pay .tr-now{background:var(--pay);color:#fff}
.tr-time{font-size:12.5px;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}
/* --- клиент: группы по этапам --- */
.overview{display:flex;gap:8px;overflow-x:auto;padding-bottom:2px;scrollbar-width:thin}
.ov-item{flex:none;display:flex;flex-direction:column;align-items:flex-start;gap:1px;border:1px solid var(--line);background:var(--surface);border-radius:10px;padding:8px 13px;cursor:pointer;min-width:110px;box-shadow:var(--shadow);text-align:left}
.ov-item:hover{border-color:var(--muted)}
.ov-item b{font-family:var(--font-display);font-size:22px;line-height:1.1}
.ov-item span{font-size:12.5px;color:var(--muted)}
.grp{display:flex;flex-direction:column;gap:10px;scroll-margin-top:72px}
.grp-title{font-size:16px;display:flex;align-items:baseline;gap:8px;margin-top:6px}
.grp-n{font-family:var(--font-body);font-size:13px;font-weight:400;color:var(--muted)}
.tracker li.done{font-size:14.5px;font-weight:400;color:var(--ink);white-space:normal}

/* ===== v9: удобство ===== */
/* кнопка «✓ следующий этап» и строка действий карточки */
.card-act{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}
.qnext{max-width:100%;overflow:hidden;text-overflow:ellipsis}
.card-act .qnext{flex:1 1 auto}
@media (min-width:600px){.card-act .qnext{flex:0 1 auto}}
/* тост с «Отменить» */
#undo{position:fixed;left:50%;bottom:84px;transform:translateX(-50%) translateY(20px);z-index:31;background:#151c22;color:#eef1f3;padding:8px 8px 8px 16px;border-radius:11px;font-size:14px;display:flex;align-items:center;gap:12px;max-width:calc(100% - 32px);opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;box-shadow:0 6px 24px rgba(0,0,0,.25)}
#undo.show{opacity:1;pointer-events:auto;transform:translateX(-50%)}
#undo .btn{background:transparent;color:var(--accent);border-color:rgba(238,241,243,.3);font-weight:600}
@media (prefers-reduced-motion:reduce){#undo{transition:none}}
/* дата прибытия */
.route-ends small.eta{display:block;font-weight:400;color:var(--muted);font-size:12px}
.route-ends small.eta.late,.r-st small.late,.late-panel .sub{color:var(--warn)}
/* переключатель вида */
.seg{display:flex;border:1px solid var(--line);border-radius:9px;overflow:hidden;background:var(--surface);flex:none}
.seg button{border:0;background:none;padding:9px 12px;cursor:pointer;font-size:13.5px;color:var(--muted);white-space:nowrap}
.seg button[aria-pressed="true"]{background:var(--ink);color:var(--bg)}
@media (max-width:560px){.seg button{padding:9px 12px;font-size:16px}.seg .lbl{display:none}}
/* компактный список (таблица) */
.rows{background:var(--surface);border:1px solid var(--line);border-radius:12px;overflow:hidden;box-shadow:var(--shadow)}
.row{display:grid;grid-template-columns:30px 130px 120px minmax(0,1fr) 150px auto;gap:10px;align-items:center;padding:9px 12px;border-top:1px solid var(--line);border-left:4px solid transparent;cursor:pointer}
.row:hover{background:var(--bg)}
.row-head{cursor:default;border-top:0;font-size:12px;color:var(--muted);padding-top:8px;padding-bottom:8px}
.row-head:hover{background:none}
.row.co-l-c0{border-left-color:var(--c0)}.row.co-l-c1{border-left-color:var(--c1)}.row.co-l-c2{border-left-color:var(--c2)}.row.co-l-c3{border-left-color:var(--c3)}.row.co-l-c4{border-left-color:var(--c4)}.row.co-l-c5{border-left-color:var(--c5)}.row.co-l-c6{border-left-color:var(--c6)}.row.co-l-c7{border-left-color:var(--c7)}
.row.is-stale{background:linear-gradient(90deg,var(--warn-bg),transparent 40%)}
.row.is-unpaid{background:linear-gradient(90deg,var(--pay-bg),transparent 40%)}
.r-st{display:grid;grid-template-columns:auto 1fr;column-gap:8px;align-items:center;min-width:0}
.r-st b{grid-column:1/-1;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.r-st small{grid-column:1/-1;color:var(--muted);font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mbar{display:block;width:70px;height:4px;background:var(--chart-track);border-radius:2px;overflow:hidden;margin:3px 0}
.mbar span{display:block;height:100%;background:var(--chart)}
.mbar-n{font-size:11px;color:var(--muted);font-family:var(--font-mono)}
.r-upd{font-size:12.5px;color:var(--muted)}
.r-act{display:flex;justify-content:flex-end}
.r-act .btn{max-width:190px}
.warn-txt{color:var(--warn);font-weight:600}
.ok-txt{color:var(--ok);font-weight:600}
@media (max-width:760px){
  .row-head{display:none}
  .row{grid-template-columns:26px auto 1fr;grid-template-areas:"pick plate co" "pick st st" "pick upd act";row-gap:6px}
  .r-pick{grid-area:pick;align-self:start}.r-plate{grid-area:plate}.r-co{grid-area:co;justify-self:start}
  .r-st{grid-area:st}.r-upd{grid-area:upd}.r-act{grid-area:act}
}
/* форма статуса: пройденные этапы свёрнуты, «Сохранить» всегда на виду */
.stages.hide-done .stage-btn.done{display:none}
.show-done{align-self:flex-start;margin-bottom:6px;color:var(--ok);text-decoration:none;font-weight:500}
.f .actions.sticky{position:sticky;bottom:-16px;margin:0 -16px -16px;padding:12px 16px;background:var(--bg);border-top:1px solid var(--line);z-index:2}
/* клиент: плашка об оплате */
.pay-banner{display:flex;align-items:center;gap:10px;width:100%;text-align:left;border:1px solid color-mix(in srgb,var(--pay) 45%,transparent);background:var(--pay-bg);color:var(--ink);border-radius:12px;padding:12px 14px;cursor:pointer;font-size:14.5px}
.pay-banner span:nth-child(2){flex:1}
.pay-banner b{color:var(--pay)}
/* сводка компактнее на телефоне; компании — в одну строку с прокруткой */
.wrap>.chips{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:thin;padding-bottom:2px}
.wrap>.chips .chip{flex:none}
@media (max-width:560px){
  .kpis{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  .kpis .tile{padding:8px 9px;border-radius:10px}
  .kpis .tile b{font-size:22px}
  .kpis .tile span{font-size:11.5px;line-height:1.25;display:block}
  .views button{padding:7px 14px}
}
.timeline.plain li:first-child::before{background:var(--bg);border-color:var(--muted);box-shadow:none}
.pay-note{flex:1 1 100%;margin:0}
/* v12: меньше шума */
.topline{display:flex;align-items:center;justify-content:space-between;gap:10px}
.topline .btn.primary{flex:none}
.actions.secondary{margin-top:-6px}
.actions.secondary .btn{flex:0 1 auto}
/* v13: удобство */
.co-pick{display:flex;flex-wrap:wrap;gap:8px}
.co-opt{display:flex;align-items:center;gap:7px;border:2px solid var(--line);border-radius:10px;padding:9px 14px;cursor:pointer;background:var(--bg);font-weight:600;color:currentColor}
.co-opt span{color:var(--ink)}
.co-opt input{accent-color:currentColor;width:17px;height:17px;margin:0}
.co-opt:has(input:checked){border-color:currentColor;background:var(--surface)}
.co-opt:focus-within{outline:2px solid var(--accent);outline-offset:2px}
.ok-hint{color:var(--ok);font-weight:500}
.pw-wrap .btn.eye{padding:0 12px;font-size:17px}
.card-act .btn.ghost{flex:0 0 auto}

/* ===== v14: ощущение приложения ===== */
/* логотип и надпись */
svg.logo{width:34px;height:34px;flex:none;display:block}
.brand-name{text-transform:none;letter-spacing:.01em;font-size:20px}
.brand-name span{color:var(--accent)}
.brand-login svg.logo{width:46px;height:46px}
.brand-login .brand-name{font-size:26px}
.login-card .brand-sub{font-size:13px}
/* нижняя панель на телефоне */
.bnav{display:none}
@media (max-width:699px){
  body.has-bnav .topline{display:none}
  body.has-bnav .top [data-action="menu"]{display:none}
  body.has-bnav .wrap{padding-bottom:150px}
  .bnav{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;position:fixed;left:0;right:0;bottom:0;z-index:7;background:var(--surface);border-top:1px solid var(--line);padding:6px 6px calc(6px + env(safe-area-inset-bottom));box-shadow:0 -4px 18px rgba(20,28,36,.08)}
  .bnav button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border:0;background:none;color:var(--muted);font-size:11.5px;font-weight:600;padding:5px 2px;border-radius:12px;cursor:pointer;min-height:52px}
  .bnav button svg{width:23px;height:23px}
  .bnav button[aria-current="page"]{color:var(--ink);background:var(--accent-soft)}
  .bnav .bnav-add svg{width:34px;height:34px;padding:6px;border-radius:50%;background:var(--accent);color:var(--accent-ink);margin-top:-14px;box-shadow:0 3px 10px color-mix(in srgb,var(--accent) 45%,transparent)}
  .bnav .bnav-add{color:var(--ink)}
  body.has-bnav .bulk{bottom:calc(64px + env(safe-area-inset-bottom))}
  body.has-bnav #toast,body.has-bnav #undo{bottom:calc(150px + env(safe-area-inset-bottom))}
}
/* клиент: приветствие и «новое» */
.hello{background:var(--surface);border:1px solid var(--line);border-left:5px solid var(--accent);border-radius:12px;padding:13px 16px;box-shadow:var(--shadow)}
.hello h2{font-size:21px;margin-bottom:4px}
.hello p{margin:0;font-size:15px;color:var(--muted);line-height:1.5}
.hello p b{color:var(--ink);font-family:var(--font-mono);font-weight:600}
.new-badge{display:inline-block;font-size:11.5px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;background:var(--accent);color:var(--accent-ink);border-radius:999px;padding:1px 8px;vertical-align:1px;white-space:nowrap}
.brand-login .brand-sub{white-space:normal;line-height:1.35}
.card-act{flex-wrap:nowrap}
.card-act .icon-btn{flex:0 0 auto;width:40px;padding-left:0;padding-right:0;font-size:16px}
.card-act .qnext{min-width:0}
@media (max-width:420px){.card-act .btn.ghost[data-action="checked"]{padding-left:9px;padding-right:9px}}

/* ===== v16: флаги стран ===== */
.flag{display:inline-flex;flex:none;margin-right:8px;vertical-align:-3px}
.flag svg{width:27px;height:18px;border-radius:3px;box-shadow:0 0 0 1px rgba(0,0,0,.18);display:block}
.flag.sm{margin-right:6px;vertical-align:-2px}
.flag.sm svg{width:20px;height:13px;border-radius:2px}
.now .val .flag svg{width:33px;height:22px}
.grp-title .flag{vertical-align:-1px}
.ov-item span .flag{margin-right:5px}
.tr-label .flag{vertical-align:-1px}
.pr-country,.co-country{border:1px solid var(--line);background:var(--bg);border-radius:8px;padding:7px 8px;font-size:13px;max-width:170px}
@media (max-width:520px){.pr-country{margin-left:26px;flex:1;max-width:none}}
/* список на компьютере: колонка статуса не сжимается, кнопки при нехватке места переносятся */
@media (min-width:761px){
  .row{grid-template-columns:30px 112px 104px minmax(170px,1fr) 118px 210px}
  .r-act{max-width:210px;flex-wrap:wrap;gap:6px}
  .r-st{overflow:hidden}
}

/* ===== v19: фирменный стиль CaravanGo ===== */
h1,h2,h3{font-weight:700;letter-spacing:0}
.top{background:var(--top-bg);color:var(--top-ink);border-bottom:3px solid var(--accent);box-shadow:0 2px 10px rgba(18,40,26,.06)}
.top .btn{background:transparent;color:var(--top-ink);border-color:var(--line)}
.brand-name{font-family:var(--font-display);font-weight:800;color:var(--accent);letter-spacing:-.01em}
.brand-name span{color:var(--orange)}
.top .brand-sub{opacity:1;color:var(--muted)}
svg.logo{width:30px;height:32px}
.st-name{font-weight:600;font-size:18px}
.tile b,.ov-item b,.kpis .tile b{font-weight:700}
/* оранжевый — акцент: «сейчас», «новое», следующий этап, приветствие */
.new-badge,.tr-now{background:var(--orange);color:var(--orange-ink)}
.stage-btn.next{border-color:var(--orange)}
.hello{border-left-color:var(--orange)}
.tracker .cur{background:var(--orange-soft)}
.tracker .cur .tr-dot{background:var(--orange);border-color:var(--orange);box-shadow:0 0 0 4px color-mix(in srgb,var(--orange) 25%,transparent)}
.timeline li:first-child::before{background:var(--orange);border-color:var(--orange);box-shadow:0 0 0 4px var(--orange-soft)}
.bulk{background:#16251c}
#undo .btn{color:#8fe3ad}
/* экран входа: настоящий логотип */
.logo-full{background:#fff;border-radius:12px;padding:6px 10px;display:flex;justify-content:center}
.logo-full img{width:100%;max-width:300px;height:auto;display:block}
.login-hint{margin:0;text-align:center;color:var(--muted);font-size:13.5px}
.login-card{border-top-color:var(--orange)}
.top .btn,.top .btn.mini{color:var(--top-ink);border-color:var(--line)}

/* ===== v21: расширенная статистика ===== */
.seg.period{align-self:flex-start}
.seg.period button{padding:8px 13px;font-size:13.5px}
@media (max-width:560px){.seg.period{align-self:stretch}.seg.period button{flex:1;padding:8px 4px}}
.delta{display:block;margin-top:3px;font-size:12px;font-weight:600;color:var(--muted)}
.delta.good{color:var(--ok)}
.delta.bad{color:var(--warn)}
.sec-sub{font-family:var(--font-body);font-size:12px;font-weight:400;text-transform:none;letter-spacing:0;color:var(--muted)}
.hbar:has(.hb-val.wide){grid-template-columns:minmax(120px,44%) 1fr 56px}
.hb-val.wide{font-size:12.5px;white-space:nowrap}
.hbar.worst .hb-fill{background:var(--orange)}
.worst-tag{display:inline-block;font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.03em;background:var(--orange);color:var(--orange-ink);border-radius:999px;padding:0 6px;margin-left:4px;vertical-align:1px}
.hb-label{display:flex;align-items:center;flex-wrap:wrap;gap:0}
.stuck-panel{border-left:4px solid var(--warn)}
.ontime{display:flex;gap:16px;align-items:center}
.ontime-big{display:flex;flex-direction:column;align-items:center;min-width:76px}
.ontime-big b{font-family:var(--font-display);font-size:34px;line-height:1;color:var(--ok)}
.ontime-big span{font-size:12px;color:var(--muted)}
.ontime-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}
.ontime-body .hint{margin:0}
.split{display:flex;height:12px;border-radius:4px;overflow:hidden;gap:2px;background:var(--surface)}
.split .ok{background:var(--ok)}
.split .bad{background:var(--warn)}
.dot{display:inline-block;width:9px;height:9px;border-radius:2px;margin-right:4px;vertical-align:0}
.dot.ok{background:var(--ok)}
.dot.bad{background:var(--warn)}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:16px}
@media (max-width:560px){.two-col{grid-template-columns:1fr}}
.sub-h{margin:0 0 4px;font-family:var(--font-body);font-size:13px;font-weight:600;color:var(--muted)}
.two-col .tbl td{white-space:nowrap}
.cols.cols7{grid-template-columns:repeat(7,1fr);height:130px}
.col-fill.peak{background:var(--orange)}
.tbl th[scope=row] .linkrow{gap:6px}
/* телефон: ничего не шире экрана */
.tip{display:none}
.hbar:hover .tip,.hbar:focus-visible .tip,.col:hover .tip,.col:focus-visible .tip{display:block}
.cols .col:first-child .tip,.cols .col:nth-child(2) .tip{left:0;transform:none}
.cols .col:last-child .tip,.cols .col:nth-last-child(2) .tip{left:auto;right:0;transform:none}
.panel{overflow-x:auto;min-width:0}
.col-lbl{font-size:10.5px}
@media (max-width:420px){
  .tbl th,.tbl td{padding:7px 3px;font-size:13px}
  .tbl thead th{font-size:11px}
  .tbl .co{font-size:11px;padding:1px 4px}
  .tbl th[scope=row] .flag{display:none}
  .cols{gap:3px}
}

/* ===== v23: схема маршрута ===== */
.route-map svg{width:100%;height:auto;display:block}
.route-map .band.b1{fill:var(--surface)}
.route-map .band.b2{fill:var(--accent-soft)}
.route-map .border{stroke:var(--muted);stroke-width:2;stroke-dasharray:6 6;opacity:.55}
.route-map .m-country{font:700 26px var(--font-display);fill:var(--ink);text-anchor:middle}
.route-map .m-city{font:500 23px var(--font-body);fill:var(--muted);text-anchor:middle}
.route-map .m-city.sm{font-size:19px}
.route-map .road{stroke:var(--chart-track);stroke-width:18;stroke-linecap:round}
.route-map .road-dash{stroke:var(--surface);stroke-width:2.5;stroke-dasharray:14 12}
.route-map .stop{fill:var(--surface);stroke:var(--muted);stroke-width:3}
.route-map .stop.fin{stroke:var(--ok);fill:var(--ok)}
.route-map .pin{fill:var(--orange);stroke:var(--surface);stroke-width:5}
.route-map .pin-stem{stroke:var(--orange);stroke-width:4}
.route-map .pin-n{font:800 26px var(--font-display);fill:var(--orange-ink);text-anchor:middle}
.route-map .pin-ink{fill:var(--orange-ink)}
.route-map .map-pin{cursor:pointer;outline:none}
.route-map .map-pin:hover .pin,.route-map .map-pin:focus-visible .pin{stroke:var(--accent);stroke-width:6}
.map-panel{gap:6px}
.map-panel .route-map{border:1px solid var(--line);border-radius:10px;overflow:hidden}
.map-mini .route-map{border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--surface)}
.map-panel .hint{margin:0}

/* ===== отчёт по рейсу (на экране и в печати — всегда светлый, как бумага) ===== */
.rep-sheet{background:#fff;border-radius:10px;padding:14px;box-shadow:0 0 0 1px #d8e2db}
.rep{color:#16251c;font-family:var(--font-body);font-size:13.5px;line-height:1.45}
.rep h1{font-family:var(--font-display);font-size:22px;margin:0;color:#1E7848}
.rep h2{font-family:var(--font-display);font-size:14px;text-transform:uppercase;letter-spacing:.04em;color:#5a6b61;margin:16px 0 6px}
.rep-head{display:flex;gap:14px;align-items:center;border-bottom:3px solid #F67200;padding-bottom:10px}
.rep-logo{width:120px;height:auto;flex:none}
.rep-title p{margin:2px 0 0}
.rep-plate{font-family:var(--font-mono);font-weight:600;font-size:15px}
.rep-status{font-weight:600;color:#1E7848;display:flex;align-items:center}
.rep-status.unpaid{color:#b35400}
.rep-grid{display:grid;grid-template-columns:1fr 1fr;gap:4px 18px;margin-top:10px}
.rep-grid dl{margin:0}
.rep-grid dl div{display:flex;justify-content:space-between;gap:10px;border-bottom:1px dotted #cfd9d2;padding:4px 0}
.rep-grid dt{color:#5a6b61}
.rep-grid dd{margin:0;font-weight:600;text-align:right}
.rep-tbl{width:100%;border-collapse:collapse}
.rep-tbl th{text-align:left;font-size:12px;color:#5a6b61;font-weight:500;border-bottom:2px solid #1E7848;padding:5px 4px}
.rep-tbl td{border-bottom:1px solid #e3ebe6;padding:5px 4px}
.rep-tbl td:last-child,.rep-tbl th:last-child{text-align:right;white-space:nowrap}
.rep-com{margin:0;padding-left:18px}
.rep-photo{margin:12px 0 18px;break-inside:avoid;page-break-inside:avoid}
.rep-photo img{display:block;width:auto;max-width:100%;height:auto;max-height:130mm;margin:auto;object-fit:contain}
.rep-photo figcaption{margin-top:6px;font-size:12px;color:#5a6b61;text-align:center;overflow-wrap:anywhere}
.rep h2{break-after:avoid}
.rep-foot{margin-top:16px;padding-top:8px;border-top:1px solid #d8e2db;font-size:11.5px;color:#5a6b61;text-align:center}
@media (max-width:520px){.rep-grid{grid-template-columns:1fr}.rep-logo{width:90px}.rep h1{font-size:19px}}
#print{display:none}
@media print{
  @page{size:A4;margin:14mm}
  html,body{background:#fff !important}
  body.printing > *:not(#print){display:none !important}
  body.printing #print{display:block}
  .rep,.rep *{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .rep{font-size:12.5px}
  .rep-tbl tr{break-inside:avoid}
}

/* деньги за рейс */
.money{width:100%;border-collapse:separate;border-spacing:0;border:1px solid var(--line);border-radius:12px;overflow:hidden;font-size:14.5px}
.money td{padding:7px 12px;border-top:1px solid var(--line);background:var(--surface)}
.money tr:first-child td{border-top:0}
.money td.num{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.money small{color:var(--muted)}
.money tr.sum td{font-weight:700}
.money tr.pay td{color:var(--muted)}
.money tr.left td{font-weight:700;font-size:15.5px}
.money tr.left.due td.num{color:var(--warn)}
.money tr.left.ok td.num{color:var(--accent)}
.pay-form{margin-top:10px}
.row3{display:grid;grid-template-columns:1fr 1fr 2fr;gap:10px}
@media (max-width:560px){.row3{grid-template-columns:1fr 1fr}.row3 .field:last-child{grid-column:1/-1}}

/* роли: пункты */
.btn.big{font-size:17px;padding:14px 18px}
.chk{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border:1px solid var(--line);border-radius:10px;background:var(--surface);cursor:pointer;font-size:14px}
.chk.sm{padding:4px 8px;font-size:12.5px;white-space:nowrap}
.chk input{margin:0}
.op-stages{display:flex;flex-wrap:wrap;gap:8px;margin:6px 0 10px}
.photo-pick{display:block;cursor:pointer}
.photo-pick input{position:absolute;opacity:0;width:1px;height:1px}
.photo-pick>span{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:150px;border:2px dashed var(--accent);border-radius:14px;background:var(--accent-soft);font-size:34px;text-align:center;padding:12px}
.photo-pick b{font-size:16px}
.photo-pick small{font-size:13px;color:var(--muted)}
.photo-pick img{max-width:100%;max-height:260px;border-radius:10px}
.photo-pick input:focus-visible+span{outline:3px solid var(--accent);outline-offset:2px}
.money tr.pend td{background:var(--warn-bg)}
.money tr.pend .btn{margin-left:6px}
.pend .list-row{flex-wrap:wrap}
/* строка этапа: название на всю ширину, настройки — второй строкой (иначе не помещаются флажки) */
.pr-row{flex-wrap:wrap}
.pr-row input[type=text]{flex-basis:calc(100% - 30px)}
.pr-row .pr-kind{margin-left:26px}
.pr-row .pr-btns{margin-left:auto}

/* Фото подтверждения оплаты */
.file-control{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden}
.payment-upload .btn{position:relative;cursor:pointer}
.payment-upload .btn:focus-within{outline:3px solid var(--accent);outline-offset:2px}
.payment-preview{display:flex;flex-direction:column;gap:5px;width:110px}
.payment-preview img{width:110px;height:90px;object-fit:cover;border-radius:8px;border:1px solid var(--line)}
.payment-proofs{margin-top:8px}
.money small.review-note{display:block;color:var(--warn);margin-top:5px}
.money tr.rejected td{background:var(--warn-bg)}
.payment-upload{padding:12px;border:1px dashed var(--line);border-radius:12px}
@media(max-width:520px){.money td{padding:8px 6px}.money .btn{margin:4px 0}.money td:first-child{overflow-wrap:anywhere}}

/* Связь машин при перегрузке */
.transfer{display:grid;grid-template-columns:minmax(0,1fr) 32px minmax(0,1fr);gap:12px;align-items:center;margin:14px 0;padding:16px;background:#f0f7f2;border:1px solid #d6e6da;border-radius:12px}
.transfer>div{display:flex;flex-direction:column;align-items:flex-start;gap:7px;min-width:0}
.transfer small{color:#52695b;font-size:13px;line-height:1.4}
.transfer .plate{font-size:20px;max-width:100%;overflow-wrap:anywhere;white-space:normal}
.transfer-arrow{font-size:26px;color:#1e7848;text-align:center}
.transfer-empty{font-size:15px;font-weight:500;color:#69786f}
.card-top{flex-wrap:wrap}.card-top .co{white-space:normal;overflow-wrap:anywhere}.card-act{flex-wrap:wrap;gap:8px}.card-act .btn{white-space:normal;height:auto;min-height:44px}.r-plate small{display:block;white-space:normal;margin-top:6px}.r-co .co{white-space:normal;overflow-wrap:anywhere}
@media(max-width:520px){.transfer{gap:8px;padding:12px;grid-template-columns:minmax(0,1fr) 20px minmax(0,1fr)}.transfer .plate{font-size:16px}.transfer small{font-size:12px}.card-act .primary{flex:1}.card-top .upd{width:100%;margin-left:0}}

.route-mobile{display:none}
@media(max-width:600px){
  .route-map{display:none}
  .route-mobile{display:flex;flex-direction:column;gap:0;list-style:none;margin:0;padding:0 0 0 12px}
  .route-mobile>li{position:relative;border-left:2px solid var(--line);padding:8px 0 12px 20px;min-width:0}
  .route-mobile>li:last-child{padding-bottom:4px;border-left-color:transparent}
  .route-mobile>li:before{content:'';position:absolute;left:-6px;top:17px;width:10px;height:10px;border-radius:50%;background:var(--accent)}
  .route-country{display:flex;align-items:center;gap:9px;font-size:16px;min-height:28px}
  .route-country .flag{flex-shrink:0}
  .route-mobile-stop{display:flex;flex-direction:column;align-items:flex-start;gap:4px;width:100%;margin-top:7px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--accent-soft);color:var(--ink);text-align:left;min-height:48px;cursor:pointer}
  .route-mobile-stop span{font-size:13px}.route-mobile-stop strong{font-size:15px}
  .field input,.field textarea,.field select,.search{font-size:16px}
  .sheet{max-height:94dvh}.sheet-body{padding-bottom:calc(20px + env(safe-area-inset-bottom))}
  .sheet .actions{flex-wrap:wrap}.sheet .actions .btn{white-space:normal;min-height:44px}
}
@media(max-width:360px){.sheet .row2{grid-template-columns:1fr}.transfer{grid-template-columns:1fr}.transfer-arrow{transform:rotate(90deg);justify-self:center}}
