/* ==========================================================================
   Araç Takip design system
   Tokens → base → layout → components → pages. Light by default; dark through
   prefers-color-scheme or html[data-theme="dark"] (user choice wins).
   ========================================================================== */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f0f3f7;
  --surface-3: #e5e9f0;
  --line: #e4e8ee;
  --line-strong: #d2d8e1;
  --text: #121826;
  --text-2: #566074;
  --text-3: #8992a3;
  --brand: #012e72;
  --ink: #012e72;
  --ink-hover: #0a3d8f;
  --on-ink: #ffffff;
  --accent: #1b5fcc;
  --accent-soft: #e6eefc;
  --focus: rgba(27, 95, 204, .3);

  --green: #188a4d;  --green-soft: #e3f3ea;
  --blue: #1b5fcc;   --blue-soft: #e6eefc;
  --cyan: #08809e;   --cyan-soft: #e0f2f7;
  --violet: #6f4fd0; --violet-soft: #eee9fb;
  --amber: #a86a00;  --amber-soft: #fcf0d6;
  --red: #cf3434;    --red-soft: #fbe8e8;
  --gray: #6b7280;   --gray-soft: #eef0f3;

  --glow: rgba(1, 46, 114, .07);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(23, 23, 26, .04);
  --shadow: 0 1px 2px rgba(23, 23, 26, .04), 0 6px 20px rgba(23, 23, 26, .045);
  --shadow-lg: 0 18px 48px rgba(23, 23, 26, .16);
  --sidebar-w: 248px;
  --bottom-h: 62px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f17; --surface: #131924; --surface-2: #1a2130; --surface-3: #232b3b;
    --line: #222a38; --line-strong: #303a4c;
    --text: #eef2f8; --text-2: #a3adbf; --text-3: #6d7789;
    --brand: #6ea2ff; --ink: #3a76ea; --ink-hover: #4c84f0; --on-ink: #ffffff;
    --accent: #6ea2ff; --accent-soft: rgba(110, 162, 255, .14); --focus: rgba(110, 162, 255, .4);
    --green: #45cf86; --green-soft: rgba(69, 207, 134, .13);
    --blue: #6ea2ff; --blue-soft: rgba(110, 162, 255, .14);
    --cyan: #4cc9e6; --cyan-soft: rgba(76, 201, 230, .13);
    --violet: #a68cff; --violet-soft: rgba(166, 140, 255, .14);
    --amber: #f0b23d; --amber-soft: rgba(240, 178, 61, .14);
    --red: #ff6b6b; --red-soft: rgba(255, 107, 107, .14);
    --gray: #9aa3b2; --gray-soft: rgba(154, 163, 178, .14);
    --glow: rgba(58, 118, 234, .08);
    --shadow-sm: none; --shadow: none; --shadow-lg: 0 18px 48px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0f17; --surface: #131924; --surface-2: #1a2130; --surface-3: #232b3b;
  --line: #222a38; --line-strong: #303a4c;
  --text: #eef2f8; --text-2: #a3adbf; --text-3: #6d7789;
  --brand: #6ea2ff; --ink: #3a76ea; --ink-hover: #4c84f0; --on-ink: #ffffff;
  --accent: #6ea2ff; --accent-soft: rgba(110, 162, 255, .14); --focus: rgba(110, 162, 255, .4);
  --green: #45cf86; --green-soft: rgba(69, 207, 134, .13);
  --blue: #6ea2ff; --blue-soft: rgba(110, 162, 255, .14);
  --cyan: #4cc9e6; --cyan-soft: rgba(76, 201, 230, .13);
  --violet: #a68cff; --violet-soft: rgba(166, 140, 255, .14);
  --amber: #f0b23d; --amber-soft: rgba(240, 178, 61, .14);
  --red: #ff6b6b; --red-soft: rgba(255, 107, 107, .14);
  --gray: #9aa3b2; --gray-soft: rgba(154, 163, 178, .14);
  --glow: rgba(58, 118, 234, .08);
  --shadow-sm: none; --shadow: none; --shadow-lg: 0 18px 48px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: radial-gradient(1100px 520px at 50% 115%, var(--glow), transparent 70%) fixed, var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 650; letter-spacing: -.015em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

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

.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

/* ---------- App shell ---------- */

.app { min-height: 100dvh; }

.sidebar { display: none; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 56px; padding: 0 16px;
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .logo { height: 27px; width: auto; }
.brand .logo-mark { width: 30px; height: 30px; }
.brand-compact { display: none; }

/* Logo colorways: navy on light, white on dark. */
.on-dark { display: none; }
:root[data-theme="dark"] .on-light { display: none; }
:root[data-theme="dark"] .on-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .on-light { display: none; }
  :root:not([data-theme="light"]) .on-dark { display: block; }
}

/* Icon tile used on auth pages and empty states. */
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.brand-mark .icon { width: 18px; height: 18px; stroke-width: 2; }

.main {
  width: 100%; margin: 0;
  padding: 8px 16px calc(var(--bottom-h) + 32px + env(safe-area-inset-bottom));
}
.app.focus .main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

.bottom-nav {
  position: fixed; inset: auto 0 0 0; z-index: 50;
  display: flex;
  height: calc(var(--bottom-h) + env(safe-area-inset-bottom));
  padding: 0 8px env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
}
.app.focus .bottom-nav { display: none; }
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 550; color: var(--text-3);
}
.bottom-nav a .icon { width: 23px; height: 23px; }
.bottom-nav a.active { color: var(--text); }
.bottom-nav a.active .icon { color: var(--accent); }

@media (min-width: 1024px) {
  .app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .topbar, .bottom-nav { display: none; }

  .sidebar {
    position: sticky; top: 0; height: 100dvh;
    display: flex; flex-direction: column; gap: 4px;
    padding: 22px 14px 16px;
    border-right: 1px solid var(--line);
  }
  .sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 0 22px 10px; }
  .nav-label { padding: 18px 12px 6px; font-size: 12px; font-weight: 600; color: var(--text-3); }
  .nav-link {
    display: flex; align-items: center; gap: 12px;
    height: 40px; padding: 0 12px; border-radius: 12px;
    font-weight: 520; color: var(--text-2);
    transition: background .15s, color .15s;
  }
  .nav-link:hover { background: var(--surface-2); color: var(--text); }
  .nav-link.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
  .nav-link.active .icon { color: var(--accent); }
  .sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
  .sidebar-user { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
  .sidebar-user:hover { background: var(--surface-2); }
  .sidebar-user .who { min-width: 0; }
  .sidebar-user .who strong { display: block; font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sidebar-user .who > span { display: block; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .main { padding: 36px 40px 56px; }
  .app.focus .main { padding-bottom: 120px; }
}

/* ---------- Page header ---------- */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 20px; }
.page-title { font-size: 30px; line-height: 1.1; font-weight: 700; letter-spacing: -.025em; }
.page-sub { margin-top: 6px; color: var(--text-2); font-size: 14px; }
.page-actions { display: flex; gap: 8px; flex: none; }
.back {
  display: inline-flex; align-items: center; gap: 4px; margin: 4px 0 10px -6px;
  height: 34px; padding: 0 10px 0 4px; border-radius: 10px; color: var(--text-2); font-weight: 520;
}
.back:hover { background: var(--surface-2); color: var(--text); }
@media (min-width: 1024px) { .page-title { font-size: 32px; } .page-head { margin: 0 0 28px; } }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border: 0; border-radius: 13px;
  font-weight: 600; font-size: 15px; white-space: nowrap; cursor: pointer;
  transition: transform .12s var(--ease), background .15s, opacity .15s, box-shadow .15s;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }
.btn-ink { background: var(--ink); color: var(--on-ink); }
.btn-ink:hover { background: var(--ink-hover); }
.btn-soft { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-soft:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger-soft { background: var(--red-soft); color: var(--red); }
.btn-block { width: 100%; }
.btn-sm { height: 36px; padding: 0 14px; border-radius: 11px; font-size: 14px; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 12px; }
.btn-icon.btn-sm { width: 34px; height: 34px; border-radius: 10px; }

/* Primary page action: icon-only circle on phones, labelled on larger screens. */
.btn-add { width: 44px; padding: 0; border-radius: 50%; }
.btn-add span { display: none; }
@media (min-width: 640px) { .btn-add { width: auto; padding: 0 18px; border-radius: 13px; } .btn-add span { display: inline; } }

.link { color: var(--accent); font-weight: 560; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Cards & grouped lists ---------- */

.card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); border: 1px solid var(--line); }
.card-pad { padding: 18px; }
@media (min-width: 640px) { .card-pad { padding: 22px; } }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; font-size: 15px; font-weight: 650; }
.card-title .icon { color: var(--text-3); }
.card-title.flush { margin-bottom: 0; }
.stack { display: grid; gap: 14px; }
@media (min-width: 640px) { .stack { gap: 16px; } }

.rows { display: grid; }
.row {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 0;
  border-top: 1px solid var(--line);
}
.row:first-child { border-top: 0; padding-top: 0; min-height: 42px; }
.row:last-child { padding-bottom: 0; }
.row-label { color: var(--text-2); flex: 1; min-width: 0; }
.row-value { font-weight: 560; text-align: right; }
.row .icon { color: var(--text-3); }

.list { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-top: 1px solid var(--line); transition: background .12s; }
.list-item:first-child { border-top: 0; }
a.list-item:hover { background: var(--surface-2); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .sub { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .chev { color: var(--text-3); }

/* ---------- Chips & badges ---------- */

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  background: var(--gray-soft); color: var(--gray);
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip .icon { width: 14px; height: 14px; }
.chip-green { background: var(--green-soft); color: var(--green); }
.chip-blue { background: var(--blue-soft); color: var(--blue); }
.chip-cyan { background: var(--cyan-soft); color: var(--cyan); }
.chip-violet { background: var(--violet-soft); color: var(--violet); }
.chip-amber { background: var(--amber-soft); color: var(--amber); }
.chip-red { background: var(--red-soft); color: var(--red); }
.chip-accent { background: var(--accent-soft); color: var(--accent); }
.chip-solid { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* Status colors: available green, reserved violet, in use blue, maintenance amber, passive gray. */
.status-available { background: var(--green-soft); color: var(--green); }
.status-reserved { background: var(--violet-soft); color: var(--violet); }
.status-inuse { background: var(--cyan-soft); color: var(--cyan); }
.status-maintenance { background: var(--amber-soft); color: var(--amber); }
.status-passive { background: var(--gray-soft); color: var(--gray); }
.status-available .dot { background: var(--green); } .status-reserved .dot { background: var(--violet); }
.status-inuse .dot { background: var(--cyan); } .status-maintenance .dot { background: var(--amber); }
.status-passive .dot { background: var(--gray); }

/* Chips laid over a photo: frosted surface, the dot keeps the status color. */
.vcard-media .chip, .hero .chip {
  background: color-mix(in srgb, var(--surface) 90%, transparent); color: var(--text);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 1px 4px rgba(0,0,0,.12);
}

/* Turkish licence plate: blue TR band, white plate, black letters — stays white in dark mode like the real thing. */
.plate {
  display: inline-flex; align-items: stretch; height: 26px; border-radius: 5px; overflow: hidden;
  background: #fff; color: #111; border: 1.5px solid #1a1a1a; box-shadow: 0 1px 2px rgba(0,0,0,.08);
  font: 700 13.5px/1 var(--font-display); letter-spacing: .06em; white-space: nowrap;
}
.plate-tr { display: grid; place-items: end center; width: 15px; padding-bottom: 3px; background: #1f47b0; color: #fff; font-size: 7px; letter-spacing: 0; }
.plate-no { display: grid; place-items: center; padding: 0 8px 0 7px; font-variant-numeric: tabular-nums; }
.plate-lg { height: 34px; font-size: 18px; border-width: 2px; border-radius: 6px; }
.plate-lg .plate-tr { width: 19px; font-size: 9px; padding-bottom: 4px; }
.plate-lg .plate-no { padding: 0 11px 0 10px; }

/* ---------- Avatars ---------- */

.avatar {
  display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%;
  font-size: 14px; font-weight: 650; letter-spacing: .01em;
}
.avatar-sm { width: 30px; height: 30px; font-size: 12px; }
.avatar-lg { width: 72px; height: 72px; font-size: 26px; }
.tone-0 { background: #fde7dc; color: #b8461a; }
.tone-1 { background: #e2ecfd; color: #2a5bc0; }
.tone-2 { background: #e2f3e9; color: #1d7a47; }
.tone-3 { background: #efe8fc; color: #6243c0; }
.tone-4 { background: #fcefd5; color: #96610a; }
.tone-5 { background: #e6f0f2; color: #2c6c78; }
:root[data-theme="dark"] [class*="tone-"] { filter: saturate(.9) brightness(.82); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) [class*="tone-"] { filter: saturate(.9) brightness(.82); } }

/* ---------- Forms ---------- */

.form-grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } .form-grid .span-2 { grid-column: 1 / -1; } }

.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12.5px; color: var(--text-3); }
.input, .select, .textarea {
  width: 100%; height: 46px; padding: 0 14px;
  border: 1px solid transparent; border-radius: var(--radius);
  background: var(--surface-2); color: var(--text);
  font-size: 16px; /* 16px stops iOS from zooming into the field */
  transition: border-color .15s, background .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { background: var(--surface-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--focus); }
.select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2392929a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input[type="date"] { min-height: 46px; }
.input-validation-error, .field.has-error .input, .field.has-error .select { border-color: var(--red); background: var(--red-soft); }
.field-error { font-size: 13px; color: var(--red); font-weight: 520; }
.field-error:empty { display: none; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 48px; }
.input-wrap .reveal { position: absolute; right: 4px; top: 3px; }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 42px; }

.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius); font-size: 14px; font-weight: 520; }
.alert ul { margin: 0; padding-left: 18px; }
.alert-error { background: var(--red-soft); color: var(--red); }
.alert-info { background: var(--blue-soft); color: var(--blue); }
.validation-summary-valid { display: none; }

/* Switch (checkbox) */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; min-height: 32px; }
.switch-text { display: grid; gap: 2px; }
.switch-text strong { font-weight: 560; }
.switch-text small { color: var(--text-3); font-size: 13px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  position: relative; flex: none; width: 50px; height: 30px; border-radius: 99px;
  background: var(--surface-3); transition: background .2s var(--ease);
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: transform .22s var(--ease);
}
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch.compact { justify-content: flex-start; gap: 10px; }
.switch.compact .track { width: 44px; height: 26px; }
.switch.compact .track::after { width: 20px; height: 20px; }
.switch.compact input:checked + .track::after { transform: translateX(18px); }

/* Segmented control */
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 13px; background: var(--surface-3); }
.segmented.block { display: flex; }
.segmented label, .segmented a {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 10px;
  font-size: 14px; font-weight: 560; color: var(--text-2); cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s;
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented input:checked + span, .segmented a.active { color: var(--text); }
.segmented label:has(input:checked), .segmented a.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.segmented label:has(input:focus-visible) { outline: 3px solid var(--focus); }

.segmented .dot { width: 7px; height: 7px; border-radius: 50%; }

/* Selectable cards (roles on the user form) */
.option-cards { display: grid; gap: 10px; }
@media (min-width: 640px) { .option-cards { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
.option-card {
  position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px; cursor: pointer;
  border-radius: var(--radius); background: var(--surface-2); border: 1.5px solid transparent;
  transition: border-color .15s, background .15s;
}
.option-card input { position: absolute; opacity: 0; }
.option-card .tick {
  display: grid; place-items: center; flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 7px;
  border: 1.5px solid var(--line-strong); background: var(--surface); color: transparent; transition: all .15s;
}
.option-card .tick .icon { width: 14px; height: 14px; stroke-width: 3; }
.option-card strong { display: block; font-weight: 600; }
.option-card small { display: block; color: var(--text-2); font-size: 13px; margin-top: 2px; }
.option-card:has(input:checked) { border-color: var(--ink); background: var(--surface); }
.option-card:has(input:checked) .tick { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.option-card:has(input:focus-visible) { outline: 3px solid var(--focus); }

/* Sticky save bar on form pages */
.form-bar {
  position: fixed; inset: auto 0 0 0; z-index: 45;
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--line);
}
.form-bar .btn { flex: 1; }
@media (min-width: 640px) { .form-bar .btn { flex: none; min-width: 140px; } }
@media (min-width: 1024px) { .form-bar { left: var(--sidebar-w); padding: 14px 40px; } }

/* Status dots (lists, filters) */
.dot-available { background: var(--green); } .dot-reserved { background: var(--violet); } .dot-inuse { background: var(--cyan); }
.dot-maintenance { background: var(--amber); } .dot-passive { background: var(--gray); }

/* ---------- Vehicle cards ---------- */

/* Compact cards: small photo on the left at every width, as many columns as fit. */
.vehicle-grid { display: grid; gap: 10px; }
@media (min-width: 640px) { .vehicle-grid { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; } }

.vcard {
  display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: start; gap: 12px; padding: 9px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
.vcard:hover { box-shadow: var(--shadow); border-color: var(--line-strong); }
.vcard:active { transform: scale(.99); }
.vcard-media { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.vcard-media img { width: 100%; height: 100%; object-fit: cover; }
.vcard-media .chip { display: none; }
.vcard-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 2px 4px 0 0; }
.vcard-next { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--violet); }
.vcard-next .icon { width: 14px; height: 14px; }
.vcard-title { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.vcard-title strong { font-size: 15px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcard-title span { font-size: 13px; color: var(--text-3); flex: none; }
.vcard-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--text-2); }
.vcard-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.vcard-meta .icon { width: 15px; height: 15px; color: var(--text-3); }
.vcard-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.vcard-foot .status-chip-inline { display: inline-flex; }


/* Placeholder when a vehicle has no photo yet */
.media-empty {
  display: grid; place-items: center; width: 100%; height: 100%; color: var(--text-3);
  background:
    radial-gradient(120% 80% at 50% 100%, var(--surface-3), transparent 70%),
    var(--surface-2);
}
.media-empty .icon { width: 38%; height: 38%; max-width: 72px; stroke-width: 1.2; opacity: .55; }

/* ---------- Vehicle detail ---------- */

.detail { display: grid; gap: 16px; }
@media (min-width: 1024px) { .detail { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: start; } .detail-side { position: sticky; top: 24px; } }

.hero { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero .chip { position: absolute; top: 14px; left: 14px; }

.title-block { display: grid; gap: 10px; margin: 18px 0 16px; }
.title-block h1 { font-size: 28px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
.title-block h1 small { display: block; margin-top: 4px; font: 500 15px/1.3 var(--font); color: var(--text-2); letter-spacing: 0; }
.title-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .specs { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.spec { display: grid; gap: 10px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.spec .icon { color: var(--text-3); }
.spec strong { display: block; font-size: 17px; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.spec span { display: block; font-size: 12.5px; color: var(--text-3); margin-top: 1px; }

.doc-row .days { font-size: 13px; }
.doc-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--surface-2); flex: none; }
.doc-icon .icon { color: var(--text-2); }
.doc-main { flex: 1; min-width: 0; }
.doc-main strong { display: block; font-weight: 560; }
.doc-main span { display: block; font-size: 13px; color: var(--text-3); }

/* Approval chain */
.chain { display: grid; gap: 0; }
.chain-step { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.chain-step + .chain-step::before { content: ""; position: absolute; left: 14px; top: -10px; height: 20px; border-left: 2px dotted var(--line-strong); }
.chain-no { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); font-size: 13px; font-weight: 650; color: var(--text-2); }
.chain-step strong { display: block; font-weight: 580; }
.chain-step > div > span { display: block; font-size: 13px; color: var(--text-3); }

.empty-inline { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 14px; }
.empty-inline .icon { color: var(--green); }

/* ---------- Form page layout ---------- */

.form-page > .alert { margin-bottom: 14px; }
.form-columns { display: grid; gap: 14px; }
@media (min-width: 1100px) { .form-columns { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; } }
.reveal-block { margin-top: 16px; }
.approver-editor { display: grid; gap: 10px; }
.approver-editor.is-empty .approvers { display: none; }
.title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.title-row .page-actions form { display: contents; }

/* ---------- Approver editor (vehicle form) ---------- */

.approvers { display: grid; gap: 8px; }
.approver {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px;
  border-radius: var(--radius); background: var(--surface-2);
}
.approver .chain-no { background: var(--surface); }
.approver .who { flex: 1; min-width: 0; }
.approver .who strong { display: block; font-weight: 580; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.approver .who span { display: block; font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.approver .btn-icon { color: var(--text-2); }
.approver:first-child [data-move="up"], .approver:last-child [data-move="down"] { visibility: hidden; }

/* Photo picker */
.photo-picker { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-2); border: 1.5px dashed var(--line-strong); cursor: pointer; }
.photo-picker:hover { border-color: var(--text-3); }
.photo-picker input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-picker img { width: 100%; height: 100%; object-fit: cover; }
.photo-picker .placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--text-2); font-weight: 560; text-align: center; padding: 16px; }
.photo-picker .placeholder .icon { width: 30px; height: 30px; color: var(--text-3); }
.photo-picker .placeholder small { color: var(--text-3); font-weight: 450; }
.photo-picker.has-image { border-style: solid; border-color: var(--line); }
.photo-picker.has-image .placeholder { display: none; }
.photo-actions { display: flex; gap: 8px; margin-top: 10px; }

/* ---------- Tabs ---------- */

.tabs { display: flex; gap: 4px; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.tab { position: relative; padding: 10px 4px 12px; margin-right: 18px; font-weight: 580; color: var(--text-3); }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); }
.tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }

/* ---------- History timeline ---------- */

.timeline { display: grid; }
.event { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding-bottom: 22px; }
.event:not(:last-child)::before { content: ""; position: absolute; left: 14px; top: 34px; bottom: 4px; width: 2px; background: var(--line); }
.event-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding-top: 4px; }
.event-head strong { font-weight: 600; }
.event-head time { font-size: 13px; color: var(--text-3); }
.event-changes { display: grid; gap: 6px; margin-top: 8px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); font-size: 14px; }
.change { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.change .field-name { color: var(--text-2); min-width: 120px; }
.change del { color: var(--text-3); text-decoration-color: var(--text-3); }
.change .icon { width: 14px; height: 14px; color: var(--text-3); align-self: center; }
.change ins { text-decoration: none; font-weight: 580; }

/* ---------- Roles & permissions ---------- */

.role-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1280px) { .role-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.role-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; transition: box-shadow .2s, border-color .2s; }
.role-card:hover { border-color: var(--line-strong); }
.role-card h3 { font-size: 17px; display: flex; align-items: center; gap: 8px; }
.role-card p { color: var(--text-2); font-size: 14px; flex: 1; }
.role-stats { display: flex; gap: 16px; font-size: 13px; color: var(--text-3); }
.role-stats span { display: inline-flex; align-items: center; gap: 6px; }
.role-stats .icon { width: 15px; height: 15px; }

.perm-group .card-title small { font-weight: 500; color: var(--text-3); font-size: 13px; }
.perm-group .switch { padding: 10px 0; border-top: 1px solid var(--line); }
.perm-group .switch:first-of-type { border-top: 0; padding-top: 2px; }

/* ---------- Profile ---------- */

.profile-head { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.profile-head h1 { font-size: 24px; }
.profile-head p { color: var(--text-2); }
.profile-grid { display: grid; gap: 16px; margin-top: 22px; }
@media (min-width: 1024px) { .profile-grid { grid-template-columns: 1fr 1fr; align-items: start; } }

/* ---------- Empty state ---------- */

.empty { display: grid; justify-items: center; gap: 10px; padding: 56px 20px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); color: var(--text-3); margin-bottom: 4px; }
.empty-icon .icon { width: 28px; height: 28px; }
.empty h3 { font-size: 18px; }
.empty p { color: var(--text-2); max-width: 340px; }
.empty .btn { margin-top: 8px; }

/* ---------- Toast ---------- */

.toast {
  position: fixed; z-index: 100; left: 50%; top: calc(12px + env(safe-area-inset-top)); translate: -50% 0;
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px);
  padding: 12px 18px 12px 14px; border-radius: 16px;
  background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow-lg);
  font-size: 14.5px; font-weight: 560;
  animation: toast-in .35s var(--ease) both;
}
.toast .icon { color: #7fb0ff; }
.toast.hide { animation: toast-out .3s var(--ease) both; }
@media (min-width: 1024px) { .toast { top: 24px; left: auto; right: 28px; translate: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px) scale(.98); } }

/* ---------- Dialog (bottom sheet on phones, modal on desktop) ---------- */

dialog.sheet {
  width: 100%; max-width: 100%; margin: auto 0 0; padding: 0; border: 0;
  border-radius: 24px 24px 0 0; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-lg);
}
dialog.sheet::backdrop { background: rgba(10, 10, 12, .42); backdrop-filter: blur(2px); }
dialog.sheet[open] { animation: sheet-in .32s var(--ease) both; }
.sheet-body { display: grid; justify-items: center; gap: 8px; padding: 26px 22px calc(18px + env(safe-area-inset-bottom)); text-align: center; }
.sheet-body::before { content: ""; width: 40px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: -12px 0 10px; }
.sheet-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--red-soft); color: var(--red); margin-bottom: 6px; }
.sheet-icon .icon { width: 24px; height: 24px; }
.sheet-body h3 { font-size: 19px; }
.sheet-body p { color: var(--text-2); max-width: 340px; }
.sheet-actions { display: grid; gap: 8px; width: 100%; margin-top: 16px; }
@media (min-width: 640px) {
  dialog.sheet { width: 420px; margin: auto; border-radius: 24px; }
  dialog.sheet[open] { animation: pop-in .22s var(--ease) both; }
  .sheet-body::before { display: none; }
  .sheet-body { padding: 28px; }
  .sheet-actions { grid-template-columns: 1fr 1fr; }
  .sheet-actions .btn:first-child { order: 2; }
}
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.96); } }

/* ---------- Auth pages ---------- */

.auth {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(900px 480px at 50% 110%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%),
    radial-gradient(600px 300px at 85% -10%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 70%),
    var(--bg);
}
.auth-card { width: 100%; max-width: 400px; }
.auth-head { display: grid; justify-items: center; gap: 14px; text-align: center; margin-bottom: 28px; }
.auth-head .brand-mark { width: 52px; height: 52px; border-radius: 16px; }
.auth-logo .logo { height: 40px; width: auto; }
.auth-head .brand-mark .icon { width: 26px; height: 26px; }
.auth-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.025em; }
.auth-head p { color: var(--text-2); }
.auth-panel { padding: 24px; }
.auth-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.auth-note { margin-top: 20px; text-align: center; font-size: 13px; color: var(--text-3); }

.sent-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: var(--green-soft); color: var(--green); }
.sent-icon .icon { width: 30px; height: 30px; }

/* ---------- Error pages ---------- */

.error-page { display: grid; place-items: center; min-height: 60dvh; text-align: center; }
.error-code { font: 800 72px/1 var(--font-display); letter-spacing: -.04em; color: var(--surface-3); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Admin pages ---------- */

.admin-tabs { margin: 4px 0 14px; }
@media (min-width: 1024px) { .admin-tabs { display: none; } }
.list-tags { display: none; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.list-tags .chip:not(.role-tag) { display: inline-flex; }
@media (max-width: 639px) { .list-tags { display: flex; } .list-tags .role-tag { display: none; } }
@media (min-width: 640px) { .list-tags { display: flex; } }
.form-narrow { max-width: none; }
fieldset.plain { margin: 0; min-width: 0; }
fieldset.plain:disabled .switch { cursor: default; opacity: .75; }
.perm-grid { display: grid; gap: 14px; }
@media (min-width: 900px) { .perm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; } }

/* ==========================================================================
   Reservations, approvals, calendar, documents
   ========================================================================== */

.mobile-only { display: block; }
@media (min-width: 1024px) { .mobile-only { display: none; } }
.small { font-size: 13px; font-weight: 560; }
.grow { flex: 1; min-width: 0; }

/* Navigation extras */
.nav-cta { margin: 0 2px 14px; height: 42px; }
.nav-link .count-badge { margin-left: auto; }
.count-badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  background: var(--red); color: #fff; font-size: 11.5px; font-weight: 700;
}
.bottom-nav .nav-icon { position: relative; display: grid; }
.dot-badge { position: absolute; top: -1px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); border: 2px solid var(--surface); }
.bottom-nav .nav-fab { flex: 0 0 auto; padding: 0 6px; }
.nav-fab > span {
  display: grid; place-items: center; width: 50px; height: 50px; margin-top: -18px; border-radius: 18px;
  background: var(--ink); color: var(--on-ink); box-shadow: 0 8px 20px color-mix(in srgb, var(--ink) 35%, transparent);
}
.bottom-nav a.nav-fab .icon, .bottom-nav a.nav-fab.active .icon { width: 24px; height: 24px; color: var(--on-ink); stroke-width: 2.2; }
.list-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.list-icon .icon { width: 18px; height: 18px; }

/* Banner (e.g. "3 requests wait for you") */
.banner {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 16px;
  border-radius: var(--radius); background: var(--amber-soft); color: var(--text);
}
.banner-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface); color: var(--amber); }
.banner .chev { color: var(--text-3); }

.segmented.scroll { max-width: 100%; overflow-x: auto; scrollbar-width: none; }

.alert-warn { background: var(--amber-soft); color: var(--text); align-items: flex-start; }
.alert-warn > .icon { color: var(--amber); margin-top: 1px; }
.alert-warn p { color: var(--text-2); margin-top: 2px; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* Reservation cards (lists) */
.rcard-list { display: grid; gap: 12px; }
@media (min-width: 900px) { .rcard-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 1500px) { .rcard-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rcard {
  display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 10px; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, border-color .2s;
}
.rcard:hover { box-shadow: var(--shadow); border-color: var(--line-strong); }
.rcard-media { aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.rcard-media img { width: 100%; height: 100%; object-fit: cover; }
.rcard-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; min-width: 0; padding: 2px 4px 2px 0; }
.rcard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rcard-top strong { flex: 1; min-width: 0; font-size: 16px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rcard-top .chip { flex: none; }
.rcard-meta { display: grid; gap: 4px; font-size: 13.5px; color: var(--text-2); }
.rcard-meta > span { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rcard-meta .icon { width: 15px; height: 15px; color: var(--text-3); flex: none; }
.rcard-meta .waiting { color: var(--amber); }
.rcard-meta .waiting .icon { color: var(--amber); }

/* Vehicle choice list on the request form */
.choices-summary { margin-bottom: 12px; }
#vehicle-choices.is-loading { opacity: .5; pointer-events: none; transition: opacity .2s; }
#vehicle-choices > .alert { margin-bottom: 12px; }
.choices { display: grid; gap: 8px; }
@media (min-width: 900px) { .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1500px) { .choices { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.choice {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; cursor: pointer;
  border-radius: var(--radius); background: var(--surface-2); border: 1.5px solid transparent; transition: border-color .15s, background .15s;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-media { flex: none; width: 56px; height: 56px; border-radius: 12px; overflow: hidden; background: var(--surface-3); }
.choice-media img { width: 100%; height: 100%; object-fit: cover; }
.choice-media .media-empty .icon { width: 50%; height: 50%; }
.choice-main { flex: 1; min-width: 0; display: grid; gap: 5px; justify-items: start; }
.choice-main strong { max-width: 100%; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.choice-main .plate { height: 22px; font-size: 12px; }
.choice-side { display: flex; align-items: center; gap: 8px; flex: none; }
.radio-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); transition: all .15s; }
.choice:has(input:checked) { border-color: var(--ink); background: var(--surface); }
.choice:has(input:checked) .radio-dot { border: 7px solid var(--ink); }
.choice:has(input:focus-visible) { outline: 3px solid var(--focus); }
.choice.is-busy { cursor: not-allowed; opacity: .62; }
.busy-text { display: grid; text-align: right; font-size: 12.5px; line-height: 1.3; }
.busy-text strong { color: var(--red); font-weight: 650; }
.busy-text span { color: var(--text-3); max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.approval-note { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 560; }

/* Reservation detail */
.vehicle-strip { display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; }
.vehicle-strip strong { display: block; font-size: 17px; font-weight: 650; margin-bottom: 5px; }
.strip-media { flex: none; width: 64px; height: 64px; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.strip-media img { width: 100%; height: 100%; object-fit: cover; }
.time-card { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 18px 20px; }
.time-block span { display: block; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.time-block strong { display: block; font: 700 30px/1.15 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.time-block small { display: block; color: var(--text-2); font-size: 13.5px; }
.time-block.end { text-align: right; }
.time-mid { display: grid; justify-items: center; gap: 2px; color: var(--text-3); }
.time-mid small { font-size: 12px; white-space: nowrap; }
.person { display: flex; align-items: center; gap: 12px; }
.person strong { display: block; font-weight: 600; }
.person .grow span { display: block; font-size: 13px; color: var(--text-3); }
.rows-top { margin-top: 14px; border-top: 1px solid var(--line); }
.rows-top .row:first-child { padding-top: 10px; min-height: 52px; }
.note-text { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); color: var(--text-2); font-size: 14px; }
.steps .chain-step { align-items: flex-start; }
.steps .chain-no .icon { width: 15px; height: 15px; stroke-width: 2.4; }
.steps q { display: block; margin-top: 6px; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; color: var(--text-2); quotes: none; }
.step-ok .chain-no { background: var(--green-soft); color: var(--green); }
.step-no .chain-no { background: var(--red-soft); color: var(--red); }
.step-wait .chain-no { background: var(--amber-soft); color: var(--amber); }
.step-skip .chain-no { color: var(--text-3); }
.sheet-icon.ok { background: var(--green-soft); color: var(--green); }
.sheet-body .textarea { margin-top: 8px; min-height: 72px; text-align: left; }

/* Vehicle page additions */
.book-cta { margin-top: 14px; height: 50px; font-size: 16px; }
.slot-row { justify-content: space-between; }
a.slot-row:hover .slot-time strong { color: var(--accent); }
.slot-time strong { display: block; font-weight: 580; font-size: 14.5px; }
.slot-time span { display: block; font-size: 13px; color: var(--text-3); }
.doc-link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.doc-link:hover strong { color: var(--accent); }
.doc-main strong, .doc-main span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-row form { display: contents; }

/* Document picker */
.file-drop {
  position: relative; display: grid; justify-items: center; gap: 6px; padding: 28px 16px; text-align: center; cursor: pointer;
  border-radius: var(--radius-lg); border: 1.5px dashed var(--line-strong); background: var(--surface-2); color: var(--text-2);
}
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop .icon { width: 28px; height: 28px; color: var(--text-3); }
.file-drop small { color: var(--text-3); }
.file-drop.has-file { border-style: solid; border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.file-drop.has-file .icon { color: var(--accent); }

/* Settings */
.inline-add { display: flex; align-items: flex-start; gap: 10px; }
.inline-add .btn { flex: none; }

/* ---------- Calendar ---------- */

.cal-panel h2 { font-size: 17px; font-weight: 650; margin: 0 2px; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 4px; }
.cal-hint { margin-top: 10px; font-size: 13px; }

.bar-approved { --bar: var(--blue); --bar-bg: var(--blue-soft); }
.bar-pending { --bar: var(--amber); --bar-bg: var(--amber-soft); }
.bar-inuse { --bar: var(--cyan); --bar-bg: var(--cyan-soft); }
.bar-done { --bar: var(--gray); --bar-bg: var(--gray-soft); }
.swatch, .month-dots i { background: var(--bar); }

.board { padding: 0; overflow: hidden; }
.board-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.board-head, .board-row { display: grid; grid-template-columns: 148px minmax(560px, 1fr); }
.board.week .board-head, .board.week .board-row { grid-template-columns: 148px minmax(640px, 1fr); }
@media (min-width: 1024px) {
  .board .board-head, .board .board-row, .board.week .board-head, .board.week .board-row { grid-template-columns: 200px minmax(0, 1fr); }
}
.board-corner, .board-label { position: sticky; left: 0; z-index: 2; background: var(--surface); border-right: 1px solid var(--line); }
.board-head { border-bottom: 1px solid var(--line); }
.board-scale { position: relative; height: 38px; }
.scale-tick { position: absolute; top: 12px; padding-left: 6px; font-size: 12px; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.scale-tick.today { color: var(--accent); }
.board-row + .board-row { border-top: 1px solid var(--line); }
.board-label { display: grid; align-content: center; gap: 5px; padding: 10px 12px; min-width: 0; }
.board-label strong { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-label .plate { height: 20px; font-size: 11px; justify-self: start; }
.board-label .plate .plate-tr { width: 12px; font-size: 6px; }
.board-label:hover strong { color: var(--accent); }
.board-track { position: relative; min-height: 66px; cursor: copy; }
.board-track:not([data-book]) { cursor: default; }
.board-track[data-book]:hover { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.board-track.is-maintenance {
  cursor: not-allowed;
  background: repeating-linear-gradient(-45deg, transparent 0 8px, color-mix(in srgb, var(--amber-soft) 70%, transparent) 8px 16px);
}
.track-note { position: absolute; left: 10px; top: 50%; translate: 0 -50%; font-size: 12px; font-weight: 600; color: var(--amber); }
.grid-line { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.now-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); z-index: 1; }
.bar {
  position: absolute; top: 9px; bottom: 9px; z-index: 1; display: grid; align-content: center; gap: 1px;
  padding: 0 8px; border-radius: 10px; overflow: hidden; cursor: pointer;
  background: var(--bar-bg); border-left: 3px solid var(--bar); color: var(--text);
  transition: filter .15s, box-shadow .15s;
}
.bar:hover { box-shadow: 0 2px 10px rgba(0,0,0,.12); filter: saturate(1.2); }
.bar span { font-size: 12.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar small { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar.bar-pending { background-image: repeating-linear-gradient(-45deg, transparent 0 6px, color-mix(in srgb, var(--amber) 10%, transparent) 6px 12px); }
.bar.mine { box-shadow: inset 0 0 0 1.5px var(--bar); }

/* Month grid */
.month { padding: 0; overflow: hidden; }
.month-head, .month-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-head span { padding: 10px 8px; font-size: 12px; font-weight: 600; color: var(--text-3); text-align: center; }
.month-week { border-top: 1px solid var(--line); }
.month-day { display: flex; flex-direction: column; gap: 4px; min-height: 64px; padding: 6px; border-left: 1px solid var(--line); min-width: 0; }
.month-day:first-child { border-left: 0; }
.month-day:hover { background: var(--surface-2); }
.month-day.out { color: var(--text-3); background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.month-num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 13px; font-weight: 600; }
.month-day.today .month-num { background: var(--ink); color: var(--on-ink); }
.month-entries { display: none; gap: 3px; }
.month-dots { display: flex; gap: 3px; flex-wrap: wrap; padding-left: 4px; }
.month-dots i { width: 6px; height: 6px; border-radius: 50%; }
.pill {
  display: block; padding: 2px 6px; border-radius: 6px; font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--bar-bg); color: var(--text); border-left: 3px solid var(--bar);
}
.pill-more { font-size: 11.5px; color: var(--text-3); padding-left: 4px; }
@media (min-width: 900px) {
  .month-day { min-height: 112px; padding: 8px; }
  .month-entries { display: grid; }
  .month-dots { display: none; }
}

/* ---------- Handover: pickup / return / confirm ---------- */

.topbar-actions { display: flex; align-items: center; gap: 6px; }
.topbar-actions .nav-icon { position: relative; }
.topbar-actions .dot-badge { top: 6px; right: 6px; border-color: var(--bg); }

.strip-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: -4px 4px 0; font-size: 13.5px; color: var(--text-2); }
.strip-meta span { display: inline-flex; align-items: center; gap: 6px; }
.strip-meta .icon { color: var(--text-3); }

.input-lg { height: 54px; font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.input-suffix { position: relative; }
.input-suffix .input { padding-right: 52px; }
.input-suffix > span { position: absolute; right: 16px; top: 50%; translate: 0 -50%; color: var(--text-3); font-weight: 600; pointer-events: none; }
.trip-km { color: var(--cyan); font-weight: 650; margin-left: 4px; }

/* Fuel / charge: five steps drawn as rising bars */
.fuel-pick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.fuel-step {
  position: relative; display: grid; justify-items: center; gap: 6px; padding: 10px 4px 8px; cursor: pointer;
  border-radius: var(--radius); background: var(--surface-2); border: 1.5px solid transparent;
  transition: border-color .15s, background .15s;
}
.fuel-step input { position: absolute; opacity: 0; pointer-events: none; }
.fuel-bar { position: relative; width: 14px; height: 30px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.fuel-bar i { position: absolute; inset: auto 0 0 0; height: calc(var(--level) * 1%); background: var(--text-3); border-radius: 0 0 5px 5px; }
.fuel-text { font-size: 14px; font-weight: 650; color: var(--text-2); }
.fuel-step:hover { background: var(--surface-3); }
.fuel-step:has(input:checked) { border-color: var(--ink); background: var(--surface); }
.fuel-step:has(input:checked) .fuel-bar i { background: var(--ink); }
.fuel-step:has(input:checked) .fuel-text { color: var(--text); }
.fuel-step:has(input:focus-visible) { outline: 3px solid var(--focus); }

/* Photo groups: square thumbnails with an add tile */
.photo-group-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.thumb { position: relative; display: block; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-add {
  display: grid; place-content: center; justify-items: center; gap: 4px; cursor: pointer;
  border: 1.5px dashed var(--line-strong); color: var(--text-2); font-size: 13px; font-weight: 600;
}
.thumb-add:hover { border-color: var(--text-3); background: var(--surface-3); }
.thumb-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.thumb-add .icon { width: 22px; height: 22px; color: var(--text-3); }
.thumb-remove {
  position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff; border: 0; cursor: pointer;
}
.thumb-remove .icon { width: 14px; height: 14px; stroke-width: 2.6; }
.thumb-tag {
  position: absolute; left: 6px; bottom: 6px; padding: 2px 7px; border-radius: 99px;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; font-weight: 650;
}
.thumb-tag.danger { background: var(--red); }
.damage-box { display: grid; gap: 14px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }

/* Reservation detail: extension and trip */
.time-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.time-foot .faint { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }

.legs { display: grid; }
.leg { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; }
.leg + .leg::before { content: ""; position: absolute; left: 17px; top: -12px; height: 22px; border-left: 2px dotted var(--line-strong); }
.leg-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 12px; background: var(--cyan-soft); color: var(--cyan); }
.leg-icon .icon { width: 18px; height: 18px; }
.leg-icon.ok { background: var(--green-soft); color: var(--green); }
.leg-icon.wait { background: var(--amber-soft); color: var(--amber); }
.leg strong { display: block; font-weight: 600; }
.leg .grow > span { display: block; font-size: 13px; color: var(--text-3); }
.leg .grow > .leg-chip { display: inline-flex; margin-top: 6px; color: var(--amber); font-size: 12px; height: 24px; }
.leg-note { font-size: 12.5px; }
.leg-stats { display: grid; justify-items: end; gap: 4px; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.leg-stats span { display: inline-flex; align-items: center; gap: 5px; }
.leg-stats .icon { color: var(--text-3); }
.leg-next .leg-icon { background: var(--surface-2); color: var(--text-3); }
.leg-next strong { color: var(--text-2); }
.leg-next.late .leg-icon { background: var(--red-soft); color: var(--red); }
.leg-next.late strong { color: var(--red); }
.trip-damage { margin-top: 12px; }
.trip-damage p { color: var(--text); margin-top: 2px; font-weight: 450; }
.trip-photos { margin-top: 14px; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }

/* Key officer desk */
.desk-section + .desk-section { margin-top: 28px; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 15px; font-weight: 650; color: var(--text-2); }
.section-title .faint { font-weight: 600; }
.rcard.is-late { border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }

/* Extension */
.extend-now { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.extend-now strong { font-weight: 650; font-variant-numeric: tabular-nums; }
.quick-picks { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip-pick { height: 36px; padding: 0 14px; font-size: 14px; background: var(--surface-2); color: var(--text); cursor: pointer; }
.chip-pick:hover { background: var(--surface-3); }
.chip-pick.active { background: var(--ink); color: var(--on-ink); }
.extend-check { margin-top: 14px; transition: opacity .2s; }
.extend-check.is-loading { opacity: .5; }
.extend-check .alert + .alert { margin-top: 8px; }
.ok-line { display: flex; align-items: center; gap: 8px; color: var(--green); font-weight: 560; font-size: 14px; }

/* Vehicle page: recent trips */
.usage-row { gap: 12px; }
a.usage-row:hover strong { color: var(--accent); }
.usage-km { font-weight: 650; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Pager & list order ---------- */

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.pager-count { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.pager-pages { display: flex; gap: 4px; }
.pager-btn {
  display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0 8px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums;
}
a.pager-btn:hover { background: var(--surface-2); color: var(--text); }
.pager-btn.active { background: var(--ink); color: var(--on-ink); }
.pager-btn.is-off { color: var(--line-strong); }
.pager-size { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--surface-3); }
.pager-size a { padding: 4px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.pager-size a.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
@media (max-width: 639px) { .pager { justify-content: center; } .pager-count { width: 100%; text-align: center; } }

/* ---------- Camera or gallery (phones) ---------- */

.source-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin: 10px 0 6px; }
.source-option {
  display: grid; justify-items: center; gap: 10px; padding: 20px 10px; border: 0; border-radius: var(--radius-lg);
  background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
}
.source-option .icon { width: 28px; height: 28px; color: var(--accent); }
.source-option:active { background: var(--surface-3); }

/* ---------- List panel: tabs or search on the left, filters and order on the right, in one surface ---------- */

.list-panel {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 18px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.lp-main { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; }
.lp-side { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 10px; margin-left: auto; min-width: 0; max-width: 100%; }
.lp-group { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lp-group > .icon { flex: none; width: 16px; height: 16px; color: var(--text-3); }
.lp-sep { width: 1px; height: 24px; background: var(--line); }
.list-panel .segmented { max-width: 100%; overflow-x: auto; scrollbar-width: none; background: var(--surface-2); }
.list-panel .segmented::-webkit-scrollbar { display: none; }
.list-panel .segmented a { flex: none; height: 34px; padding: 0 13px; font-size: 13.5px; }
.list-panel .segmented .count { color: var(--text-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.list-panel .segmented .dot { width: 7px; height: 7px; border-radius: 50%; }
.list-panel .search { flex: 1 1 260px; max-width: 420px; }
.list-panel .search .input { height: 40px; background: var(--surface-2); border-color: transparent; }
.list-panel .search .input:hover { background: var(--surface-3); }
.list-panel .search .input:focus { background: var(--surface); border-color: var(--accent); }
.lp-toggle { display: none; position: relative; flex: none; }
@media (max-width: 420px) { .lp-toggle > span:not(.lp-count) { display: none; } .lp-toggle { padding: 0 10px; } }
.lp-toggle .lp-count {
  display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--ink); color: var(--on-ink); font-size: 11px; font-weight: 700;
}
.lp-row { display: flex; align-items: center; gap: 6px; }
.lp-row > .search { flex: 1 1 auto; }
/* Phones: the main control (tabs or search) stays; other filters fold behind a "Filtre" button (app.js marks them). */
@media (max-width: 639px) {
  .list-panel { flex-direction: column; align-items: stretch; gap: 6px; padding: 6px; margin-bottom: 14px; }
  .lp-main { width: 100%; }
  .lp-main-empty { justify-content: flex-end; }
  .lp-main > .segmented { display: flex; flex: 1 1 auto; min-width: 0; }
  .lp-main > .segmented a { flex: 1 0 auto; }
  .list-panel .search { flex: 1 1 auto; max-width: none; }
  .list-panel .segmented a { height: 32px; padding: 0 11px; font-size: 13px; }
  .lp-sep { display: none; }
  /* A single filter row (vehicle status, active/passive) scrolls sideways instead of wrapping. */
  .lp-side { width: 100%; margin-left: 0; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .lp-side::-webkit-scrollbar { display: none; }
  .lp-side > .segmented { flex: none; }
  .list-panel.has-toggle .lp-toggle { display: inline-flex; }
  .list-panel.has-toggle .lp-side { display: none; }
  .list-panel.has-toggle.open .lp-side {
    display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; gap: 8px;
    padding: 8px 2px 2px; border-top: 1px solid var(--line); overflow: visible;
  }
  .list-panel.has-toggle .lp-group { width: 100%; }
  .list-panel.has-toggle .lp-group > .segmented, .list-panel.has-toggle .lp-side > .segmented { display: flex; flex: 1; min-width: 0; }
  .list-panel.has-toggle .lp-group > .segmented a, .list-panel.has-toggle .lp-side > .segmented a { flex: 1 0 auto; }
  .list-panel.has-toggle .lp-group > .select, .list-panel.has-toggle .lp-group > .input { flex: 1; min-width: 0; max-width: none; height: 40px; }
  .cal-panel .lp-main { justify-content: space-between; }
  .cal-panel .lp-side { flex-wrap: wrap; justify-content: center; }
  .cal-panel .legend { justify-content: center; }
}
@media (min-width: 640px) { .lp-row { flex: 1 1 260px; max-width: 420px; } .lp-main-empty { display: none; } }

/* Number with a unit ("30 gün önce"): the unit sits inside, and our own stepper replaces the browser's arrows. */
.input-suffix input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.input-suffix input[type="number"]::-webkit-inner-spin-button,
.input-suffix input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.input-suffix .stepper { position: absolute; right: 6px; top: 6px; bottom: 6px; display: grid; grid-template-rows: 1fr 1fr; gap: 2px; width: 28px; }
.input-suffix .stepper button {
  display: grid; place-items: center; border: 0; border-radius: 6px; padding: 0; cursor: pointer;
  background: var(--surface-3); color: var(--text-2);
}
.input-suffix .stepper button:hover { background: var(--line-strong); color: var(--text); }
.input-suffix .stepper .icon { width: 14px; height: 14px; }
.input-suffix.has-stepper > span { right: 44px; }

/* Approval needed: an icon is enough (the title names the approvers). */
.approval-mark { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); color: var(--text-2); }
.approval-mark .icon { width: 15px; height: 15px; }

/* ---------- Settings: section list on the left, the section on the right ---------- */

.settings { display: grid; gap: 16px; }
.settings-nav { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
.settings-nav a {
  display: flex; align-items: center; gap: 10px; flex: none; padding: 10px 14px; border-radius: 14px;
  color: var(--text-2); font-weight: 560; white-space: nowrap; background: var(--surface-2);
}
.settings-nav a .icon { color: var(--text-3); }
.settings-nav a small { display: none; }
.settings-nav a:hover { color: var(--text); }
.settings-nav a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.settings-nav a.active .icon { color: var(--accent); }
@media (min-width: 900px) {
  .settings { grid-template-columns: 260px minmax(0, 1fr); gap: 32px; align-items: start; }
  .settings-nav { flex-direction: column; gap: 4px; margin: 0; padding: 0; overflow: visible; position: sticky; top: 24px; }
  .settings-nav a { background: transparent; white-space: normal; padding: 12px 14px; }
  .settings-nav a strong { display: block; font-weight: 600; }
  .settings-nav a small { display: block; font-size: 12.5px; color: var(--text-3); font-weight: 450; }
}
.settings-head { margin-bottom: 16px; }
.settings-head h2 { font-size: 20px; font-weight: 680; letter-spacing: -.015em; }
.settings-head p { margin-top: 4px; color: var(--text-2); font-size: 14px; }
.settings-cards { display: grid; gap: 16px; }
@media (min-width: 1280px) { .settings-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.settings-note { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 13px; color: var(--text-3); }

.rule-rows { display: grid; }
.rule-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.rule-row:first-child { border-top: 0; padding-top: 0; }
.rule-label { font-weight: 560; display: grid; flex: 1 1 0; min-width: 96px; }
.rule-label small { font-size: 12px; font-weight: 500; }
.rule-sub { margin: 16px 0 6px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.rule-pick label { height: 32px; padding: 0 12px; font-size: 13px; }
.rule-pick label.rule-required:has(input:checked) { background: var(--ink); color: var(--on-ink); }
.rule-pick label.rule-required:has(input:checked) span { color: var(--on-ink); }
.rule-pick label.rule-off:has(input:checked), .rule-pick label.rule-off:has(input:checked) span { color: var(--text-2); }

/* ---------- Photo tiles on handover forms ---------- */

.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.shot {
  position: relative; display: block; aspect-ratio: 1; border-radius: 14px; overflow: hidden; cursor: pointer;
  background: var(--surface-2); border: 1.5px dashed var(--line-strong);
}
.shot:hover { border-color: var(--text-3); }
.shot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot-empty { position: absolute; inset: 0; display: grid; place-items: center; padding-bottom: 18px; color: var(--text-3); }
.shot-empty .icon { width: 24px; height: 24px; }
.shot-label {
  position: absolute; left: 6px; right: 6px; bottom: 6px; padding: 3px 8px; border-radius: 99px; text-align: center;
  font-size: 12px; font-weight: 650; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shot.has-photo { border-style: solid; border-color: transparent; }
.shot.has-photo .shot-empty { display: none; }
.shot.has-photo .shot-label { left: 6px; right: auto; background: rgba(0, 0, 0, .55); color: #fff; }
.shot .thumb-remove { z-index: 1; }
.shot.is-missing { border-color: var(--red); background: var(--red-soft); }
.req { color: var(--red); margin-left: 2px; }
.shot.has-photo .req { color: #fff; }
.shot-group { grid-column: 1 / -1; }

/* ---------- Extension waiting for approval ---------- */

.pending-ext { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--amber); }
.ext-card .card-title .chip { margin-left: auto; }
.ext-times { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.ext-times span { color: var(--text-3); text-decoration: line-through; }
.ext-times strong { font-size: 17px; font-weight: 650; }
.ext-times .icon { color: var(--text-3); }
.ext-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- Collapsible sidebar (desktop): icons only, state kept in the "nav" cookie ---------- */

.sidebar-toggle { color: var(--text-3); }
@media (min-width: 1024px) {
  .app.nav-collapsed { grid-template-columns: 76px minmax(0, 1fr); }
  .nav-collapsed .sidebar { padding: 22px 12px 16px; }
  .nav-collapsed .sidebar-head { flex-direction: column; gap: 14px; padding: 0 0 18px; }
  .nav-collapsed .brand-full, .nav-collapsed .nav-text, .nav-collapsed .sidebar-user .who { display: none; }
  .nav-collapsed .brand-compact { display: block; }
  .nav-collapsed .nav-cta { width: 44px; padding: 0; margin: 0 auto 14px; }
  .nav-collapsed .nav-link { position: relative; justify-content: center; width: 44px; padding: 0; margin: 0 auto; }
  .nav-collapsed .nav-link .count-badge { position: absolute; top: 2px; right: -2px; min-width: 17px; height: 17px; padding: 0 4px; font-size: 10px; }
  .nav-collapsed .nav-label { padding: 12px 8px 8px; }
  .nav-collapsed .nav-label::before { content: ""; display: block; height: 1px; background: var(--line); }
  .nav-collapsed .sidebar-foot { flex-direction: column; gap: 6px; }
  .nav-collapsed .sidebar-user { flex: none; padding: 4px; }
}
.trip-photos-head { margin-top: 14px; font-size: 12px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.trip-photos-head + .trip-photos { margin-top: 8px; }
@media (min-width: 1024px) { .shots { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }

/* ---------- Fleet records: lists, forms ---------- */

.select-sm, .input-sm { height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13.5px; background-color: var(--surface-2); }
.select.select-sm { padding-right: 34px; background-position: right 8px center; max-width: 240px; }
.input-sm[type="month"] { max-width: 170px; }
.sum-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 4px 10px; font-size: 13.5px; color: var(--text-2); }
.sum-line strong { font-size: 17px; color: var(--text); font-variant-numeric: tabular-nums; }
.rec-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.rec-icon .icon { width: 19px; height: 19px; }
.rec-icon.sm { width: 30px; height: 30px; border-radius: 9px; }
.rec-icon.sm .icon { width: 16px; height: 16px; }
.rec-icon.warn { background: var(--amber-soft); color: var(--amber); }
.amount { flex: none; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 639px) { .list-tags-hide { display: none; } }
.locked-field { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 14px; border-radius: var(--radius); background: var(--surface-2); font-weight: 560; }
.locked-field .icon { color: var(--text-3); }
.locked-field .chip { margin-left: auto; }
.saved-file { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.saved-file .switch { gap: 8px; font-size: 13.5px; color: var(--text-2); }
.report-file { display: grid; gap: 8px; margin-top: 16px; }

/* Document rows on the new-vehicle form */
.doc-rows { display: grid; gap: 10px; margin-bottom: 12px; }
.doc-row-new { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; border-radius: var(--radius); background: var(--surface-2); }
.doc-row-new .input, .doc-row-new .select { background-color: var(--surface); }
.doc-row-new .file-drop { grid-column: 1 / -2; }
.doc-row-new [data-doc-remove] { align-self: center; justify-self: end; }
@media (min-width: 900px) { .doc-row-new { grid-template-columns: 1.1fr .9fr 1fr 1.2fr auto; align-items: center; } .doc-row-new .file-drop { grid-column: auto; } }
.file-drop-sm { display: flex; justify-items: start; gap: 8px; padding: 0 12px; min-height: 46px; align-items: center; text-align: left; border-radius: var(--radius); background: var(--surface); }
.file-drop-sm .icon { width: 18px; height: 18px; }
.file-drop-sm span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }

/* Type picker: icon tiles in a grid */
.type-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.type-option {
  position: relative; display: grid; justify-items: center; gap: 6px; padding: 12px 6px; cursor: pointer; text-align: center;
  border-radius: var(--radius); background: var(--surface-2); border: 1.5px solid transparent; font-size: 13px; font-weight: 600; color: var(--text-2);
}
.type-option input { position: absolute; opacity: 0; pointer-events: none; }
.type-option .icon { width: 22px; height: 22px; color: var(--text-3); }
.type-option:hover { background: var(--surface-3); }
.type-option:has(input:checked) { background: var(--surface); border-color: var(--ink); color: var(--text); }
.type-option:has(input:checked) .icon { color: var(--accent); }
.type-option:has(input:focus-visible) { outline: 3px solid var(--focus); }

/* Due list (maintenance page) */
.due-list { display: grid; }
.due-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.due-row:first-child { border-top: 0; padding-top: 0; }
.due-row:last-child { padding-bottom: 0; }
.due-row strong { display: block; font-weight: 600; }
.due-row .grow > span { display: block; font-size: 13px; color: var(--text-3); }
.due-row:hover strong { color: var(--accent); }
.due-row .chev { color: var(--text-3); }
.due-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 12px; background: var(--surface-2); color: var(--text-2); }
.due-icon .icon { width: 18px; height: 18px; }
.due-card { margin-bottom: 18px; }
.count-badge.soft { background: var(--amber-soft); color: var(--amber); }
.incident-head { display: flex; align-items: center; gap: 12px; }
.incident-head strong { display: block; font-weight: 650; }
.incident-head .grow > span { display: block; font-size: 13.5px; color: var(--text-2); }
.report-link { margin-top: 14px; }

/* Vehicle page: costs and shortcuts */
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.mini-stats > * { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); }
.mini-stats span { font-size: 12.5px; color: var(--text-3); }
.mini-stats strong { font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
.mini-stats a:hover { background: var(--surface-3); }
.mini-stats .warn strong { color: var(--amber); }
.mini-stats .bad strong { color: var(--red); }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.trip-records .row { gap: 10px; }

/* ---------- Cost report ---------- */

.year-nav strong { min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.year-nav [aria-disabled="true"] { opacity: .35; pointer-events: none; }
.stats { display: grid; gap: 12px; margin-bottom: 16px; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stat { display: grid; align-content: start; gap: 4px; padding: 16px 18px; }
.stat-label { font-size: 13px; font-weight: 600; color: var(--text-3); }
.stat-value { font: 700 26px/1.15 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-value.small-value { font-size: 19px; }
.stat-note { font-size: 13px; color: var(--text-2); }
.stat-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; }
.stat-delta.up { color: var(--red); }
.stat-delta.down { color: var(--green); }
.report-grid { display: grid; gap: 16px; margin-bottom: 16px; }
@media (min-width: 1100px) { .report-grid { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: stretch; } }

/* Column chart: one series, thin columns from one baseline, value on hover */
.colchart { position: relative; height: 240px; padding: 22px 0 0 54px; }
.colchart-grid { position: absolute; inset: 22px 0 24px 0; }
.colchart-grid span { position: absolute; left: 0; right: 0; bottom: var(--y); border-top: 1px solid var(--line); }
.colchart-grid small { position: absolute; left: 0; top: -9px; width: 50px; font-size: 11px; color: var(--text-3); background: var(--surface); font-variant-numeric: tabular-nums; }
.colchart-cols { position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; height: 100%; }
.col { display: grid; grid-template-rows: 1fr 24px; min-width: 0; }
.col-track { position: relative; }
.col-bar {
  position: absolute; bottom: 0; left: 50%; translate: -50% 0; width: min(24px, 70%); height: var(--h);
  border-radius: 4px 4px 0 0; background: var(--accent); outline: none; cursor: default;
}
.col-bar::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); translate: -50% 0; z-index: 2;
  padding: 5px 9px; border-radius: 8px; white-space: nowrap; font-size: 12px; font-weight: 600;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .12s;
}
.col-bar:hover::after, .col-bar:focus-visible::after { opacity: 1; }
.col-bar:hover, .col-bar:focus-visible { filter: brightness(1.12); }
.col-value { position: absolute; left: 50%; bottom: calc(100% + 4px); translate: -50% 0; font-size: 11.5px; font-weight: 650; color: var(--text-2); white-space: nowrap; }
.col-bar:hover .col-value, .col-bar:focus-visible .col-value { visibility: hidden; }
.col-label { align-self: end; text-align: center; font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; }
.hbars { display: grid; gap: 14px; }
.hbar { display: grid; gap: 6px; }
.hbar-head { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.hbar-head strong { font-weight: 650; font-variant-numeric: tabular-nums; }
.hbar-track { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.hbar-fill { display: block; height: 100%; width: var(--w); border-radius: 0 4px 4px 0; background: var(--accent); }

/* Data table (report by vehicle) */
.table-card { padding: 0 0 6px; overflow: hidden; }
.card-pad-x { padding: 18px 18px 4px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th, .data-table td { padding: 10px 12px; border-top: 1px solid var(--line); text-align: left; white-space: nowrap; }
.data-table thead th { border-top: 0; font-size: 12px; font-weight: 600; color: var(--text-3); }
.data-table tbody th { font-weight: 600; }
.data-table tbody th a:hover { color: var(--accent); }
.data-table th small { display: block; font-weight: 450; color: var(--text-3); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .zero { color: var(--text-3); }
.data-table .total, .data-table tfoot td, .data-table tfoot th { font-weight: 650; }
.data-table tfoot tr { background: var(--surface-2); }
.data-table th:first-child { position: sticky; left: 0; background: var(--surface); padding-left: 18px; }
.data-table tfoot th:first-child { background: var(--surface-2); }

/* Desk: a returned trip with its "Teslim aldım" button joined below the card */
.rcard-act { display: grid; }
.rcard-act .rcard { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.rcard-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 8px 14px;
  background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.rcard-foot .faint { font-size: 13px; }

/* AdBlue question and the warning on a trip */
.adblue-pick label span { display: inline-flex; align-items: center; gap: 6px; }
.adblue-pick label.warn:has(input:checked) { color: var(--amber); }
.adblue-on { color: var(--amber); font-weight: 600; }

/* Handover settings: required shows blue, off shows red */

/* ---------- Cards / rows switch, and the row ("list") layout of reservations and vehicles ---------- */
.page-actions { display: flex; align-items: center; gap: 10px; }
.view-toggle { background: var(--surface-3); }
.view-toggle a { height: 34px; padding: 0 10px; }
.view-toggle .icon { width: 17px; height: 17px; }
.tlist .tl-head { display: none; }
.tl-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px;
  padding: 12px 14px; border-top: 1px solid var(--line); color: var(--text);
}
.tl-row:first-of-type { border-top: 0; }
.tl-row:hover { background: var(--surface-2); }
.tl-row.is-late { box-shadow: inset 3px 0 0 var(--red); }
.tl-main { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.tl-main strong { font-weight: 640; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-main .plate { height: 22px; font-size: 12px; }
.tl-cell { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-cell .icon { flex: none; color: var(--text-3); }
.tl-faint { color: var(--text-3); }
.tl-next { color: var(--violet); font-weight: 560; }
.tl-next .icon { color: var(--violet); }
.tl-status { display: flex; align-items: center; justify-content: flex-end; gap: 6px; grid-column: 2; grid-row: 1; }
.tl-wait { color: var(--amber); }
.tl-plate { display: none; }
.tlist-veh .tl-main .plate { display: inline-flex; }
@media (max-width: 899px) {
  .tl-row > .tl-cell { grid-column: 1 / -1; }
  .tl-row > .tl-cell:empty { display: none; }
  .tlist-veh .tl-row > .tl-cell.tl-faint { display: none; }
}
@media (min-width: 900px) {
  .tlist .tl-head {
    display: grid; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line);
    font-size: 12px; font-weight: 650; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3);
  }
  .tlist-res .tl-head, .tlist-res .tl-row { grid-template-columns: minmax(260px, 1.4fr) minmax(200px, 1.1fr) minmax(140px, 1fr) 200px; }
  .tlist-veh .tl-head, .tlist-veh .tl-row { grid-template-columns: minmax(220px, 1.5fr) 130px 110px 110px minmax(160px, 1fr) 230px; }
  .tl-row { gap: 12px; padding: 10px 14px; }
  .tl-status { grid-column: auto; grid-row: auto; }
  .tl-head span:last-child { text-align: right; }
  .tl-head .num, .tl-cell.num { justify-content: flex-end; text-align: right; }
  .tlist-veh .tl-plate { display: block; }
  .tlist-veh .tl-main .plate { display: none; }
}
@media (max-width: 639px) { .page-actions .view-toggle a { height: 32px; padding: 0 8px; } }

.mono-wrap { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; word-break: break-all; }

/* ---------- Dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.kpi {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  padding: 14px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: var(--text);
}
.kpi:hover { border-color: var(--line-strong); }
.kpi-icon { grid-row: span 2; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; }
.kpi-icon .icon { width: 19px; height: 19px; }
.kpi-label { font-size: 12.5px; font-weight: 600; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value { font: 700 24px/1.1 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-value small { margin-left: 4px; font-size: 14px; font-weight: 600; color: var(--text-3); letter-spacing: 0; }
.kpi.is-bad { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
.kpi.is-bad .kpi-value { color: var(--red); }
.kpi.is-warn .kpi-value { color: var(--amber); }
.ki-green { background: var(--green-soft); color: var(--green); }
.ki-cyan { background: var(--cyan-soft); color: var(--cyan); }
.ki-blue { background: var(--blue-soft); color: var(--blue); }
.ki-red { background: var(--red-soft); color: var(--red); }
.ki-violet { background: var(--violet-soft); color: var(--violet); }
.ki-amber { background: var(--amber-soft); color: var(--amber); }
.dash-grid { display: grid; gap: 16px; }
@media (min-width: 1100px) { .dash-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; } }
.dash-trip { display: flex; align-items: center; gap: 12px; color: var(--text); }
.dash-trip .grow { display: grid; min-width: 0; }
.dash-trip .grow strong, .dash-trip .grow .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-trip .muted { font-size: 13px; }
.dash-time { flex: none; width: 74px; font-weight: 650; color: var(--text-2); font-size: 13.5px; }
.dash-more { display: inline-block; margin-top: 10px; }
.dash-money { display: flex; gap: 28px; margin-bottom: 4px; }
.dash-money > div { display: grid; gap: 2px; }
.muted-value { color: var(--text-3); font-size: 20px; }
.colchart-sm { height: 190px; }
a.hbar { color: var(--text); border-radius: 10px; }
a.hbar:hover .hbar-head span { text-decoration: underline; }
.hbar-note { font-size: 12.5px; color: var(--text-3); }

/* ---------- Reports ---------- */
.report-filter { display: grid; gap: 14px; margin-bottom: 16px; }
.report-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.report-presets .chip-pick { text-decoration: none; }
@media (min-width: 760px) { .report-fields { grid-template-columns: 180px 180px minmax(0, 1fr); } }
.report-item { align-items: center; }
.report-actions { display: flex; gap: 6px; flex: none; }
@media (max-width: 639px) {
  .report-item { flex-wrap: wrap; }
  .report-actions { width: 100%; padding-left: 52px; }
  .report-actions .btn { flex: 1; }
}

/* ---------- Audit page: days, then one compact line per save with its changes underneath ---------- */
.audit-day { margin: 18px 4px 8px; font-size: 13px; font-weight: 650; letter-spacing: .02em; color: var(--text-3); }
.audit-day:first-of-type { margin-top: 0; }
.audit-list { padding: 2px 0; overflow: hidden; margin-bottom: 4px; }
.audit-row { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; padding: 11px 18px; border-top: 1px solid var(--line); }
.audit-row:first-child { border-top: 0; }
.audit-time { padding-top: 1px; font-size: 13px; font-weight: 600; color: var(--text-3); }
.audit-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 14px; }
.audit-who { font-weight: 650; }
.audit-what { color: var(--text-2); }
.audit-scope { font-size: 13px; color: var(--text-3); }
a.audit-scope:hover { color: var(--accent); text-decoration: underline; }
.audit-changes { list-style: none; margin: 5px 0 0; padding: 0; display: grid; gap: 2px; font-size: 13px; color: var(--text-2); }
.audit-field { color: var(--text-3); margin-right: 6px; }
.audit-changes del { color: var(--text-3); }
.audit-arrow { margin: 0 5px; color: var(--text-3); }
.audit-changes strong { font-weight: 600; color: var(--text); }

/* Side-by-side cards share one height; a chart grows into the extra space instead of leaving a gap. */
.report-grid > .card, .dash-grid > .card { display: flex; flex-direction: column; }
.report-grid > .card > .colchart { flex: 1 1 auto; min-height: 240px; height: auto; }
.report-grid > .card > .colchart .colchart-cols { position: absolute; inset: 22px 0 0 54px; height: auto; }

.help-steps { margin-top: 14px; font-size: 13.5px; color: var(--text-2); }
.help-steps summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.help-steps ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.input.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 14px; }
