/* BUMO Planner - Stylesheet */

:root {
    --color-primary: #5096CD;
    --color-primary-dark: #3c7bac;
    --color-accent: #fbbe36;
    --color-bg: #f4f6f8;
    --color-panel: #ffffff;
    --color-text: #1a2c37;
    --color-muted: #6b7a85;
    --color-border: #e2e7ec;
    --color-border-strong: #c8d0d8;
    --color-error: #c62828;
    --color-error-bg: #fde8e8;
    --color-success: #2e7d32;
    --color-success-bg: #e6f4ea;
    --color-info: #1565c0;
    --color-info-bg: #e3f2fd;
    --color-warn: #e65100;
    --color-warn-bg: #fff3cd;

    --radius: 8px;
    --radius-sm: 4px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 2px 8px rgba(0,0,0,0.06);

    --font-sans: "Sora", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Bungee", "Sora", -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 22px; margin: 0 0 12px; font-weight: 600; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 600; color: var(--color-text); }
h3 { font-size: 14px; margin: 0 0 8px; font-weight: 600; }

.muted { color: var(--color-muted); }

/* Topbar / navigation */
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    position: sticky; top: 0; z-index: 10;
}
.topbar-inner {
    max-width: 1400px; margin: 0 auto;
    padding: 0 24px;
    display: flex; align-items: center;
    height: 56px;
    gap: 24px;
}
.brand {
    font-weight: 700; font-size: 16px; color: var(--color-text);
    display: flex; align-items: center; gap: 10px;
}
.brand:hover { text-decoration: none; }
.brand-logo {
    height: 32px;
    width: 32px;
    object-fit: contain;
    display: block;
}
.brand-text {
    line-height: 1;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 17px;
    letter-spacing: 0.5px;
    color: var(--color-text);
}
/* Backwards compat: oude .brand-dot stijl wordt nergens meer gerendered, maar
   zou anders een ongebruikte dot tonen. */
.brand-dot { display: none; }
.mainnav { display: flex; gap: 4px; flex: 1; }
.mainnav a {
    color: var(--color-text);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}
.mainnav a:hover { background: var(--color-bg); text-decoration: none; }
.mainnav a.active { background: var(--color-primary); color: #fff; }

.userbox { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.user-name { font-weight: 600; }
.user-role { color: var(--color-muted); }

/* Page structure */
.page {
    max-width: 1400px; margin: 0 auto;
    padding: 24px;
}
.page-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}
.page-head h1 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 400; /* Bungee heeft alleen 400 */
    font-size: 26px;
    letter-spacing: 0.5px;
    color: var(--color-text);
    line-height: 1.2;
}
.page-actions { display: flex; gap: 8px; }

.panel {
    background: var(--color-panel);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    margin-bottom: 20px;
}
.panel.no-pad { padding: 0; }
.panel h2:first-child { margin-top: 0; }

.footer {
    padding: 40px 0; text-align: center;
    color: var(--color-muted); font-size: 12px;
}

/* Forms */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-section { padding: 0 0 16px; border-bottom: 1px dashed var(--color-border); }
.form-section:last-of-type { border-bottom: none; padding-bottom: 0; }
.form-grid .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    align-items: end;
}
/* Compact row: auto-size (niet uitgerekt), voor kleine velden zoals tellers + checkbox */
.form-grid .form-row.form-row-compact {
    grid-template-columns: none;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.field { display: flex; flex-direction: column; gap: 4px; position: relative; }
.field > span {
    font-size: 12px; font-weight: 600; color: var(--color-muted);
    text-transform: uppercase; letter-spacing: 0.3px;
}
.field.field-wide { flex: 2; }
.field.field-narrow { width: 110px; flex: 0 0 110px; }
.field.field-full { flex: 1; width: 100%; }
.field.field-inline {
    flex-direction: row; align-items: center; gap: 8px; padding: 10px 0;
}
.field.field-inline > span { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--color-text); font-weight: 500; }

/* Nette checkbox-stijl binnen compact row (rollator etc.) */
.field.field-checkbox {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 120ms, background 120ms;
    height: 40px;
    box-sizing: border-box;
    user-select: none;
}
.field.field-checkbox:hover { border-color: var(--color-primary); background: #f0f6fc; }
.field.field-checkbox input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
}
.field.field-checkbox > span {
    text-transform: none;
    letter-spacing: 0;
    font-size: 14px;
    color: var(--color-text);
    font-weight: 500;
}
.field.field-checkbox:has(input:checked) {
    border-color: var(--color-primary);
    background: #e4f0fa;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="tel"],
.field input[type="number"],
.field input[type="date"],
.field input[type="time"],
.field input[type="search"],
.field select,
.field textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="search"],
select,
textarea {
    padding: 9px 12px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    font-family: inherit; font-size: 14px;
    color: var(--color-text);
    width: 100%;
    line-height: 1.3;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(80, 150, 205, 0.15);
}
input[type="checkbox"], input[type="radio"] { width: auto; }

/* Color picker: zichtbare kleurvlak */
input[type="color"] {
    width: 46px;
    height: 34px;
    padding: 3px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    cursor: pointer;
    vertical-align: middle;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}
input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 4px;
}

.form-footer {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; padding-top: 16px; border-top: 1px solid var(--color-border);
}
.form-footer-right { display: flex; gap: 8px; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 20px;
    border-radius: 24px; /* Rond zoals op buitenpostmobyl.nl */
    font-family: inherit; font-size: 14px; font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 120ms, border-color 120ms, box-shadow 120ms, transform 80ms;
    line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 16px;
}
.btn-primary {
    background: var(--color-primary); color: #fff; border-color: var(--color-primary);
}
.btn-primary:hover { background: var(--color-primary-dark); border-color: var(--color-primary-dark); }
.btn-secondary {
    background: #fff; color: var(--color-primary); border-color: var(--color-primary);
}
.btn-secondary:hover { background: var(--color-bg); }
.btn-ghost {
    background: transparent; color: var(--color-text); border-color: var(--color-border-strong);
}
.btn-ghost:hover { background: var(--color-bg); }
.btn-danger {
    background: #fff; color: var(--color-error); border-color: var(--color-error);
}
.btn-danger:hover { background: var(--color-error-bg); }
.btn-full { width: 100%; }
.btn-swap {
    align-self: flex-end;
    height: 40px; /* match input height */
    margin-bottom: 0;
}

/* Flash messages */
.flash {
    padding: 12px 16px; border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border-left: 4px solid;
}
.flash-success { background: var(--color-success-bg); border-color: var(--color-success); color: var(--color-success); }
.flash-error   { background: var(--color-error-bg);   border-color: var(--color-error);   color: var(--color-error); }
.flash-info    { background: var(--color-info-bg);    border-color: var(--color-info);    color: var(--color-info); }
.flash-warn    { background: var(--color-warn-bg);    border-color: var(--color-warn);    color: var(--color-warn); }

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: 8px;
}
.badge-info    { background: var(--color-info-bg);    color: var(--color-info); }
.badge-success { background: var(--color-success-bg); color: var(--color-success); }
.badge-danger  { background: var(--color-error-bg);   color: var(--color-error); }
.badge-ghost   { background: var(--color-bg);         color: var(--color-muted); }
.badge-small   {
    display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10px;
    background: #fff3cd; color: var(--color-warn); font-weight: 600; margin-left: 4px;
}

/* Login page */
.login-body {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #5096CD 0%, #2d4163 100%);
    padding: 20px;
}
.login-box {
    background: #fff; padding: 40px;
    border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    width: 100%; max-width: 420px;
}
.login-logo {
    text-align: center;
    margin-bottom: 8px;
}
.login-logo-img {
    max-width: 240px;
    width: 100%;
    height: auto;
    display: inline-block;
}
.login-subtitle {
    text-align: center;
    color: var(--color-muted);
    margin: 0 0 24px;
    font-size: 14px;
}

/* Toolbar (dashboard) */
.toolbar {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
    margin-bottom: 16px;
}
.toolbar-group { display: flex; align-items: center; gap: 8px; }
.toolbar-group input[type="date"],
.toolbar-group select { width: auto; }
.toolbar-group label { font-size: 13px; color: var(--color-muted); }
.toolbar-group label strong { color: var(--color-text); }

/* Slots grid */
.slots-heading { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.slots-day { color: var(--color-text); }
.slots-container { min-height: 200px; }
.slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 14px;
}
.slot {
    display: block;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: #fff;
    transition: border-color 150ms, box-shadow 150ms, transform 150ms, background 150ms;
    text-decoration: none; color: inherit;
    min-height: 72px;
    position: relative;
}
.slot:hover { text-decoration: none; }
.slot-time { font-weight: 700; font-size: 15px; color: var(--color-text); letter-spacing: 0.3px; }

/* Vrij: lichte primary-tint achtergrond + duidelijke dashed border + prominente + */
.slot-free {
    background: #eaf3fa;
    border: 1.5px dashed #8fb7d4;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
}
.slot-free .slot-time { color: #3b6a8f; }
.slot-free .slot-plus {
    margin: 4px auto 0;
    font-size: 26px;
    font-weight: 300;
    line-height: 1;
    color: #6ba3cc;
    transition: color 150ms, transform 150ms;
    align-self: center;
}
.slot-free:hover {
    background: #d4e6f5;
    border-color: var(--color-primary);
    border-style: solid;
    box-shadow: 0 2px 8px rgba(80, 150, 205, 0.25);
}
.slot-free:hover .slot-plus {
    color: var(--color-primary);
    transform: scale(1.2);
}

/* Bezet: gekleurde accent-balk links (kleur per rittype), klant prominent */
.slot-booked {
    border-left: 4px solid var(--color-primary);
    padding-left: 13px;
}
.slot-booked:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}
.slot-customer { font-weight: 600; font-size: 13px; margin-top: 4px; }
.slot-addresses { font-size: 12px; color: var(--color-muted); margin-top: 2px;
                  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.loading, .empty {
    text-align: center; color: var(--color-muted);
    padding: 40px 20px; font-size: 14px;
}

/* Tables */
.table-rides {
    width: 100%; border-collapse: collapse; font-size: 13px;
}
.table-rides th, .table-rides td {
    padding: 10px 14px; text-align: left; vertical-align: middle;
    border-bottom: 1px solid var(--color-border);
}
.table-rides th {
    font-size: 11px; font-weight: 600; color: var(--color-muted);
    text-transform: uppercase; letter-spacing: 0.3px;
    background: var(--color-bg);
}
.table-rides tr:last-child td { border-bottom: none; }
.table-rides tr.row-cancelled td { opacity: 0.55; }
.table-rides .nowrap { white-space: nowrap; }
.table-rides .type-dot {
    display: inline-block; width: 10px; height: 10px;
    border-radius: 50%; margin-right: 6px; vertical-align: middle;
}
.table-compact th, .table-compact td { padding: 6px 10px; }
.table-rides input[type="text"],
.table-rides input[type="password"],
.table-rides input[type="number"],
.table-rides input[type="time"],
.table-rides input[type="email"],
.table-rides select {
    padding: 6px 8px; font-size: 13px;
}

/* Filter bar: uniforme label-boven-input uitlijning */
.filter-bar {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.filter-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.filter-field > span {
    font-size: 11px;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
/* Zelfde hoogte voor inputs EN knoppen in de filter-bar → perfecte bottom-alignment */
.filter-bar input,
.filter-bar select,
.filter-bar .btn {
    height: 40px;
    box-sizing: border-box;
}
.filter-field > input,
.filter-field > select {
    min-width: 150px;
    width: 100%;
}
.filter-field-grow {
    flex: 1 1 280px;
    min-width: 0;
}
.filter-field-grow > input { min-width: 0; }
.filter-field-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: flex-end;
}
@media (max-width: 600px) {
    .filter-field { flex: 1 1 140px; }
    .filter-field-grow { flex: 1 1 100%; }
    .filter-field-buttons { flex: 1 1 100%; }
}

/* Autocomplete */
.field-with-autocomplete { position: relative; }
.autocomplete-list {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    max-height: 240px; overflow-y: auto;
    z-index: 100;
    display: none;
}
.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--color-border);
    font-size: 13px;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: var(--color-bg); }

/* Inline form in table cells */
.inline-form { display: contents; }

/* =========================================
   RESPONSIVE — alle breakpoints op één plek
   ========================================= */

/* Tablet en kleiner */
@media (max-width: 900px) {
    .topbar-inner { padding: 0 14px; }
    .brand-text {
        /* Op tablets is er nog ruimte voor de tekst */
        font-size: 15px;
    }
    .page { padding: 16px; }
}

/* Mobiel (telefoon) */
@media (max-width: 720px) {
    /* Hele app: minder padding, kleinere fonts */
    html, body { font-size: 13.5px; }
    .page { padding: 12px; }

    /* iOS zoomt automatisch in als input font-size < 16px is. Voorkom dat. */
    input[type="text"], input[type="email"], input[type="password"],
    input[type="tel"], input[type="number"], input[type="date"],
    input[type="time"], input[type="search"], select, textarea {
        font-size: 16px;
    }

    /* Topbar */
    .topbar-inner {
        padding: 0 12px; gap: 8px;
        flex-wrap: wrap;
        height: auto;
        min-height: 56px;
        padding-top: 8px;
        padding-bottom: 8px;
    }
    .brand-logo { width: 28px; height: 28px; }
    .brand-text {
        font-size: 14px;
        /* Bij heel smalle schermen verbergen — alleen logo */
    }
    .mainnav {
        gap: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex: 1 1 100%;
        order: 3; /* Onder de brand + userbox */
        border-top: 1px solid var(--color-border);
        margin: 0 -12px;
        padding: 4px 12px;
    }
    .mainnav a {
        padding: 8px 12px;
        font-size: 13px;
        white-space: nowrap;
    }

    /* Userbox compacter */
    .userbox { font-size: 12px; gap: 6px; }
    .user-role { display: none; }
    .user-name { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    /* Page-head: titel + actie onder elkaar */
    .page-head {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .page-head h1 { font-size: 22px; }
    .page-actions { width: 100%; }
    .page-actions .btn { width: 100%; justify-content: center; }

    /* Panels iets minder padding */
    .panel { padding: 14px 16px; }

    /* Tabellen: horizontale scroll wanneer ze niet passen.
       De .panel.no-pad-wrapper container komt om elke .table-rides heen via JS-loose
       fallback, maar ook met een directe CSS-aanpak: */
    .panel.no-pad {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table-rides { min-width: 540px; font-size: 13px; }
    .table-rides th, .table-rides td { padding: 10px 8px; }

    /* Filter bars: stacken */
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-field { flex: 1 1 100%; }
    .filter-field-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }
    .filter-field-buttons .btn { flex: 1; min-width: 0; }

    /* Form rows: alle velden full-width op mobiel */
    .form-grid .form-row {
        grid-template-columns: 1fr; /* alles onder elkaar */
        gap: 14px;
    }
    .form-grid .form-row.form-row-compact {
        flex-wrap: wrap;
        gap: 12px;
    }
    .field.field-narrow {
        width: 100%;
        flex: 1 1 calc(50% - 6px); /* 2-koloms voor adults/kids */
    }
    .field.field-checkbox {
        width: 100%;
        flex: 1 1 100%;
    }

    /* Slot-grids smaller minmax */
    .slots-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .slot-grid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }

    /* Toolbar (dashboard) */
    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .toolbar-group { flex-wrap: wrap; }

    /* Form-footer: knop full-width */
    .form-footer { flex-direction: column; gap: 8px; }
    .form-footer .btn { width: 100%; justify-content: center; }

    /* Sync status panel */
    .sync-status-panel {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .sync-status-panel form { width: 100%; }
    .sync-status-panel .btn { width: 100%; justify-content: center; }

    /* Login box */
    .login-body { padding: 12px; }
    .login-box { padding: 24px 20px; border-radius: 16px; }
    .login-logo-img { max-width: 200px; }

    /* AVG-modal */
    .gdpr-modal {
        padding: 22px 18px;
        border-radius: 16px;
    }
    .gdpr-modal h2 { font-size: 18px; }
    .gdpr-modal .gdpr-actions { flex-direction: column; gap: 8px; }
    .gdpr-modal .gdpr-actions .btn { width: 100%; justify-content: center; }

    /* View-toggle (Lijst/Kalender) */
    .view-toggle { width: 100%; }
    .view-toggle a { flex: 1; text-align: center; }

    /* FullCalendar: kleinere headertoolbar */
    .fc .fc-toolbar.fc-header-toolbar {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 12px;
    }
    .fc .fc-toolbar-chunk { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
    .fc .fc-button { padding: 6px 10px; font-size: 12px; }
    .fc .fc-toolbar-title { font-size: 16px; }

    /* Plus-knoppen op kalender: nog kleiner op mobiel, alleen begintijd */
    .fc-add-ride-btn { left: 2px; right: 2px; height: 14px; font-size: 9px; padding: 0 2px; }
    .fc-add-ride-btn:hover { height: 18px; font-size: 10px; }
    .fc-add-ride-btn .fc-add-icon { font-size: 10px; }
    .fc-add-ride-btn .fc-add-time-end,
    .fc-add-ride-btn .fc-add-time-sep { display: none; }
}

/* Heel klein (zoals iPhone SE) */
@media (max-width: 380px) {
    .brand-text { display: none; } /* Alleen logo om ruimte te besparen */
    .userbox .btn { padding: 6px 10px; font-size: 11px; }
    .page-head h1 { font-size: 20px; }
}

/* View toggle (Lijst / Kalender) */
.view-toggle {
    display: inline-flex;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.view-toggle a {
    padding: 7px 16px;
    border-radius: 3px;
    color: var(--color-text);
    font-weight: 500;
    font-size: 13px;
    transition: background 120ms;
}
.view-toggle a:hover { text-decoration: none; background: var(--color-bg); }
.view-toggle a.active {
    background: var(--color-primary);
    color: #fff;
}
.view-toggle a.active:hover { background: var(--color-primary-dark); }

/* FullCalendar aanpassingen */
.calendar-panel { padding: 12px; }
.fc { font-family: var(--font-sans); font-size: 13px; }
.fc .fc-toolbar-title { font-size: 18px; font-weight: 600; }
.fc .fc-button {
    background: #fff;
    color: var(--color-text);
    border: 1px solid var(--color-border-strong);
    font-weight: 500;
    padding: 6px 12px;
    font-size: 13px;
    box-shadow: none;
}
.fc .fc-button:hover {
    background: var(--color-bg);
    border-color: var(--color-border-strong);
}
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    box-shadow: none;
}
.fc .fc-event {
    border: none;
    padding: 2px 4px;
    cursor: pointer;
    font-weight: 500;
    border-radius: 3px;
}
.fc .fc-event:hover { opacity: 0.85; }
.fc .fc-timegrid-slot { height: 28px; }
.fc .fc-col-header-cell-cushion { font-weight: 600; color: var(--color-text); padding: 8px 4px; }
.fc .fc-daygrid-day-number { padding: 6px 8px; color: var(--color-text); }
.fc .fc-day-today { background: rgba(80, 150, 205, 0.06) !important; }

/* Autocomplete: styling blijft gelijk - werkt nu op 3 velden i.p.v. 1 */

/* =========================================
   Slot-picker (in rit-formulier)
   ========================================= */
.slot-picker-section { margin-top: 16px; }
.slot-picker-label {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 10px;
}
.slot-picker-label > span:first-child {
    font-size: 12px; font-weight: 600; color: var(--color-muted);
    text-transform: uppercase; letter-spacing: 0.3px;
}
.slot-picker-selected { font-size: 14px; color: var(--color-text); }
.slot-picker-selected strong { color: var(--color-primary); }

.slot-picker {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 12px;
    min-height: 60px;
}
.slot-picker .loading-small {
    text-align: center; color: var(--color-muted);
    font-size: 13px; padding: 20px;
}
.slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 6px;
}
.slot-btn {
    background: #fff;
    border: 1px solid #d6e3ee;
    color: var(--color-primary);
    font-family: inherit; font-size: 13px; font-weight: 500;
    padding: 9px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: center;
    transition: background 120ms, border-color 120ms, transform 120ms;
    white-space: nowrap;
}
.slot-btn:hover:not(:disabled) {
    background: #e8f1f9;
    border-color: var(--color-primary);
    transform: translateY(-1px);
}
.slot-btn-selected,
.slot-btn-selected:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    font-weight: 700;
}
.slot-btn-booked,
.slot-btn-booked:disabled {
    background: #fff4e5;
    border-color: #ffe0b2;
    color: #b36200;
    cursor: not-allowed;
    font-weight: 500;
}
.slot-btn-past,
.slot-btn-past:disabled {
    background: #f0f0f0;
    border-color: #e0e0e0;
    color: #aaa;
    cursor: not-allowed;
    text-decoration: line-through;
}
.slot-btn-blocked,
.slot-btn-blocked:disabled {
    background: #fef4e5;
    border-color: #fde2bc;
    color: #b36200;
    cursor: not-allowed;
}

/* Verleden-slot op dashboard */
.slot-past {
    background: #f3f4f6;
    border-color: #e5e7eb;
    cursor: not-allowed;
    opacity: 0.7;
}
.slot-past:hover { box-shadow: none; transform: none; }
.slot-past .slot-time {
    color: #9ca3af;
    text-decoration: line-through;
    text-decoration-color: #b0b7bf;
}

/* =========================================
   Retour-rit preview (live bij nieuwe rit)
   ========================================= */
.retour-preview {
    background: #f7fbfd;
    border: 1px solid #d8e7f3;
    border-left: 4px solid var(--color-primary);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin-top: 16px;
}
.retour-preview h3 {
    margin: 0 0 10px; font-size: 13px;
    color: var(--color-primary); font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.4px;
}
.retour-preview-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px 20px;
}
.retour-preview-grid > div {
    display: flex; flex-direction: column;
}
.retour-preview-grid > div.wide {
    grid-column: span 2;
}
.retour-preview-grid .label {
    font-size: 11px; font-weight: 600; color: var(--color-muted);
    text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 2px;
}
.retour-preview-grid .value {
    font-size: 14px; color: var(--color-text);
}
.retour-preview-grid .value strong { color: var(--color-primary); }

/* Info-panel wanneer een retour al bestaat */
.retour-exists-panel {
    border-left: 4px solid var(--color-success);
    background: var(--color-success-bg);
}
.retour-exists-panel h2 { color: var(--color-success); }

/* Responsive: retour-preview */
@media (max-width: 600px) {
    .retour-preview-grid > div.wide { grid-column: span 1; }
}

/* =========================================
   Read-only mode (rit in verleden)
   ========================================= */
.form-readonly input:not([type="hidden"]):not([type="submit"]),
.form-readonly select,
.form-readonly textarea {
    background: #f5f6f8;
    color: var(--color-muted);
    cursor: not-allowed;
}
.form-readonly input[type="checkbox"] {
    opacity: 0.6;
}
.form-readonly .autocomplete-list { display: none !important; }

.readonly-time-display {
    margin-top: 12px;
    padding: 14px 18px;
    background: #f5f6f8;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 15px;
}
.readonly-time-display strong { color: var(--color-text); }

@media (max-width: 600px) {
    .readonly-time-display { padding: 10px 12px; font-size: 14px; }
}

/* =========================================
   Dashboard: "alle rittypen" bookings-lijst
   ========================================= */
.bookings-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}
.booking-row {
    display: grid;
    grid-template-columns: 90px 160px 220px 1fr;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: #fff;
    text-decoration: none;
    color: var(--color-text);
    transition: border-color 0.15s, background 0.15s;
}
.booking-row:hover {
    border-color: var(--color-primary);
    background: var(--color-bg);
}
.booking-row-past {
    opacity: 0.55;
}
.booking-time {
    display: flex;
    flex-direction: column;
    font-size: 16px;
    line-height: 1.2;
}
.booking-time-end {
    font-size: 11px;
    color: var(--color-muted);
    margin-top: 2px;
}
.booking-type {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--color-muted);
}
.booking-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.booking-customer { font-size: 14px; }
.booking-addresses {
    font-size: 12px;
    color: var(--color-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 800px) {
    .booking-row {
        grid-template-columns: 70px 1fr;
        grid-template-areas:
            "time type"
            "time customer"
            "time addresses";
        gap: 6px 14px;
    }
    .booking-time     { grid-area: time; }
    .booking-type     { grid-area: type; }
    .booking-customer { grid-area: customer; }
    .booking-addresses{ grid-area: addresses; white-space: normal; }
}
.pac-container {
    font-family: var(--font-sans);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    border: 1px solid var(--color-border-strong);
    margin-top: 2px;
    z-index: 10000;
}
.pac-item {
    padding: 8px 12px;
    font-size: 13px;
    color: var(--color-text);
    cursor: pointer;
    border-top: 1px solid var(--color-border);
}
.pac-item:first-child { border-top: none; }
.pac-item:hover,
.pac-item-selected { background: var(--color-bg); }
.pac-icon { margin-right: 8px; }
.pac-item-query {
    font-size: 13px;
    color: var(--color-primary);
    font-weight: 500;
}
.pac-matched { font-weight: 700; }

/* =========================================
   Logboek-pagina
   ========================================= */
.table-log td.log-details {
    color: var(--color-muted);
    font-size: 12px;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.table-log tbody tr:hover { background: var(--color-bg); }

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 20px 0;
}
.pagination-info {
    color: var(--color-muted);
    font-size: 13px;
}

/* =========================================
   Flatpickr date-picker overrides (huisstijl)
   ========================================= */
.flatpickr-input {
    /* het verborgen echte input-veld */
}
input.flatpickr-input.form-control.input {
    /* altInput: de zichtbare vervanger - hetzelfde uiterlijk als native */
    display: inline-block !important;
}
.flatpickr-calendar {
    font-family: var(--font-sans);
    border-radius: var(--radius) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    border: 1px solid var(--color-border) !important;
    padding: 4px !important;
}
.flatpickr-calendar.arrowTop::before,
.flatpickr-calendar.arrowTop::after { border-bottom-color: var(--color-border) !important; }

.flatpickr-months {
    padding: 6px 8px 4px;
}
.flatpickr-months .flatpickr-month {
    color: var(--color-text) !important;
    fill: var(--color-text) !important;
    height: 36px;
}
.flatpickr-current-month {
    font-size: 14px !important;
    font-weight: 600 !important;
    padding: 4px 0 0 !important;
}
.flatpickr-monthDropdown-months {
    font-weight: 600 !important;
    font-size: 14px !important;
}
.flatpickr-weekdays { background: transparent; }
.flatpickr-weekday {
    color: var(--color-muted) !important;
    font-weight: 600 !important;
    font-size: 11px !important;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.flatpickr-day {
    border-radius: 6px !important;
    font-weight: 500;
    color: var(--color-text);
    transition: background 120ms, color 120ms;
}
.flatpickr-day:hover {
    background: var(--color-bg) !important;
    border-color: transparent !important;
}
.flatpickr-day.today {
    border-color: var(--color-primary) !important;
    color: var(--color-primary);
    font-weight: 700;
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.selected.today {
    background: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
    color: #fff !important;
    font-weight: 700;
}
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay { color: #c5ccd5 !important; }
.flatpickr-day.disabled { opacity: 0.35; }

/* Pijl-knoppen */
.flatpickr-prev-month,
.flatpickr-next-month {
    fill: var(--color-muted) !important;
    padding: 8px !important;
    border-radius: 6px;
    transition: background 120ms;
}
.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
    background: var(--color-bg);
    fill: var(--color-text) !important;
}

/* =========================================
   Google Calendar koppeling status
   ========================================= */
.gcal-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}
.gcal-status-ok {
    background: var(--color-success-bg);
    color: var(--color-success);
}
.gcal-status-err {
    background: var(--color-error-bg);
    color: var(--color-error);
}

/* =========================================
   Slot-button hover tooltips (instant, i.p.v. trage native title)
   ========================================= */
.slot-btn { position: relative; }

.slot-btn:disabled:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(33, 37, 41, 0.95);
    color: #fff;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    width: max-content;
    max-width: 260px;
    text-align: center;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: tip-fade-in 120ms ease-out;
}
.slot-btn:disabled:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(33, 37, 41, 0.95);
    z-index: 100;
    pointer-events: none;
}
@keyframes tip-fade-in {
    from { opacity: 0; transform: translateX(-50%) translateY(2px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.slot-grid { overflow: visible; }

/* =========================================
   Google Calendar sync-status panel (rit-bewerk pagina)
   ========================================= */
.sync-status-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border-left: 4px solid;
    background: #fff;
    border: 1px solid var(--color-border);
    flex-wrap: wrap;
}
.sync-status-main {
    display: flex;
    align-items: center;
    gap: 12px;
}
.sync-status-icon {
    font-size: 20px;
    font-weight: 700;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}
.sync-status-detail {
    font-size: 12px;
    color: var(--color-muted);
    margin-top: 2px;
}
.sync-status-ok {
    border-left-color: var(--color-success);
    background: var(--color-success-bg);
}
.sync-status-ok .sync-status-icon {
    background: var(--color-success);
    color: #fff;
}
.sync-status-err {
    border-left-color: var(--color-error);
    background: var(--color-error-bg);
}
.sync-status-err .sync-status-icon {
    background: var(--color-error);
    color: #fff;
}
.sync-status-pending {
    border-left-color: var(--color-muted);
    background: var(--color-bg);
}
.sync-status-pending .sync-status-icon {
    background: var(--color-muted);
    color: #fff;
}

/* ===== AVG-modaal ===== */
.gdpr-modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.gdpr-modal-backdrop[hidden] { display: none; }
.gdpr-modal {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 28px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.gdpr-modal h2 { margin-top: 0; color: var(--color-error); }
.gdpr-modal .gdpr-info {
    background: var(--color-bg);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin: 16px 0;
    font-size: 14px;
}
.gdpr-modal .gdpr-info ul { margin: 8px 0 0; padding-left: 22px; }
.gdpr-modal .gdpr-info li { margin: 4px 0; }
.gdpr-modal .gdpr-warning {
    color: var(--color-error);
    margin: 12px 0;
}
.gdpr-modal .gdpr-future-warning {
    background: var(--color-error-bg, #fee);
    border-left: 4px solid var(--color-error);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin: 16px 0;
    font-size: 14px;
    color: var(--color-text);
}
.gdpr-modal .gdpr-future-warning strong { color: var(--color-error); }
.gdpr-modal .gdpr-future-warning p { color: var(--color-text); }
.gdpr-modal .gdpr-actions {
    display: flex; justify-content: flex-end; gap: 10px;
    margin-top: 18px;
}
.gdpr-modal code {
    background: var(--color-error-bg);
    color: var(--color-error);
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 700;
}

/* ===== Bare fieldset (alleen voor disabled-wrapping in past-mode) ===== */
.fieldset-bare {
    border: 0;
    margin: 0;
    padding: 0;
    /* Erfgenamen: laat alle interne spacing onaangeroerd */
    display: contents;
}

/* =========================================
   FullCalendar: zichtbare plus-knoppen in vrije werktijd-uren
   ========================================= */
.calendar-help {
    margin: 0 0 14px;
    padding: 10px 14px;
    background: #eaf3fa;
    border-left: 3px solid var(--color-primary);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

/* Werktijden-zones: subtiel onderscheid */
.fc .fc-non-business {
    background: rgba(0, 0, 0, 0.04);
}

/* Selecteren-mirror (FullCalendar's ghost-kader bij dragging) opvallender */
.fc .fc-highlight {
    background: rgba(80, 150, 205, 0.25) !important;
}

/* === Zichtbare "+" knoppen op elk vrij 15-min slot in werktijden === */
.fc-timegrid-col-frame { position: relative; }

.fc-add-ride-btn {
    position: absolute;
    left: 4px;
    right: 4px;
    transform: translateY(-50%);
    height: 18px;
    background: rgba(80, 150, 205, 0.06);
    border: 1px dashed rgba(80, 150, 205, 0.5);
    color: var(--color-primary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    padding: 0 4px;
    z-index: 1;
    transition: background 100ms, border-color 100ms, color 100ms, transform 100ms, height 100ms, box-shadow 100ms;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    overflow: hidden;
    white-space: nowrap;
}
.fc-add-ride-btn:hover {
    height: 22px;
    background: var(--color-primary);
    border-color: var(--color-primary);
    border-style: solid;
    color: #fff;
    box-shadow: 0 2px 6px rgba(80, 150, 205, 0.3);
    z-index: 3; /* Boven evt. naburige knoppen */
    font-size: 11px;
}
.fc-add-ride-btn .fc-add-icon {
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}
.fc-add-ride-btn .fc-add-time {
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0;
}

/* Smalle kolommen (week-view op desktop, of dag-view op tablet):
   verberg het eindtijd-deel zodat de knop niet uit de cel groeit. */
@media (max-width: 1100px) {
    .fc-timeGridWeek-view .fc-add-ride-btn .fc-add-time-end,
    .fc-timeGridWeek-view .fc-add-ride-btn .fc-add-time-sep {
        display: none;
    }
}

/* =========================================
   Slot-grid (dashboard list-view): tooltip op vrije slots
   ========================================= */
.slot.slot-free { position: relative; }
.slot.slot-free:hover::after {
    content: 'Klik om rit toe te voegen';
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(33, 37, 41, 0.95);
    color: #fff;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: tip-fade-in 120ms ease-out;
}
.slot.slot-free:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(33, 37, 41, 0.95);
    z-index: 100;
    pointer-events: none;
}
.slots-grid { overflow: visible; }

/* === Conflict-resolutie blok bij herhalende ritten === */
.panel-warning {
    background: #fffbea;
    border: 1px solid #fbbf24;
    border-left-width: 4px;
}
.conflict-resolution h2 { color: #b45309; }

.conflict-list {
    display: flex; flex-direction: column; gap: 12px;
    margin: 14px 0;
}
.conflict-item {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}
.conflict-header {
    margin-bottom: 8px;
    font-size: 14px;
}
.conflict-header strong { color: var(--color-error); }
.conflict-options {
    display: flex; flex-direction: column; gap: 6px;
    padding-left: 4px;
}
.conflict-option {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 0;
}
.conflict-option input[type="radio"] { margin: 0; }
.conflict-time-input {
    width: 110px !important;
    padding: 4px 8px !important;
    margin-left: 4px;
}
.conflict-custom { flex-wrap: wrap; }

/* Keuze-opties in delete-recurring modal */
.delete-options {
    display: flex; flex-direction: column; gap: 10px;
    margin: 16px 0;
}
.delete-option {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 14px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 100ms, background 100ms;
}
.delete-option:hover { border-color: var(--color-primary); }
.delete-option input[type="radio"] {
    margin: 4px 0 0 0;
    flex-shrink: 0;
}
.delete-option:has(input:checked) {
    background: #fff;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(80, 150, 205, 0.15);
}
.delete-option-detail {
    font-size: 13px;
    color: var(--color-text-soft);
    margin-top: 4px;
    line-height: 1.4;
}

/* Voltooide rit in dashboard slot-grid: gedimd, met groen vinkje */
.slot-completed {
    opacity: 0.65;
    background: #f8faf8;
}
.slot-completed .slot-customer { color: var(--color-text-soft); }
.slot-completed-badge {
    color: #16a34a;
    font-weight: 700;
    margin-left: 6px;
    font-size: 12px;
}

/* Retour-paar visuele groepering in rittenoverzicht */
.row-pair td:first-child {
    border-left: 3px solid var(--color-primary);
}
.row-pair-retour td:first-child {
    border-left-color: #fbbe36; /* accent-kleur, anders dan heenrit */
}
.pair-icon {
    color: var(--color-primary);
    font-weight: 700;
    margin-right: 4px;
    font-size: 14px;
}
.row-pair-retour .pair-icon { color: #d97706; }

.badge-pair {
    display: inline-block;
    background: #eef5fa;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
    transition: background 100ms;
}
.badge-pair:hover {
    background: var(--color-primary);
    color: #fff;
    text-decoration: none;
}

/* Status-kolom: badges netjes onder elkaar i.p.v. vechten om horizontale ruimte */
.status-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}
.status-stack .badge { white-space: nowrap; }

/* Geblokkeerd slot in dashboard */
.slot-blockage {
    background: #f3f4f6;
    border-left: 3px solid #9ca3af;
    color: #4b5563;
}
.slot-blockage:hover { background: #e5e7eb; }
.slot-blockage .slot-customer {
    color: #4b5563;
    font-weight: 600;
}

/* Geblokkeerd slot in slot-picker */
.slot-btn-blocked-block {
    background: repeating-linear-gradient(
        45deg, #f3f4f6, #f3f4f6 6px, #e5e7eb 6px, #e5e7eb 12px
    );
    color: #6b7280;
    border-color: #d1d5db;
    cursor: not-allowed;
}

/* Conflict-blokken in blockage.php */
.conflict-rides-list {
    list-style: none; padding: 0; margin: 12px 0 0;
}
.conflict-rides-list li {
    padding: 8px 12px;
    background: #fff;
    border-left: 3px solid #f59e0b;
    margin-bottom: 6px;
    border-radius: 4px;
}
.conflict-rides-list a {
    text-decoration: none;
    color: var(--color-text);
}
.conflict-rides-list a:hover { color: var(--color-primary); }

/* Alert-badge: rit onder blokkade */
.badge-alert {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
    font-weight: 600;
}

/* Alert-blok bovenaan rit-detail */
.panel-alert {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-left-width: 4px;
    padding: 14px 18px;
    margin-bottom: 16px;
    border-radius: var(--radius-sm);
    color: #78350f;
}
.panel-alert a { color: #b45309; font-weight: 600; }
.panel-alert strong { color: #92400e; }

/* Warning-knop variant */
.btn-warning {
    background: #f59e0b;
    color: #fff;
    border: 1px solid #d97706;
}
.btn-warning:hover { background: #d97706; }

/* Iconenrij rechtsboven in slot-tegel (pair + recurring) */
.slot-booked { position: relative; }
.slot-badges {
    position: absolute;
    top: 6px; right: 8px;
    display: flex;
    gap: 3px;
    pointer-events: none;
}
.slot-icon-badge {
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    background: rgba(255, 255, 255, 0.85);
    padding: 2px 5px;
    border-radius: 4px;
}

/* Harde-refresh knop in topbar */
.btn-refresh {
    background: transparent;
    border: 1px solid var(--color-border-strong);
    color: var(--color-text);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: background 100ms, transform 200ms;
}
.btn-refresh:hover {
    background: var(--color-bg);
    color: var(--color-primary);
}
.btn-refresh:active {
    transform: rotate(180deg);
}
@media (max-width: 720px) {
    .btn-refresh { padding: 4px 8px; font-size: 14px; }
}


/* ============================================================
   CHAUFFEUR-PAGINA — gebruikt dezelfde huisstijl-tokens als de hoofdapp
   (CSS-vars: --color-primary, --font-display, --radius, --shadow-sm).
   ============================================================ */

/* Login-pagina hergebruikt .login-body / .login-box; alleen kleine extra: */
.login-foot {
    text-align: center;
    margin-top: 16px;
    margin-bottom: 0;
    font-size: 13px;
}
.login-foot a {
    color: var(--color-muted);
    text-decoration: none;
}
.login-foot a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

/* Topbar: spacer duwt userbox naar rechts (geen mainnav voor chauffeur) */
.driver-topbar-spacer {
    flex: 1;
}

/* Header-meta op page-head — naast de h1 */
.driver-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: 13px;
    color: var(--color-muted);
}
.driver-meta strong {
    color: var(--color-text);
    font-weight: 600;
}
.driver-update-ago {
    color: var(--color-muted);
    font-size: 12px;
    margin-left: 4px;
}

/* Per-dag panel — gebruikt .panel (al gestyled), alleen extra spacing */
.driver-day-panel {
    margin-bottom: 16px;
}
.driver-day-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}
.driver-day-header h2 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 22px;
    color: var(--color-primary);
    letter-spacing: 0.3px;
}
.driver-day-meta {
    display: flex;
    gap: 14px;
    font-size: 13px;
    color: var(--color-muted);
    align-items: baseline;
}
.driver-day-date {
    text-transform: capitalize;
}
.driver-day-count strong {
    color: var(--color-text);
    font-weight: 600;
}

.driver-empty {
    text-align: center;
    color: var(--color-muted);
    font-style: italic;
    padding: 24px 0;
}

/* Lijst van ritten + blokkades */
.driver-rides-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Eén rij — rit of blokkade */
.driver-row {
    display: flex;
    gap: 16px;
    padding: 12px 14px;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--color-primary);
    align-items: flex-start;
}
.driver-row-blockage {
    background: #f3f4f6;
    border-left-color: #6b7a85;
    color: var(--color-text);
    align-items: center;
}

.driver-time-block {
    flex: 0 0 auto;
    min-width: 78px;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}
.driver-time {
    font-weight: 700;
    font-size: 17px;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}
.driver-time-sep {
    color: var(--color-muted);
    font-size: 12px;
    margin: 1px 0;
}
.driver-duration {
    margin-top: 6px;
    font-size: 11px;
    color: var(--color-muted);
    background: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid var(--color-border);
}

.driver-row-body {
    flex: 1;
    min-width: 0;
}
.driver-route {
    font-size: 15px;
    line-height: 1.4;
    word-break: break-word;
    color: var(--color-text);
}
.driver-route-from, .driver-route-to {
    font-weight: 500;
}
.driver-route-arrow {
    color: var(--color-muted);
    margin: 0 6px;
}

.driver-tags {
    margin-top: 6px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.driver-tag {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--color-bg);
    color: var(--color-text);
    font-weight: 500;
}
.driver-tag-pair {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--color-info-bg);
    color: var(--color-info);
    font-weight: 600;
}

.driver-blockage-line {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text);
}
.driver-blockage-icon {
    font-size: 18px;
}

.driver-footer-note {
    text-align: center;
    color: var(--color-muted);
    font-size: 13px;
    line-height: 1.6;
    padding: 16px;
    margin-top: 8px;
}

/* Status-badges in /settings driver-access panel */
.badge-ok {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid var(--color-success);
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
}
.badge-warning {
    background: var(--color-warn-bg);
    color: var(--color-warn);
    border: 1px solid var(--color-warn);
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
}
.btn-small {
    padding: 4px 10px;
    font-size: 13px;
}

/* --- Mobiele optimalisatie: chauffeur-pagina --- */
@media (max-width: 720px) {
    .driver-meta {
        align-items: flex-start;
    }
    .driver-day-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .driver-day-meta {
        flex-wrap: wrap;
    }
}
@media (max-width: 480px) {
    .driver-day-header h2 { font-size: 18px; }
    .driver-time-block { min-width: 64px; }
    .driver-time { font-size: 15px; }
    .driver-route { font-size: 14px; }
    .driver-row { padding: 10px 12px; gap: 12px; }
}

/* Samenvattingsbalk op /rides — toont aantallen per type + totaal */
.rides-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 12px 18px;
}
.rides-summary-total {
    font-size: 16px;
    color: var(--color-text);
}
.rides-summary-total strong {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-primary);
    margin-right: 4px;
}
.rides-summary-total .muted {
    color: var(--color-muted);
    font-size: 13px;
    margin-left: 6px;
}
.rides-summary-types {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.rides-type-chip {
    background: var(--color-bg);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--color-text);
}
.rides-type-chip strong {
    font-weight: 700;
    color: var(--color-text);
    margin-right: 4px;
}

/* Completed ritten op chauffeur-pagina — dimmer + checkmark */
.driver-row-done {
    opacity: 0.65;
}
.driver-row-done .driver-route {
    text-decoration: line-through;
    text-decoration-color: var(--color-muted);
    text-decoration-thickness: 1px;
}
.driver-done-check {
    color: var(--color-success);
    font-weight: 700;
    margin-right: 6px;
}
.driver-tag-done {
    background: var(--color-success-bg);
    color: var(--color-success);
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* Import-pagina */
.import-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}
.import-stat-box {
    background: var(--color-bg);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--color-primary);
    flex: 1 1 180px;
}
.import-stat-box.import-stat-warn {
    border-left-color: var(--color-warn);
}
.import-stat-num {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1;
}
.import-stat-label {
    font-size: 13px;
    color: var(--color-muted);
    margin-top: 4px;
}
.import-errors {
    margin-top: 16px;
    background: var(--color-warn-bg);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
}
.import-errors summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--color-warn);
}
.import-errors ul {
    margin-top: 8px;
    font-size: 13px;
    color: var(--color-text);
}
.row-duplicate {
    opacity: 0.5;
    background: var(--color-warn-bg);
}
.badge-info {
    background: var(--color-info-bg);
    color: var(--color-info);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

/* Banner bovenaan /rides als gefilterd op specifieke klant */
.customer-filter-banner {
    background: var(--color-info-bg);
    border-left: 4px solid var(--color-info);
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.customer-filter-banner strong {
    color: var(--color-text);
}

/* Progress-bar voor batch-sync na CSV-import */
.sync-progress-bar {
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    height: 24px;
    overflow: hidden;
    margin-top: 16px;
    border: 1px solid var(--color-border);
}
.sync-progress-fill {
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
    height: 100%;
    transition: width 300ms ease-out;
}

/* Google Calendar synchronisatie-overzicht in /settings */
.gcal-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 16px 0;
}
.gcal-stat {
    background: var(--color-bg);
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--color-primary);
    flex: 1 1 160px;
}
.gcal-stat.gcal-stat-ok {
    border-left-color: var(--color-success);
}
.gcal-stat.gcal-stat-warn {
    border-left-color: var(--color-warn);
    background: var(--color-warn-bg);
}
.gcal-stat-num {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1;
}
.gcal-stat-label {
    font-size: 13px;
    color: var(--color-muted);
    margin-top: 4px;
}

.gcal-progress-bar {
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    height: 16px;
    overflow: hidden;
    margin-top: 8px;
    border: 1px solid var(--color-border);
}
.gcal-progress-fill {
    background: linear-gradient(90deg, var(--color-success), #15803d);
    height: 100%;
    transition: width 300ms ease-out;
}

.gcal-action-block {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}
.gcal-running-progress {
    background: var(--color-info-bg);
    color: var(--color-info);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin: 8px 0;
}
.gcal-all-synced {
    background: var(--color-success-bg);
    color: var(--color-success);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    margin-top: 16px;
}

/* Info-balk boven klantenlijst — toont rol-afhankelijke retentie-uitleg */
.customers-info-bar {
    background: var(--color-info-bg);
    color: var(--color-info);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 13px;
}
.customers-info-bar .muted { color: var(--color-info); }
.customers-info-bar strong { color: var(--color-info); font-weight: 600; }

/* Statistieken — KPI-tegels */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.kpi-tile {
    background: var(--color-bg);
    padding: 16px 18px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--color-primary);
}
.kpi-tile.kpi-success {
    border-left-color: var(--color-success);
}
.kpi-tile.kpi-warn {
    border-left-color: var(--color-warn);
    background: var(--color-warn-bg);
}
.kpi-num {
    font-size: 30px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.1;
}
.kpi-label {
    font-size: 12px;
    color: var(--color-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Statistieken — heatmap dag × uur */
.heatmap-wrap {
    overflow-x: auto;
    margin-top: 12px;
}
.heatmap {
    border-collapse: separate;
    border-spacing: 2px;
    font-size: 12px;
    margin: 0 auto;
}
.heatmap th {
    font-weight: 500;
    color: var(--color-muted);
    padding: 4px 6px;
    text-align: center;
    font-size: 11px;
}
.heatmap th.heatmap-day {
    text-align: right;
    padding-right: 10px;
    color: var(--color-text);
    font-weight: 600;
    font-size: 12px;
    min-width: 80px;
}
.heatmap-cell {
    width: 36px;
    height: 28px;
    text-align: center;
    border-radius: 3px;
    color: var(--color-text);
    font-weight: 600;
    font-size: 11px;
    transition: transform 100ms;
}
.heatmap-cell:hover { transform: scale(1.1); cursor: help; }

/* Heatmap-header met titel en toggle-knoppen */
.heatmap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.heatmap-toggle {
    display: inline-flex;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--color-bg);
}
.heatmap-toggle a {
    padding: 6px 14px;
    color: var(--color-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-right: 1px solid var(--color-border);
    transition: background 100ms;
}
.heatmap-toggle a:last-child { border-right: none; }
.heatmap-toggle a:hover { background: var(--color-bg-hover, #e8eef3); color: var(--color-text); }
.heatmap-toggle a.active {
    background: var(--color-primary);
    color: #fff;
}

/* Statistieken — speciale tabelstijl met betere koppen en spacing */
.table-stats {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.table-stats th, .table-stats td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}
.table-stats thead th {
    background: var(--color-bg);
    font-size: 11px;
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 12px 8px;
    text-align: left;
    line-height: 1.3;
    vertical-align: bottom;
}
.table-stats th.num,
.table-stats td.num {
    text-align: right;
    padding-right: 16px;
    font-variant-numeric: tabular-nums;
}
.table-stats td:first-child,
.table-stats th:first-child {
    padding-left: 18px;
}
.table-stats tbody tr:hover { background: rgba(80, 150, 205, 0.04); }
.table-stats tr.row-future td { color: var(--color-muted); font-style: italic; }
.table-stats tr.row-future td strong { font-weight: 500; }
.table-stats tr:last-child td { border-bottom: none; }

/* Heatmap — extra resolutie-toggle (twee toggles naast elkaar) */
.heatmap-toggles {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
/* table-layout: fixed forceert dat elke kolom dezelfde breedte krijgt — anders
   maakt de browser cellen met een achtergrondkleur visueel breder dan lege */
.heatmap {
    table-layout: fixed;
}
/* 15-min mode: smallere cellen + visuele uur-scheiding */
.heatmap-quarter .heatmap-cell {
    width: 14px;
    height: 28px;
    padding: 0;
    font-size: 9px;
}
/* Uur-scheiding via inset shadow zodat het geen ruimte inneemt */
.heatmap-quarter .heatmap-slot-0 {
    box-shadow: inset 2px 0 0 var(--color-border);
}
.heatmap-quarter .heatmap-hdr-major {
    text-align: left;
    padding-left: 2px;
    box-shadow: inset 2px 0 0 var(--color-border);
}
.heatmap-quarter .heatmap-hdr-minor { width: 14px; padding: 0; }

/* Herhaling — UI uitbreidingen */
.recurring-custom-box {
    background: var(--color-bg);
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-top: 12px;
    border-left: 3px solid var(--color-primary);
}
.recurring-weekdays {
    margin: 12px 0;
}
.recurring-weekdays .small { display: block; margin-bottom: 6px; }
.weekday-toggles {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.weekday-toggle {
    cursor: pointer;
    user-select: none;
}
.weekday-toggle input { display: none; }
.weekday-toggle span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-muted);
    transition: all 100ms;
}
.weekday-toggle:hover span {
    border-color: var(--color-primary);
    color: var(--color-primary);
}
.weekday-toggle input:checked + span {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}
.recurring-end {
    border: none;
    padding: 0;
    margin: 0;
}
.recurring-end legend { padding: 0; margin-bottom: 6px; }
.recurring-end .field-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.recurring-preview {
    margin-top: 14px;
    padding: 10px 14px;
    background: var(--color-info-bg, #eef5fb);
    border-radius: var(--radius-sm);
    font-size: 13px;
}
.recurring-preview .small { display: block; margin-bottom: 4px; font-weight: 600; }
.recurring-preview-list {
    line-height: 1.7;
    color: var(--color-text);
}
.recurring-preview-item {
    display: inline-block;
    background: rgba(255,255,255,0.7);
    padding: 1px 8px;
    border-radius: 12px;
    font-size: 12px;
    color: var(--color-text);
}

/* Niet-beschikbare weekdag bij herhaling — uitgegrijst, niet aanklikbaar */
.weekday-toggle-disabled {
    cursor: not-allowed;
    opacity: 0.4;
}
.weekday-toggle-disabled span {
    background: var(--color-bg);
    border-color: var(--color-border);
    color: var(--color-muted);
}
.weekday-toggle-disabled:hover span {
    border-color: var(--color-border);
    color: var(--color-muted);
}

/* Route-kaart op /ride */
.route-map-wrap {
    margin-top: 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--color-bg);
}
.route-map {
    width: 100%;
    height: 280px;
    background: #f5f6f7;
}
@media (max-width: 767px) {
    .route-map { height: 220px; }
}
.route-map-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #fff;
    border-top: 1px solid var(--color-border);
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
}
.route-map-legend {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
}
.route-legend-dot {
    width: 14px;
    height: 4px;
    border-radius: 2px;
    display: inline-block;
}
.route-legend-outbound { background: #1e5a82; }
.route-legend-return   { background: #fbbe36; }
.route-map-legend > span:not(.route-legend-dot) { margin-right: 8px; }
.route-map-meta {
    color: var(--color-text);
    font-size: 13px;
    line-height: 1.5;
    text-align: right;
    flex: 1;
    min-width: 200px;
}
.route-map-meta strong { color: var(--color-primary); font-weight: 600; }
.route-map-meta-error { color: var(--color-warn, #c0392b); }
@media (max-width: 600px) {
    .route-map-summary { flex-direction: column; align-items: flex-start; }
    .route-map-meta { text-align: left; }
}
