:root, [data-theme="light"] {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --surface-alt: #f0f1f4;
    --border: #e2e4e9;
    --text: #1a1d27;
    --text-muted: #6b7084;
    --accent: #DA3628;
    --green: #16a34a;
    --orange: #d97706;
    --red: #dc2626;
    --marker-blue: #2563eb;
    --sidebar-bg: #1a1d27;
    --sidebar-text: #8b8fa3;
    --sidebar-text-hover: #e4e6ed;
    --sidebar-active-bg: rgba(232,93,58,.15);
    --sidebar-active-text: #DA3628;
    --tooltip-shadow: rgba(0,0,0,.12);
}

[data-theme="dark"] {
    --bg: #0f1117;
    --surface: #1a1d27;
    --surface-alt: #222633;
    --border: #2a2e3b;
    --text: #e4e6ed;
    --text-muted: #8b8fa3;
    --green: #22c55e;
    --orange: #f59e0b;
    --red: #ef4444;
    --marker-blue: #3b82f6;
    --sidebar-bg: #13151c;
    /* Brightened from #555a6e (~3.0:1 on #13151c) to meet WCAG AA 4.5:1 */
    --sidebar-text: #a8b3c5;
    --sidebar-text-hover: #f4f5f7;
    --sidebar-active-bg: rgba(232,93,58,.20);
    --sidebar-active-text: #ff6b5e;
    --tooltip-shadow: rgba(0,0,0,.4);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 220px;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    /* Boven de Leaflet-panes (popups ~700) zodat de mobiele drawer/menu de
       kaart afdekt; onder de revenue-modal (1000) zodat die alles afdekt. */
    z-index: 950;
    padding: 14px 12px;
}
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 16px;
}
.sidebar-logo {
    display: flex; align-items: center;
    padding: 4px 6px;
    color: #fff;
    text-decoration: none;
    flex: 1 1 auto;
    min-width: 0;
}

/* Close-knop alleen zichtbaar in mobile-overlay. Op desktop heeft de sidebar
   geen toggle dus geen close-affordance. */
.sidebar-close {
    display: none;
    /* 44px raakvlak (WCAG 2.5.5) voor duim-bediening; het icoon blijft even groot. */
    width: 44px; height: 44px;
    border-radius: 8px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    color: #e4e6ed;
    cursor: pointer;
    flex-shrink: 0;
    align-items: center; justify-content: center;
}
.sidebar-close:hover { background: rgba(255,255,255,.12); color: #fff; }
.sidebar-close:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Hamburger zit in de topbar; alleen zichtbaar op mobile (zie media query).
   Desktop verbergt hem omdat de sidebar daar permanent open is. */
.mobile-menu-toggle {
    display: none;
    /* 44px raakvlak (WCAG 2.5.5) voor duim-bediening; het icoon blijft even groot. */
    width: 44px; height: 44px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    color: var(--text);
    cursor: pointer;
    align-items: center; justify-content: center;
    flex-shrink: 0;
}
.mobile-menu-toggle:hover { background: var(--border); }
.mobile-menu-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Mobiele actie-host in de drawer (locate + theme). JS portaliseert de
   bestaande topbar-knoppen hierheen op mobile zodat de listeners in
   locate.js / theme.js geen nieuwe DOM-bindings nodig hebben.
   Standaard verborgen via [hidden]; JS verwijdert het attribuut op mobile. */
.sidebar-mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 4px 0 8px;
}
.sidebar-mobile-actions[hidden] { display: none; }
.sidebar-mobile-actions .topbar-btn {
    width: 100%;
    height: auto;
    padding: 11px 14px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--sidebar-text);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
}
.sidebar-mobile-actions .topbar-btn:hover {
    background: rgba(255,255,255,.06);
    color: var(--sidebar-text-hover);
    border-color: transparent;
}
.sidebar-mobile-actions .topbar-btn svg {
    width: 18px; height: 18px;
    flex-shrink: 0;
}
.sidebar-mobile-actions .topbar-btn::after {
    content: attr(data-mobile-label);
    font-size: 14px;
    font-weight: 600;
}

/* Backdrop hoort bij de mobile-drawer. Op desktop is hij hidden via [hidden]. */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 940;
    opacity: 0;
    transition: opacity .18s ease;
    pointer-events: none;
}
.sidebar-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}
.sidebar-backdrop[hidden] { display: none; }
.sidebar-logo-img {
    width: 100%;
    max-width: 160px;
    height: auto;
    display: block;
    background: #fff;
    padding: 8px 12px;
    border-radius: 10px;
    box-sizing: border-box;
}

.sidebar-sep { height: 1px; background: rgba(255,255,255,.08); margin: 4px 0 12px; }
.sidebar-spacer { flex: 1; }

.sidebar-tab,
.sidebar-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--sidebar-text);
    background: none;
    border: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    transition: all .15s;
    margin-bottom: 2px;
    width: 100%;
}
.sidebar-tab svg,
.sidebar-link svg { flex-shrink: 0; stroke: currentColor; }
.sidebar-tab-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-tab:hover,
.sidebar-link:hover { color: var(--sidebar-text-hover); background: rgba(255,255,255,.06); }
.sidebar-tab.active {
    color: #fff;
    background: var(--accent);
}
.sidebar-tab.active svg { stroke: #fff; }

/* Logout sits visually below Admin but separated by a divider — different
   intent (exit the app vs. navigate within). Muted default colour signals
   "lower priority destination"; the brand-red hover state surfaces only on
   pointer interaction so the button reads as deliberate rather than alarming. */
.sidebar-sep--bottom { margin: 8px 0 4px; }
.sidebar-logout-form { margin: 0; padding: 0; }
.sidebar-link--logout { opacity: 0.6; }
.sidebar-link--logout:hover {
    opacity: 1;
    color: var(--accent);
    background: rgba(218, 54, 40, 0.08);
}
.sidebar-link--logout:hover svg { stroke: var(--accent); }

.main {
    margin-left: 220px;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.topbar {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    background: var(--surface);
    /* Boven de Leaflet-panes; blijft onder de mobiele drawer (950). */
    position: relative;
    z-index: 930;
}
.topbar-context {
    display: flex; flex-direction: column;
    gap: 1px;
    line-height: 1.2;
    min-width: 140px;
}
.topbar-eyebrow {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
}
.topbar-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}
.stat-pills {
    display: flex; gap: 6px;
    padding-left: 16px;
    margin-left: 16px;
    border-left: 1px solid var(--border);
}
.pill {
    display: inline-flex; align-items: baseline; gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: inherit;
}
button.pill {
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
button.pill:hover {
    background: var(--border);
    border-color: var(--text-muted);
}
button.pill.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
button.pill.active .dot { box-shadow: 0 0 0 1px rgba(255,255,255,.4); }
.pill .num {
    font-weight: 800;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.pill .dot {
    width: 7px; height: 7px; border-radius: 50%;
    align-self: center;
}
.dot-green { background: var(--green); }
.dot-orange { background: var(--orange); }
.dot-red { background: var(--red); }

/* Colour-blind safety: shape per band via CSS mask-image. Square for green
   (stable/OK), triangle for orange (warning/attention), X for red
   (stop/wrong). Shapes don't collide with the HACCP trend chart's
   circle/diamond glyphs (which encode source, not band). */
.pill .dot[data-band],
.legal-docs-pill .dot[data-band] {
    border-radius: 0;
    -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
    -webkit-mask-position: center;
            mask-position: center;
    -webkit-mask-size: contain;
            mask-size: contain;
}
.pill .dot[data-band="green"],
.legal-docs-pill .dot[data-band="green"] {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><rect width='10' height='10' fill='black'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><rect width='10' height='10' fill='black'/></svg>");
}
.pill .dot[data-band="orange"],
.legal-docs-pill .dot[data-band="orange"] {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><polygon points='5,0 10,10 0,10' fill='black'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><polygon points='5,0 10,10 0,10' fill='black'/></svg>");
}
.pill .dot[data-band="red"],
.legal-docs-pill .dot[data-band="red"] {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><path d='M1,1 L9,9 M9,1 L1,9' stroke='black' stroke-width='2.5' stroke-linecap='round'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><path d='M1,1 L9,9 M9,1 L1,9' stroke='black' stroke-width='2.5' stroke-linecap='round'/></svg>");
}

/* The existing `button.pill.active .dot { box-shadow: 0 0 0 1px rgba(255,255,255,.4); }`
   draws a ring around the element's BORDER-BOX, not the masked silhouette. With
   triangle/X masks that ring would render as a phantom square outside the shape.
   Drop the box-shadow for masked dots, and invert their colour to white when the
   parent pill is active (its red background swallows same-band shapes otherwise).

   The .legal-docs-pill .dot[data-band] half of the comma-separated rules
   above is the only consumer of [data-band] now; pills themselves use
   [data-tone]. */

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search-box {
    display: flex; align-items: center; gap: 6px;
    background: var(--surface-alt); border: 1px solid var(--border);
    border-radius: 8px; padding: 6px 12px;
}
.search-box svg { stroke: var(--text-muted); flex-shrink: 0; }
.search-box input {
    background: none; border: none; color: var(--text);
    font-size: 13px; outline: none; width: 240px; font-family: inherit;
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box:focus-within {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.search-kbd {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
    /* --surface is lighter than search-box's --surface-alt in light theme,
       and darker in dark theme — both give the keycap visual prominence
       against its parent. Re-evaluate if dark-theme contrast feels weak. */
    background: var(--surface);
    color: var(--text-muted);
    line-height: 1;
    font-weight: 600;
    user-select: none;
}
.search-box:focus-within .search-kbd { display: none; }
@media (hover: none) { .search-kbd { display: none; } }

/* View-tabs zitten nu in de sidebar (.sidebar-tab) */

.filter-bar {
    padding: 8px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; gap: 8px; align-items: center;
    background: var(--surface);
    flex-shrink: 0;
    min-height: 40px;
}
.filter-select.tab-hidden { display: none; }
.filter-bar-notice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0 10px 0 8px;
    height: 26px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: color-mix(in srgb, var(--orange) 8%, transparent);
    border-left: 2px solid var(--orange);
}
.filter-bar-notice svg {
    stroke: var(--orange);
    flex-shrink: 0;
}
.filter-bar-notice[hidden] { display: none; }

.filter-reset {
    /* Sits inline with the filter selects via the filter-bar's own gap. */
    margin-left: 8px;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    animation: filter-reset-in .2s ease-out;
}
.filter-reset:hover {
    background: var(--surface-alt);
    color: var(--text);
    border-color: var(--text-muted);
}
.filter-reset:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.filter-reset[hidden] { display: none; }

@keyframes filter-reset-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .filter-reset { animation: none; }
}

/* On mobile the filter-bar wraps; an auto-margin pushes the button up or
   left unexpectedly. Reset here so it stays after the notice/selects. */
@media (max-width: 800px) {
    .filter-reset { margin-left: 0; }
}

.filter-select {
    padding: 5px 10px; border-radius: 6px; font-size: 12px;
    border: 1px solid var(--border); background: var(--surface-alt);
    color: var(--text); font-family: inherit; cursor: pointer;
}
.filter-select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.topbar-freshness {
    font-size: 11px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    user-select: none;
}
.topbar-freshness[hidden] { display: none; }
.topbar-freshness time { font-weight: 600; }

.topbar-btn {
    /* Desktop-formaat; op mobiel worden deze knoppen door menu.js naar de
       drawer geportaliseerd, waar ze al een ruim (≥44px) pill-raakvlak krijgen
       via .sidebar-mobile-actions .topbar-btn. */
    width: 34px; height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    color: var(--text-muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s;
}
.topbar-btn:hover { color: var(--text); background: var(--border); }
.topbar-btn svg { width: 16px; height: 16px; }

.content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 380px;
    overflow: hidden;
}

.map-wrap {
    position: relative;
    background: var(--surface-alt);
}

#map { width: 100%; height: 100%; }

.side-panel {
    border-left: 1px solid var(--border);
    background: var(--surface);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.panel-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}
.panel-header h2 { font-size: 18px; font-weight: 700; }
.panel-header .muted { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.panel-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.empty-state { color: var(--text-muted); font-size: 13px; }

/* Top/Bottom-5 ranking widget op de Omzet-tab. Staat tussen panel-header en
   panel-body, alleen zichtbaar wanneer tab=omzet. Compact zodat de kiosk-lijst
   eronder zichtbaar blijft zonder scroll bij gemiddelde scherm-grootte. */
.rankings-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2, var(--surface));
}
.rankings-section { display: flex; flex-direction: column; gap: 6px; }
.rankings-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.rankings-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    counter-reset: rankings;
}
.rankings-list li {
    counter-increment: rankings;
    display: block;
}
.rankings-row {
    display: grid;
    grid-template-columns: 18px 1fr auto auto;
    gap: 8px;
    align-items: center;
    width: 100%;
    padding: 6px 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: inherit;
    text-align: left;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.12s ease, border-color 0.12s ease;
}
.rankings-row::before {
    content: counter(rankings) ".";
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    font-size: 11px;
}
.rankings-row:hover,
.rankings-row:focus-visible {
    background: var(--hover, rgba(0, 0, 0, 0.04));
    border-color: var(--border);
    outline: none;
}
.rankings-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.rankings-formula {
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.rankings-delta {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.rankings-row--above .rankings-delta { color: var(--green); }
.rankings-row--below .rankings-delta { color: var(--red); }

/* Per-categorie ticket-samenvatting op de Tickets-tab. Zelfde plek als de
   Omzet-rankings (tussen panel-header en panel-body), alleen zichtbaar wanneer
   tab=tickets. Rijen linken door naar de admin ticket-lijst per categorie. */
.category-summary-card {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2, var(--surface));
}
.category-summary-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.category-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.category-summary-table th {
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    padding: 4px 6px;
    border-bottom: 1px solid var(--border);
}
.category-summary-table th:not(:first-child),
.category-summary-table td.cat-sum-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    width: 56px;
}
.category-summary-table td {
    padding: 5px 6px;
    border-bottom: 1px solid var(--border);
}
.category-summary-table tr:last-child td { border-bottom: none; }
.cat-sum-name { color: var(--text); }
.cat-sum-link { color: inherit; text-decoration: none; }
.cat-sum-link:hover,
.cat-sum-link:focus-visible { text-decoration: underline; outline: none; }
.cat-sum-overdue { color: var(--red); font-weight: 700; }
.cat-sum-empty { color: var(--text-muted); text-align: left; }

.kiosk-list-empty {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
    padding: 8px 4px;
}
.kiosk-list-empty p { margin: 0; }
.kiosk-list-empty-reset {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    color: var(--accent);
    background: transparent;
    border: 1px solid var(--accent);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.kiosk-list-empty-reset:hover {
    background: var(--accent);
    color: #fff;
}
.kiosk-list-empty-reset:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.muted { color: var(--text-muted); }

/* -- Kiosk list -- */
.kiosk-list { display: flex; flex-direction: column; gap: 2px; }
.kiosk-list-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 8px;
    background: transparent; border: none; cursor: pointer;
    text-align: left; font: inherit; color: var(--text);
    transition: background .12s;
    width: 100%;
}
.kiosk-list-item:hover { background: var(--surface-alt); }
.kli-score {
    width: 36px; height: 36px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.kli-score[data-band="green"] { background: var(--green); }
.kli-score[data-band="orange"] {
    /* Diagonal stripes on the orange fill — extra CVD cue. */
    background:
        repeating-linear-gradient(
            45deg,
            rgba(255,255,255,0) 0,
            rgba(255,255,255,0) 4px,
            rgba(255,255,255,0.12) 4px,
            rgba(255,255,255,0.12) 6px
        ),
        var(--orange);
}
.kli-score[data-band="red"] {
    /* Cross-hatch on the red fill — denser than orange, also legible in greyscale. */
    background:
        repeating-linear-gradient(
            45deg,
            rgba(255,255,255,0) 0,
            rgba(255,255,255,0) 3px,
            rgba(255,255,255,0.14) 3px,
            rgba(255,255,255,0.14) 5px
        ),
        repeating-linear-gradient(
            -45deg,
            rgba(255,255,255,0) 0,
            rgba(255,255,255,0) 3px,
            rgba(255,255,255,0.14) 3px,
            rgba(255,255,255,0.14) 5px
        ),
        var(--red);
}
.kli-score[data-band="none"] { background: var(--border); color: var(--text-muted); }
.kli-info { flex: 1; min-width: 0; }
.kli-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kli-meta { font-size: 11px; color: var(--text-muted); }
.kli-formula {
    font-size: 11px; color: var(--text-muted); flex-shrink: 0;
}
.kli-noloc {
    color: var(--orange); font-size: 11px; cursor: help; margin-left: 4px;
}

/* -- Back to list -- */
.back-to-list {
    color: var(--text-muted); text-decoration: none;
    font-size: 16px; margin-right: 6px;
}
.back-to-list:hover { color: var(--accent); }

/* -- Visit type widgets (3 laatste-datums per type) -- */
.visit-type-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}
.visit-type-cell {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    text-align: center;
}
.visit-type-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 4px;
}
.visit-type-date {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}
.visit-type-date.is-empty { color: var(--text-muted); font-weight: 400; }

.visit-latest {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
}

/* Quick-note CTA: vanaf het kiosk-detail panel direct een bezoek vastleggen.
   Alleen zichtbaar voor users met VisitVoter::EDIT (winkelondersteuning,
   HACCP-manager) - server-side gegated in KioskSerializer. */
.btn-quick-visit {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 12px;
    padding: 8px 14px;
    background: var(--accent);
    color: #fff !important;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: filter 0.15s ease;
}
.btn-quick-visit:hover,
.btn-quick-visit:focus {
    filter: brightness(0.92);
    text-decoration: none;
}
.btn-quick-visit svg { flex-shrink: 0; }

/* -- Revenue card -- */
.revenue-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.revenue-big {
    font-size: 30px; font-weight: 800; line-height: 1;
    color: var(--text);
}
.revenue-delta {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
}
.revenue-delta.rev-up {
    background: color-mix(in srgb, var(--green) 12%, transparent);
    color: var(--green);
}
.revenue-delta.rev-down {
    background: color-mix(in srgb, var(--red) 12%, transparent);
    color: var(--red);
}
.revenue-benchmarks {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.revenue-benchmark-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-muted) 8%, transparent);
    color: var(--text);
    line-height: 1.4;
}
.revenue-benchmark-chip .chip-label {
    font-weight: 500;
    color: var(--text-muted);
}
.revenue-benchmark-chip.rev-up {
    background: color-mix(in srgb, var(--green) 10%, transparent);
}
.revenue-benchmark-chip.rev-down {
    background: color-mix(in srgb, var(--red) 10%, transparent);
}
.card {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    font-size: 13px;
    line-height: 1.5;
}
.card-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: .04em;
    margin-bottom: 8px;
}
.card hr { border: none; border-top: 1px solid var(--border); margin: 8px 0; }
.score-row { display: flex; align-items: center; gap: 16px; }
.score-big {
    position: relative;
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    padding: 8px 12px;
    border-radius: 10px;
    color: #fff;
}
.score-big[data-band="green"] { background: var(--green); }
.score-big[data-band="orange"] { background: var(--orange); }
.score-big[data-band="red"] { background: var(--red); }

/* Corner glyph mirrors the pill shape language: square (green) / triangle
   (orange) / X (red). White on the band-coloured background. Empty-state
   badges have no `data-band` so no glyph renders. Top-right placement
   avoids overlapping the score digits (which sit bottom-heavy in the 36px
   font box). */
.score-big[data-band]::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 10px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.85);
    -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
    -webkit-mask-position: center;
            mask-position: center;
    -webkit-mask-size: contain;
            mask-size: contain;
    pointer-events: none;
}
.score-big[data-band="green"]::after {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><rect width='10' height='10' fill='black'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><rect width='10' height='10' fill='black'/></svg>");
}
.score-big[data-band="orange"]::after {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><polygon points='5,0 10,10 0,10' fill='black'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><polygon points='5,0 10,10 0,10' fill='black'/></svg>");
}
.score-big[data-band="red"]::after {
    /* viewBox 12 + stroke 3 matches the pill X's effective stroke ratio (~25% of
       rendered size). Pill is 7×7 with viewBox 10 stroke 2.5 ≈ 1.75px effective;
       corner is 12×12 with viewBox 12 stroke 3 ≈ 3px effective — consistent ratio. */
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M1.5,1.5 L10.5,10.5 M10.5,1.5 L1.5,10.5' stroke='black' stroke-width='3' stroke-linecap='round'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M1.5,1.5 L10.5,10.5 M10.5,1.5 L1.5,10.5' stroke='black' stroke-width='3' stroke-linecap='round'/></svg>");
}

.score-big.is-empty {
    background: transparent;
    color: var(--text-muted);
    border: 1.5px dashed var(--border);
    padding: 6px 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.score-meta { font-size: 12px; line-height: 1.6; }

/* ─── HACCP split cards: internal (Sushi Lin) vs external (Bureau de Wit etc.) ─── */
.haccp-card {
    position: relative;
    padding-block: 16px;
    overflow: hidden;
}
.haccp-card + .haccp-card {
    margin-top: 10px;
}
.haccp-card .score-row {
    align-items: flex-start;
    gap: 14px;
}
.haccp-eyebrow {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 12px;
}
.haccp-eyebrow-tag {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 3px;
    line-height: 1.4;
}
.haccp-eyebrow-sub {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}
.haccp-meta {
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
}
.haccp-when {
    font-weight: 600;
    color: var(--text);
}
.haccp-meta-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}
.haccp-meta-next {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}
.haccp-meta-empty {
    color: var(--text-muted);
    font-style: italic;
    font-size: 12px;
}

/* Internal card: subtle red-accent left edge — owns operational rhythm. */
.haccp-card--internal {
    border-left: 3px solid var(--accent);
}
.haccp-card--internal .haccp-eyebrow-tag {
    background: rgba(218, 54, 40, 0.10);
    color: var(--accent);
}

/* External card: cooler steel-blue accent — formal/institutional tone. */
.haccp-card--external {
    border-left: 3px solid #5b6b85;
}
.haccp-card--external .haccp-eyebrow-tag {
    background: rgba(91, 107, 133, 0.14);
    color: #5b6b85;
}
[data-theme="dark"] .haccp-card--external {
    border-left-color: #7a8aa6;
}
[data-theme="dark"] .haccp-card--external .haccp-eyebrow-tag {
    background: rgba(122, 138, 166, 0.18);
    color: #a4b2cb;
}

.haccp-card.is-empty {
    background: transparent;
}
.haccp-card.is-empty .haccp-eyebrow-tag {
    opacity: 0.65;
}

.haccp-trend-card {
    margin-top: 10px;
}

.haccp-trend-card .card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.haccp-trend-legend {
    display: inline-flex;
    gap: 4px;
}

.haccp-trend-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.haccp-trend-chip:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

.haccp-trend-chip[aria-pressed="false"] {
    color: var(--text-muted);
    opacity: 0.55;
    background: transparent;
}

.haccp-trend-chip[aria-pressed="true"] {
    color: var(--text);
    background: var(--surface);
}

.haccp-trend-chip[aria-disabled="true"] {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.haccp-trend-chip-glyph {
    width: 10px;
    height: 10px;
    background: currentColor;
    flex-shrink: 0;
}

.haccp-trend-chip-glyph--circle {
    border-radius: 50%;
}

.haccp-trend-chip-glyph--diamond {
    transform: rotate(45deg);
}
.visit-notes {
    margin-top: 8px;
    color: var(--text);
    font-size: 12px;
    background: var(--surface);
    border-radius: 6px;
    padding: 8px 10px;
    border: 1px solid var(--border);
}

.trend-wrap {
    margin-top: 14px;
    height: 140px;
    position: relative;
}
.trend-wrap canvas { max-width: 100%; }

/* -- Locate me button -- */
#locate-me.locating { animation: spin .8s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* -- Proximity banner -- */
#proximity-banner {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
    z-index: 150; display: none;
}
.proximity-inner {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 10px 16px;
    box-shadow: 0 4px 16px var(--tooltip-shadow);
    font-size: 13px; white-space: nowrap;
}
.proximity-inner svg { stroke: #2563eb; flex-shrink: 0; }
.proximity-close {
    background: none; border: none; font-size: 18px; cursor: pointer;
    color: var(--text-muted); padding: 0 0 0 8px; line-height: 1;
}
.proximity-close:hover { color: var(--text); }

/* -- User location marker -- */
.user-loc-marker { filter: drop-shadow(0 0 6px rgba(37,99,235,.5)); }

/* -- Audit breakdown progress bars -- */
.audit-breakdown { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.audit-bar-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.audit-bar-label { width: 160px; flex-shrink: 0; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audit-bar-track { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.audit-bar-fill { height: 100%; border-radius: 4px; transition: width .4s ease; }
.audit-bar-fill[data-band="green"] { background: var(--green); }
.audit-bar-fill[data-band="orange"] { background: var(--orange); }
.audit-bar-fill[data-band="red"] { background: var(--red); }
.audit-bar-pct { width: 34px; text-align: right; font-weight: 600; font-size: 11px; color: var(--text-muted); }

/* -- Audit action items -- */
.audit-actions { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.audit-action { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; line-height: 1.5; color: var(--text); }
.audit-action::before { content: '\2022'; color: var(--text-muted); flex-shrink: 0; }

/* -- Owner badges -- */
.badge { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 10px; font-weight: 700; line-height: 1.6; letter-spacing: .02em; white-space: nowrap; }
.badge-supermarkt { background: rgba(59,130,246,.15); color: #3b82f6; }
.badge-operatie { background: rgba(232,93,58,.15); color: var(--accent); }
.badge-gotosushi { background: rgba(249,115,22,.15); color: #f97316; }
.badge-warning { background: rgba(217,119,6,.18); color: #b45309; }
.badge-sushi-lin { background: rgba(20,184,166,.15); color: #14b8a6; }
.badge-jumbo { background: rgba(59,130,246,.15); color: #3b82f6; }

/* -- Visit action items -- */
.visit-actions { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.visit-action { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; line-height: 1.5; color: var(--text); }
.visit-action::before { content: '\2022'; color: var(--text-muted); flex-shrink: 0; }

/* -- Opening checklist -- */
.opening-checklist { display: flex; flex-direction: column; gap: 6px; }
.checklist-item { display: flex; align-items: center; gap: 8px; font-size: 12px; line-height: 1.5; }
.checklist-icon { width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 10px; }
.checklist-icon.done { background: var(--green); color: #fff; }
.checklist-icon.pending { background: var(--border); color: var(--text-muted); }
.checklist-label { flex: 1; color: var(--text); }
.checklist-item.is-done .checklist-label { text-decoration: line-through; color: var(--text-muted); }

/* Deeplink-rij naar admin (legal docs). Onderscheidt zich subtiel van een
   info-only rij via hover; padding + tap target zodat hij op mobiel ook
   duidelijk klikbaar is. */
a.checklist-item.is-deeplink {
    text-decoration: none;
    color: inherit;
    padding: 4px 6px;
    margin: -4px -6px;
    border-radius: 6px;
    transition: background-color .15s;
    cursor: pointer;
}
a.checklist-item.is-deeplink:hover {
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}
a.checklist-item.is-deeplink:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}
a.checklist-item.is-deeplink .checklist-label {
    cursor: pointer;
}

/* -- Legal documents card -- */
.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
}
.card-header-row .card-label { margin-bottom: 0; }
.legal-docs-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}
.legal-docs-pill .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.legal-franchisee-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    margin: 6px 0 4px;
}
.legal-inline-checks {
    font-size: 14px;
    color: var(--green);
    letter-spacing: 4px;
    line-height: 1.2;
}
.legal-empty {
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
}
.legal-doc-link {
    font-size: 11px;
    color: var(--accent);
    text-decoration: none;
    margin-left: auto;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.legal-doc-link:hover { text-decoration: underline; }

.legal-doc-approve-cta {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: var(--green);
    padding: 2px 8px;
    border-radius: 4px;
    text-decoration: none;
    margin-left: 6px;
    white-space: nowrap;
}
.legal-doc-approve-cta:hover { background: color-mix(in srgb, var(--green) 85%, black); }

/* -- Tickets card --
   Rows reuse .checklist-item.is-deeplink but stack the title above a wrapping
   meta line (priority/status/deadline/assignee), so a long title never squeezes
   the badges. */
.ticket-list .ticket-row {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
}
.ticket-title { font-weight: 600; }
.ticket-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
}
.ticket-priority { font-weight: 700; }
.ticket-priority--critical { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }
.ticket-priority--high     { background: color-mix(in srgb, var(--orange) 18%, transparent); color: var(--orange); }
/* medium + low share the quiet treatment — no visual distinction by design. */
.ticket-priority--medium,
.ticket-priority--low      { background: var(--surface-alt); color: var(--text-muted); }
.ticket-deadline { white-space: nowrap; }
.ticket-deadline.is-overdue { color: var(--red); font-weight: 700; }
.ticket-assignee { white-space: nowrap; }
.ticket-assignee.is-empty { font-style: italic; }

/* -- Opening date banner -- */
.opening-date { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.opening-date strong { color: var(--accent); }

/* -- Pulsating ring for pre-opening markers -- */
@keyframes pulse-ring {
    0% { transform: scale(1); opacity: .6; }
    70% { transform: scale(2.2); opacity: 0; }
    100% { transform: scale(2.2); opacity: 0; }
}
.pulse-marker { position: relative; }
.pulse-ring {
    position: absolute;
    width: 16px; height: 16px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    top: 50%; left: 50%;
    margin-top: -8px; margin-left: -8px;
    animation: pulse-ring 1.8s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
    pointer-events: none;
}

.leaflet-tooltip {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 2px 12px var(--tooltip-shadow);
    color: var(--text);
    font-size: 12px;
    padding: 8px 10px;
}
.leaflet-tooltip:before { display: none; }

/* -- Keyboard focus indicators (WCAG 2.4.7) -- */
.sidebar-tab:focus-visible,
.sidebar-link:focus-visible,
.kiosk-list-item:focus-visible,
.topbar-btn:focus-visible,
.proximity-close:focus-visible,
button.pill:focus-visible,
.filter-select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
/* Suppress the browser's default focus outline only when focus came from
   mouse/touch (`:not(:focus-visible)`). Keyboard focus still gets the
   accessible outline defined in the `:focus-visible` block above. */
.sidebar-tab:focus:not(:focus-visible),
.sidebar-link:focus:not(:focus-visible),
.kiosk-list-item:focus:not(:focus-visible),
.topbar-btn:focus:not(:focus-visible),
.proximity-close:focus:not(:focus-visible),
button.pill:focus:not(:focus-visible) {
    outline: none;
}

/* -- Mobile breakpoint: sidebar wordt fullscreen drawer (slide-in van links),
      topbar bevat hamburger + compacte context, filter-bar compacter (3 cols),
      map+panel stacken verticaal. -- */
@media (max-width: 800px) {
    /* Sidebar als fullscreen drawer: standaard verborgen (offscreen), schuift
       in via .is-open. width 84vw geeft ruimte voor de backdrop rechts zodat
       buiten-tappen direct sluit. */
    .sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: min(320px, 84vw);
        max-width: none;
        height: 100dvh;
        overflow-y: auto;
        /* Leaflet's control-containers (.leaflet-top/.leaflet-bottom) staan op
           z-index 1000, dus de open drawer moet daarboven om de +/- zoomknoppen
           écht af te dekken. 1100/1090 ligt boven die 1000-laag; de drawer is op
           mobiel sowieso de bovenste laag wanneer hij open is. */
        z-index: 1100;
        transform: translateX(-100%);
        transition: transform .22s cubic-bezier(.2,.7,.3,1);
        padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
        box-shadow: 4px 0 20px rgba(0,0,0,.25);
    }
    .sidebar.is-open {
        transform: translateX(0);
    }
    /* Backdrop boven de Leaflet-controls (1000), onder de drawer (1100). */
    .sidebar-backdrop {
        z-index: 1090;
    }
    /* Tabs/links zien er hier weer uit als full-rows met labels (zoals desktop). */
    .sidebar-header { margin-bottom: 14px; }
    .sidebar-logo-img { max-width: 140px; padding: 6px 10px; }
    .sidebar-close { display: inline-flex; }

    .sidebar-tab,
    .sidebar-link {
        width: 100%;
        flex: 0 0 auto;
        padding: 12px 14px;
        font-size: 14px;
        margin-bottom: 4px;
    }
    .sidebar-tab-label {
        display: inline-block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .sidebar-sep { display: block; }
    .sidebar-spacer { display: block; }

    /* Main neemt nu volle breedte, sidebar overlapt 'm bij open. */
    .main { margin-left: 0; height: auto; min-height: 100vh; }

    /* Topbar: hamburger zichtbaar, context flex toelaten naast de hamburger. */
    .mobile-menu-toggle { display: inline-flex; }
    .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 12px; align-items: center; }
    .topbar-context { min-width: 0; flex: 1 1 auto; }
    .topbar-eyebrow { font-size: 9px; }
    .topbar-title { font-size: 15px; }

    /* Stat-pills + zoek stacken hieronder; de border-left wordt overbodig. */
    .stat-pills {
        margin-left: 0; padding-left: 0; border-left: none;
        flex-wrap: wrap;
        flex: 1 1 100%;
        gap: 4px;
    }
    .pill { padding: 4px 9px; font-size: 11px; }
    .pill .num { font-size: 12px; }

    /* JS portaliseert #locate-me + #theme-toggle naar .sidebar-mobile-actions
       op mobile, dus topbar-right hoeft alleen search/freshness te tonen.
       Mocht JS nog niet gedraaid hebben (initiele render), dan zijn de knoppen
       hier zichtbaar maar netjes wrappend. */
    .topbar-right {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }
    .search-box {
        flex: 1 1 100%;
        min-width: 0;
    }
    .search-box input {
        width: 100%;
        min-width: 0;
    }
    .topbar-freshness { flex: 0 0 auto; font-size: 10px; }

    /* Filter-bar: 3 selects op 1 rij via grid; notice/wis vullen aparte rijen. */
    .filter-bar {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        padding: 8px 12px;
        align-items: stretch;
        min-height: 0;
    }
    .filter-bar-notice {
        grid-column: 1 / -1;
        height: auto;
        font-size: 11px;
        padding: 4px 8px;
    }
    .filter-select {
        width: 100%;
        min-width: 0;
        padding: 7px 8px;
        font-size: 11px;
    }
    .filter-reset {
        grid-column: 1 / -1;
        margin-left: 0;
        padding: 7px 12px;
        font-size: 12px;
    }

    .content {
        grid-template-columns: 1fr;
        grid-template-rows: 50vh auto;
    }
    .side-panel {
        border-left: none;
        border-top: 1px solid var(--border);
    }

    /* Body scroll lock wanneer drawer open is, anders blijft de pagina
       achter de overlay scrollbaar (Safari issue). */
    body.menu-open {
        overflow: hidden;
        touch-action: none;
    }
}

/* Desktop: hamburger en backdrop verborgen, sidebar gewoon altijd in beeld. */
@media (min-width: 801px) {
    .mobile-menu-toggle,
    .sidebar-close,
    .sidebar-backdrop { display: none !important; }
}

/* -- Respect reduced-motion preference -- */
@media (prefers-reduced-motion: reduce) {
    .sidebar-tab,
    .sidebar-link,
    button.pill,
    .topbar-btn,
    .kiosk-list-item,
    .audit-bar-fill {
        transition: none;
    }
    .pulse-ring,
    #locate-me.locating {
        animation: none;
    }
    /* Keep the marker visible without the ring */
    .pulse-ring { display: none; }
}

/* ============================================================
   Legend glyph class
   ============================================================
   Plain coloured discs that match the map's circleMarker rendering.
   Background colour comes from the inline `style` attribute set in legend.js.
   The chip-shape mask-image rules in .pill .dot[data-band] /
   .score-big[data-band] apply to chips, not to map markers, which are
   circles today (the divIcon migration is deferred).
*/

.glyph {
    display: inline-block;
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    border-radius: 50%;
}

/* ============================================================
   Map legend control (bottom-right)
   ============================================================ */

.map-legend {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    font-size: 12px;
    min-width: 140px;
}

.map-legend-title {
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    font-size: 12px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.map-legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.5;
    color: var(--text);
}

.map-legend-label {
    flex: 1;
}

.map-legend-toggle {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text);
}

.map-legend-toggle:hover {
    background: var(--bg);
}

/* Mobile: collapse card behind a button. */
@media (max-width: 800px) {
    .map-legend.is-collapsed {
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
    }
}

/* Reduced motion: no transitions ever on the legend control. */
@media (prefers-reduced-motion: reduce) {
    .map-legend,
    .map-legend-toggle,
    .map-legend-card {
        transition: none !important;
        animation: none !important;
    }
}

/* ============================================================
   Side-panel summary header
   ============================================================ */

.panel-summary {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    margin-top: 2px;
}

.panel-summary-sub {
    display: block;
    font-size: 11px;
    margin-top: 2px;
}

/* ============================================================
   Slashed-fraction chip variant (Jumbo contracten tab)
   ============================================================ */

.kli-score--fraction {
    /* Inherits 36x36 from .kli-score; three glyphs need to fit. */
    gap: 0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.kli-score-divider {
    display: inline-block;
    transform: rotate(-15deg) translateY(-0.5px);
    opacity: 0.85;
    margin: 0 1px;
}

/* ============================================================
   Weekomzet empty-state map overlay
   ============================================================
   Mirrors #proximity-banner chrome; positioned top-centre of the map area
   to avoid collision with the bottom-centred proximity banner.
   No transition by default -> no reduced-motion concern.
*/

.map-banner {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-muted);
    max-width: 360px;
}

.map-banner[hidden] {
    display: none;
}

.map-banner svg {
    flex-shrink: 0;
    color: var(--text-muted);
}

/* ============================================================
   Descriptor-driven pill tones
   ============================================================
   Decouples shape from band so non-HACCP tabs get correct CVD shapes via
   tone semantics rather than colour names. Shape rules keyed on data-band
   apply to HACCP chips; the data-tone axis here is used by pills.js.
   Five tones: ok (square/green), warn (triangle/orange), critical (cross/red),
   muted (circle/grey, for "n.v.t." and "gesloten"), info (circle/blue, for
   "open"). */
.pill .dot[data-tone] {
    border-radius: 0;
    -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
    -webkit-mask-position: center;
            mask-position: center;
    -webkit-mask-size: contain;
            mask-size: contain;
}
.pill .dot[data-tone="ok"] {
    background: var(--green);
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><rect width='10' height='10' fill='black'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><rect width='10' height='10' fill='black'/></svg>");
}
.pill .dot[data-tone="warn"] {
    background: var(--orange);
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><polygon points='5,0 10,10 0,10' fill='black'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><polygon points='5,0 10,10 0,10' fill='black'/></svg>");
}
.pill .dot[data-tone="critical"] {
    background: var(--red);
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><path d='M1,1 L9,9 M9,1 L1,9' stroke='black' stroke-width='2.5' stroke-linecap='round'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><path d='M1,1 L9,9 M9,1 L1,9' stroke='black' stroke-width='2.5' stroke-linecap='round'/></svg>");
}
.pill .dot[data-tone="muted"] {
    background: var(--text-muted);
    border-radius: 50%;
    -webkit-mask-image: none;
            mask-image: none;
}
.pill .dot[data-tone="info"] {
    background: var(--marker-blue);
    border-radius: 50%;
    -webkit-mask-image: none;
            mask-image: none;
}
.pill .dot[data-tone] { box-shadow: none; }
button.pill.active .dot[data-tone] { background-color: #fff; }

/* Kiosk marker halos. Stroked SVG rings on overlayPane — see
   selection.js for the rationale on why we stroke instead of fill+shadow.
   Two intensities: hover is a transient cue while the cursor is over a list
   row; selected stays until cleared. Both use a brighter red (#FF4D3D) than
   brand #DA3628 to keep the halo distinguishable against HACCP-red markers. */
.kiosk-marker-halo-hover {
    filter: drop-shadow(0 0 4px rgba(255, 77, 61, 0.5));
    pointer-events: none;
}
.kiosk-marker-halo-selected {
    filter: drop-shadow(0 0 8px rgba(255, 77, 61, 0.75));
    pointer-events: none;
    animation: haloIn 180ms ease-out;
    transform-origin: center;
}
@keyframes haloIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .kiosk-marker-halo-selected { animation: none; }
}

/* -- Clickable card affordance (e.g. revenue card -> detail modal) -- */
.card.card-clickable {
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease, transform 120ms ease;
}
.card.card-clickable:hover,
.card.card-clickable:focus-visible {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 4%, var(--surface-alt));
}
.card.card-clickable:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.card.card-clickable:active { transform: scale(0.997); }
.card.card-clickable .card-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.card-action-hint {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    text-transform: none;
    letter-spacing: 0;
    opacity: 0.85;
}
.card.card-clickable:hover .card-action-hint,
.card.card-clickable:focus-visible .card-action-hint { opacity: 1; }

/* -- Revenue detail modal -- */
body.rev-modal-open { overflow: hidden; }
.rev-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
    animation: revModalFadeIn 140ms ease-out;
}
.rev-modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    width: min(880px, 100%);
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    animation: revModalSlideIn 180ms ease-out;
}
.rev-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--border);
}
.rev-modal-eyebrow {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 4px;
}
.rev-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}
.rev-modal-close {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    border-radius: 8px;
    padding: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.rev-modal-close:hover,
.rev-modal-close:focus-visible {
    color: var(--text);
    background: var(--surface-alt);
    border-color: var(--border);
}
.rev-modal-close:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.rev-modal-body {
    padding: 18px 22px 22px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.rev-modal-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.rev-kpi {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
}
.rev-kpi-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 6px;
}
.rev-kpi-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
}
.rev-modal-chart-card .rev-modal-chart {
    position: relative;
    height: 260px;
    margin-top: 4px;
}
.rev-modal-bench .rev-bench-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    font-size: 13px;
}
.rev-modal-bench .rev-bench-row + .rev-bench-row { border-top: 1px dashed var(--border); }
.rev-bench-label { color: var(--text-muted); }
.rev-bench-value { font-weight: 600; color: var(--text); }
.rev-bench-outlier {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}
.rev-modal-table-wrap { overflow-x: auto; }
.rev-modal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.rev-modal-table th,
.rev-modal-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.rev-modal-table th {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
}
.rev-modal-table td.rev-num,
.rev-modal-table th.rev-num { text-align: right; font-variant-numeric: tabular-nums; }
.rev-modal-table tbody tr:hover { background: var(--surface-alt); }
.rev-modal-table .rev-up { color: var(--green); font-weight: 600; }
.rev-modal-table .rev-down { color: var(--red); font-weight: 600; }
.rev-modal-table .rev-detail-link {
    color: var(--brand-red);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.rev-modal-table .rev-detail-link:hover,
.rev-modal-table .rev-detail-link:focus-visible { text-decoration: underline; }

/* Revenue drilldown tables: highlight the whole row and the whole column
   when hovering a cell. Row uses a subtle surface tint, column uses a brand
   overlay so the intersection remains visibly stronger. */
.revenue-table-hover td.revenue-table-row-hover,
.revenue-table-hover th.revenue-table-row-hover {
    background: color-mix(in srgb, var(--surface-alt) 92%, var(--surface));
}
.revenue-table-hover td.revenue-table-col-hover,
.revenue-table-hover th.revenue-table-col-hover {
    box-shadow: inset 0 0 0 9999px color-mix(in srgb, var(--accent) 7%, transparent);
}
.revenue-table-hover td.revenue-table-cell-hover,
.revenue-table-hover th.revenue-table-cell-hover {
    background: color-mix(in srgb, var(--accent) 9%, var(--surface-alt));
    box-shadow: inset 0 0 0 9999px color-mix(in srgb, var(--accent) 14%, transparent);
}

@keyframes revModalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes revModalSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .rev-modal-backdrop,
    .rev-modal { animation: none; }
}
@media (max-width: 640px) {
    .rev-modal-backdrop { padding: 0; }
    .rev-modal {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
        border: none;
    }
    .rev-modal-kpis { grid-template-columns: 1fr; }
    .rev-modal-chart-card .rev-modal-chart { height: 220px; }
}
