/* ==========================================================================
   Glovebox — vehicle service & logging
   Design language: workshop / service department.
   Graphite surfaces, tool-blue primary, amber for service due, red overdue,
   amber plate for registrations. Left drawer navigation (Fuelio pattern).
   ========================================================================== */

/* ------------------------------------------------------------------ tokens */
:root {
  --bg: #0d1216;
  --bg-soft: #111820;
  --card: #161f27;
  --card-alt: #1d2833;
  --surface-3: #243140;
  --line: #2b3846;
  --line-soft: #212c37;

  --ink: #e9eff5;
  --ink-soft: #c3ced9;
  --muted: #8d9dab;

  --accent: #4a9fe0;
  --accent-soft: rgba(74, 159, 224, .14);
  --accent-line: rgba(74, 159, 224, .38);
  --accent-ink: #061420;
  --amber: #e5a23c;
  --amber-soft: rgba(229, 162, 60, .15);
  --ok: #45b37e;
  --ok-soft: rgba(69, 179, 126, .14);
  --danger: #e0605c;
  --danger-soft: rgba(224, 96, 92, .15);
  --sky: #7fb3d5;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow: 0 10px 28px rgba(0, 0, 0, .42);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
  --drawer-w: 268px;

  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-head: var(--font);
}

html[data-font="grotesk"] { --font-head: "Space Grotesk", var(--font); }
html[data-font="serif"] { --font-head: "Source Serif 4", Georgia, serif; }
html[data-font="mono"] { --font: "JetBrains Mono", ui-monospace, monospace; --font-head: var(--font); }

/* "daylight workshop" light theme */
html[data-theme="light"] {
  --bg: #eef1f4; --bg-soft: #f6f8fa; --card: #ffffff; --card-alt: #f2f5f8;
  --surface-3: #e7ecf1; --line: #d3dae1; --line-soft: #e4e9ee;
  --ink: #14202b; --ink-soft: #35434f; --muted: #596975;
  --accent: #1f6fb8; --accent-soft: rgba(31, 111, 184, .1);
  --accent-line: rgba(31, 111, 184, .32); --accent-ink: #ffffff;
  --amber: #8a550c; --amber-soft: rgba(138, 85, 12, .14);
  --ok: #176b43; --ok-soft: rgba(23, 107, 67, .12);
  --danger: #b3322a; --danger-soft: rgba(179, 50, 42, .12);
  --shadow: 0 12px 30px rgba(20, 32, 43, .14);
  --shadow-1: 0 1px 2px rgba(20, 32, 43, .1);
}

/* ------------------------------------------------------------------- basics */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}
html[data-theme="light"] body {
  background: linear-gradient(180deg, #f7f9fb, var(--bg) 420px) no-repeat, var(--bg);
}

h1, h2, h3, h4 { font-family: var(--font-head); margin: 0 0 .4rem; line-height: 1.22; letter-spacing: -.01em; }
h1 { font-size: clamp(1.4rem, 2.6vw, 1.75rem); font-weight: 650; }
h2 { font-size: 1.1rem; font-weight: 620; }
h3 { font-size: .98rem; font-weight: 600; }
p { margin: 0 0 .75rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
small, .muted { color: var(--muted); }
code, .mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .86em; }
hr, .rule { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.num, .value, .fuel-amount, td.num, .stat .value { font-variant-numeric: tabular-nums; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: .5rem; background: var(--card); padding: .5rem .8rem; z-index: 200; border-radius: var(--radius-sm); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ------------------------------------------------------------------- appbar */
.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: .7rem;
  min-height: 58px; padding: .5rem .9rem;
  background: color-mix(in srgb, var(--bg-soft) 92%, #000);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}
html[data-theme="light"] .topbar { background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); }
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, var(--accent), transparent 45%); opacity: .6;
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }

.nav-toggle {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 4px;
  width: 42px; height: 42px; padding: 0 10px; cursor: pointer; flex: none;
  background: var(--card-alt); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.nav-toggle span { display: block; height: 2px; background: var(--ink-soft); border-radius: 2px; transition: transform .18s ease, opacity .18s ease; }
.nav-toggle:hover { border-color: var(--accent-line); }
body[data-drawer="open"] .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body[data-drawer="open"] .nav-toggle span:nth-child(2) { opacity: 0; }
body[data-drawer="open"] .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); font-weight: 700; font-family: var(--font-head); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; display: block; flex: 0 0 34px; border-radius: 10px;
  background: #131c25; object-fit: cover; box-shadow: 0 2px 8px rgba(0, 0, 0, .22);
}
.brand-text { letter-spacing: .01em; }
.brand-sub { display: block; font-size: .66rem; text-transform: uppercase; letter-spacing: .15em; color: var(--muted); font-weight: 700; }

.vehicle-switch, .account-chip { position: relative; }
.vehicle-switch > summary, .account-chip > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: .55rem;
  padding: .4rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card-alt); color: var(--ink);
}
.vehicle-switch > summary::-webkit-details-marker, .account-chip > summary::-webkit-details-marker { display: none; }
.vehicle-switch > summary::after, .account-chip > summary::after {
  content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin-left: .2rem;
}
.vehicle-switch[open] > summary::after, .account-chip[open] > summary::after { transform: rotate(225deg); }
.vehicle-name { font-weight: 620; }
.vehicle-odo { font-size: .8rem; color: var(--muted); }
.vehicle-menu, .account-menu {
  position: absolute; top: calc(100% + .45rem); min-width: 250px; z-index: 70;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: .35rem; display: grid; gap: .1rem;
}
.vehicle-menu { left: 0; }
.account-menu { right: 0; min-width: 215px; padding: .6rem; }
.vehicle-option {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  color: var(--ink); padding: .55rem .7rem; border-radius: var(--radius-sm); cursor: pointer; font: inherit;
}
.vehicle-option small { display: block; color: var(--muted); }
.vehicle-option:hover { background: var(--card-alt); text-decoration: none; }
.vehicle-option.is-current { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.vehicle-option-add { color: var(--accent); font-weight: 620; }
.account-menu a { padding: .4rem .5rem; border-radius: var(--radius-sm); color: var(--ink); display: block; }
.account-menu a:hover { background: var(--card-alt); text-decoration: none; }
.account-identity { margin: 0; padding: .2rem .5rem .5rem; border-bottom: 1px solid var(--line); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); border: 1px solid var(--line); font-weight: 700;
}

/* -------------------------------------------------------------- left drawer */
.drawer-scrim {
  position: fixed; inset: 0; z-index: 80; background: rgba(4, 8, 12, .62);
  opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s ease;
}
body[data-drawer="open"] .drawer-scrim { opacity: 1; visibility: visible; }

.drawer {
  position: fixed; z-index: 90; top: 0; bottom: 0; left: 0; width: var(--drawer-w);
  display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg-soft); border-right: 1px solid var(--line);
  transform: translateX(-100%); transition: transform .22s cubic-bezier(.4, 0, .2, 1);
}
body[data-drawer="open"] .drawer { transform: translateX(0); box-shadow: var(--shadow); }

.drawer-head { padding: 1rem .95rem .85rem; border-bottom: 1px solid var(--line); }
.drawer-vehicle {
  margin-top: .8rem; padding: .6rem .7rem; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--card); display: grid; gap: .15rem;
}
.drawer-vehicle strong { font-size: .93rem; }
.drawer-vehicle span { color: var(--muted); font-size: .8rem; }
.plate {
  display: inline-block; padding: .08rem .45rem; border-radius: 4px;
  background: #f0d264; color: #1c1a06; border: 1px solid #c9ab3f;
  font-family: "JetBrains Mono", ui-monospace, monospace; font-weight: 700;
  font-size: .74rem; letter-spacing: .07em;
}

.drawer-nav { padding: .55rem .55rem 1.4rem; display: grid; gap: .08rem; }
.drawer-group-label {
  margin: .9rem .6rem .3rem; font-size: .66rem; letter-spacing: .17em;
  text-transform: uppercase; color: var(--muted); font-weight: 700;
}
.drawer-link {
  display: flex; align-items: center; gap: .7rem; padding: .58rem .65rem;
  border-radius: var(--radius-sm); color: var(--ink-soft); font-weight: 550; font-size: .93rem;
  border-left: 3px solid transparent;
}
.drawer-link:hover { background: var(--card); color: var(--ink); text-decoration: none; }
.drawer-link.is-current { background: var(--accent-soft); color: var(--ink); border-left-color: var(--accent); font-weight: 650; }
.drawer-link .icon { width: 18px; height: 18px; flex: none; opacity: .85; }
.drawer-link.is-current .icon { color: var(--accent); opacity: 1; }
.drawer-link .badge {
  margin-left: auto; min-width: 20px; text-align: center; padding: 0 .35rem;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 700;
}
.drawer-foot { margin-top: auto; padding: .8rem .95rem 1.1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.drawer-foot a { display: block; padding: .25rem 0; color: var(--muted); }

/* desktop: the drawer is a permanent rail, so the sheet stays readable */
@media (min-width: 1080px) {
  body[data-drawer="open"] .drawer { box-shadow: none; }
  .drawer-scrim { display: none; }
  body[data-drawer="open"] .shell,
  body[data-drawer="open"] .footer { margin-left: var(--drawer-w); }
  body[data-drawer="open"] .topbar { padding-left: calc(var(--drawer-w) + .9rem); }
  body[data-drawer="open"] .topbar > .nav-toggle,
  body[data-drawer="open"] .topbar > .brand { display: none; }
}

/* -------------------------------------------------------------------- shell */
.shell { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 1.2rem clamp(.85rem, 3vw, 1.6rem) 4rem; }
.shell-auth { max-width: 470px; padding-top: 4rem; }
@media (max-width: 640px) { .shell { padding: .9rem .8rem 4.5rem; } }

.footer {
  border-top: 1px solid var(--line); background: var(--bg-soft); color: var(--muted);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .9rem clamp(.85rem, 3vw, 1.6rem); font-size: .84rem;
}
.footer a { color: var(--muted); }

/* -------------------------------------------------------------------- flash */
.flash { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .4rem; }
.flash-item {
  display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem;
  border-radius: var(--radius-sm); border: 1px solid var(--line); border-left: 3px solid var(--line);
  background: var(--card);
}
.flash-item.tone-error { border-left-color: var(--danger); }
.flash-item.tone-warning, .flash-item.tone-warn { border-left-color: var(--amber); }
.flash-item.tone-success, .flash-item.tone-ok { border-left-color: var(--ok); }
.flash-close { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 1.2rem; cursor: pointer; }

/* ------------------------------------------------------------------- pieces */
.card, .panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.05rem 1.1rem; margin-bottom: 1rem; box-shadow: var(--shadow-1);
}
.panel-head {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  margin-bottom: .85rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line);
}
.panel-head h2, .panel-head h3 { margin: 0; }
.panel-head > :last-child { margin-left: auto; }
.eyebrow {
  display: block; font-size: .66rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin-bottom: .12rem;
}
.panel-head .eyebrow { width: 100%; }
.count-badge {
  display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 .45rem;
  border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font-size: .8rem; font-weight: 700; margin-left: auto;
}
.empty { color: var(--muted); padding: 1rem 0; }

/* -------------------------------------------------------------------- stats */
.grid { display: grid; gap: .8rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); }
.grid-pairs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .grid-pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .grid-pairs { grid-template-columns: 1fr; } }

.stat {
  background: var(--card-alt); border: 1px solid var(--line); border-radius: var(--radius-sm);
  border-left: 3px solid var(--line); padding: .7rem .85rem;
}
.stat .value { font-size: 1.38rem; font-weight: 660; font-family: var(--font-head); display: block; letter-spacing: -.02em; }
.stat .label { color: var(--ink-soft); font-size: .8rem; display: block; }
.stat .sub { color: var(--muted); font-size: .77rem; display: block; }
.stat-accent { border-left-color: var(--accent); }
.stat-ok { border-left-color: var(--ok); }
.stat-warn { border-left-color: var(--amber); }
.stat-danger { border-left-color: var(--danger); }

/* ---------------------------------------------------------------------- hero */
.hero {
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  margin-bottom: 1.1rem; padding: 1rem 1.1rem; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--card-alt), var(--card));
  border: 1px solid var(--line); box-shadow: var(--shadow-1);
}
.hero h1 { margin-bottom: .15rem; }
.hero .plate { padding: .28rem .55rem; border-radius: 6px; }
.hero-photo { width: 96px; height: 76px; border-radius: var(--radius-sm); object-fit: cover; border: 1px solid var(--line); }

/* ---------------------------------------------------------------- pills/chips */
.pill {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .16rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 620;
  border: 1px solid var(--line); background: var(--card-alt); color: var(--muted); white-space: nowrap;
}
.pill-ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.pill-warn { background: var(--amber-soft); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
.pill-danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.pill-pro {
  background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line);
  text-transform: uppercase; letter-spacing: .09em; font-size: .68rem;
}

/* service-life meter */
.meter { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin: .35rem 0; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.meter-ok > span { background: var(--ok); }
.meter-warn > span { background: var(--amber); }
.meter-danger > span { background: var(--danger); }

.reminder-mark { width: 7px; min-height: 42px; border-radius: 8px; background: var(--ok); }
.mark-warn { background: var(--amber); }
.mark-danger { background: var(--danger); }
.mark-ok { background: var(--ok); }

/* ------------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { text-align: left; padding: .55rem .65rem; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
table.data th {
  color: var(--muted); background: var(--card-alt); font-weight: 700; font-size: .7rem;
  text-transform: uppercase; letter-spacing: .1em; border-bottom: 1px solid var(--line);
}
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr.is-partial td { color: var(--amber); }
table.data tbody tr:hover { background: var(--card-alt); }
table.data tbody tr:last-child td { border-bottom: 0; }

/* ------------------------------------------------------------------ buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 40px; padding: .45rem .95rem; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--line); background: var(--card-alt); color: var(--ink);
  font: inherit; font-weight: 620; transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.button:hover { text-decoration: none; border-color: var(--accent-line); background: var(--surface-3); }
.button:active { transform: translateY(1px); }
.button-accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.button-accent:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); color: var(--accent-ink); }
.button-quiet { background: none; color: var(--ink-soft); }
.button-quiet:hover { background: var(--card-alt); }
.button-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 38%, transparent); background: var(--danger-soft); }
.button-compact { min-height: 34px; padding: .25rem .7rem; font-size: .87rem; }
.button-row { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; }

/* floating quick-add, Fuelio-style */
.fab-wrap { position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 55; }
.fab {
  display: inline-flex; align-items: center; gap: .5rem; height: 54px; padding: 0 1rem;
  border-radius: 999px; border: 0; cursor: pointer; font: inherit; font-weight: 650;
  background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow);
}
.fab:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }
.fab .icon { width: 20px; height: 20px; }
.fab-menu {
  position: absolute; right: 0; bottom: calc(100% + .55rem); min-width: 215px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: .35rem; display: grid; gap: .1rem;
}
.fab-menu[hidden] { display: none; }
.fab-menu a { display: flex; align-items: center; gap: .55rem; padding: .55rem .6rem; border-radius: var(--radius-sm); color: var(--ink); }
.fab-menu a:hover { background: var(--card-alt); text-decoration: none; }
@media (max-width: 640px) { .fab-label { display: none; } }

/* -------------------------------------------------------------------- forms */
form .field { margin-bottom: .8rem; }
.field { display: grid; gap: .25rem; }
form label, .field-label { display: block; font-size: .82rem; color: var(--ink-soft); font-weight: 620; margin-bottom: .25rem; }
input, select, textarea {
  width: 100%; min-height: 40px; padding: .55rem .65rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--card-alt); color: var(--ink); font: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="checkbox"] { width: auto; min-height: 0; accent-color: var(--accent); }
.field-check { display: flex; align-items: center; gap: .5rem; margin-bottom: .7rem; }
.field-check label { margin: 0; color: var(--ink); font-size: .92rem; }
.field-help { color: var(--muted); font-size: .78rem; margin-top: .2rem; }
.field-error { color: var(--danger); font-size: .8rem; margin-top: .2rem; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .3rem .9rem .9rem; margin: 0 0 1rem; background: var(--bg-soft); }
html[data-theme="light"] .fieldset { background: var(--card-alt); }
.fieldset legend { padding: .35rem .3rem 0; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.form-actions { display: flex; gap: .6rem; align-items: center; margin-top: 1rem; flex-wrap: wrap; }

details.disclosure { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card-alt); margin-bottom: .7rem; }
details.disclosure > summary { cursor: pointer; padding: .65rem .85rem; list-style: none; font-weight: 620; display: flex; align-items: center; gap: .5rem; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::after {
  content: ""; width: 8px; height: 8px; margin-left: auto; border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted); transform: rotate(45deg);
}
details.disclosure[open] > summary::after { transform: rotate(225deg); }
details.disclosure > .disclosure-body { padding: 0 .85rem .85rem; }

/* ------------------------------------------------------------------- charts */
.chart { width: 100%; height: auto; display: block; }
.chart-grid { stroke: var(--line-soft); stroke-width: 1; }
.chart-tick, .chart-label, .chart-empty { fill: var(--muted); font-size: 12.5px; }
.chart-label { fill: var(--ink); fill-opacity: .82; font-size: 13px; font-weight: 500; }
.chart-tick { font-variant-numeric: tabular-nums; }
.chart-unit { fill: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; }
.chart-area { fill: url(#fillgrad); stroke: none; }
.chart-avg { stroke: var(--amber); stroke-width: 1.2; stroke-dasharray: 5 4; }
.chart-hit { fill: transparent; }
.chart-hit:hover { fill: var(--accent); fill-opacity: .5; }
.chart-bar { fill: var(--accent); }
.chart-bar-alt { fill: var(--sky); fill-opacity: .8; }
.cat-bar { opacity: .92; }
.cat-name { fill: var(--ink); font-size: 12px; }
.cat-value { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

.gauge { width: 54px; height: 54px; }
.gauge-track { fill: none; stroke: var(--line); stroke-width: 6; }
.gauge-value { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; }
.gauge-due-soon .gauge-value, .gauge-warn .gauge-value { stroke: var(--amber); }
.gauge-overdue .gauge-value, .gauge-danger .gauge-value { stroke: var(--danger); }
.gauge-ok .gauge-value { stroke: var(--ok); }
.gauge-text { fill: var(--ink); font-size: 15px; font-weight: 700; }
.gauge-caption { display: block; margin-top: -.15rem; text-align: center; font-size: .63rem; color: var(--muted); white-space: nowrap; }

/* --------------------------------------------------------------- log rows */
.reminder-row { display: grid; grid-template-columns: 54px 1fr auto; gap: .9rem; align-items: center; padding: .75rem .2rem; border-bottom: 1px solid var(--line-soft); }
.reminder-row:last-child { border-bottom: 0; }
.reminder-title { font-weight: 620; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.reminder-meta { color: var(--muted); font-size: .85rem; }
.meter-label { margin-top: .25rem; color: var(--muted); font-size: .72rem; }
.service-board .reminder-row:has(.reminder-mark) { grid-template-columns: 10px minmax(0, 1fr) auto; }
.service-board .reminder-row:has(.reminder-mark) > .button { align-self: center; }

.fuel-row { display: grid; grid-template-columns: 96px 1fr auto; gap: .8rem; padding: .7rem .2rem; border-bottom: 1px solid var(--line-soft); align-items: baseline; }
.fuel-row:last-child { border-bottom: 0; }
.fuel-row:hover { background: color-mix(in srgb, var(--card-alt) 70%, transparent); }
.fuel-date { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.fuel-amount { font-variant-numeric: tabular-nums; text-align: right; font-weight: 650; }
.fuel-details { color: var(--muted); font-size: .84rem; }
.fuel-badges { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .25rem; }

.month-heading { display: flex; align-items: baseline; gap: .6rem; margin: 1.3rem 0 .5rem; }
.month-heading h3 { margin: 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .13em; color: var(--muted); }
.month-heading .rule { flex: 1; height: 1px; background: var(--line); }

/* phones: rows go two-up and controls get thumb-sized targets */
@media (max-width: 760px) {
  .fuel-row { grid-template-columns: 1fr auto; row-gap: .15rem; }
  .fuel-row .fuel-date { grid-column: 1; }
  .fuel-row .fuel-amount { grid-column: 2; grid-row: 1; }
  .fuel-row > span:nth-child(2) { grid-column: 1 / -1; }
  .fuel-details, .fuel-date { font-size: .86rem; }
  .service-board .reminder-row:has(.reminder-mark) { grid-template-columns: 8px minmax(0, 1fr); align-items: start; }
  .service-board .reminder-row:has(.reminder-mark) > .button { grid-column: 2; justify-self: start; }
  .service-board .reminder-row > .button-row { grid-column: 1 / -1; flex-wrap: wrap; }
  .service-board .reminder-row > .button-row form { flex-wrap: wrap; }
  .button, .button-compact { min-height: 44px; }
  .pill { min-height: 28px; }
  .grid-2, .field-pair { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  table.data th, table.data td { padding: .45rem .45rem; }
}

/* ------------------------------------------------------------------- auth */
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); }
.auth-card .brand { margin-bottom: 1rem; }

@keyframes spin { to { transform: rotate(360deg); } }

@media print {
  .topbar, .drawer, .drawer-scrim, .footer, .button-row, .flash, .fab-wrap { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .panel { border-color: #bbb; box-shadow: none; }
  a { color: #000; }
}

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