/* Kosten per wasbeurt (js/kosten-per-beurt.js): tegels en tabel onder Kosten
   per maand (dashboard, klantportaal) en de kaart op de toestelpagina. */
.kpb { display: flex; flex-direction: column; gap: 10px; }
.kpb-tegels { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.kpb-tegel { border: 1px solid var(--alp-outline); border-radius: var(--alp-radius-sm); padding: 11px 14px; min-width: 0; background: var(--alp-surface); }
.kpb-tegel small { display: block; font-size: 0.74rem; color: var(--alp-text-secondary); }
.kpb-tegel strong { display: block; margin-top: 2px; font-size: 1.3rem; font-weight: 600; color: var(--alp-text-primary); font-variant-numeric: tabular-nums; }
.kpb-tegel span { display: block; margin-top: 2px; font-size: 0.76rem; color: var(--alp-text-secondary); font-variant-numeric: tabular-nums; }
.kpb-tegel.is-groot strong { font-size: 1.7rem; }
.kpb-tegel .kpb-geschat { color: var(--alp-status-aandacht-tekst); }
.kpb-leeg { margin: 0; font-size: 0.82rem; color: var(--alp-text-secondary); }
.kpb-leeg b { color: var(--alp-text-primary); }

.kpb-detail { font-size: 0.82rem; color: var(--alp-text-secondary); }
.kpb-detail summary { cursor: pointer; color: var(--alp-text-primary); font-weight: 600; width: fit-content; }
.kpb-detail summary:focus-visible { outline: 2px solid var(--alp-brand-primary); outline-offset: 2px; border-radius: 4px; }
.kpb-scroll { margin-top: 8px; max-height: 420px; overflow: auto; }
.kpb-uitleg { margin: 8px 0 0; max-width: 75ch; font-size: 0.78rem; }

.kpb-tabel { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
/* style.css zet elke th grijs, in hoofdletters en met !important: hier niet */
.kpb-tabel th, .kpb-tabel td { padding: 7px 8px !important; border-bottom: 1px solid var(--alp-outline); text-align: start; vertical-align: middle; }
.kpb-tabel th { background: transparent !important; text-transform: none; letter-spacing: normal; font-size: inherit !important; }
.kpb-tabel thead th { position: sticky; top: 0; z-index: 1; background: var(--alp-surface) !important; font-size: 0.74rem !important; font-weight: 600 !important; color: var(--alp-text-secondary) !important; }
.kpb-tabel tbody th { width: 42%; font-weight: 600 !important; color: var(--alp-text-primary) !important; overflow-wrap: break-word; hyphens: auto; }
.kpb-tabel tbody th small { display: block; font-weight: 400; font-size: 0.72rem; color: var(--alp-text-secondary); }
.kpb-tabel .kpb-loc th, .kpb-tabel .kpb-loc td { background: var(--alp-rij-hover, transparent) !important; }
.kpb-tabel .kpb-pomp th { padding-inline-start: 22px !important; font-weight: 400 !important; color: var(--alp-text-secondary) !important; }
.kpb-tabel .kpb-n, .kpb-tabel .kpb-som { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpb-waarde { display: flex; align-items: center; gap: 8px; min-width: 150px; }
.kpb-waarde + .kpb-waarde { margin-top: 4px; }
.kpb-waarde b { font-weight: 600; color: var(--alp-text-primary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpb-balk { flex: 1 1 70px; max-width: 120px; height: 8px; border-radius: 4px; background: var(--alp-status-toekomst-bg); overflow: hidden; }
.kpb-balk i { display: block; height: 100%; border-radius: 4px; background: var(--alp-brand-primary); }
.kpb-balk.is-uur i { background: var(--alp-status-actief); }
.kpb-geen { font-style: italic; }

/* Toestelpagina */
.kpb-t { display: grid; grid-template-columns: minmax(200px, 280px) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.kpb-t-grafiek { min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.kpb-maanden { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; align-items: end; height: 150px; }
.kpb-m { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.kpb-m-staaf { flex: 1; width: 100%; max-width: 28px; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; border-bottom: 1px solid var(--alp-outline); }
.kpb-m-staaf em { font-style: normal; font-size: 0.66rem; text-align: center; color: var(--alp-text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; margin-bottom: 2px; }
.kpb-m.is-nu .kpb-m-staaf em { color: var(--alp-text-primary); font-weight: 600; }
.kpb-m-staaf i { display: block; width: 100%; background: var(--alp-brand-primary); border-radius: 4px 4px 0 0; }
.kpb-m.is-nu .kpb-m-staaf i { opacity: 0.55; }
.kpb-m small { font-size: 0.68rem; color: var(--alp-text-secondary); white-space: nowrap; }
.kpb-maanden-noot { margin: 6px 0 0; font-size: 0.72rem; color: var(--alp-text-secondary); }

@media (max-width: 640px) {
    .kpb-tabel .kpb-som, .kpb-tabel .kpb-n { display: none; }
    .kpb-waarde { min-width: 0; }
    .kpb-balk { display: none; }
    .kpb-t { grid-template-columns: minmax(0, 1fr); }
    .kpb-maanden { gap: 3px; height: 110px; }
    .kpb-m small { font-size: 0.6rem; }
    .kpb-m:not(.is-nu) .kpb-m-staaf em { visibility: hidden; }
    .kpb-tabel tbody th { width: 46%; }
}

/* Dealer: winst (js/kosten-per-beurt.js winstTegel) */
.kpb-tegel.is-winst strong { color: var(--alp-status-klaar-tekst); }
.kpb-tegel .kpb-let-op { color: var(--alp-status-aandacht-tekst); }
.kpb-winst { display: block; margin-top: 2px; font-size: 0.74rem; color: var(--alp-status-klaar-tekst); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpb-maanden.is-winst .kpb-m-staaf i { background: var(--alp-status-klaar); }

/* Na een overgenomen insteladvies, nog niet gekalibreerd op de nieuwe snelheid
   (lib/verbruik-zekerheid.js): hoe onzeker het verbruik is */
.kpb-onzeker { display: inline-block; align-self: flex-start; margin-top: 4px; padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600;
    background: var(--alp-status-aandacht-bg); color: var(--alp-status-aandacht-tekst); white-space: nowrap; }
.kpb-onzeker-uitleg { font-size: 0.78rem; color: var(--alp-text-secondary); }
.kpb-tabel th .kpb-onzeker { display: block; width: max-content; margin-top: 3px; font-size: 0.72rem; }
