:root { --bg:#f6f5f2; --card:#fff; --text:#1f2328; --muted:#6b6f76; --line:#e3e1dc; --accent:#b45309;
  --ok:#15803d; --warn:#c2410c; --bad:#b91c1c; --soft-ok:#e7f6ec; --soft-warn:#fff1e6; --soft-bad:#fde2e1; }
* { box-sizing: border-box; }
body { margin:0; font:15px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; background:var(--bg); color:var(--text); }
a { color: var(--accent); }
.layout { display:flex; min-height:100vh; }
.side { --side:#141b2d; --side-2:#1f2940; --side-text:#c9d1e3; --side-muted:#7f8aa3;
  width:236px; flex:none; background:var(--side); color:var(--side-text); padding:18px 12px;
  position:sticky; top:0; height:100vh; overflow-y:auto; display:flex; flex-direction:column; gap:18px; }
.side .brand { display:flex; align-items:center; gap:10px; padding:2px 8px; color:#fff; font-weight:700; font-size:17px; text-decoration:none; }
.side .logo { width:34px; height:34px; border-radius:9px; background:var(--accent); display:grid; place-items:center; }
.side .logo .ic { stroke:#fff; }
.side nav { display:flex; flex-direction:column; gap:2px; }
.side nav a { display:flex; align-items:center; gap:12px; padding:10px 12px; border-radius:8px; text-decoration:none;
  color:var(--side-text); font-size:15px; border-left:3px solid transparent; }
.side nav a:hover { background:var(--side-2); color:#fff; }
.side nav a.on { background:var(--side-2); color:#fff; font-weight:600; border-left-color:var(--accent); }
.side nav a.on .ic { stroke:#f59e0b; }
.ic { width:20px; height:20px; flex:none; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.side .who { margin-top:auto; display:flex; align-items:center; gap:10px; padding:12px 8px 0; border-top:1px solid var(--side-2); font-size:13px; }
.side .avatar { width:34px; height:34px; border-radius:50%; background:var(--side-2); color:#fff; display:grid; place-items:center; font-weight:700; flex:none; }
.side .name { color:#fff; line-height:1.2; } .side .role { color:var(--side-muted); }
.side .out { background:none; border:none; padding:6px; color:var(--side-muted); border-radius:6px; }
.side .out:hover { color:#fff; background:var(--side-2); }
.layout > .wrap { flex:1; min-width:0; margin:0; }
.wrap { max-width:1200px; margin:0 auto; padding:16px; }
h1 { font-size:22px; margin:4px 0 16px; }
h2 { font-size:17px; margin:0 0 12px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:16px; margin-bottom:16px; }
.row { display:flex; gap:12px; flex-wrap:wrap; align-items:end; }
.grow { flex:1; }
label { display:flex; flex-direction:column; gap:4px; font-size:13px; color:var(--muted); }
input, select, textarea { font:inherit; padding:8px 10px; border:1px solid var(--line); border-radius:6px; background:#fff; color:var(--text); min-width:0; }
button, .btn { font:inherit; padding:8px 14px; border-radius:6px; border:1px solid var(--accent); background:var(--accent); color:#fff; cursor:pointer; text-decoration:none; display:inline-block; }
button.ghost, .btn.ghost { background:#fff; color:var(--accent); }
button.ok { background:var(--ok); border-color:var(--ok); }
button.bad { background:var(--bad); border-color:var(--bad); }
button.link { background:none; border:none; color:var(--accent); padding:0; text-decoration:underline; }
table { width:100%; border-collapse:collapse; }
th, td { text-align:left; padding:8px 10px; border-bottom:1px solid var(--line); vertical-align:top; }
th { font-size:12px; color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:.02em; }
.table-scroll { overflow-x:auto; }
.muted { color:var(--muted); }
.small { font-size:13px; }
.pill { display:inline-block; padding:2px 8px; border-radius:999px; font-size:12px; font-weight:600; white-space:nowrap; }
.pill.missing { background:#eee; color:#555; } .pill.pending { background:var(--soft-warn); color:var(--warn); }
.pill.approved { background:var(--soft-ok); color:var(--ok); } .pill.rejected { background:var(--soft-bad); color:var(--bad); }
.pill.active { background:#e0ecff; color:#1d4ed8; } .pill.off { background:#eee; color:#777; }
.flash { padding:10px 14px; border-radius:8px; margin-bottom:16px; }
.flash.ok { background:var(--soft-ok); color:var(--ok); } .flash.err { background:var(--soft-bad); color:var(--bad); }
.stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; margin-bottom:16px; }
.stat { background:#fff; border:1px solid var(--line); border-radius:10px; padding:12px 14px; }
.stat b { display:block; font-size:24px; }
.docs { display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:16px; }
.doc img { width:100%; max-height:420px; object-fit:contain; background:#f0efec; border-radius:6px; }
.doc .pdf { display:flex; align-items:center; justify-content:center; height:160px; background:#f0efec; border-radius:6px; }
.pin { font-size:40px; letter-spacing:10px; font-weight:700; padding:12px 0; }
.login { max-width:360px; margin:60px auto; }
.inline { display:inline; }
.timeline li { margin-bottom:6px; }
@media (max-width:800px) {
  .layout { flex-direction:column; }
  .side { width:auto; height:auto; position:sticky; top:0; z-index:5; padding:8px 10px; gap:6px; flex-direction:row; align-items:center; }
  .side .brand span:last-child, .side .who .grow { display:none; }
  .side nav { flex-direction:row; overflow-x:auto; flex:1; scrollbar-width:none; }
  .side nav a { padding:8px 10px; border-left:none; white-space:nowrap; font-size:14px; gap:6px; }
  .side .who { margin:0; padding:0; border:none; }
  .side .avatar { display:none; }
}
@media (max-width:640px) { .wrap { padding:12px; } th,td { padding:6px; } }
@media print { .side, .noprint { display:none !important; } .card { border:none; } }
.pill.t-Бонус { background:var(--soft-ok); color:var(--ok); } .pill.t-Стандарт { background:#eef1f5; color:#334155; }
.pill.t-Штраф { background:var(--soft-bad); color:var(--bad); }
.pill.s-work { background:var(--soft-ok); color:var(--ok); } .pill.s-repair { background:var(--soft-bad); color:var(--bad); }
.pill.s-off { background:#eee; color:#777; }
.tabs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:12px; }
.tabs a { padding:6px 12px; border:1px solid var(--line); border-radius:999px; text-decoration:none; color:var(--text); background:#fff; font-size:14px; }
.tabs a.on { border-color:var(--accent); color:var(--accent); font-weight:600; }
.warn-text { color:var(--bad); }
details summary { cursor:pointer; color:var(--accent); }
.pill.slot-day { background:#fef9c3; color:#854d0e; } .pill.slot-night { background:#e0e7ff; color:#3730a3; }
.pill.slot-full { background:#eef1f5; color:#334155; }
td a b, .plate { white-space:nowrap; }
label { max-width:100%; } select { max-width:100%; }
.photos { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:12px; }
.photo { display:flex; flex-direction:column; gap:6px; text-decoration:none; color:var(--text); font-size:13px; }
.photo img { width:100%; height:170px; object-fit:cover; border-radius:8px; background:#f0efec; }
.timeline-log { display:flex; flex-direction:column; }
.timeline-log .ev { display:grid; grid-template-columns:52px 18px 1fr; gap:8px; align-items:start; padding:6px 0; }
.timeline-log .t { color:var(--muted); font-variant-numeric:tabular-nums; font-size:14px; padding-top:1px; }
.timeline-log .dot { width:12px; height:12px; border-radius:50%; background:#cbd5e1; margin-top:4px; position:relative; }
.timeline-log .ev:not(:last-child) .dot::after { content:""; position:absolute; left:5px; top:14px; width:2px; height:34px; background:var(--line); }
.timeline-log .ev-shift .dot { background:var(--accent); } .timeline-log .ev-trip .dot { background:#2563eb; }
.timeline-log .ev-stage .dot { background:#60a5fa; } .timeline-log .ev-pause .dot { background:#f59e0b; }
.timeline-log .ev-resume .dot { background:#16a34a; } .timeline-log .ev-fuel .dot { background:#0d9488; }
.timeline-log .ev-gap .dot { background:var(--bad); } .timeline-log .ev-gap { background:var(--soft-bad); border-radius:8px; padding:6px 8px; margin:2px -8px; }
.timeline-log .ev-warn .body b { color:var(--bad); }
.stack { display:flex; flex-direction:column; gap:14px; }
.qr svg { display:block; background:#fff; }
.install-steps { padding-left:20px; } .install-steps li { margin:6px 0; }
.install-block { border:1px solid var(--line); border-radius:10px; padding:14px 16px; margin:14px 0; }
.install-block.mine { border-color:var(--accent); box-shadow:0 0 0 2px #b4530922; }
.driver-card { display:flex; gap:18px; align-items:center; flex-wrap:wrap; }
/* Оповещение о поломке на всех страницах кабинета */
.side nav a .badge { margin-left:auto; background:var(--bad); color:#fff; border-radius:999px; font-size:12px; padding:1px 7px; font-weight:700; }
.alert-bar { display:block; background:var(--bad); color:#fff; padding:12px 16px; border-radius:10px; margin-bottom:16px; text-decoration:none; font-weight:600; animation:alert-pulse 1.6s ease-in-out 3; }
.alert-bar[hidden] { display:none; }
.alert-bar .small { font-weight:400; opacity:.9; }
@keyframes alert-pulse { 50% { box-shadow:0 0 0 6px var(--soft-bad); } }
.pill.breakdown { background:var(--soft-bad); color:var(--bad); }
.pill.cancelled { background:#eee; color:#555; text-decoration:line-through; }
.bd { border-left:4px solid var(--warn); }
.bd.serious { border-left-color:var(--bad); }
.bd .actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; align-items:flex-end; }
.map { height:420px; border-radius:10px; border:1px solid var(--line); margin-bottom:16px; z-index:0; }
.map.small { height:280px; }
.tmap { position:relative; overflow:hidden; background:#e8eef0; touch-action:none; cursor:grab; user-select:none; }
.tmap:active { cursor:grabbing; }
.tmap-tiles img, .tmap-labels > *, .tmap-popup { position:absolute; left:0; top:0; }
.tmap-tiles img { width:256px; height:256px; }
.tmap-svg { position:absolute; inset:0; width:100%; height:100%; overflow:visible; }
.tmap-dot { cursor:pointer; }
.tmap-labels { position:absolute; inset:0; pointer-events:none; }
.map-label { background:#fff; border:1px solid var(--line); border-radius:4px; font-size:12px; padding:1px 6px; white-space:nowrap; }
.tmap-popup { background:#fff; border-radius:8px; box-shadow:0 4px 16px rgba(0,0,0,.18); padding:8px 10px; font-size:13px; max-width:260px; cursor:auto; }
.tmap-zoom { position:absolute; left:10px; top:10px; display:flex; flex-direction:column; gap:4px; }
.tmap-zoom button { width:32px; height:32px; padding:0; font-size:18px; line-height:1; background:#fff; color:var(--text); border:1px solid var(--line); border-radius:6px; }
.tmap-attr { position:absolute; right:4px; bottom:2px; font-size:10px; color:#555; opacity:.7; pointer-events:none; }
.legend { display:flex; flex-wrap:wrap; gap:12px; font-size:13px; color:var(--muted); margin:-6px 0 12px; }
.legend i { display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:4px; vertical-align:middle; }
.bd-photo img { max-width:220px; max-height:160px; border-radius:8px; border:1px solid var(--line); display:block; }
/* Документы: список слева, рейсы по дням справа */
.docs-layout { display:grid; grid-template-columns:300px 1fr; gap:16px; align-items:start; }
.dlist { padding:8px; position:sticky; top:12px; max-height:calc(100vh - 24px); overflow:auto; }
.dlist input { width:100%; margin-bottom:8px; }
.dlist a { display:flex; justify-content:space-between; gap:8px; padding:8px; border-radius:8px; text-decoration:none; color:var(--text); }
.dlist a:hover { background:#f4f3ef; } .dlist a.on { background:var(--soft-warn); }
.dlist a[hidden] { display:none; }
.dlist .counts { display:flex; gap:4px; align-items:flex-start; flex:none; }
.dday h3 { margin:0 0 8px; }
.dtrip { display:grid; grid-template-columns:minmax(180px,1fr) 1fr 1fr; gap:12px; padding:12px 0; border-top:1px solid var(--line); }
.dcell { border:1px solid var(--line); border-radius:8px; padding:8px; background:#fcfcfb; }
.dcell.missing { border-color:var(--bad); background:var(--soft-bad); }
.dcell.pending { border-color:var(--warn); }
.dcell.rejected { border-color:var(--bad); }
.dcell-head { display:flex; gap:6px; align-items:center; flex-wrap:wrap; margin-bottom:6px; }
.dthumb img { width:100%; max-height:200px; object-fit:contain; background:#f0efec; border-radius:6px; display:block; }
.dthumb .pdf { display:flex; align-items:center; justify-content:center; height:90px; background:#f0efec; border-radius:6px; font-weight:700; }
.dreview { margin-top:8px; display:flex; flex-direction:column; gap:6px; }
@media (max-width: 1000px) { .docs-layout { grid-template-columns:1fr; } .dlist { position:static; max-height:300px; } .dtrip { grid-template-columns:1fr; } }
a.flash { display:block; text-decoration:none; }
.copyright { margin-top:32px; padding-top:12px; border-top:1px solid var(--line, #e5e7eb); }
