/* ── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary:       #1565C0;
  --primary-light: #1976D2;
  --primary-dark:  #0D47A1;
  --accent:        #FF6B35;
  --success:       #2E7D32;
  --danger:        #C62828;
  --warning:       #E65100;
  --bg:            #F0F4F8;
  --card-bg:       #FFFFFF;
  --text:          #212121;
  --text-sec:      #616161;
  --border:        #E0E0E0;
  --shadow:        0 2px 8px rgba(0,0,0,0.10);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.12);
  --header-h:      56px;
  --nav-h:         64px;
  --radius:        12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ────────────────────────────────────────────────────── */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.app-header h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.header-icon { font-size: 1.4rem; }

/* ── Main ──────────────────────────────────────────────────────── */
.app-main {
  margin-top: var(--header-h);
  margin-bottom: var(--nav-h);
  min-height: calc(100vh - var(--header-h) - var(--nav-h));
  padding: 16px;
}

.tab-section       { display: none; }
.tab-section.active { display: block; }

/* ── Page title ────────────────────────────────────────────────── */
.page-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}

/* ── Bottom Nav ────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-btn {
  flex: 1;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-sec);
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
  padding: 8px 0;
}

.nav-btn.active { color: var(--primary); }
.nav-icon { font-size: 1.25rem; }
.nav-label { font-size: 0.65rem; font-weight: 600; }

/* ── FAB ───────────────────────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  right: 20px;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255,107,53,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s;
}
.fab:active { transform: scale(0.93); }

/* ── Cards ─────────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.card-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-sec);
  font-weight: 700;
  margin-bottom: 12px;
}

/* ── Stat grid ─────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-item {
  background: #fff;
  border-radius: 10px;
  padding: 12px 10px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.stat-item.clickable {
  cursor: pointer;
  border-left: 3px solid var(--primary);
  position: relative;
}

.stat-item.clickable::after {
  content: 'ℹ';
  position: absolute;
  top: 7px; right: 8px;
  font-size: 0.75rem;
  color: var(--primary);
  opacity: 0.55;
}

.stat-item.clickable:active { background: #F0F4FF; }

.stat-label {
  font-size: 0.70rem;
  color: var(--text-sec);
  margin-bottom: 5px;
  line-height: 1.35;
}

.stat-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  word-break: break-all;
}

.stat-value.amount { color: var(--primary-dark); }

.stat-sub {
  font-size: 0.68rem;
  color: var(--text-sec);
  margin-top: 2px;
}

/* ── Tables ────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.85rem;
  white-space: nowrap;
}

thead th {
  background: var(--primary);
  color: #fff;
  padding: 10px 10px;
  text-align: left;
  font-weight: 600;
}

thead th:first-child { border-radius: 12px 0 0 0; }
thead th:last-child  { border-radius: 0 12px 0 0; }

tbody tr:nth-child(even) { background: #F5F8FF; }

tbody td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tfoot td {
  padding: 10px 10px;
  font-weight: 700;
  background: #E8F0FE;
  border-top: 2px solid var(--primary);
}

.td-right { text-align: right; }
.amount-total { color: var(--primary-dark); font-weight: 700; }

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: opacity 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { opacity: 0.78; transform: scale(0.97); }

.btn-primary   { background: var(--primary);  color: #fff; }
.btn-secondary { background: #E3F2FD; color: var(--primary); }
.btn-danger    { background: #FFEBEE; color: var(--danger); }
.btn-success   { background: #E8F5E9; color: var(--success); }

.btn-full { width: 100%; padding: 13px 16px; font-size: 1rem; }

.btn-icon {
  padding: 5px 8px;
  border-radius: 6px;
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-sec);
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.btn-icon:active { background: #F5F5F5; }
.btn-icon.danger { color: var(--danger); border-color: #FFCDD2; }

/* ── Jaarkosten cell ───────────────────────────────────────────── */
.jk-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

/* ── Forms ─────────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-sec);
  margin-bottom: 5px;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Mode radio toggle ─────────────────────────────────────────── */
.mode-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.mode-option {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 10px;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s;
}

.mode-option input[type="radio"] { accent-color: var(--primary); }
.mode-option.selected { border-color: var(--primary); background: #EEF4FF; }

/* ── Onderhoud entries ─────────────────────────────────────────── */
.year-group { margin-bottom: 20px; }

.year-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 5px;
  margin-bottom: 8px;
}

.entry-card {
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.entry-info { flex: 1; min-width: 0; }

.entry-date {
  font-size: 0.72rem;
  color: var(--text-sec);
  margin-bottom: 3px;
}

.entry-desc {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-meta {
  font-size: 0.73rem;
  color: var(--text-sec);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.entry-amount {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary-dark);
  white-space: nowrap;
}

.entry-actions { display: flex; gap: 5px; }

/* ── Modal ─────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.50);
  z-index: 200;
  display: flex;
  align-items: flex-end;
}

.modal-overlay.hidden { display: none; }

.modal {
  background: #fff;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.28s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-header h2 { font-size: 1rem; font-weight: 700; }

.modal-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-sec);
  padding: 4px 6px;
  line-height: 1;
  border-radius: 6px;
}

.modal-close:active { background: #F5F5F5; }

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ── Calculation breakdown ─────────────────────────────────────── */
.calc-formula {
  font-size: 0.78rem;
  color: var(--text-sec);
  background: #F5F7FA;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-family: 'Menlo', 'Consolas', monospace;
  line-height: 1.5;
}

.calc-breakdown { display: flex; flex-direction: column; }

.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  gap: 8px;
}

.calc-row:last-child { border-bottom: none; }

.calc-row.subtotal {
  font-weight: 700;
  font-size: 0.92rem;
  border-top: 2px solid var(--primary);
  border-bottom: none;
  margin-top: 4px;
  padding-top: 10px;
  color: var(--primary-dark);
}

.calc-neg { color: var(--success); }

.calc-result {
  margin-top: 12px;
  padding: 12px;
  background: #E8F0FE;
  border-radius: 10px;
  text-align: center;
}

.calc-result-label {
  font-size: 0.78rem;
  color: var(--text-sec);
  margin-bottom: 4px;
}

.calc-result-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-dark);
}

/* ── Empty state ───────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-sec);
}

.empty-icon { font-size: 2.8rem; margin-bottom: 10px; }
.empty-state p { font-size: 0.9rem; line-height: 1.5; }

/* ── Divider ───────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 14px 0;
}

/* ── Info box ──────────────────────────────────────────────────── */
.info-box {
  background: #EEF4FF;
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
  font-size: 0.82rem;
  color: var(--text-sec);
  margin-bottom: 14px;
}

/* ── Toast ─────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 74px);
  left: 50%;
  transform: translateX(-50%);
  background: #323232;
  color: #fff;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 0.85rem;
  z-index: 400;
  white-space: nowrap;
  pointer-events: none;
  animation: toastAnim 2.8s ease forwards;
}

@keyframes toastAnim {
  0%   { opacity: 0; transform: translateX(-50%) translateY(8px); }
  15%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  80%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ── Header extras ─────────────────────────────────────────────── */
.header-titles {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.header-sub {
  font-size: 0.70rem;
  opacity: 0.82;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  margin-left: auto;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.header-btn:active { background: rgba(255,255,255,0.20); }

/* ── Button sizes ──────────────────────────────────────────────── */
.btn-sm { padding: 5px 11px; font-size: 0.80rem; }

/* ── Badges ────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-blue  { background: #DBEAFE; color: #1E3A8A; }
.badge-green { background: #DCFCE7; color: #166534; }
.badge-grey  { background: #F3F4F6; color: #4B5563; }

/* ── Car list ──────────────────────────────────────────────────── */
.car-list { display: flex; flex-direction: column; gap: 8px; }

.car-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--bg);
  border-radius: 10px;
  border: 1.5px solid transparent;
}

.car-list-item.active {
  background: #EEF4FF;
  border-color: var(--primary);
}

.car-list-info { flex: 1; cursor: pointer; min-width: 0; }

.car-list-name {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 5px;
}

.car-list-badges { display: flex; flex-wrap: wrap; gap: 4px; }

/* ── Afgesloten banner ─────────────────────────────────────────── */
.afgesloten-banner {
  background: #FEF3C7;
  border-left: 3px solid #D97706;
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
  font-size: 0.82rem;
  color: #92400E;
  margin-bottom: 12px;
}

/* ── Km-stand logboek ──────────────────────────────────────────── */
.km-log-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.km-log-entry:last-child { border-bottom: none; }

.km-log-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.km-log-date  { font-size: 0.78rem; color: var(--text-sec); white-space: nowrap; }
.km-log-km    { font-weight: 700; font-size: 0.9rem; white-space: nowrap; }
.km-log-note  { font-size: 0.74rem; color: var(--text-sec); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Sub-tabs ──────────────────────────────────────────────────── */
.sub-tabs {
  display: flex;
  gap: 4px;
  margin: -4px 0 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.sub-tabs::-webkit-scrollbar { display: none; }

.sub-tab-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: #fff;
  font-size: 0.80rem;
  font-weight: 600;
  color: var(--text-sec);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.sub-tab-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.sub-tab-btn:active { opacity: 0.80; }

.subtab-content.hidden { display: none; }

/* ── Page header row ────────────────────────────────────────────── */
.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 8px;
}
.page-header-row .page-title { margin-bottom: 0; }

.total-badge {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-dark);
  white-space: nowrap;
}

/* ── Card action row ────────────────────────────────────────────── */
.card-action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.card-action-row .card-title { margin-bottom: 0; }

/* ── Year card (verzekering / belasting) ────────────────────────── */
.year-card {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.year-card:last-child { margin-bottom: 0; }

.year-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #F5F8FF;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.year-card-header > span:first-child { font-weight: 700; font-size: 0.92rem; }
.year-card-header > span:nth-child(2) { font-weight: 700; color: var(--primary-dark); font-size: 0.92rem; margin-left: auto; margin-right: 8px; }

/* ── Month grid (display) ───────────────────────────────────────── */
.month-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 8px;
  background: #fff;
}

.month-cell {
  padding: 6px 4px;
  text-align: center;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.month-cell:nth-child(4n) { border-right: none; }
.month-cell:nth-last-child(-n+4) { border-bottom: none; }

.month-name {
  font-size: 0.62rem;
  color: var(--text-sec);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}

.month-amount {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.month-amount.zero { color: var(--border); }

/* ── Month form grid (edit modal) ───────────────────────────────── */
.month-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.month-form-cell .form-label { margin-bottom: 3px; font-size: 0.75rem; }
.month-form-cell .form-input { padding: 8px 10px; font-size: 0.88rem; }

/* ── Fuel / brandstof ───────────────────────────────────────────── */
.fuel-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}
.fuel-stat-label { font-size: 0.82rem; color: var(--text-sec); }
.fuel-stat-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.consumption {
  display: inline-block;
  background: #ECFDF5;
  color: #065F46;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.deeltank-badge {
  display: inline-block;
  background: #FEF3C7;
  color: #92400E;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-main);
}
.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ── Calc trio (3 linked fuel inputs) ───────────────────────────── */
.calc-trio {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.calc-trio-hint {
  font-size: 0.74rem;
  color: var(--text-sec);
  margin-bottom: 4px;
  margin-top: -8px;
  font-style: italic;
}

/* ── Km-stand inline warning ────────────────────────────────────── */
.km-warning {
  display: none;
  font-size: 0.78rem;
  color: #92400E;
  background: #FEF3C7;
  border-radius: 6px;
  padding: 6px 10px;
  margin-top: 4px;
}

.km-delta {
  font-size: 0.75rem;
  color: #059669;
  font-weight: 600;
  margin-left: 4px;
}

/* ── Brandstof per jaar summary ─────────────────────────────────── */
.ysum-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.ysum-table th,
.ysum-table td {
  padding: 7px 4px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.ysum-table th { font-weight: 700; color: var(--text-sec) !important; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; background: transparent !important; }
.ysum-table .num { text-align: right; }
.ysum-table tfoot td { border-top: 2px solid var(--border); border-bottom: none; font-weight: 700; }

/* ── Jaarlijks overzicht table ──────────────────────────────────── */
.overzicht-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.80rem;
}
.overzicht-table th,
.overzicht-table td {
  padding: 8px 5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.overzicht-table th { font-weight: 700; color: var(--text-sec) !important; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; background: transparent !important; }
.overzicht-table tfoot td { border-top: 2px solid var(--border); border-bottom: none; font-weight: 700; }
.overzicht-table .num { text-align: right; }
.overzicht-table .total-col { font-weight: 700; color: var(--primary); }

/* ── Chart containers ───────────────────────────────────────────── */
.chart-container {
  position: relative;
  height: 180px;
  margin-top: 4px;
}

/* ── Inline km-stand editor ─────────────────────────────────────── */
.km-log-entry.editing .km-log-view { display: none; }
.km-log-entry:not(.editing) .km-log-edit { display: none; }
.km-log-edit {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}
.km-log-edit input {
  padding: 4px 8px;
  font-size: 0.85rem;
  border: 1px solid var(--primary);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  width: 120px;
}
.km-log-edit input.wide { width: 160px; }

/* ── Calc trio (3 linked fuel inputs) ───────────────────────────── */
.calc-trio {
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.calc-trio-hint {
  font-size: 0.74rem;
  color: var(--text-sec);
  margin-bottom: 4px;
  margin-top: -8px;
  font-style: italic;
}

/* ── Desktop / wider screens ───────────────────────────────────── */
@media (min-width: 620px) {
  .app-main {
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
  }

  .bottom-nav {
    max-width: 620px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 16px 16px 0 0;
  }

  .fab {
    right: calc(50% - 310px + 20px);
  }

  .modal-overlay {
    align-items: center;
    padding: 20px;
  }

  .modal {
    border-radius: 20px;
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
    max-height: 85vh;
  }

  .toast {
    bottom: calc(var(--nav-h) + 80px);
  }
}
