/* Drivo — one stylesheet for the sign-in page, the office console and the driver app. Light by default (or the device's setting),
   dark via [data-theme=dark]. Ink on paper: neutral grays, black primary actions, color only where it carries a meaning. */

/* ---------- tokens ---------- */

:root {
  color-scheme: light; --ease: cubic-bezier(.2, 0, 0, 1); --fast: .12s; --med: .18s; --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace; --top: 56px;
  --bg: #f6f6f7; --panel: #fbfbfb; --surface: #fff; --surface-2: #f4f4f5; --surface-3: #eaeaec; --field: #fff;
  --line: #e6e6e9; --line-2: #d4d4d8; --text: #111113; --text-2: #3f3f46; --muted: #65656f;
  --ink: #18181b; --ink-fg: #fff; --ink-hover: #34343a; --link: #1f4fd1; --ring: 0 0 0 3px rgb(31 79 209 / .2);
  --shadow: 0 1px 2px rgb(17 17 19 / .05); --shadow-lg: 0 12px 32px rgb(17 17 19 / .12), 0 2px 6px rgb(17 17 19 / .05);
  --neutral: #f1f1f3; --neutral-dot: #a1a1aa; --amber: #fdf3dc; --amber-fg: #7a4803; --amber-dot: #e39a0b;
  --green: #e7f5eb; --green-dot: #16a34a; --blue: #e9effd; --blue-dot: #2563eb;
  --slate: #eef0f3; --slate-dot: #64748b; --red: #fdeded; --red-fg: #991b1b; --red-dot: #dc2626; --violet: #f2edfd; --violet-fg: #4c1d95; --violet-dot: #7c3aed;
  font: 14px/1.5 'Rubik', 'Heebo', Arial, sans-serif; color: var(--text); -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0f; --panel: #111113; --surface: #161618; --surface-2: #1c1c1f; --surface-3: #26262b; --field: #121214;
  --line: #25252a; --line-2: #35353b; --text: #ececee; --text-2: #b9b9c1; --muted: #8e8e98;
  --ink: #ececee; --ink-fg: #111113; --ink-hover: #d0d0d5; --link: #93b4ff; --ring: 0 0 0 3px rgb(147 180 255 / .28);
  --shadow: none; --shadow-lg: 0 16px 48px rgb(0 0 0 / .6);
  --neutral: rgb(161 161 170 / .12); --neutral-dot: #8e8e98; --amber: rgb(227 154 11 / .13); --amber-fg: #f2c264; --amber-dot: #e39a0b;
  --green: rgb(22 163 74 / .14); --green-dot: #22c55e; --blue: rgb(37 99 235 / .17); --blue-dot: #5b8ff9;
  --slate: rgb(100 116 139 / .18); --slate-dot: #7d8899; --red: rgb(220 38 38 / .15); --red-fg: #f7a1a1; --red-dot: #ef4444;
  --violet: rgb(124 58 237 / .17); --violet-fg: #c9bafd; --violet-dot: #8b5cf6;
}
/* Tinted elements read their colors from a tone class: --c background, --d dot, icon and edge. */
:where(.chip, .dot, .banner, .alert-i, .g-bar, .issues li, .lane-warn) { --c: var(--neutral); --d: var(--neutral-dot); }
.amber { --c: var(--amber); --d: var(--amber-dot); } .green { --c: var(--green); --d: var(--green-dot); } .blue { --c: var(--blue); --d: var(--blue-dot); }
.slate { --c: var(--slate); --d: var(--slate-dot); } .red { --c: var(--red); --d: var(--red-dot); } .violet { --c: var(--violet); --d: var(--violet-dot); }

/* ---------- base ---------- */

* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; background: var(--bg); }
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; }
h1, h2, h3 { font-weight: 600; line-height: 1.3; }
ol, ul { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--link); text-decoration: none; } a[href^="tel:"] { color: inherit; } a[href^="tel:"]:hover { text-decoration: underline; text-underline-offset: 3px; }
small { font-size: 12.5px; color: var(--muted); }
b, strong { font-weight: 500; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
[hidden] { display: none !important; }
.i { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.grow { flex: 1; min-width: 0; } .grow:not(.btn) { display: grid; }
.stack { display: grid; gap: 16px; align-content: start; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; } .actions.fill > .btn { flex: 1; }
.stat b, .time, .stop-time, .day b, .meta, .kv dd, .sched-trips b, .g-tick, .chip { font-variant-numeric: tabular-nums; }

/* ---------- controls ---------- */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 14px; border: 1px solid transparent; border-radius: 8px; font-size: 13.5px; font-weight: 500; line-height: 1.2; white-space: nowrap; transition: background-color var(--fast), border-color var(--fast), color var(--fast); }
.btn:disabled { opacity: .45; cursor: not-allowed; } .busy { opacity: .6; pointer-events: none; } /* an action still running */
.btn.primary { background: var(--ink); color: var(--ink-fg); } .btn.primary:hover:not(:disabled) { background: var(--ink-hover); }
.btn.ghost { background: var(--surface); border-color: var(--line-2); color: var(--text); box-shadow: var(--shadow); } .btn.ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn.soft { background: var(--surface-2); color: var(--text); } .btn.soft:hover { background: var(--surface-3); }
.btn.quiet { background: transparent; color: var(--text-2); } .btn.quiet:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn.success { background: #15803d; color: #fff; } .btn.success:hover:not(:disabled) { background: #166534; }
.btn.danger { background: #b91c1c; color: #fff; } .btn.danger:hover { background: #991b1b; }
.danger-text { color: var(--red-fg) !important; }
.btn.sm { min-height: 30px; padding: 0 10px; gap: 6px; font-size: 13px; } .btn.sm .i { width: 15px; height: 15px; }
.btn.lg { min-height: 44px; padding: 0 20px; font-size: 14.5px; }
.link-btn { padding: 0; border: 0; background: none; color: var(--text-2); font-size: inherit; font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.link-btn:hover { color: var(--text); text-decoration-color: currentColor; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); list-style: none; transition: background-color var(--fast), color var(--fast); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); } .icon-btn.danger:hover { background: var(--red); color: var(--red-fg); }
.icon-btn::-webkit-details-marker, summary.btn::-webkit-details-marker, .user-btn::-webkit-details-marker { display: none; } summary.btn, .user-btn { list-style: none; }
.theme-btn .sun, [data-theme="dark"] .theme-btn .moon { display: none; } [data-theme="dark"] .theme-btn .sun { display: block; }
.chip { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; height: 22px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text-2); font-size: 12px; font-weight: 500; white-space: nowrap; }
.chip.red { border-color: transparent; background: var(--red); color: var(--red-fg); }
.chip i, .dot { display: inline-block; width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: var(--d); }
.dot.none { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.tag { justify-self: start; padding: 0 6px; border-radius: 5px; background: var(--surface-3); color: var(--text-2); font-size: 11.5px; line-height: 20px; white-space: nowrap; }
.kid { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 6px; background: var(--violet); color: var(--violet-fg); font-size: 12px; font-weight: 500; } .kid .i { width: 14px; height: 14px; }
.avatar { display: inline-grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: hsl(var(--hue) 32% 92%); color: hsl(var(--hue) 40% 28%); font-size: 12px; font-weight: 600; }
[data-theme="dark"] .avatar { background: hsl(var(--hue) 16% 23%); color: hsl(var(--hue) 45% 84%); }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; } .avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.bar { display: block; height: 4px; border-radius: 99px; background: var(--surface-3); overflow: hidden; } .bar i { display: block; height: 100%; border-radius: inherit; background: var(--ink); }

/* ---------- surfaces ---------- */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; min-height: 50px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.card-head h2 { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.count { padding: 0 7px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 500; line-height: 19px; }
.card-body { padding: 18px; } .pad { padding: 0 16px 10px; }
.banner { display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px; border: 1px solid color-mix(in srgb, var(--d) 28%, transparent); border-radius: 8px; background: var(--c); font-size: 13.5px; }
.banner > .i { margin-top: 2px; color: var(--d); } .banner > div { flex: 1; } .banner b { display: block; }
.empty { display: grid; justify-items: center; gap: 4px; padding: 44px 20px; text-align: center; }
.empty > .i { width: 26px; height: 26px; margin-bottom: 8px; color: var(--muted); stroke-width: 1.5; }
.empty h3 { font-size: 15px; } .empty p { max-width: 420px; color: var(--muted); } .empty .btn { margin-top: 12px; }
.menu { position: relative; } .menu > summary { cursor: pointer; } .menu[open] > summary { background: var(--surface-3); color: var(--text); }
.menu-list { position: absolute; top: calc(100% + 4px); inset-inline-end: 0; z-index: 40; min-width: 220px; padding: 4px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow-lg); animation: fade var(--fast) var(--ease); }
.menu-list > * { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px; background: none; color: var(--text); font-size: 13.5px; text-align: start; }
.menu-list .i { color: var(--muted); } .menu-list > :hover { background: var(--surface-2); } .menu-list > .danger, .menu-list > .danger .i { color: var(--red-fg); } .menu-list > .danger:hover { background: var(--red); }
.issues { display: grid; gap: 6px; } .issues li { display: flex; gap: 9px; padding: 9px 11px; border-radius: 8px; background: var(--c); font-size: 13px; } .issues .i { margin-top: 2px; color: var(--d); }
.rules { display: block; margin-top: 12px; font-size: 12px; line-height: 1.6; }

/* ---------- forms & dialogs ---------- */

.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.field { display: grid; gap: 6px; align-content: start; min-width: 0; } .field.full { grid-column: 1 / -1; }
.field > label { font-size: 13px; font-weight: 500; color: var(--text); } .field > label small { font-weight: 400; }
.field.check { display: flex; align-items: center; gap: 10px; cursor: pointer; } .field.check input { width: 16px; min-height: 16px; accent-color: var(--ink); }
input, select, textarea { width: 100%; min-width: 0; min-height: 38px; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--field); font-size: 16px; /* 16px stops iOS zoom */ transition: border-color var(--fast), box-shadow var(--fast); }
@media (min-width: 700px) { input, select, textarea { font-size: 14px; } }
textarea { min-height: 72px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { border-color: var(--link); box-shadow: var(--ring); outline: none; }
::placeholder { color: var(--muted); opacity: .7; }
dialog { width: min(540px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; overflow: auto; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog[open] { animation: rise var(--med) var(--ease); } dialog::backdrop { background: rgb(9 9 11 / .5); } dialog[open]::backdrop { animation: fade var(--med); }
.dlg-head { padding: 20px 22px 0; } .dlg-head h2 { font-size: 16px; } .dlg-head p { margin-top: 6px; color: var(--text-2); }
dialog .grid-form { padding: 18px 22px 2px; }
.form-error { margin: 14px 22px 0; padding: 9px 11px; border-radius: 8px; background: var(--red); color: var(--red-fg); font-size: 13px; }
.dlg-foot { position: sticky; bottom: 0; display: flex; gap: 8px; margin-top: 20px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface); } /* always in reach, even in a long form */
.form-section { grid-column: 1 / -1; display: grid; gap: 2px; margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.form-section:first-child { margin: 0; padding: 0; border: 0; } .form-section small { font-weight: 400; }
.pin { display: block; margin: 14px 0 6px; padding: 14px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface-2); color: var(--text); font: 600 28px var(--mono); letter-spacing: .3em; text-align: center; direction: ltr; }
.toast { position: fixed; inset-inline: 16px; bottom: 20px; z-index: 100; display: flex; align-items: center; gap: 10px; width: fit-content; max-width: min(520px, calc(100vw - 32px)); margin-inline: auto; padding: 10px 16px; border-radius: 8px; background: var(--ink); color: var(--ink-fg); font-weight: 500; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity var(--med), transform var(--med) var(--ease); }
.toast.show { opacity: 1; transform: none; } .toast .i { color: var(--green-dot); } .toast.error .i { color: var(--red-dot); }
.connection { display: flex; align-items: center; gap: 8px; padding: 4px 10px; color: var(--muted); font-size: 12px; }
.connection i { width: 7px; height: 7px; border-radius: 50%; background: var(--green-dot); } .connection.off { color: var(--red-fg); } .connection.off i { background: var(--red-dot); }
.sk { height: 120px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); animation: fade .6s ease-in-out infinite alternate; } .sk.h1 { width: min(360px, 60%); height: 40px; } .sk.tall { height: 320px; }

/* ---------- motion: short and quiet ---------- */

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes flash { from { background-color: var(--surface-3); } }
.fresh { animation: flash 1.4s ease-out; }
::view-transition-old(root) { animation: .12s ease-in both fade reverse; } ::view-transition-new(root) { animation: .18s var(--ease) both fade; }
.theming::view-transition-old(root), .theming::view-transition-new(root) { animation: none; mix-blend-mode: normal; } /* the theme circle is drawn by script */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- sign-in ---------- */

.auth { display: grid; justify-items: center; align-content: center; gap: 28px; min-height: 100dvh; padding: 40px 16px; }
.auth-brand { display: flex; align-items: center; gap: 12px; } .auth-brand img { width: 40px; height: 40px; }
.auth-brand div { display: grid; } .auth-brand b { font-size: 19px; font-weight: 700; line-height: 1.2; } .auth-brand small { font-size: 12.5px; }
.auth-card { display: grid; gap: 22px; width: min(100%, 420px); padding: 28px 32px 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); }
.auth-head { display: grid; gap: 4px; text-align: center; } .auth-head h1 { font-size: 21px; } .auth-head p { color: var(--muted); }
.seg, .tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px; border-radius: 9px; background: var(--surface-3); }
:is(.seg, .tabs) button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 34px; border: 0; border-radius: 7px; background: none; color: var(--text-2); font-weight: 500; transition: background-color var(--fast), color var(--fast); }
:is(.seg, .tabs) button:hover { color: var(--text); } :is(.seg, .tabs) [aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 0 0 1px var(--line); }
.auth-card form { display: grid; gap: 14px; } .auth-card form .btn { width: 100%; margin-top: 6px; } .auth-card .form-error { margin: 0; }
.demo { display: grid; gap: 10px; padding: 14px 16px; border: 1px dashed var(--line-2); border-radius: 8px; font-size: 13px; }
.demo-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; } .demo-head b { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.demo dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; } .demo dt { color: var(--text-2); } .demo dd { font-family: var(--mono); font-size: 13px; text-align: left; }
.auth-note { color: var(--muted); font-size: 12.5px; text-align: center; }
.auth-foot { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }

/* ---------- office: shell ---------- */

.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 2px; padding: 14px 12px; background: var(--panel); border-inline-end: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); } .sidebar .brand { padding: 4px 8px 22px; }
.brand img { width: 30px; height: 30px; } .brand b { display: block; font-size: 15px; font-weight: 700; line-height: 1.2; } .brand small { display: block; font-size: 12px; }
#nav { display: grid; gap: 1px; }
#nav a, .side-btn { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; min-height: 34px; padding: 0 10px; border: 0; border-radius: 7px; background: none; color: var(--text-2); font-size: 13.5px; font-weight: 500; text-align: start; transition: background-color var(--fast), color var(--fast); }
#nav a .i, .side-btn .i { color: var(--muted); } #nav a:hover, .side-btn:hover { background: var(--surface-2); color: var(--text); }
#nav a[aria-current] { background: var(--surface-3); color: var(--text); font-weight: 600; } #nav a[aria-current] .i { color: var(--text); }
#nav em { margin-inline-start: auto; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--ink); color: var(--ink-fg); font-size: 11px; font-style: normal; font-weight: 600; line-height: 19px; text-align: center; }
.side-foot { margin-top: auto; display: grid; gap: 1px; padding-top: 10px; border-top: 1px solid var(--line); }
.content { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; height: var(--top); padding: 0 36px; border-bottom: 1px solid var(--line); background: var(--bg); }
.top-start { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; } .top-start b { overflow: hidden; font-size: 14.5px; white-space: nowrap; text-overflow: ellipsis; }
.env { flex-shrink: 0; padding: 0 8px; border: 1px solid color-mix(in srgb, var(--amber-dot) 45%, transparent); border-radius: 6px; background: var(--amber); color: var(--amber-fg); font-size: 12px; font-weight: 500; line-height: 22px; }
.top-actions { display: flex; align-items: center; gap: 6px; } .topbar .connection { padding: 0 4px; }
.user-btn { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px; border-radius: 8px; color: var(--text); font-size: 13.5px; font-weight: 500; cursor: pointer; transition: background-color var(--fast); }
.user-btn:hover, .menu[open] > .user-btn { background: var(--surface-2); } .user-btn > span { max-width: 160px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .user-btn > .i { width: 14px; color: var(--muted); }
.main { min-width: 0; padding: 28px 36px 56px; }
.page { max-width: 1320px; margin: 0 auto; display: grid; gap: 20px; align-content: start; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; min-height: 40px; }
.page-head h1 { font-size: 23px; } .page-head p { margin-top: 2px; color: var(--muted); }
.page-head.sticky { position: sticky; top: var(--top); z-index: 20; margin: -28px -36px 0; padding: 16px 36px 14px; background: var(--bg); border-bottom: 1px solid var(--line); }
.crumbs { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; font-size: 12.5px; } .crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--text); } .crumbs .i { width: 13px; height: 13px; color: var(--muted); }
.head-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 6px; color: var(--muted); font-size: 13px; }
.dirty { display: inline-flex; align-items: center; gap: 5px; color: var(--amber-fg); font-weight: 500; } .dirty .i { width: 14px; height: 14px; }
.preview-only :is(.report .btn, [data-a="ack"], [data-a="trip"]) { opacity: .5; pointer-events: none; }
.preview-bar { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 16px; background: var(--ink); color: var(--ink-fg); font-size: 13px; font-weight: 500; }

/* ---------- office: dashboard ---------- */

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { display: grid; align-content: start; gap: 2px; padding: 16px 20px 18px; } .stat + .stat { border-inline-start: 1px solid var(--line); }
.stat > span { color: var(--text-2); font-size: 13px; font-weight: 500; } .stat > small { color: var(--muted); }
.stat b { margin-top: 4px; font-size: 28px; line-height: 1.15; } .stat b small { font-size: 15px; font-weight: 500; } .stat.warn b { color: var(--amber-fg); }
.gantt { padding: 10px 18px 16px; overflow-x: auto; }
.g-row { display: grid; grid-template-columns: 150px minmax(560px, 1fr); align-items: center; gap: 12px; min-height: 40px; }
.g-who { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; color: var(--text); font-size: 13px; font-weight: 500; white-space: nowrap; }
.g-track { position: relative; height: 30px; border-radius: 6px; background: repeating-linear-gradient(to left, var(--line) 0 1px, transparent 1px var(--step)), var(--surface-2); }
.g-scale { height: 20px; background: none; } .g-tick { position: absolute; top: 2px; transform: translateX(50%); color: var(--muted); font-size: 11px; }
.g-bar { position: absolute; top: 4px; bottom: 4px; min-width: 6px; padding: 0 4px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--d) 55%, transparent); border-radius: 5px; background: var(--c); color: var(--text); font-size: 11px; font-weight: 600; line-height: 20px; text-align: center; white-space: nowrap; transition: border-color var(--fast); }
.g-bar:hover { border-color: var(--d); } .g-bar.draft { border-style: dashed; }
.g-now { position: absolute; top: -3px; bottom: -3px; z-index: 3; width: 2px; border-radius: 1px; background: var(--red-dot); pointer-events: none; }
.alerts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); }
.alerts li { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.alerts a:not(.icon-btn) { flex: 1; display: grid; min-width: 0; color: var(--text); } .alerts a:hover b { text-decoration: underline; text-underline-offset: 3px; }
.alert-i { display: grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0; border-radius: 7px; background: var(--c); color: var(--d); } .alert-i .i { width: 15px; height: 15px; }

/* ---------- office: board ---------- */

.toolbar { display: grid; gap: 12px; padding: 12px 14px; }
.week-nav { display: flex; align-items: center; gap: 6px; } .week { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); transition: background-color var(--fast), border-color var(--fast); }
.day:hover { background: var(--surface-2); border-color: var(--line-2); } .day b { color: var(--text); font-size: 18px; font-weight: 600; line-height: 1.3; } .day small { font-size: 11.5px; white-space: nowrap; }
.day .dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; min-height: 7px; } .day.is-today small:first-child { color: var(--text); font-weight: 700; }
.day[aria-current] { background: var(--ink); border-color: var(--ink); } .day[aria-current] :is(b, small) { color: var(--ink-fg) !important; } .day[aria-current] .dot { box-shadow: 0 0 0 1.5px var(--ink-fg); }
.toolbar-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.filters { display: flex; flex-wrap: wrap; gap: 2px; }
.filters a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; color: var(--text-2); font-size: 13px; font-weight: 500; transition: background-color var(--fast); }
.filters a:hover { background: var(--surface-2); } .filters a[aria-current] { background: var(--surface-3); color: var(--text); } .filters small { font-size: 12px; }
.date-jump { position: relative; display: flex; align-items: center; } .date-jump .i { position: absolute; inset-inline-start: 10px; color: var(--muted); pointer-events: none; }
.date-jump input { width: 168px; min-height: 32px; padding: 4px 10px; padding-inline-start: 34px; font-size: 13px; }
.lane { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; padding: 14px 18px; } .lane + .lane { border-top: 1px solid var(--line); }
.who { display: flex; align-items: center; gap: 11px; min-width: 0; color: inherit; } .who > div { display: grid; justify-items: start; min-width: 0; } .lane .who { align-items: flex-start; }
a.who:hover b, .who a.name:hover { text-decoration: underline; text-underline-offset: 3px; } .who a.name { color: var(--text); font-weight: 500; }
.lane-add { padding: 10px 12px; border-top: 1px solid var(--line); }
.lane-warn { display: inline-flex; align-items: center; gap: 4px; margin-top: 5px; padding: 0 7px; border-radius: 5px; background: var(--c); color: var(--text); font-size: 11.5px; font-weight: 500; line-height: 20px; cursor: help; } .lane-warn .i { width: 13px; height: 13px; color: var(--d); }
.lane-cards { display: flex; flex-wrap: wrap; gap: 10px; }
.sched { position: relative; width: 290px; display: grid; gap: 7px; align-content: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); transition: border-color var(--fast), box-shadow var(--fast); }
.sched:hover { border-color: var(--line-2); box-shadow: 0 2px 8px rgb(0 0 0 / .06); }
.sched-top { display: flex; align-items: center; gap: 6px; } .sched-top .menu { z-index: 2; margin: -6px 0; margin-inline-start: auto; } .sched-top .kid { position: relative; z-index: 2; padding: 0 5px; }
.sched-title { color: var(--text); font-size: 14px; font-weight: 600; line-height: 1.4; } .sched-title::after { content: ''; position: absolute; inset: 0; } /* the whole card opens it */
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; color: var(--muted); font-size: 12.5px; } .meta .i { width: 14px; height: 14px; } .meta .i:not(:first-child) { margin-inline-start: 8px; }
.sched-prog { display: flex; align-items: center; gap: 8px; } .sched-prog .bar { flex: 1; }
.sched-trips { display: grid; gap: 3px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--text-2); font-size: 12.5px; }
.sched-trips li { display: flex; align-items: center; gap: 7px; } .sched-trips b { color: var(--muted); font-weight: 500; }
.slot { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 140px; min-height: 56px; padding: 10px 14px; border: 1px dashed var(--line-2); border-radius: 8px; color: var(--muted); font-size: 13px; font-weight: 500; transition: border-color var(--fast), color var(--fast); }
.slot:hover { border-color: var(--text-2); color: var(--text); }

/* ---------- office: editor ---------- */

.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; } .editor > .side { position: sticky; top: calc(var(--top) + 118px); }
.trips { display: grid; gap: 12px; padding: 14px; }
.trip { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.trip-head { display: flex; align-items: flex-start; gap: 11px; padding: 12px 14px 8px; } .trip-head h3 { font-size: 14.5px; }
.trip-n { display: grid; place-items: center; width: 24px; height: 24px; flex-shrink: 0; border-radius: 6px; background: var(--surface-3); color: var(--text); font-size: 12px; font-weight: 600; }
.tools { display: flex; align-items: center; }
.trip-empty { margin: 0 14px; padding: 14px; border: 1px dashed var(--line-2); border-radius: 8px; color: var(--muted); text-align: center; }
.trip-foot { padding: 4px 10px 10px; } .stops { padding: 2px 14px 0; }
.stop { display: grid; grid-template-columns: 46px 20px minmax(0, 1fr) auto; gap: 8px; border-radius: 8px; } .stop-time { padding-top: 6px; color: var(--text); font-size: 13px; font-weight: 500; }
.rail { position: relative; } .rail::before { content: ''; position: absolute; inset: 0 50%; width: 1px; background: var(--line-2); }
.stop:first-child .rail::before { top: 13px; } .stop:last-child .rail::before { bottom: calc(100% - 13px); }
.rail::after { content: ''; position: absolute; top: 8px; inset-inline-start: 50%; width: 9px; height: 9px; margin-inline-start: -4.5px; border: 2px solid var(--ink); border-radius: 50%; background: var(--surface); }
.stop.drop .rail::after { background: var(--ink); } .stop.done .rail::after { border-color: var(--green-dot); background: var(--green-dot); } .stop.noshow .rail::after { border-color: var(--red-dot); background: var(--red-dot); }
.stop .grow { padding: 4px 0 11px; } .stop-name { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; }
.note { display: flex; align-items: center; gap: 6px; margin-top: 3px; color: var(--amber-fg); } .note .i { width: 13px; height: 13px; }
.stop .tools { opacity: 0; transition: opacity var(--fast); } .stop:hover .tools, .stop:focus-within .tools { opacity: 1; }
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); }
.stepper li { position: relative; display: grid; justify-items: center; gap: 5px; color: var(--muted); font-size: 12px; text-align: center; }
.stepper li::before { content: ''; position: absolute; top: 12px; inset-inline-start: 50%; width: 100%; height: 1px; background: var(--line-2); } .stepper li:last-child::before { display: none; } .stepper li.done::before { background: var(--ink); }
.stepper span { position: relative; z-index: 1; display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--line-2); border-radius: 50%; background: var(--surface); font-size: 11.5px; font-weight: 600; }
.stepper .i { width: 13px; height: 13px; stroke-width: 2.6; } .stepper .done span { border-color: var(--ink); background: var(--ink); color: var(--ink-fg); }
.stepper .current span { border: 2px solid var(--ink); color: var(--text); } .stepper :is(.done, .current) { color: var(--text); } .stepper small { display: block; font-size: 11px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13px; } .kv dt { color: var(--muted); } .kv dd { font-weight: 500; text-align: end; }

/* ---------- office: drivers & settings ---------- */

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 500; text-align: start; white-space: nowrap; }
.table th:first-child { border-start-start-radius: 10px; } .table th:last-child { border-start-end-radius: 10px; }
.table td { padding: 11px 16px; border-top: 1px solid var(--line); vertical-align: middle; white-space: nowrap; } .table tbody tr:first-child td { border-top: 0; }
.table tbody tr { transition: background-color var(--fast); } .table tbody tr:hover { background: var(--surface-2); } .table tr.off td { color: var(--muted); }
.today-link { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: inherit; } .row-tools { display: flex; justify-content: flex-end; }
.settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; } .setting + .setting { border-top: 1px solid var(--line); }
.setting > div:first-child { display: grid; } .setting input[type="month"] { width: 160px; min-height: 34px; }
.profile { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; } .page-head .who h1 { line-height: 1.2; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 12px 18px; } .list > li + li { border-top: 1px solid var(--line); }
.list > li > a { display: flex; flex: 1; align-items: center; gap: 14px; min-width: 0; margin: -12px -18px; padding: 12px 18px; color: inherit; transition: background-color var(--fast); }
.list > li > a:hover { background: var(--surface-2); } .list .grow > b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.when { display: grid; min-width: 72px; } .when small { font-variant-numeric: tabular-nums; }

/* ---------- driver app ---------- */

.d-app { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.picker { display: grid; gap: 14px; padding: calc(40px + env(safe-area-inset-top)) 18px 32px; }
.dbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; background: var(--bg); border-bottom: 1px solid var(--line); }
.dbar .brand { min-width: 0; gap: 9px; } .dbar .brand img { width: 26px; height: 26px; } .dbar .brand b { overflow: hidden; font-size: 14.5px; white-space: nowrap; text-overflow: ellipsis; }
#app { flex: 1; } .dmain { display: grid; gap: 14px; align-content: start; padding: 20px 14px 24px; }
.hello h1 { font-size: 22px; }
.ack { display: grid; gap: 12px; padding: 14px; border: 1px solid color-mix(in srgb, var(--amber-dot) 45%, transparent); border-radius: 10px; background: var(--amber); }
.ack-top { display: flex; gap: 11px; } .ack-top > .i { width: 20px; height: 20px; margin-top: 2px; color: var(--amber-fg); } .ack-top > div { display: grid; } .ack-top b { font-size: 15px; } .ack small { color: var(--text-2); }
.focus { display: grid; gap: 12px; padding: 16px; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-lg); }
.focus > small { color: var(--text-2); font-weight: 600; } .focus h2 { font-size: 19px; }
.focus-stop { display: flex; gap: 14px; } .focus-stop .time { font-size: 22px; font-weight: 600; line-height: 1.25; } .focus-stop span { color: var(--text-2); font-size: 15px; }
.focus .nav-links .btn { min-height: 44px; }
.tabs button { min-height: 38px; font-size: 14px; } .tabs button span { min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--surface-2); font-size: 12px; line-height: 19px; }
.panel { display: grid; gap: 14px; } .panel > .empty { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.dsched { display: grid; gap: 10px; } .dsched-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 0 2px; } .dsched-head > div { display: grid; } .dsched-head h2 { font-size: 17px; }
.dnote { display: flex; gap: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.dnote > .i { margin-top: 2px; color: var(--amber-dot); } .dnote small { color: var(--text-2); font-weight: 600; }
.dtrip, .dup { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); transition: border-color var(--med); }
.dtrip.started { border-color: var(--blue-dot); } .dtrip.late { border-color: var(--red-dot); } .dtrip.completed { opacity: .8; }
:is(.dtrip, .dup) > summary { display: flex; align-items: center; gap: 12px; padding: 13px 14px; list-style: none; cursor: pointer; } :is(.dtrip, .dup) > summary::-webkit-details-marker { display: none; }
.dtrip .time { display: grid; min-width: 50px; color: var(--muted); font-size: 12.5px; line-height: 1.3; text-align: center; } .dtrip .time b { color: var(--text); font-size: 17px; font-weight: 600; }
.dtrip .side { display: grid; justify-items: end; gap: 6px; }
.chev { color: var(--muted); transition: transform var(--med) var(--ease); } details[open] > summary .chev { transform: rotate(180deg); }
.dtrip-body, .dup-body { display: grid; gap: 12px; padding: 0 14px 14px; } .dstops { display: grid; gap: 8px; }
.dstop { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); transition: background-color var(--med), border-color var(--med); }
.dstop.done { border-color: color-mix(in srgb, var(--green-dot) 45%, transparent); background: var(--green); } .dstop.noshow { border-color: color-mix(in srgb, var(--red-dot) 45%, transparent); background: var(--red); }
.dstop-head { display: flex; gap: 12px; } .dstop .time { min-width: 46px; font-size: 15px; font-weight: 600; } .dstop .grow > small:first-of-type { color: var(--text-2); font-size: 14px; }
.nav-links, .report { display: flex; flex-wrap: wrap; gap: 6px; } .nav-links .btn { flex: 1; min-width: 84px; } .report .btn { flex: 1; min-height: 46px; }
.report.done { align-items: center; gap: 10px; } .report.done .btn { flex: 0 0 auto; min-height: 32px; margin-inline-start: auto; }
.dday { display: grid; gap: 8px; } .dday h2 { padding: 0 2px; color: var(--muted); font-size: 13.5px; font-weight: 500; }
.preview { display: grid; gap: 2px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); } .preview ol { display: grid; gap: 2px; margin-top: 6px; padding-inline-start: 18px; list-style: disc; font-size: 13px; }
.dfoot { display: flex; justify-content: center; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }

/* ---------- responsive ---------- */

@media (max-width: 1200px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat:nth-child(3) { border-inline-start: 0; } .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .editor, .profile { grid-template-columns: minmax(0, 1fr); } :is(.editor, .profile) > .side, .profile > aside { position: static; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
}
@media (max-width: 900px) {
  .shell { display: block; }
  .sidebar { position: fixed; inset: auto 0 0 0; z-index: 50; height: auto; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--line); }
  .sidebar .brand, .side-foot { display: none; } #nav { flex: 1; grid-template-columns: repeat(4, 1fr); }
  #nav a { flex-direction: column; justify-content: center; gap: 2px; min-height: 50px; padding: 4px 2px; font-size: 11px; text-align: center; } #nav a .i { width: 20px; height: 20px; }
  #nav a[aria-current] { background: none; } #nav a[aria-current] .i { color: var(--text); }
  #nav em { position: absolute; top: 2px; inset-inline-start: calc(50% + 6px); min-width: 17px; padding: 0 4px; font-size: 10.5px; line-height: 16px; }
  .main { padding: 18px 14px calc(90px + env(safe-area-inset-bottom)); } .page-head h1 { font-size: 20px; }
  .topbar { gap: 8px; padding: 0 14px; } .topbar .connection span, .user-btn > :not(.avatar) { display: none; }
  .page-head.sticky { margin: -18px -14px 0; padding: 12px 14px; } .page-head.sticky .actions { width: 100%; } .page-head.sticky .actions > .btn { flex: 1; }
  .settings { grid-template-columns: minmax(0, 1fr); }
  .week-nav > .icon-btn, .day small:last-child { display: none; } .week { gap: 4px; } .day { padding: 7px 2px; }
  .toolbar-row { display: grid; } .filters { flex-wrap: nowrap; margin: 0 -14px; padding: 0 14px 2px; overflow-x: auto; scrollbar-width: none; } .filters a { flex-shrink: 0; }
  .lane { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px; } .sched, .slot { width: 100%; } .slot { min-height: 44px; }
  .g-row { grid-template-columns: 104px minmax(520px, 1fr); }
  .table thead { display: none; } .table, .table tbody, .table tr, .table td { display: block; }
  .table tr { position: relative; padding: 12px 14px; } .table tbody tr + tr { border-top: 1px solid var(--line); }
  .table td { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border: 0; } .table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; }
  .table td:first-child { padding-inline-end: 80px; padding-bottom: 8px; } .table td:first-child::before { display: none; } .row-tools { position: absolute; top: 10px; inset-inline-end: 8px; }
  .setting { flex-direction: column; align-items: stretch; }
}
@media (max-width: 560px) {
  .stat { padding: 13px 14px; } .stat b { font-size: 24px; } .grid-form { grid-template-columns: 1fr; }
  .auth { align-content: start; gap: 22px; padding-top: calc(36px + env(safe-area-inset-top)); } .auth-card { padding: 22px 18px 24px; box-shadow: var(--shadow); }
  .trips { padding: 10px; } .stops { padding: 2px 10px 0; } .stop { grid-template-columns: 42px 16px minmax(0, 1fr); } .stop .tools { grid-column: 3; margin-top: -6px; padding-bottom: 8px; }
  .card-head, .card-body { padding-inline: 14px; }
  dialog { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto auto 0; border-radius: 12px 12px 0 0; }
  .dlg-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); } .dlg-foot .btn { flex: 1; min-height: 44px; }
}
@media (hover: none) { .btn { min-height: 42px; } .btn.sm { min-height: 36px; } .icon-btn { width: 38px; height: 38px; } .stop .tools { opacity: 1; } }

/* ---------- print: the editor becomes a driver sheet ---------- */

@media print {
  :root, [data-theme="dark"] { color-scheme: light; --bg: #fff; --surface: #fff; --surface-2: #fff; --text: #000; --text-2: #222; --muted: #555; --line: #ccc; --line-2: #bbb; --ink: #000; }
  .shell, .editor { display: block; } .main { padding: 0; } .card, .trip { box-shadow: none; break-inside: avoid; }
  .sidebar, .topbar, .no-print, .toast, .editor > .side > :not(:nth-child(2)) { display: none !important; }
  .page-head.sticky { position: static; margin: 0 0 12px; padding: 0; border: 0; }
}

/* Fleet extension: inherits Drivo colors, type and RTL. */
.fleet-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:12px;margin-top:16px}.fleet-tile{border:1px solid var(--line, #ddd);border-radius:14px;padding:16px}.fleet-tile .actions{display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap}.fleet-tile small{display:block;margin:10px 0}.driver-vehicle{margin-bottom:16px}
