/* Brandstof v3 - minimalistisch grijs, één accentkleur (instelbaar) */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
}
:root {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f5f5f6; --text: #111113; --text-2: #3a3a3e; --muted: #86868b; --border: #e6e6e8; --hair: #ececee;
  /* accentkleur: wordt per account overschreven via style-attribuut op <html> */
  --primary: #e8c547; --primary-contrast: #1c1c1e;
  --primary-soft: color-mix(in srgb, var(--primary) 16%, transparent);
  --good: #3f8f5b; --warn: #b7791f; --bad: #c4453c;
  --radius: 14px; --radius-sm: 10px; --shadow: 0 1px 2px rgba(0,0,0,.03);
  --nav-h: 62px; --top-h: 56px; --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #1c1c1e; --surface: #242426; --surface-2: #2c2c2e; --text: #f2f2f3; --text-2: #d0d0d3; --muted: #98989d; --border: #38383b; --hair: #313133;
  --good: #7cc495; --warn: #e0b45a; --bad: #ef8079;
  --shadow: none;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 300 16px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "calt"; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 20px);
}
body.page-login, body.page-plain { padding-bottom: 0; }
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--text); }
b, strong { font-weight: 500; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; font-weight: 500; letter-spacing: -.015em; color: var(--text); }
h1 { font-size: 1.6rem; } h2 { font-size: 1.05rem; }
.icon { width: 20px; height: 20px; flex: none; vertical-align: middle; stroke-width: 1.6; }
.muted { color: var(--muted); } .small { font-size: .84rem; } .center { text-align: center; }
.subtitle { color: var(--muted); font-size: .82rem; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
code { background: var(--surface-2); padding: 0 .3em; border-radius: 4px; }
::selection { background: var(--primary); color: var(--primary-contrast); }

/* layout */
.container { max-width: 1040px; margin: 0 auto; padding: 20px 18px; }
.container.wide { max-width: 1400px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.page-title { font-size: 1.6rem; margin: 6px 0 18px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 26px 0 12px; }
.section-head h2, .section-head h1 { margin: 0; }

/* topbar */
.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.2) blur(14px); -webkit-backdrop-filter: saturate(1.2) blur(14px); border-bottom: 1px solid var(--hair); padding-top: env(safe-area-inset-top, 0px); }
.topbar-inner { max-width: 1040px; margin: 0 auto; height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 14px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); font-size: 1rem; text-decoration: none; letter-spacing: -.01em; }
.logo .icon { width: 22px; height: 22px; }
.logo span { display: none; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--text); cursor: pointer; flex: none; text-decoration: none; }
.icon-btn:hover { background: var(--surface-2); }
.vehicle-switch { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 0; border-radius: 999px; padding: 4px 12px 4px 5px; }
.vehicle-switch select { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 400; padding: 4px 0; appearance: none; -webkit-appearance: none; text-overflow: ellipsis; }
.vehicle-switch select:not([disabled]) { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 10px) 55%, calc(100% - 5px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 18px; cursor: pointer; }
.topnav { display: none; }

/* bottom nav (mobiel) */
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--hair); }
.bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: .66rem; font-weight: 400; text-decoration: none; letter-spacing: .01em; }
.bottomnav a.active { color: var(--text); font-weight: 500; }
.bottomnav a.active .icon { stroke-width: 2.1; }
.bottomnav a.active:not(.fab)::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--primary); margin-top: 1px; }
.bottomnav a.fab .icon { width: 26px; height: 26px; padding: 9px; box-sizing: content-box; color: var(--primary-contrast); background: var(--primary); border-radius: 50%; margin-top: -22px; stroke-width: 2; border: 4px solid var(--bg); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 400; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.985); }
.btn.primary { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); font-weight: 500; }
.btn.primary:hover { filter: brightness(.96); }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: .88rem; } .btn.small .icon { width: 17px; height: 17px; }
.btn.big { min-height: 52px; font-size: 1rem; }
.btn.block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; }
.seg a, .seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .88rem; font-weight: 400; padding: 6px 14px; border-radius: 999px; cursor: pointer; text-decoration: none; }
.seg a.active, .seg button.active { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
[data-theme="dark"] .seg a.active, [data-theme="dark"] .seg button.active { background: #3a3a3c; }

/* banners & badges */
.banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 12px; background: var(--surface-2); color: var(--text); border: 0; font-size: .94rem; }
.banner::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; }
.banner.ok::before { background: var(--good); } .banner.warn::before { background: var(--warn); } .banner.bad::before { background: var(--bad); }
.banner .icon { width: 18px; height: 18px; color: var(--muted); }
.banner.slim { padding: 6px 10px; font-size: .88rem; margin: 8px 0 0; }
.banner a { margin-left: auto; font-weight: 500; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 400; white-space: nowrap; background: var(--surface-2); color: var(--text-2); border: 0; font-variant-numeric: tabular-nums; }
.badge.good { color: var(--good); } .badge.warn { color: var(--warn); } .badge.bad { color: var(--bad); }
.badge.primary { background: var(--primary); color: var(--primary-contrast); }
.plate { display: inline-block; font-weight: 500; letter-spacing: .08em; background: transparent; color: var(--text-2); border-radius: 6px; padding: 0 7px; border: 1px solid var(--border); font-size: .82rem; font-variant-numeric: tabular-nums; }
.plate.small { font-size: .74rem; padding: 0 5px; }
.vehicle-info .plate, .hero .plate { align-self: flex-start; }
.brand-logo { width: 42px; height: 42px; object-fit: contain; border-radius: 50%; background: #fff; padding: 7px; border: 1px solid var(--border); flex: none; filter: grayscale(1); }
.brand-logo.sm { width: 28px; height: 28px; padding: 4px; }
.brand-fallback { display: inline-grid; place-items: center; color: var(--muted); background: var(--surface-2); }

/* dashboard */
.hero { display: flex; flex-direction: column; gap: 18px; background: transparent; border: 0; box-shadow: none; padding: 4px 0 6px; }
.hero-head { display: flex; align-items: center; gap: 14px; }
.hero h1 { font-size: 1.5rem; margin: 0 0 6px; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 18px 0 8px; }
.stats-grid .card { margin: 0; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 16px; }
.stat-label { font-size: .78rem; color: var(--muted); font-weight: 400; }
.stat.good .stat-label::after, .stat.warn .stat-label::after, .stat.bad .stat-label::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-left: 6px; vertical-align: 2px; }
.stat.good .stat-label::after { background: var(--good); } .stat.warn .stat-label::after { background: var(--warn); } .stat.bad .stat-label::after { background: var(--bad); }
.stat-value { font-size: 1.5rem; font-weight: 400; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: .74rem; font-weight: 300; color: var(--muted); letter-spacing: 0; }
.stat-sub { font-size: .78rem; color: var(--muted); }
.fill-list, .station-list, .vehicle-list, .menu-list { list-style: none; margin: 0; padding: 0; }
.fill-list { border-top: 1px solid var(--hair); }
.fill { display: flex; gap: 12px; justify-content: space-between; padding: 14px 2px; margin: 0; color: var(--text); text-decoration: none; background: transparent; border: 0; border-bottom: 1px solid var(--hair); border-radius: 0; box-shadow: none; }
.fill:hover { background: var(--surface-2); }
.fill-main { min-width: 0; flex: 1; }
.fill-date { font-weight: 500; }
.fill-station { color: var(--muted); font-size: .88rem; display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fill-station .icon { width: 15px; height: 15px; } .icon.fav { color: var(--primary); fill: var(--primary); }
.fill-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: .86rem; margin-top: 4px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.fill-note { font-size: .84rem; color: var(--muted); font-style: italic; margin-top: 2px; }
.fill-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 6px; }
.fill-total { font-weight: 500; font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; }
.empty .icon { width: 32px; height: 32px; color: var(--muted); stroke-width: 1.2; }

/* forms */
.form { display: flex; flex-direction: column; gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 400; font-size: .9rem; color: var(--text-2); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; font: inherit; font-size: 1.04rem; font-weight: 400; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; appearance: none; -webkit-appearance: none;
}
.form select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: transparent; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
input[type=file] { font: inherit; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.row3 input { padding: 10px 8px; text-align: right; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
.hint { font-size: .8rem; color: var(--muted); font-weight: 300; margin: -8px 0 0; }
label .hint { margin: 0; }
.field-error { color: var(--bad); font-size: .86rem; font-weight: 400; margin: -8px 0 0; }
.check { flex-direction: row !important; align-items: center; gap: 10px !important; }
.check input { width: 20px; height: 20px; accent-color: var(--text); }
.toggles { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.toggle { flex-direction: row !important; align-items: flex-start; gap: 12px !important; padding: 13px 14px; border: 0; border-bottom: 1px solid var(--hair); background: var(--surface); cursor: pointer; color: var(--text) !important; }
.toggle:last-child { border-bottom: 0; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle small { display: block; color: var(--muted); font-weight: 300; font-size: .8rem; }
.switch { flex: none; width: 44px; height: 26px; border-radius: 999px; background: var(--border); position: relative; transition: background .2s; margin-top: 1px; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s; }
.toggle input:checked + .switch { background: var(--primary); }
.toggle input:checked + .switch::after { transform: translateX(18px); }
.toggle input:focus-visible + .switch { outline: 2px solid var(--primary); outline-offset: 2px; }
fieldset.location { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin: 0; display: flex; flex-direction: column; gap: 12px; }
fieldset.location legend { font-weight: 500; padding: 0 6px; }
.gps { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 0; }
.gps-text { flex: 1; font-size: .9rem; }
.gps-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.gps.busy .gps-dot { background: var(--primary); animation: pulse 1s infinite; }
.gps.ok .gps-dot { background: var(--good); } .gps.err .gps-dot { background: var(--bad); } .gps.warn .gps-dot { background: var(--warn); }
@keyframes pulse { 50% { opacity: .3; transform: scale(.8); } }
.form-actions { margin-top: 4px; }
.danger-zone { text-align: center; margin: 8px 0 24px; }
.row-form { flex-direction: row; align-items: center; gap: 8px; margin: 10px 0; }
.row-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
form.inline { display: inline; }
details summary { cursor: pointer; color: var(--text); font-weight: 400; margin-top: 10px; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "+ "; color: var(--muted); } details[open] summary::before { content: "− "; }
details .form { margin-top: 12px; }

/* instellingen: thema + accent */
.choice-row { display: flex; flex-wrap: wrap; gap: 10px; }
.choice { position: relative; display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 8px !important; padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; color: var(--text) !important; }
.choice input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { border-color: var(--text); font-weight: 500; }
.choice:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); flex: none; }
.color-input { width: 44px; height: 32px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: none; cursor: pointer; }
.accent-preview { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 4px; }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; }
.auth-card { width: 100%; max-width: 380px; padding: 32px 22px; text-align: center; border: 0; box-shadow: none; background: transparent; }
.auth-card h1 { font-size: 1.5rem; }
.auth-card .form { text-align: left; margin-top: 22px; }
.auth-logo { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--primary); color: var(--primary-contrast); margin-bottom: 14px; }
.auth-logo .icon { width: 26px; height: 26px; }

/* stations & voertuigen */
.station-head, .vehicle-head { display: flex; align-items: center; gap: 12px; }
.station-info, .vehicle-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.station-price { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; }
.station-price small { color: var(--muted); font-weight: 300; font-size: .74rem; }
.star-btn { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 10px; }
.star-btn.on { color: var(--text); } .star-btn.on .icon { fill: var(--primary); color: var(--primary); }
.vehicle.current { border-color: var(--text); }
.vehicle.archived { opacity: .6; }
.menu-list { padding: 0; }
.menu-list a { display: flex; align-items: center; gap: 14px; padding: 15px 16px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--hair); }
.menu-list a:hover { background: var(--surface-2); }
.menu-list li:last-child a { border-bottom: 0; }
.menu-list a .icon { color: var(--text-2); }
.menu-list small { display: block; color: var(--muted); font-size: .8rem; }
.plate-input { text-transform: uppercase; font-weight: 500 !important; letter-spacing: .1em; text-align: center; }

/* charts / tabel / kaart */
.chart-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.chart-grid .card { margin: 0; }
.chart { width: 100%; height: 220px; position: relative; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .axis { stroke: var(--border); } .chart .grid { stroke: var(--hair); }
.chart text { fill: var(--muted); font-size: 11px; font-weight: 300; }
.chart .line { fill: none; stroke: var(--primary); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: color-mix(in srgb, var(--primary) 12%, transparent); }
.chart .dot { fill: var(--primary); }
.chart .bar { fill: var(--primary); opacity: .9; } .chart .bar:hover { opacity: 1; }
.chart .threshold { stroke: var(--muted); stroke-dasharray: 4 4; stroke-width: 1; }
.chart .tip { position: absolute; pointer-events: none; background: var(--text); color: var(--bg); font-size: .78rem; padding: 4px 8px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -120%); }
.chart-empty { color: var(--muted); display: grid; place-items: center; height: 100%; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--hair); text-align: left; white-space: nowrap; }
.table th { color: var(--muted); font-size: .76rem; font-weight: 400; }
.table .num { text-align: right; }
.map { height: calc(100vh - var(--top-h) - var(--nav-h) - 140px); min-height: 360px; padding: 0; overflow: hidden; }
.leaflet-container { font: inherit; background: var(--surface-2); }
.tiles-gray { filter: grayscale(1) contrast(.92) brightness(1.04); }
[data-theme="dark"] .tiles-gray { filter: grayscale(1) invert(1) brightness(.82) contrast(.88); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.leaflet-popup-content-wrapper { border-radius: 12px; }
.leaflet-bar a { background: var(--surface); color: var(--text); border-color: var(--border); }
.leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 85%, transparent) !important; color: var(--muted); }
.leaflet-control-attribution a { color: var(--text-2); }
.map-pop strong { display: block; margin-bottom: 2px; font-weight: 500; }
.install-card[hidden], [hidden] { display: none !important; }

/* desktop */
@media (min-width: 640px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .grid2 { grid-template-columns: 1fr 1fr; } .grid2 .span2 { grid-column: span 2; }
  .hero { flex-direction: row; align-items: center; justify-content: space-between; }
  .chart-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  body { padding-bottom: 28px; }
  .bottomnav { display: none; }
  .logo span { display: inline; }
  .vehicle-switch { flex: 0 1 300px; }
  .topnav { display: flex; gap: 2px; margin-left: auto; }
  .topnav a { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; color: var(--muted); font-weight: 400; text-decoration: none; }
  .topnav a .icon { width: 17px; height: 17px; }
  .topnav a:hover { color: var(--text); background: var(--surface-2); }
  .topnav a.active { color: var(--text); font-weight: 500; box-shadow: inset 0 -2px 0 var(--primary); border-radius: 0; }
  .page-tanken .container { max-width: 640px; }
  .fill-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; border-top: 0; }
  .fill-list li { display: flex; border-top: 1px solid var(--hair); } .fill-list .fill { flex: 1; }
  .map { height: calc(100vh - var(--top-h) - 160px); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
