/* ============================================================
   Firmabilportal v1.0
   Designspråk matchet mot 2GM Booking:
   - Mørk header med pille-knapper
   - Lyst lerret med subtile grå nyanser
   - Tett, profesjonell tabell-layout
   - Grønn aksent for primærhandlinger
   ============================================================ */

:root {
  --bg: #f5f6f7;
  --surface: #ffffff;
  --border: #e4e6ea;
  --border-strong: #d0d4d9;
  --text: #1a1d21;
  --text-muted: #6b7280;
  --text-soft: #9ca3af;
  --header-bg: #1a1d21;
  --header-text: #f5f6f7;
  --accent: #16a34a;
  --accent-hover: #15803d;
  --warn: #f59e0b;
  --danger: #dc2626;
  --info: #3b82f6;
  --hover: #f9fafb;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

/* ============================================================
   Versjons-oppdatering — sticky banner til brukeren klikker.
   Samme mønster som 2gmbooking-portal: update.js poll'er version.txt
   og setter .show når kjørende versjon != deployet versjon.
   ============================================================ */
#updateBanner {
  display: none;
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  padding: 12px 22px;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(22,163,74,.35), 0 2px 6px rgba(0,0,0,.08);
  z-index: 10001;
  font-size: 14px;
  font-weight: 500;
  align-items: center;
  gap: 14px;
  font-family: inherit;
  max-width: calc(100vw - 24px);
  animation: _updateBannerIn .25s cubic-bezier(.2,.7,.3,1) forwards;
}
#updateBanner.show { display: flex !important; }
#updateBanner button {
  background: #fff;
  color: var(--accent-hover);
  border: 0;
  border-radius: 8px;
  padding: 7px 16px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s;
}
#updateBanner button:hover { background: #f0fdf4; }
@keyframes _updateBannerIn {
  from { opacity: 0; transform: translate(-50%, -12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ============================================================
   HEADER - mørk pille-stil som booking
   ============================================================ */
.header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: var(--radius-lg);
  margin: 16px 16px 0;
}

.header__title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  flex: 1;
}

.header__nav {
  display: flex;
  gap: 6px;
  align-items: center;
}

.pill {
  background: transparent;
  color: var(--header-text);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}
.pill--active {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
}
.pill--secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.pill--secondary:hover {
  background: var(--hover);
  border-color: var(--text-muted);
}
.pill--accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.pill--accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.version-tag {
  font-size: 11px;
  color: var(--text-soft);
  font-weight: 400;
  margin-left: 4px;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  padding: 16px;
  max-width: 1800px;
  margin: 0 auto;
}

/* ============================================================
   STATISTIKK-KORT - som booking
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 16px 0 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}
.stat-card--clickable {
  cursor: pointer;
}
.stat-card--clickable:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.stat-card__label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 6px;
}
.stat-card__value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-card--warn .stat-card__value { color: var(--warn); }
.stat-card--danger .stat-card__value { color: var(--danger); }

/* ============================================================
   FILTER-BANNER - vises når special-filter er aktivt
   ============================================================ */
.filter-banner {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #78350f;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* Ekstra pille-varianter */
.pill--secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.pill--secondary:hover {
  background: var(--hover);
  border-color: var(--text-soft);
}
.pill--small {
  padding: 3px 10px;
  font-size: 11px;
}

/* "Ledig" badge for biler uten sjåfør */
.badge--ledig {
  background: #fef3c7;
  color: #92400e;
}

/* ============================================================
   FILTER-RAD
   ============================================================ */
.filter-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.input, .select {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.15s;
}
.input:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
}
.input { min-width: 220px; }

.filter-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================================
   TABELL - tett, profesjonell stil
   ============================================================ */
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.section__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}
.section__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.section__meta {
  font-size: 12px;
  color: var(--text-muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

thead th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 10px 14px;
  background: #fafbfc;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
  cursor: pointer;
}
tbody tr:hover { background: var(--hover); }
tbody tr:last-child { border-bottom: none; }

tbody td {
  padding: 11px 14px;
  vertical-align: middle;
}

td.num, th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.regnr {
  font-family: 'SF Mono', 'Consolas', monospace;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
}

/* ============================================================
   STATUS-BADGES
   ============================================================ */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.badge--aktiv { background: #dcfce7; color: #166534; }
.badge--selges { background: #fef3c7; color: #92400e; }
.badge--solgt { background: #f3f4f6; color: #4b5563; }
.badge--utleid { background: #dbeafe; color: #1e40af; }
.badge--avregistrert { background: #fee2e2; color: #991b1b; }

.badge--type-service { background: #dcfce7; color: #166534; }
.badge--type-pkk { background: #dbeafe; color: #1e40af; }
.badge--type-km { background: #f3f4f6; color: #4b5563; }
.badge--type-booking { background: #fef3c7; color: #92400e; }
.badge--type-reparasjon { background: #fee2e2; color: #991b1b; }
.badge--type-default { background: #f3f4f6; color: #4b5563; }

/* ============================================================
   PKK-FRIST INDIKATOR
   ============================================================ */
.pkk-warn { color: var(--warn); font-weight: 600; }
.pkk-danger { color: var(--danger); font-weight: 600; }

/* ============================================================
   DETALJSIDE
   ============================================================ */
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.detail-header__title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.detail-header__regnr {
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.detail-header__biltype {
  font-size: 16px;
  color: var(--text-muted);
}

.back-link {
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 8px;
  display: inline-block;
}
.back-link:hover { color: var(--text); }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.info-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.info-cell__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.info-cell__value {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  word-wrap: break-word;
}
.info-cell__value--mono {
  font-family: 'SF Mono', 'Consolas', monospace;
}
.info-cell__value--empty {
  color: var(--text-soft);
  font-weight: 400;
  font-style: italic;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

/* ============================================================
   MOBIL
   ============================================================ */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    margin: 8px 8px 0;
  }
  .header__nav {
    flex-wrap: wrap;
    gap: 6px;
  }
  .header__nav .pill {
    font-size: 12px;
    padding: 5px 10px;
  }
  .container { padding: 8px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* Tabell → kortvisning */
  thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tbody tr {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
  }
  tbody td {
    padding: 4px 0;
    border: none;
    display: flex;
    justify-content: space-between;
    gap: 12px;
  }
  tbody td::before {
    content: attr(data-label);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 600;
    flex-shrink: 0;
  }
  td.num { text-align: right; }

  /* Skjul mindre viktige kolonner på mobil */
  td[data-label="INNREDNING"],
  td[data-label="BILKORT"],
  td[data-label="PRODUKT"] { display: none; }

  .filter-row { flex-wrap: wrap; gap: 6px; }
  .filter-row .input { min-width: 0; flex: 1 1 100%; }
  .filter-row select { flex: 1; }
  .filter-row .pill { font-size: 12px; }

  /* Detaljside */
  .detail-header { flex-direction: column; gap: 12px; }
  .detail-header__actions { flex-wrap: wrap; gap: 6px; }
  .detail-nav { flex-direction: column; gap: 8px; align-items: flex-start; }
  .detail-nav__pil { width: 100%; justify-content: space-between; }
  .info-grid { grid-template-columns: 1fr 1fr; }

  /* Modal */
  .modal { margin: 8px; max-height: calc(100vh - 16px); }
  .form-rad { flex-direction: column; }
  .form-gruppe--halv { width: 100%; }

  /* Drivstoff */
  .drivstoff-topp5-grid { grid-template-columns: 1fr; }
  .drivstoff-panel__totaler { gap: 12px; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.muted { color: var(--text-muted); }
.empty { color: var(--text-soft); font-style: italic; }
.hidden { display: none !important; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: fadeIn 0.15s ease;
}
.modal-overlay--lukker {
  animation: fadeOut 0.2s ease forwards;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.15s ease;
}
.modal--stor { max-width: 680px; }
@keyframes slideUp {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal__tittel {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.modal__lukk {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  line-height: 1;
}
.modal__lukk:hover { background: var(--hover); color: var(--text); }

.modal__body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.modal__ingress {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 16px;
  line-height: 1.6;
}

.modal__footer {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ============================================================
   SKJEMA-ELEMENTER
   ============================================================ */
.form-gruppe {
  margin-bottom: 14px;
}
.form-gruppe--halv { flex: 1; min-width: 0; }

.form-rad {
  display: flex;
  gap: 12px;
  margin-bottom: 0;
}
.form-rad .form-gruppe { margin-bottom: 14px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.form-krav { color: var(--danger); }

.form-hint {
  display: block;
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 4px;
}

.input--textarea {
  width: 100%;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}

.form-status {
  font-size: 12px;
  padding: 6px 0;
  font-weight: 500;
}
.form-status--ok { color: var(--accent); }
.form-status--feil {
  color: var(--danger);
  background: #fee2e2;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #fca5a5;
}

/* ============================================================
   VARSEL-BANNER (toast)
   ============================================================ */
.varsel-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: white;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  z-index: 2000;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  animation: slideUpToast 0.2s ease;
  white-space: nowrap;
}
.varsel-banner--ok { background: var(--accent); }
.varsel-banner--feil { background: var(--danger); }
.varsel-banner--forsvinner { animation: fadeOut 0.4s ease forwards; }
@keyframes slideUpToast {
  from { transform: translateX(-50%) translateY(12px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ============================================================
   MOBIL-TILPASNING FOR MODAL
   ============================================================ */
@media (max-width: 768px) {
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 92vh;
    max-width: 100%;
  }
  .form-rad { flex-direction: column; gap: 0; }
  .form-gruppe--halv { flex: unset; }
}

/* ============================================================
   SØKBART BILFELT
   ============================================================ */
.bil-sok-liste {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 100;
  max-height: 220px;
  overflow-y: auto;
}

.bil-sok-item {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.bil-sok-item:last-child { border-bottom: none; }
.bil-sok-item:hover { background: var(--hover); }

/* Gjør form-gruppe relativ for absolutt-posisjonert liste */
.form-gruppe { position: relative; }

/* Skillelinje i modal */
.modal__skillelinje {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* ============================================================
   FAKTURA IMPORT - SLIPP-SONE
   ============================================================ */
.faktura-slipp-sone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--hover);
}
.faktura-slipp-sone:hover,
.faktura-slipp-sone--aktiv {
  border-color: var(--accent);
  background: #f0fdf4;
}
.faktura-slipp-ikon {
  font-size: 32px;
  margin-bottom: 8px;
}
.faktura-slipp-tekst {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}
.faktura-slipp-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* Handlingsknapper på detaljside */
.detail-header__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Neste service dato */
.dato-snart {
  color: var(--text);
  font-size: 13px;
}
.num {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

/* Knapp for aktiv inaktiv-visning */
.pill--inaktiv {
  background: #f97316;
  color: #fff;
  border-color: #f97316;
}
.pill--inaktiv:hover {
  background: #ea6c0a;
  border-color: #ea6c0a;
}

/* ============================================================
   SERVICEHEFTE MODAL
   ============================================================ */
.sh-rad {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
}
.sh-rad--ny {
  border-color: var(--accent);
  border-left: 4px solid var(--accent);
}
.sh-rad--importert {
  opacity: 0.6;
}
.sh-rad__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--hover);
  flex-wrap: wrap;
}
.sh-rad__dato {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 90px;
}
.sh-rad__faktura {
  font-size: 12px;
  color: var(--text-muted);
  font-family: monospace;
}
.sh-rad__km {
  font-size: 12px;
  color: var(--text-muted);
}
.sh-rad__verksted {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}
.sh-rad__tekst {
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  white-space: pre-wrap;
}

/* ============================================================
   DRIVSTOFF-PANEL
   ============================================================ */
.drivstoff-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 16px;
}
.drivstoff-panel__header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  cursor: pointer;
  user-select: none;
}
.drivstoff-panel__header:hover .drivstoff-panel__tittel { color: var(--brand, #1B4F72); }
.drivstoff-panel__header:focus-visible {
  outline: 2px solid var(--brand, #1B4F72);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
.drivstoff-panel__chevron {
  margin-left: auto;
  font-size: 14px;
  color: var(--text-muted);
  transition: transform .15s ease;
  line-height: 1;
}
.drivstoff-panel--collapsed .drivstoff-panel__chevron { transform: rotate(-90deg); }
.drivstoff-panel--collapsed .drivstoff-panel__header  { margin-bottom: 0; }
.drivstoff-panel--collapsed .drivstoff-panel__body    { display: none; }
.drivstoff-panel__tittel {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.drivstoff-panel__sub {
  font-size: 12px;
  color: var(--text-muted);
}
.drivstoff-panel__totaler {
  display: flex;
  gap: 32px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.drivstoff-tall__verdi {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.drivstoff-tall__label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}
.drivstoff-panel__topp-tittel {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.drivstoff-rad {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
}
.drivstoff-rad:hover { background: var(--hover); }
.drivstoff-rad .regnr { min-width: 80px; font-weight: 600; }
.drivstoff-rad__antall { color: var(--text-muted); margin-left: auto; }

/* Drivstoff topp 5 banner */
.drivstoff-topp5 {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}
.drivstoff-topp5__rad {
  display: grid;
  grid-template-columns: 24px 90px 1fr 70px 90px;
  align-items: center;
  gap: 12px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
}
.drivstoff-topp5__rad:hover { background: var(--hover); }
.drivstoff-topp5__nr {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}
.drivstoff-topp5__bar-wrap {
  background: var(--border);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}
.drivstoff-topp5__bar {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.3s;
}
.drivstoff-topp5__liter {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.drivstoff-topp5__belop {
  text-align: right;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Topp5 side om side */
.drivstoff-topp5-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 4px;
}
.drivstoff-topp5-wrap { min-width: 0; }
@media (max-width: 600px) {
  .drivstoff-topp5-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   DRIVSTOFF TOOLTIP
   ============================================================ */
.ck-tooltip-trigger {
  cursor: default;
  position: relative;
}
.ck-tooltip {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 200;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  padding: 8px 0;
  min-width: 280px;
  white-space: nowrap;
}
.ck-tooltip-trigger:hover .ck-tooltip {
  display: block;
}
.ck-tooltip__rad {
  display: grid;
  grid-template-columns: 120px 55px 70px 1fr;
  gap: 6px;
  padding: 5px 14px;
  font-size: 12px;
  align-items: center;
}
.ck-tooltip__rad:hover { background: var(--hover); }
.ck-tooltip__tid {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.ck-tooltip__liter {
  text-align: right;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.ck-tooltip__belop {
  text-align: right;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.ck-tooltip__stasjon {
  color: var(--text-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Siste 3 fyllinger i drivstoffpanel */
.drivstoff-siste3 { display: flex; flex-direction: column; gap: 4px; }
.drivstoff-siste3__rad {
  display: grid;
  grid-template-columns: 80px 130px 60px 80px 1fr;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  align-items: center;
  cursor: pointer;
}
.drivstoff-siste3__rad:hover { background: var(--hover); }
.drivstoff-siste3__tid { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.drivstoff-siste3__liter { font-weight: 600; color: var(--accent); text-align: right; font-variant-numeric: tabular-nums; }
.drivstoff-siste3__belop { text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.drivstoff-siste3__stasjon { color: var(--text-muted); font-size: 12px; }

/* Detaljside navigasjon */
.detail-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.detail-nav__pil {
  display: flex;
  align-items: center;
  gap: 12px;
}
.detail-nav__teller {
  font-size: 13px;
  color: var(--text-muted);
  min-width: 60px;
  text-align: center;
}

/* Månedsvekler */
.mnd-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.mnd-nav__pil {
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
}
.mnd-nav__pil:hover { background: var(--hover); }
.mnd-nav__pil--disabled { opacity: 0.3; cursor: default; }
.mnd-nav__pil--disabled:hover { background: none; }

/* Sorterbare tabell-headere */
th.sortable {
  position: relative;
  transition: background 0.15s;
}
th.sortable:hover { background: var(--hover); }
th.sortable--active { color: var(--accent); }
