/* Custom variables matching layouts.auth-card */
:root {
    --ink: #1f2428;
    --muted: #5a626b;
    --line: #d9dee3;
    --brand: #175296;
    --brand-dark: #103b70;
    --bg: #f4f6f7;
    --white: #fff;
}

/* Filled primary actions throughout the dashboard. */
.fi-btn.fi-color-primary:not(.fi-outlined) {
    --bg: var(--brand) !important;
    --hover-bg: var(--brand-dark) !important;
    --text: var(--white) !important;
    --hover-text: var(--white) !important;
    background-color: var(--brand) !important;
    color: var(--white) !important;
    transition: background-color .2s ease, color .2s ease !important;
}

.fi-btn.fi-color-primary:not(.fi-outlined):hover {
    background-color: var(--brand-dark) !important;
    color: var(--white) !important;
}

.fi-btn.fi-color-primary:not(.fi-outlined) .fi-icon {
    color: currentColor !important;
}

.max-dashboard-stat .fi-wi-stats-overview-stat-content {
    position: relative;
}

.max-dashboard-stat .fi-wi-stats-overview-stat-label-ctn {
    padding-right: 2rem;
}

.max-dashboard-stat .fi-wi-stats-overview-stat-label-ctn > .fi-icon {
    position: absolute;
    top: 0;
    right: 0;
}

.max-dashboard-stat-lines {
    display: grid;
    gap: .15rem;
}

.max-dashboard-stat-lines span {
    display: block;
    line-height: 1.35;
}

.max-dashboard-stat-lines strong {
    font-weight: 600;
}

.max-order-form-actions.fi-sticky .fi-ac {
    width: max-content !important;
    max-width: calc(100vw - 2rem);
    margin-inline: 0 !important;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    transition:
        box-shadow .2s ease,
        background-color .2s ease !important;
}

.max-order-form-actions.fi-sticky .fi-ac::-webkit-scrollbar {
    display: none;
}

.max-order-form-actions.fi-sticky .fi-ac > * {
    flex: 0 0 auto;
}

@media (max-width: 47.999rem) {
    .max-order-form-actions.fi-sticky .fi-ac {
        right: 1rem;
        left: 1rem;
        width: auto !important;
        max-width: none;
        border-radius: .75rem;
        padding: .75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .max-order-form-actions.fi-sticky .fi-ac {
        transition: none !important;
    }
}

.max-outstanding-amount {
    color: #b42318;
    font-size: 1.2rem;
}

.max-completion-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.max-completion-summary span {
    display: grid;
    gap: 4px;
    border: 1px solid #d9e1ea;
    border-radius: 10px;
    padding: 12px;
    background: #f8fafc;
}

.max-completion-summary strong {
    color: var(--ink);
    font-size: 1.05rem;
}

.max-signature-pad {
    display: grid;
    gap: 12px;
    width: 100%;
}

.max-signature-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.max-signature-canvas-frame {
    position: relative;
    overflow: hidden;
    min-height: 300px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.max-signature-canvas {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 300px;
    background: transparent;
    cursor: crosshair;
    touch-action: none;
}

.max-signature-canvas:focus-visible {
    outline: 4px solid rgba(23, 82, 150, .2);
    outline-offset: -6px;
}

.max-signature-button {
    min-height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    padding: 0 16px;
    background: #fff;
    color: #263445;
    font-size: 14px;
    font-weight: 750;
    cursor: pointer;
}

.max-signature-button:hover {
    border-color: #175296;
    background: #eef5fc;
    color: #175296;
}

.max-signature-fullscreen-button,
.max-signature-close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    display: grid;
    width: 40px;
    min-height: 40px;
    padding: 0;
    border-color: #d1d5db;
    place-items: center;
    color: #4b5563;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.max-signature-fullscreen-button svg,
.max-signature-close-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.max-signature-close-button {
    z-index: 4;
    border-color: #bfccd9;
    background: #fff;
    color: #111827;
}

.max-signature-close-button:hover {
    border-color: #175296;
    background: #eef5fc;
    color: #175296;
}

.max-signature-done-button {
    border-color: #175296;
    background: #175296;
    color: #fff;
}

.max-signature-done-button:hover {
    background: #103b70;
    color: #fff;
}

.max-signature-pad.is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 14px;
    height: 100vh;
    height: 100dvh;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    background: #f4f7fa;
}

.max-signature-pad.is-fullscreen .max-signature-canvas-frame {
    min-height: 0;
    border-width: 1px;
    border-radius: 8px;
}

.max-signature-pad.is-fullscreen .max-signature-canvas {
    height: 100%;
}

.max-signature-pad.is-fullscreen .max-signature-actions {
    justify-content: flex-end;
}

@media (max-width: 760px) {
    .max-completion-summary {
        grid-template-columns: 1fr 1fr;
    }

    .max-signature-canvas-frame {
        min-height: 260px;
    }

    .max-signature-canvas {
        height: 260px;
    }

    .max-signature-pad.is-fullscreen .max-signature-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .max-signature-pad.is-fullscreen .max-signature-button {
        width: 100%;
        min-height: 48px;
        font-size: 15px;
    }

    .max-signature-pad.is-fullscreen .max-signature-close-button {
        width: 40px;
        min-height: 40px;
        padding: 0;
    }
}

/* Admin e-mail preview page. */
.email-preview-page {
    width: min(100%, 1120px);
    margin: 0 auto;
}

.email-preview-toolbar,
.email-preview-stage {
    border: 1px solid #d9e1ea;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(31, 36, 40, .06);
}

.email-preview-toolbar {
    display: flex;
    justify-content: center;
    padding: 22px 24px;
}

.email-preview-select {
    display: grid;
    width: min(100%, 420px);
    gap: 7px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
}

.email-preview-select select {
    width: 100%;
    min-height: 44px;
    border: 1px solid #b8c5d3;
    border-radius: 9px;
    padding: 0 38px 0 12px;
    background: #fff;
    color: var(--ink);
    font-size: 15px;
}

.email-preview-select select:focus {
    border-color: var(--brand);
    outline: 3px solid rgba(23, 82, 150, .16);
}

.email-preview-stage {
    margin-top: 22px;
    padding: 24px;
}

.email-preview-browser {
    overflow: hidden;
    border: 1px solid #cfd9e4;
    border-radius: 12px;
    background: #eef3f8;
}

.email-preview-browser iframe {
    display: block;
    width: 100%;
    min-height: 780px;
    border: 0;
    background: #eef3f8;
}

@media (max-width: 760px) {
    .email-preview-stage,
    .email-preview-toolbar {
        padding: 18px;
    }

    .email-preview-browser iframe {
        min-height: 680px;
    }
}

/* Planning calendar. */
.planning-calendar {
    width: 100%;
}

/* Gedeelde balk boven planning en rooster. */
.planning-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    margin-bottom: 18px;
    padding: 14px 18px;
    border: 1px solid #d9e1ea;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(31, 36, 40, .05);
}

/* Bovenbalk van de planning: alleen paginabrede acties en filters. De kalendernavigatie
   staat bewust niet hier maar gecentreerd boven de kalender zelf. */
.planning-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 20px;
    margin-bottom: 18px;
    padding: 14px 18px;
    border: 1px solid #d9e1ea;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(31, 36, 40, .05);
}

.planning-topbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

/* Anders breken labels als "Dag definitief maken" over twee regels zodra de balk vol raakt. */
.planning-topbar-actions .fi-btn { white-space: nowrap; }

/* Het rooster gebruikt nog de oorspronkelijke opbouw met een eigen periodeblok. */
.planning-period {
    display: flex;
    align-items: center;
    gap: 8px;
}

.planning-period h2 {
    margin: 0 0 0 10px;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 600;
}

.planning-area-filter {
    display: grid;
    gap: 5px;
    margin-left: auto;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 500;
}

.planning-area-filter select {
    min-width: 180px;
    min-height: 2.25rem;
    padding: 7px 34px 7px 10px;
    border: 1px solid var(--line);
    border-radius: .5rem;
    background: #fff;
    color: var(--ink);
    font-size: .875rem;
}

.planning-day-actions { display: inline-flex; gap: .5rem; align-items: center; }

.planning-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-left: auto;
}

.planning-filter {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 500;
}

.planning-filter select {
    min-width: 180px;
    min-height: 2.25rem;
    padding: 7px 34px 7px 10px;
    border: 1px solid var(--line);
    border-radius: .5rem;
    background: #fff;
    color: var(--ink);
    font-size: .875rem;
}

.planning-unplanned {
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid #d7e1ec;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(31, 36, 40, .05);
}

.planning-unplanned > header h2 {
    margin: 0;
    color: #172033;
    font-size: 18px;
}

.planning-unplanned > header p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 13px;
}

.planning-unplanned-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.planning-area-card {
    min-width: 0;
    border: 1px solid #dce5ee;
    border-radius: 10px;
    background: #f8fafc;
    overflow: hidden;
}

.planning-area-card h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    border-bottom: 1px solid #dce5ee;
    color: #172033;
    font-size: 14px;
}

.planning-area-card h3 span {
    min-width: 24px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #175296;
    color: #fff;
    text-align: center;
    font-size: 12px;
}

.planning-area-card > div {
    display: grid;
    gap: 1px;
}

.planning-area-card a {
    display: grid;
    gap: 2px;
    padding: 9px 12px;
    color: #334155;
    text-decoration: none;
}

.planning-area-card a + a {
    border-top: 1px solid #e5ebf1;
}

.planning-area-card a:hover {
    background: #eef5fb;
}

.planning-area-card a strong,
.planning-area-card a span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.planning-area-card a strong {
    color: #172033;
    font-size: 12px;
}

.planning-area-card a span,
.planning-area-more,
.planning-unplanned-empty {
    color: #64748b;
    font-size: 11px;
}

.planning-area-more {
    padding: 9px 12px;
    border-top: 1px solid #e5ebf1;
    font-weight: 600;
}

/* De kalender is één kaart: navigatie, raster en legenda horen visueel bij elkaar.
   Bewust zonder `overflow: hidden`, want dat zou de hover-preview afknippen. De ronde
   hoeken zitten daarom op de eerste en laatste strook zelf. */
.planning-board {
    border: 1px solid #d9e1ea;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(31, 36, 40, .05);
}

.planning-nav {
    border-radius: 13px 13px 0 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #e3e9ef;
}

.planning-nav-end { justify-self: end; }

.planning-nav-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.planning-nav-center h2 {
    min-width: 13rem;
    margin: 0;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
}

/* Zelfde maat en gewicht als de Filament-knoppen elders in het paneel. */
.planning-nav button,
.planning-period button,
.planning-view-switch button {
    min-height: 2.25rem;
    border: 1px solid var(--line);
    border-radius: .5rem;
    padding: 0 .75rem;
    background: #fff;
    color: var(--ink);
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.planning-nav-center button,
.planning-period button:first-child,
.planning-period button:nth-child(3) {
    width: 2.25rem;
    padding: 0;
    color: var(--muted);
    font-size: 1.25rem;
    line-height: 1;
}

.planning-nav button:hover,
.planning-period button:hover,
.planning-view-switch button:hover {
    border-color: var(--brand);
    background: #eef5fc;
    color: var(--brand);
}

.planning-view-switch {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border-radius: .625rem;
    background: #edf2f7;
}

.planning-view-switch button {
    border-color: transparent;
    background: transparent;
}

.planning-view-switch button.is-active,
.planning-view-switch button.is-active:hover {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.planning-weekdays,
.planning-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.planning-weekdays {
    border-bottom: 1px solid #d9e1ea;
    background: #f7f9fb;
}

.planning-weekdays div {
    padding: 9px 12px;
    color: #64748b;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-align: center;
    text-transform: uppercase;
}

.planning-day {
    /* Zonder dit groeit een grid-cel mee met zijn breedste kind en loopt een orderbalk
       de buurdag in, in plaats van af te breken met een ellipsis. */
    min-width: 0;
    min-height: 150px;
    padding: 8px;
    border-right: 1px solid #e3e9ef;
    border-bottom: 1px solid #e3e9ef;
    background: #fff;
}

/* De maand mag niet meegroeien met het aantal orders: lege dagen blijven laag en
   drukke dagen tonen hooguit de preview plus een "nog N orders"-knop. */
.planning-grid.is-month .planning-day {
    min-height: 94px;
}

.planning-grid.is-week {
    min-width: 980px;
}

.planning-grid.is-week .planning-day {
    min-height: 520px;
    padding: 10px;
}

/* De weekkolommen zijn te smal voor zeven volle kaarten naast elkaar, dus daar mag
   het raster schuiven. De maand krijgt zo'n container bewust niet: die zou de
   hover-preview afknippen, en zijn kolommen passen altijd. */
.planning-grid-scroll { overflow-x: auto; }

/* De dagnamen moeten even breed schuiven als het raster eronder. */
.planning-grid-scroll .planning-weekdays { min-width: 980px; }

.planning-day:nth-child(7n) {
    border-right: 0;
}

.planning-day.is-outside {
    background: #f8fafc;
}

/* Alleen de kop vervaagt. Zou de orderbalk zelf doorzichtig worden, dan erft zijn
   hover-preview die doorzichtigheid en is die onleesbaar. */
.planning-day.is-outside > header {
    opacity: .55;
}

.planning-day > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-height: 26px;
    margin-bottom: 5px;
    color: #64748b;
    font-size: .75rem;
}

.planning-day-label,
.planning-day-marks {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

/* Het dagnummer is de ingang naar de dagweergave. */
.planning-day-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    font-size: .8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.planning-day-open:hover {
    background: #eef5fc;
    color: var(--brand);
}

/* Het aantal orders per dag maakt de drukte zichtbaar zonder alle balken uit te klappen. */
.planning-day-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #e8eef6;
    color: #334155;
    font-size: .6875rem;
    font-weight: 600;
}

.planning-day.is-today {
    background: #f5f9fe;
    box-shadow: inset 0 0 0 2px rgba(23, 82, 150, .28);
}

.planning-day.is-today .planning-day-open {
    background: var(--brand);
    color: #fff;
}

.planning-day-orders {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
}

/* Orders staan gegroepeerd per tijdvak. De volgorde binnen een tijdvak zegt niets:
   de rittenvolgorde rekent het systeem 's avonds uit. */
.planning-block {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
}

.planning-block-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    margin: 0;
    color: #64748b;
    font-size: .625rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.planning-block-head span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.planning-block-head span:last-child {
    flex: none;
    white-space: nowrap;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.planning-day-toggle {
    justify-self: start;
    padding: 3px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: #52616f;
    font-size: .6875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.planning-day-toggle:hover {
    border-color: var(--brand);
    background: #eef5fc;
    color: var(--brand);
}

/* Eén order. Standaard een smalle balk van één regel; de details zitten in een
   preview die pas bij hover of toetsenbordfocus verschijnt. */
.planning-order {
    position: relative;
    display: block;
    min-width: 0;
    overflow: visible;
    border-left: 3px solid #64748b;
    border-radius: 5px;
    background: #eef2f6;
    color: #334155;
    line-height: 1.35;
    text-decoration: none;
}

.planning-order.is-compact {
    padding: 3px 6px;
    font-size: .6875rem;
}

.planning-order.is-full {
    display: grid;
    gap: 2px;
    border-left-width: 4px;
    border-radius: 7px;
    padding: 7px 8px;
    font-size: .6875rem;
}

/* De balk zelf omhoog tillen, niet alleen de preview: een volgende balk is een later
   gepositioneerde broer en zou er anders overheen tekenen. */
.planning-order:hover,
.planning-order:focus-visible {
    z-index: 20;
    outline: none;
}

.planning-order:hover .planning-order-title,
.planning-order:focus-visible .planning-order-title {
    filter: brightness(.97);
}

.planning-order-title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.planning-order-title strong {
    color: #172033;
    font-weight: 600;
}

.planning-order.is-full .planning-order-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    white-space: normal;
    font-size: .75rem;
}

.planning-order-sub {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* De preview mag buiten zijn dagcel vallen, daarom heeft de maand geen overflow. */
.planning-order-preview {
    position: absolute;
    z-index: 30;
    top: calc(100% + 4px);
    left: 0;
    display: none;
    grid-auto-rows: min-content;
    gap: 2px;
    width: max-content;
    max-width: 17rem;
    padding: 8px 10px;
    border: 1px solid #d9e1ea;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(31, 36, 40, .18);
    color: #52616f;
    font-size: .6875rem;
    font-weight: 500;
    line-height: 1.45;
    white-space: normal;
}

.planning-order:hover .planning-order-preview,
.planning-order:focus-visible .planning-order-preview {
    display: grid;
}

/* Bij de laatste kolommen en de onderste rij zou de preview buiten beeld vallen. */
.planning-day:nth-child(7n) .planning-order-preview,
.planning-day:nth-child(7n - 1) .planning-order-preview,
.planning-day-board-row > :last-child .planning-order-preview {
    left: auto;
    right: 0;
}

.planning-grid > :nth-last-child(-n + 7) .planning-order-preview {
    top: auto;
    bottom: calc(100% + 4px);
}

.planning-order-preview-head {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #172033;
    font-weight: 600;
}

.planning-order-preview-name {
    color: #172033;
    font-weight: 600;
}

/* Statuskleuren, gelijk aan Order::statusColors(). */
.planning-order.is-gray { border-left-color: #64748b; background: #eef2f6; }
.planning-order.is-info { border-left-color: #175296; background: #eaf2fb; }
.planning-order.is-warning { border-left-color: #d97706; background: #fff5df; }
.planning-order.is-purple { border-left-color: #7c3aed; background: #f3edff; }
.planning-order.is-success { border-left-color: #15803d; background: #eaf7ef; }
.planning-order.is-danger { border-left-color: #b42318; background: #fff0ef; }

.planning-status-dot {
    display: inline-block;
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.planning-status-dot.is-gray { background: #64748b; }
.planning-status-dot.is-info { background: #175296; }
.planning-status-dot.is-warning { background: #d97706; }
.planning-status-dot.is-purple { background: #7c3aed; }
.planning-status-dot.is-success { background: #15803d; }
.planning-status-dot.is-danger { background: #b42318; }

.planning-legend {
    border-radius: 0 0 13px 13px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    padding: 9px 16px;
    border-top: 1px solid #e3e9ef;
    background: #f7f9fb;
    color: #64748b;
    font-size: .6875rem;
}

.planning-legend > span:first-child { font-weight: 600; }

.planning-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Dagweergave: monteur tegen tijdvak, net als het rooster. Zo groeit het overzicht
   met het aantal monteurs en niet met het aantal orders. Geen vaste minimumbreedte en
   geen scrollcontainer, anders knipt die de hover-preview af. */
.planning-day-board-head,
.planning-day-board-row {
    display: grid;
    grid-template-columns: minmax(7rem, 1.1fr) repeat(var(--planning-day-columns, 4), minmax(0, 2fr));
}

.planning-day-board-head {
    border-bottom: 1px solid #d9e1ea;
    background: #f7f9fb;
}

.planning-day-board-head > div {
    display: grid;
    gap: 1px;
    padding: 8px 12px;
    color: #64748b;
    font-size: .6875rem;
}

.planning-day-board-head strong {
    color: #334155;
    font-size: .75rem;
    font-weight: 600;
}

.planning-day-board-row + .planning-day-board-row {
    border-top: 1px solid #e3e9ef;
}

.planning-day-board-technician {
    display: grid;
    align-content: center;
    gap: 2px;
    padding: 8px 12px;
    border-right: 1px solid #e3e9ef;
}

.planning-day-board-technician strong {
    color: #172033;
    font-size: .8125rem;
    font-weight: 600;
}

.planning-day-board-technician span {
    color: #64748b;
    font-size: .6875rem;
}

.planning-day-board-cell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 4px;
    padding: 8px;
    border-right: 1px solid #e3e9ef;
}

.planning-day-board-row > :last-child { border-right: 0; }

.planning-day-board-free {
    color: #cbd5e1;
    font-size: .75rem;
}

.planning-empty {
    padding: 12px 0;
    color: #94a3b8;
    font-size: 11px;
    text-align: center;
}

/* Clear status choices on the order form. */
.order-status-picker .fi-fo-toggle-buttons-btn-ctn {
    min-width: 0;
}

.order-status-picker .fi-btn {
    width: 100%;
    min-height: 46px;
    border: 1px solid;
    border-radius: 9px;
    font-weight: 800;
    justify-content: center;
    box-shadow: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.order-status-picker input + .fi-btn {
    border-color: #d5dde6;
    background: #fff !important;
    color: #334155 !important;
}

.order-status-picker input + .fi-btn:hover {
    border-color: #94a3b8;
    background: #f8fafc !important;
}

.order-status-picker input[value="new"]:checked + .fi-btn {
    border-color: #475569;
    background: #475569 !important;
    color: #fff !important;
}

.order-status-picker input[value="quote_sent"]:checked + .fi-btn {
    border-color: #d97706;
    background: #d97706 !important;
    color: #fff !important;
}

.order-status-picker input[value="quote_accepted"]:checked + .fi-btn {
    border-color: #0f766e;
    background: #0f766e !important;
    color: #fff !important;
}

.order-status-picker input[value="scheduled"]:checked + .fi-btn {
    border-color: #175296;
    background: #175296 !important;
    color: #fff !important;
}

.order-status-picker input[value="in_progress"]:checked + .fi-btn {
    border-color: #b76300;
    background: #b76300 !important;
    color: #fff !important;
}

.order-status-picker input[value="waiting_for_parts"]:checked + .fi-btn {
    border-color: #6d28d9;
    background: #6d28d9 !important;
    color: #fff !important;
}

.order-status-picker input[value="completed"]:checked + .fi-btn {
    border-color: #15803d;
    background: #15803d !important;
    color: #fff !important;
}

.order-status-picker input[value="cancelled"]:checked + .fi-btn {
    border-color: #b42318;
    background: #b42318 !important;
    color: #fff !important;
}

.order-status-picker input:focus-visible + .fi-btn {
    outline: 3px solid rgba(23, 82, 150, .2);
    outline-offset: 2px;
}

@media (max-width: 900px) {
    .planning-toolbar,
    .planning-topbar {
        align-items: stretch;
        flex-direction: column;
    }

    /* Gecentreerd uitlijnen kan niet meer als de drie delen onder elkaar staan. */
    .planning-nav {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 8px;
    }

    .planning-period {
        flex-wrap: wrap;
    }

    .planning-period h2 {
        width: 100%;
        margin: 8px 0 0;
    }

    .planning-view-switch {
        align-self: flex-start;
    }

    .planning-nav-end { justify-self: center; }

    .planning-filters {
        width: 100%;
        margin-left: 0;
    }

    .planning-filter,
    .planning-area-filter {
        flex: 1 1 180px;
        width: 100%;
        margin-left: 0;
    }

    .planning-filter select,
    .planning-area-filter select {
        width: 100%;
        min-width: 0;
    }
}

/* Background & Body Font */
.fi-simple-layout {
    background: var(--bg) !important;
    font-family: Arial, sans-serif !important;
    color: var(--ink) !important;

    /* Brand blue for login page components (buttons, focus rings, checkboxes and links). */
    --primary-50: 239 246 255 !important;
    --primary-100: 219 234 254 !important;
    --primary-200: 191 219 254 !important;
    --primary-300: 147 197 253 !important;
    --primary-400: 59 130 246 !important;
    --primary-500: 23 82 150 !important;
    --primary-600: 23 82 150 !important;
    --primary-700: 16 59 112 !important;
    --primary-800: 15 47 87 !important;
    --primary-900: 13 39 72 !important;
    --primary-950: 8 25 48 !important;

    /* Also support hex primary colors if Tailwind expects hex */
    --color-primary-50: #eff6ff !important;
    --color-primary-100: #dbeafe !important;
    --color-primary-200: #bfdbfe !important;
    --color-primary-300: #93c5fd !important;
    --color-primary-400: #3b82f6 !important;
    --color-primary-500: var(--brand) !important;
    --color-primary-600: var(--brand-dark) !important;
    --color-primary-700: var(--brand-dark) !important;
}

/* Centered Main Card */
.fi-simple-main {
    background: var(--white) !important;
    border: 1px solid var(--line) !important;
    border-radius: 10px !important;
    padding: 34px !important;
    box-shadow: 0 14px 34px rgba(31, 36, 40, .06) !important;
    width: 100% !important;
    max-width: 448px !important;
}

/* Header & Logo styling */
.fi-simple-header {
    margin-bottom: 24px !important;
}

.fi-simple-header .fi-logo {
    display: block !important;
    width: 260px !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 auto 26px !important;
    object-fit: contain !important;
}

/* Heading (Title) */
.fi-simple-header-heading {
    margin: 0 !important;
    font-size: 26px !important;
    font-weight: bold !important;
    line-height: 1.25 !important;
    text-align: center !important;
    color: var(--ink) !important;
}

/* Subheading (Description) */
.fi-simple-header-subheading {
    margin: 12px 0 0 !important;
    color: var(--muted) !important;
    line-height: 1.6 !important;
    text-align: center !important;
}

/* Text Inputs (Email & Password) */
.fi-simple-layout input[type="email"],
.fi-simple-layout input[type="password"],
.fi-simple-layout input[type="text"] {
    width: 100% !important;
    min-height: 46px !important;
    border: 1px solid var(--line) !important;
    border-radius: 8px !important;
    padding: 0 12px !important;
    font-size: 16px !important;
    box-shadow: none !important;
    background-color: var(--white) !important;
    color: var(--ink) !important;
}

.fi-simple-layout input[type="email"]:focus,
.fi-simple-layout input[type="password"]:focus,
.fi-simple-layout input[type="text"]:focus {
    outline: 2px solid rgba(23, 82, 150, .22) !important;
    border-color: var(--brand) !important;
    box-shadow: none !important;
    --tw-ring-offset-width: 0px !important;
    --tw-ring-width: 0px !important;
    --tw-ring-color: transparent !important;
}

/* Login remember-me checkbox. */
.fi-simple-layout input[type="checkbox"].fi-checkbox-input {
    appearance: none !important;
    width: 18px !important;
    height: 18px !important;
    flex: 0 0 18px !important;
    border: 1px solid #9ca3af !important;
    border-radius: 4px !important;
    background-color: var(--white) !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-size: 12px 12px !important;
    cursor: pointer !important;
}

.fi-simple-layout input[type="checkbox"].fi-checkbox-input:checked {
    border-color: var(--brand) !important;
    background-color: var(--brand) !important;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.5 8.5 6.5 11.5 12.5 4.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}

.fi-simple-layout input[type="checkbox"].fi-checkbox-input:focus-visible {
    outline: 3px solid rgba(23, 82, 150, .2) !important;
    outline-offset: 2px !important;
}

/* Labels */
.fi-simple-layout label {
    font-weight: 800 !important;
    color: var(--ink) !important;
}

/* Submit Action Button */
.fi-simple-layout button[type="submit"],
.fi-simple-layout .fi-btn {
    min-height: 46px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: var(--brand) !important;
    color: var(--white) !important;
    font-weight: 900 !important;
    font-size: 16px !important;
    cursor: pointer !important;
    box-shadow: none !important;
    width: 100% !important;
    padding: 0 24px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.fi-simple-layout button[type="submit"]:hover,
.fi-simple-layout .fi-btn:hover {
    background: var(--brand-dark) !important;
}

/* Text links (e.g., Back to Login, Forgot Password, etc.) */
.fi-simple-layout a {
    color: var(--brand) !important;
    font-weight: 700 !important;
}

.fi-simple-layout a:hover {
    color: var(--brand-dark) !important;
    text-decoration: underline !important;
}

[x-cloak] {
    display: none !important;
}

.fi-ta-selection-indicator {
    display: none !important;
}

/* Order attachments tab. */
.max-attachments-table .fi-ta-content-grid {
    gap: 10px !important;
}

.max-attachments-table .fi-ta-record {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    overflow: hidden;
    min-width: 0;
    border: 1px solid #d9e1ea !important;
    border-radius: 9px !important;
    background: #fff !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04) !important;
    transition: border-color .15s ease, box-shadow .15s ease !important;
}

.max-attachments-table .fi-ta-record:hover {
    border-color: rgba(23, 82, 150, .35) !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .08) !important;
}

.max-attachments-table .fi-ta-record-content-ctn {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-width: 0;
}

.max-attachments-table .fi-ta-record-content-ctn > div:first-child,
.max-attachments-table .fi-ta-record-content {
    display: block;
    width: 100%;
    min-width: 0;
    text-align: left;
}

.max-attachments-table button.fi-ta-record-content {
    appearance: none;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.max-attachments-table .fi-ta-actions {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
    padding: 8px 10px 8px 4px !important;
}

.max-attachments-table .fi-ta-actions .fi-icon-btn {
    border-radius: 8px !important;
}

.max-attachment-card {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    min-height: 82px;
    padding: 8px 2px 8px 8px;
    color: #111827;
}

.max-attachment-card__preview {
    display: flex;
    flex: 0 0 80px;
    width: 80px;
    height: 64px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #edf1f5;
    border-radius: 7px;
    background: #f6f8fb;
}

.max-attachment-card__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.max-attachment-card__placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    color: #64748b;
}

.max-attachment-card__placeholder-icon {
    width: 32px;
    height: 32px;
}

.max-attachment-card__body {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
}

.max-attachment-card__title {
    min-width: 0;
    overflow: hidden;
    color: #111827;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.max-attachment-card__description {
    overflow: hidden;
    color: #4b5563;
    font-size: 13px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.max-attachment-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.max-attachment-card__meta span + span::before {
    content: "·";
    margin: 0 7px;
}

.max-attachment-modal {
    display: flex;
    align-items: center;
    justify-content: center;
}

.max-attachment-modal__stage {
    width: 100%;
}

.max-attachment-modal__stage--image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.max-attachment-modal__image {
    max-width: 100%;
    max-height: 76vh;
    border-radius: 8px;
    object-fit: contain;
}

.max-attachment-modal__pdf {
    width: 100%;
    height: 72vh;
    min-height: 460px;
    border: 0;
    border-radius: 8px;
    background: #fff;
}

.max-attachment-modal__fallback {
    color: #64748b;
    font-size: 13px;
}

.dark .max-attachments-table .fi-ta-record {
    border-color: #263445 !important;
    background: #111827 !important;
}

.dark .max-attachments-table .fi-ta-record:hover {
    border-color: rgba(96, 165, 250, .45) !important;
    box-shadow: 0 16px 34px rgba(0, 0, 0, .28) !important;
}

.dark .max-attachment-card,
.dark .max-attachment-card__title {
    color: #f9fafb;
}

.dark .max-attachment-card__preview,
.dark .max-attachment-modal__stage {
    border-color: #263445;
    background: #0b1120;
}

.dark .max-attachment-modal__fallback {
    color: #94a3b8;
}

.dark .max-attachment-card__description,
.dark .max-attachment-card__meta {
    color: #94a3b8;
}

.dark .max-attachment-modal__pdf {
    border-color: #263445;
}

@media (max-width: 760px) {
    .max-attachment-card__preview {
        flex-basis: 72px;
        width: 72px;
        height: 58px;
    }

    .max-attachment-modal__pdf {
        min-height: 360px;
    }

    .max-attachments-table .fi-ta-record {
        grid-template-columns: minmax(0, 1fr);
    }

    .max-attachments-table .fi-ta-record-content-ctn {
        grid-template-columns: minmax(0, 1fr);
    }

    .max-attachments-table .fi-ta-actions {
        justify-content: flex-end !important;
        padding: 0 10px 8px !important;
    }
}

.max-unsaved-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .58);
    backdrop-filter: blur(2px);
}

.max-unsaved-dialog {
    width: 100%;
    max-width: 520px;
    padding: 28px;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}

.max-unsaved-title {
    margin: 0;
    color: #111827;
    font-size: 21px;
    font-weight: 800;
    line-height: 1.3;
}

.max-unsaved-description {
    margin: 10px 0 0;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.6;
}

.max-unsaved-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 26px;
}

.max-unsaved-button {
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 750;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.max-unsaved-button-back {
    background: transparent;
    color: #4b5563;
}

.max-unsaved-button-back:hover {
    background: #f3f4f6;
}

.max-unsaved-button-discard {
    border-color: #d1d5db;
    background: #fff;
    color: #374151;
}

.max-unsaved-button-discard:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.max-unsaved-button-save {
    background: #175296;
    color: #fff;
}

.max-unsaved-button-save:hover {
    background: #123f74;
}

@media (max-width: 560px) {
    .max-unsaved-dialog {
        padding: 22px;
    }

    .max-unsaved-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .max-unsaved-button {
        width: 100%;
    }
}

.max-order-chat-shell {
    overflow: hidden;
    margin-bottom: 6rem;
    scroll-margin-bottom: 6rem;
    border: 1px solid #dce3eb;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 1px 3px rgb(15 23 42 / 5%);
}

.max-order-chat-header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 3.75rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #e5eaf0;
}

.max-order-chat-header h2 {
    margin: 0;
    color: #17212b;
    font-size: 1rem;
    font-weight: 750;
}

.max-order-chat-header-icon {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    border-radius: 50%;
    background: #e8f1fb;
    color: #175296;
}

.max-order-chat-header-icon svg {
    width: 1.2rem;
    height: 1.2rem;
}

.max-order-chat-layout {
    background: #fff;
}

.max-order-chat-messages {
    display: flex;
    min-height: 11rem;
    max-height: 34rem;
    flex-direction: column;
    overflow-y: auto;
    padding: 0 1.15rem;
    background: #fff;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
}

.max-order-chat-load-more {
    text-align: center;
}

.max-order-chat-load-more button {
    border: 0;
    color: #52616f;
    font-size: 0.75rem;
    font-weight: 650;
}

.max-order-chat-empty {
    display: flex;
    flex: 1;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    gap: 0.55rem;
    min-height: 11rem;
    color: #8a98a7;
    font-size: 0.82rem;
}

.max-order-chat-empty svg {
    width: 2rem;
    height: 2rem;
}

.max-order-chat-thread {
    display: flex;
    flex-direction: column;
}

.max-order-chat-conversation-group {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}

.max-order-chat-conversation-group + .max-order-chat-conversation-group {
    border-top: 1px solid #dce4ec;
}

.max-order-chat-message-row {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.75rem;
    scroll-margin-top: 5rem;
}

.max-order-chat-message-row.max-order-chat-message-row-own {
    justify-content: flex-start;
}

.max-order-chat-avatar {
    display: grid;
    width: 2.35rem;
    height: 2.35rem;
    flex: 0 0 2.35rem;
    place-items: center;
    border: 1px solid #c7d5e3;
    border-radius: 50%;
    background: #edf4fb;
    color: #175296;
    font-size: 0.72rem;
    font-weight: 800;
}

.max-order-chat-message-row-own .max-order-chat-avatar {
    border-color: #175296;
    background: #175296;
    color: #fff;
}

.max-order-chat-message-stack {
    display: flex;
    width: min(100%, 62rem);
    min-width: 0;
    align-items: flex-start;
    flex-direction: column;
}

.max-order-chat-message-row-own .max-order-chat-message-stack {
    align-items: flex-start;
    margin-right: 0;
    margin-left: 0;
}

.max-order-chat-message-meta {
    display: flex;
    width: auto;
    max-width: 100%;
    align-items: baseline;
    gap: 0.45rem;
    margin: 0 0 0.3rem;
    color: #8492a1;
    font-size: 0.72rem;
}

.max-order-chat-message-meta strong {
    color: #344557;
    font-size: 0.78rem;
    font-weight: 750;
}

.max-order-chat-message-meta time {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0;
    color: #65788b;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
    white-space: nowrap;
}

.max-order-chat-message-meta time svg {
    width: 0.78rem;
    height: 0.78rem;
    flex: 0 0 0.78rem;
}

.max-order-chat-own-label {
    display: inline-flex;
    align-items: center;
    min-height: 1.1rem;
    border-radius: 999px;
    padding: 0.05rem 0.4rem;
    background: #e8f1fb;
    color: #175296;
    font-size: 0.62rem;
    font-weight: 750;
}

.max-order-chat-bubble {
    width: 100%;
    min-width: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    color: #17212b;
    font-size: 0.88rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.max-order-chat-message-row-own .max-order-chat-bubble {
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #17212b;
}

.max-order-chat-bubble p {
    margin-block: 0;
}

.max-order-chat-bubble [data-type='mention'] {
    border-radius: 0.3rem;
    background: #e2effd;
    color: #175296;
    padding: 0.06rem 0.25rem;
    font-weight: 750;
}

.max-order-chat-message-row-own .max-order-chat-bubble [data-type='mention'] {
    background: #e2effd;
    color: #175296;
}

.max-order-chat-message-highlighted {
    border-radius: 0.55rem;
    background: #eef6ff;
    outline: 3px solid rgb(23 82 150 / 20%);
    outline-offset: 4px;
}

.max-order-chat-reply-quote {
    display: flex;
    max-width: 100%;
    flex-direction: column;
    gap: 0.1rem;
    margin-bottom: 0.25rem;
    padding: 0.35rem 0.55rem;
    border-left: 2px solid #8ea8c2;
    color: #657687;
    font-size: 0.68rem;
    text-decoration: none;
}

.max-order-chat-reply-quote span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.max-order-chat-reply-button {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0.4rem 0 0;
    border: 0;
    color: #718096;
    font-size: 0.68rem;
    font-weight: 650;
}

.max-order-chat-reply-button svg {
    width: 0.8rem;
    height: 0.8rem;
}

.max-order-chat-reply-button:hover {
    color: #175296;
}

.max-order-chat-thread-controls {
    display: flex;
    width: min(calc(100% - 3.1rem), 46rem);
    flex-direction: column;
    overflow: hidden;
    margin: 0.7rem 0 0 3.1rem;
    border: 1px solid #d4dee9;
    border-radius: 0.8rem;
    background: #f8fafc;
}

.max-order-chat-thread-controls.is-expanded {
    box-shadow: 0 1px 3px rgb(15 23 42 / 6%);
}

.max-order-chat-thread-heading {
    display: inline-flex;
    min-height: 2.5rem;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.65rem;
    background: #edf3f8;
    color: #52697f;
    font-size: 0.72rem;
}

.max-order-chat-thread-heading > svg {
    width: 0.9rem;
    height: 0.9rem;
    flex: 0 0 0.9rem;
}

.max-order-chat-thread-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
    padding: 0.2rem 0.3rem;
    border: 0;
    color: #175296;
    font-size: 0.68rem;
    font-weight: 700;
}

.max-order-chat-thread-toggle:hover {
    color: #175296;
}

.max-order-chat-thread-toggle .max-order-chat-thread-chevron {
    width: 0.8rem;
    height: 0.8rem;
    flex: 0 0 0.8rem;
    transition: transform .15s ease;
}

.max-order-chat-thread-toggle .max-order-chat-thread-chevron.is-expanded {
    transform: rotate(180deg);
}

.max-order-chat-thread-replies {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 0.85rem;
    border-top: 1px solid #d4dee9;
    background: #fff;
}

.max-order-chat-thread-earlier-replies {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.max-order-chat-message-row-reply .max-order-chat-message-stack {
    width: min(100%, 58rem);
}

.max-order-chat-message-row-reply .max-order-chat-avatar {
    width: 1.85rem;
    height: 1.85rem;
    flex-basis: 1.85rem;
    font-size: 0.62rem;
}

.max-order-chat-composer {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #e5eaf0;
    background: #f8fafc;
}

.max-order-chat-replying {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
    padding: 0.45rem 0.6rem 0.45rem 0.7rem;
    border-left: 3px solid #175296;
    border-radius: 0.35rem;
    background: #f0f5fa;
}

.max-order-chat-replying div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.max-order-chat-replying strong,
.max-order-chat-replying span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.max-order-chat-replying strong {
    color: #175296;
    font-size: 0.72rem;
}

.max-order-chat-replying span {
    color: #657687;
    font-size: 0.68rem;
}

.max-order-chat-replying button {
    display: grid;
    width: 1.75rem;
    height: 1.75rem;
    flex: 0 0 1.75rem;
    place-items: center;
    border-radius: 50%;
    color: #657687;
}

.max-order-chat-replying button:hover {
    background: #e1e9f1;
    color: #17212b;
}

.max-order-chat-replying svg {
    width: 1rem;
    height: 1rem;
}

.max-order-chat-compose-row {
    display: flex;
    align-items: flex-end;
    gap: 0.55rem;
}

.max-order-chat-compose-field {
    min-width: 0;
    flex: 1;
}

.max-order-chat-compose-field .fi-fo-field-wrp {
    gap: 0;
}

.max-order-chat-compose-field .fi-fo-rich-editor {
    overflow: hidden;
    border-radius: 0.55rem;
    background: #fff;
}

.max-order-chat-compose-field .fi-fo-rich-editor-content {
    min-height: 3.5rem;
    max-height: 8rem;
    padding-block: 0.62rem;
    overflow-y: auto;
}

.max-order-chat-send {
    display: inline-flex;
    width: auto;
    height: 3.5rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border-radius: 0.5rem;
    padding: 0 1rem;
    background: #175296;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 750;
    box-shadow: 0 2px 5px rgb(23 82 150 / 25%);
    transition: background-color .15s ease, transform .15s ease;
}

.max-order-chat-send:hover {
    background: #123f74;
    transform: translateY(-1px);
}

.max-order-chat-send:disabled {
    cursor: wait;
    opacity: 0.55;
}

.max-order-chat-send svg {
    width: 1.15rem;
    height: 1.15rem;
}

@media (max-width: 640px) {
    .max-order-chat-shell {
        margin-bottom: calc(7rem + env(safe-area-inset-bottom));
        scroll-margin-bottom: calc(7rem + env(safe-area-inset-bottom));
    }

    .max-order-chat-header {
        min-height: 3.25rem;
        padding: 0.6rem 0.75rem;
    }

    .max-order-chat-header-icon {
        width: 2rem;
        height: 2rem;
    }

    .max-order-chat-messages {
        min-height: 10rem;
        max-height: none;
        overflow-y: visible;
        padding: 0 0.75rem;
        overscroll-behavior: auto;
    }

    .max-order-chat-message-stack {
        width: calc(100% - 2.5rem);
    }

    .max-order-chat-avatar {
        width: 2rem;
        height: 2rem;
        flex-basis: 2rem;
    }

    .max-order-chat-thread-controls {
        width: calc(100% - 1rem);
        margin-left: 1rem;
    }

    .max-order-chat-bubble {
        padding: 0;
        font-size: 0.82rem;
    }

    .max-order-chat-composer {
        padding: 0.7rem 0.75rem;
    }

    .max-order-chat-send {
        width: 3rem;
        height: 3rem;
        flex-basis: 3rem;
        border-radius: 50%;
        padding: 0;
    }

    .max-order-chat-send span {
        display: none;
    }

    .max-order-chat-compose-field .fi-fo-rich-editor-content {
        min-height: 3rem;
    }

    .max-order-chat-message-meta {
        flex-wrap: wrap;
        column-gap: 0.35rem;
    }

    .max-order-chat-message-meta time {
        margin-left: 0;
        font-size: 0.66rem;
    }
}
.max-order-context {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.max-order-region-badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d7dee7;
    border-radius: 999px;
    padding: 6px 12px;
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
}

.max-region-primary { color: #1d4ed8; background-color: #dbeafe; }
.max-region-info { color: #075985; background-color: #e0f2fe; }
.max-region-success { color: #166534; background-color: #dcfce7; }
.max-region-warning { color: #92400e; background-color: #fef3c7; }
.max-region-danger { color: #991b1b; background-color: #fee2e2; }
.max-region-gray { color: #374151; background-color: #f3f4f6; }

.max-work-regions-header {
    margin-bottom: 1rem;
}

.max-work-regions-header h2 {
    color: var(--gray-950);
    font-size: 1.125rem;
    font-weight: 700;
}

.max-work-regions-header p {
    margin-top: .25rem;
    color: var(--gray-500);
    font-size: .875rem;
}

.max-work-regions-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
}

.max-work-region-card {
    overflow: hidden;
    border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
    border-radius: .75rem;
    background: var(--gray-50);
    box-shadow: 0 1px 2px rgb(0 0 0 / .04);
}

.max-work-region-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    color: inherit;
    text-decoration: none;
}

.max-work-region-summary span {
    display: grid;
    gap: .2rem;
}

.max-work-region-summary strong { font-size: 1rem; }
.max-work-region-summary small { opacity: .75; font-size: .75rem; }
.max-work-region-summary b { font-size: 1.75rem; line-height: 1; }

.max-work-region-postcodes {
    display: grid;
    border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent);
    background: var(--gray-50);
}

.max-work-region-postcodes a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .65rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-800);
    font-size: .8125rem;
    text-decoration: none;
}

.max-work-region-postcodes a:hover { background: var(--gray-100); }
.max-work-region-postcodes small { color: var(--gray-500); }
.max-work-region-empty { padding: .8rem 1rem; color: var(--gray-500); font-size: .8125rem; }

.max-work-region-card > button {
    width: 100%;
    padding: .65rem 1rem;
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: .75rem;
    font-weight: 600;
    text-align: left;
}

@media (min-width: 640px) {
    .max-work-regions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
    .max-work-regions-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Rooster (planning fase 1) */
.roster {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.roster-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
}

.roster-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    border: 1px solid #d9e1ea;
    font-weight: 500;
}

.roster-chip.is-available,
.roster-cell.is-available { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }

.roster-chip.is-partial,
.roster-cell.is-partial { background: #fffbeb; border-color: #fcd34d; color: #92400e; }

.roster-chip.is-booked,
.roster-cell.is-booked { background: #eef5fc; border-color: #9dc3e8; color: #175296; }

.roster-chip.is-absent,
.roster-cell.is-absent { background: #fef2f2; border-color: #fecaca; color: #b42318; }

.roster-chip.is-empty,
.roster-cell.is-empty { background: #f8fafc; border-color: #e2e8f0; color: #94a3b8; }

.roster-hint { color: #64748b; }

.roster-technician {
    border: 1px solid #d9e1ea;
    border-radius: 0.75rem;
    background: var(--white, #ffffff);
    overflow: hidden;
}

.roster-technician > header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #d9e1ea;
}

.roster-areas { font-size: 0.8125rem; color: #64748b; }
.roster-areas.is-warning { color: #b42318; font-weight: 500; }

.roster-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(9rem, 1fr));
    gap: 1px;
    background: #e2e8f0;
    overflow-x: auto;
    border-bottom: 1px solid #e2e8f0;
}

.roster-grid:last-child { border-bottom: 0; }

/* Maandweergave: compactere cellen zodat alle weken van de maand passen. */
.roster-grid.is-month { grid-template-columns: repeat(7, minmax(6.5rem, 1fr)); }
.roster-grid.is-month .roster-day { padding: 0.375rem; gap: 0.125rem; }
.roster-grid.is-month .roster-cell { padding: 0.1875rem 0.375rem; font-size: 0.6875rem; }
.roster-day.is-outside { background: #f8fafc; }
.roster-day.is-outside > header,
.roster-day.is-outside .roster-cell { opacity: 0.55; }

.roster-day {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
    background: #ffffff;
}

.roster-day > header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.75rem;
    color: #64748b;
}

.roster-day.is-today { background: #f8fafc; }
.roster-day.is-today > header strong { color: #175296; }

.roster-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.0625rem;
    width: 100%;
    padding: 0.375rem 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    font-size: 0.75rem;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.roster-cell:disabled { cursor: default; }
.roster-cell:not(:disabled):hover { filter: brightness(0.96); }

.roster-cell-name { font-weight: 600; }
.roster-cell-time { opacity: 0.8; }
.roster-cell-badge { font-weight: 600; }

.roster-empty { color: #64748b; }

.planning-day-finalized {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 999px;
    background: #eaf2fb;
    color: #175296;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Agendakoppeling voor monteurs, geopend vanaf de planningspagina. */
.calendar-link { display: grid; gap: 1rem; font-size: 0.875rem; color: #172033; }
.calendar-link-intro { margin: 0; line-height: 1.5; }

.calendar-link-primary {
    justify-self: start;
    padding: 0.5rem 0.875rem;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .2s ease;
}

.calendar-link-primary:hover { background: var(--brand-dark); color: #fff; }

.calendar-link-scope { display: grid; gap: 0.375rem; }
.calendar-link-scope > label { font-weight: 600; color: #52616f; font-size: 0.8125rem; }
.calendar-link-scope > div { display: flex; gap: 0.5rem; }
.calendar-link-scope select {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 0.625rem;
    border: 1px solid #d7e1ec;
    border-radius: 8px;
    background: #fff;
    color: #172033;
}
.calendar-link-scope button {
    flex-shrink: 0;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d7e1ec;
    border-radius: 8px;
    background: #fff;
    color: #172033;
    font-weight: 600;
    font-size: 0.8125rem;
    cursor: pointer;
}
.calendar-link-scope button:hover { background: #eef2f6; }
.calendar-link-scope > p { margin: 0; color: #64748b; font-size: 0.75rem; }

.calendar-link-copy { display: grid; gap: 0.375rem; }
.calendar-link-copy > label { font-weight: 600; color: #52616f; font-size: 0.8125rem; }
.calendar-link-copy > div { display: flex; gap: 0.5rem; }

.calendar-link-copy input {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 0.625rem;
    border: 1px solid #d7e1ec;
    border-radius: 8px;
    background: #f7f9fb;
    color: #172033;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.75rem;
}

.calendar-link-copy button,
.calendar-link-footer button {
    flex-shrink: 0;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d7e1ec;
    border-radius: 8px;
    background: #fff;
    color: #172033;
    font-weight: 600;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background-color .2s ease;
}

.calendar-link-copy button:hover,
.calendar-link-footer button:hover { background: #eef2f6; }

.calendar-link-help > p { margin: 0 0 0.375rem; font-weight: 600; }
.calendar-link-help ul { margin: 0; padding-left: 1.125rem; display: grid; gap: 0.375rem; list-style: disc; }
.calendar-link-help li { line-height: 1.45; color: #3f4a57; }

.calendar-link-warning {
    margin: 0;
    padding: 0.75rem 0.875rem;
    border: 1px solid #f0d8a8;
    border-radius: 10px;
    background: #fdf6e7;
    color: #6b4e12;
    line-height: 1.45;
}

.calendar-link-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e4eaf0;
}

.calendar-link-footer > span { color: #64748b; font-size: 0.75rem; }

/* Dagroute van de monteur: bezoeken op rijvolgorde, per tijdvak gegroepeerd. */
.max-day-route-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.max-day-route-header h2 {
    color: var(--gray-950);
    font-size: 1.125rem;
    font-weight: 700;
}

.max-day-route-header h2 span {
    color: var(--gray-500);
    font-weight: 500;
}

.max-day-route-header p {
    margin-top: .25rem;
    color: var(--gray-500);
    font-size: .875rem;
}

.max-day-route-nav {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    flex-shrink: 0;
    padding: .5rem .85rem;
    border-radius: .5rem;
    background: #1d4ed8;
    color: #fff;
    font-size: .8125rem;
    font-weight: 600;
    text-decoration: none;
}

.max-day-route-nav svg { width: 1rem; height: 1rem; }

.max-day-route-block {
    margin-bottom: 1rem;
    overflow: hidden;
    border: 1px solid var(--gray-200);
    border-radius: .75rem;
    background: var(--gray-50);
}

.max-day-route-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    background: #f1f5f9;
}

.max-day-route-block-header span { display: grid; gap: .15rem; }
.max-day-route-block-header strong { font-size: .9375rem; }
.max-day-route-block-header small { color: var(--gray-500); font-size: .75rem; }

.max-day-route-block-header a {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: #1d4ed8;
    font-size: .8125rem;
    font-weight: 600;
    text-decoration: none;
}

.max-day-route-block-header a svg { width: .95rem; height: .95rem; }

.max-day-route-stop {
    display: flex;
    gap: .85rem;
    padding: .85rem 1rem;
    border-top: 1px solid var(--gray-200);
}

.max-day-route-stop:first-of-type { border-top: 0; }

.max-day-route-position {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: #1d4ed8;
    color: #fff;
    font-size: .8125rem;
    font-weight: 700;
}

.max-day-route-body { flex: 1; min-width: 0; }

.max-day-route-customer {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
}

.max-day-route-customer strong { font-size: .9375rem; }
.max-day-route-customer small { flex-shrink: 0; color: var(--gray-500); font-size: .75rem; }

.max-day-route-address { color: var(--gray-700); font-size: .875rem; }
.max-day-route-meta { margin-top: .15rem; color: var(--gray-500); font-size: .8125rem; }
.max-day-route-meta a { color: #1d4ed8; text-decoration: none; }

.max-day-route-parts {
    margin-top: .55rem;
    padding: .5rem .7rem;
    border-radius: .5rem;
    background: #fef3c7;
    color: #92400e;
}

.max-day-route-parts span { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.max-day-route-parts ul { margin-top: .2rem; font-size: .8125rem; }
.max-day-route-parts li { list-style: disc; margin-left: 1rem; }

@media (max-width: 640px) {
    .max-day-route-header { flex-direction: column; }
}

/* Kaart met de dagroute. Leaflet levert zijn eigen opmaak; dit is alleen de omlijsting,
   de genummerde spelden en de legenda. */
.max-day-route-map {
    margin-bottom: 1rem;
    overflow: hidden;
    border: 1px solid var(--gray-200);
    border-radius: .75rem;
    background: var(--gray-50);
}

.max-day-route-canvas {
    width: 100%;
    height: 22rem;
    background: #f8fafc;
}

.max-day-route-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem 1rem;
    padding: .6rem .9rem;
    border-top: 1px solid var(--gray-200);
    color: var(--gray-600);
    font-size: .8125rem;
}

.max-day-route-legend span {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.max-day-route-swatch {
    display: inline-block;
    width: .85rem;
    height: .3rem;
    border-radius: 999px;
}

/* Leaflet zet zijn eigen achtergrond en rand op een divIcon; die halen we weg. */
.max-day-route-pin-wrapper {
    background: none;
    border: 0;
}

.max-day-route-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border: 2px solid #fff;
    border-radius: 999px;
    box-shadow: 0 1px 3px rgb(0 0 0 / .35);
    color: #fff;
    font-size: .8125rem;
    font-weight: 700;
    line-height: 1;
}

.max-day-route-pin-home {
    background: #0f172a;
    font-size: 1rem;
}

.max-day-route-map .leaflet-container {
    font: inherit;
}

@media (max-width: 640px) {
    .max-day-route-canvas { height: 16rem; }
}

/* Acties per bezoek: navigeren en de order openen. */
.max-day-route-stop-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem 1rem;
    margin-top: .5rem;
}

.max-day-route-stop-actions a {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: #1d4ed8;
    font-size: .8125rem;
    font-weight: 600;
    text-decoration: none;
}

.max-day-route-stop-actions a svg { width: .95rem; height: .95rem; }

/* Bronvermelding van de kaart: verplicht, maar hoort niet als balk over de kaart. */
.max-day-route-credit {
    margin-left: auto;
    color: var(--gray-400);
    font-size: .875rem;
    cursor: help;
}

/* =========================================================================
   Donkere modus voor planning, rooster en agendakoppeling.

   Deze onderdelen zijn met vaste lichte kleuren opgebouwd in plaats van met
   Filament-tokens, dus zonder deze regels blijven ze wit in donkere modus.
   De waarden sluiten aan op de tinten die de bijlagenweergave hierboven
   al gebruikt: #111827 vlak, #0b1120 diep, #263445 lijn.
   ========================================================================= */

.dark .planning-toolbar,
.dark .planning-topbar,
.dark .planning-unplanned,
.dark .planning-board {
    border-color: #263445;
    background: #111827;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .3);
}

.dark .planning-unplanned > header h2 { color: #f9fafb; }
.dark .planning-unplanned > header p,
.dark .planning-area-card a span,
.dark .planning-area-more,
.dark .planning-unplanned-empty { color: #94a3b8; }

.dark .planning-area-card {
    border-color: #263445;
    background: #0b1120;
}

.dark .planning-area-card h3 {
    border-bottom-color: #263445;
    color: #f9fafb;
}

.dark .planning-area-card h3 span {
    background: #2563eb;
    color: #f9fafb;
}

.dark .planning-area-card a { color: #cbd5e1; }
.dark .planning-area-card a + a { border-top-color: #263445; }
.dark .planning-area-card a:hover { background: #172033; }
.dark .planning-area-card a strong { color: #f9fafb; }
.dark .planning-area-more { border-top-color: #263445; }

.dark .planning-nav button,
.dark .planning-period button,
.dark .planning-view-switch button {
    border-color: #374151;
    background: #1f2937;
    color: #e5e7eb;
}

.dark .planning-nav-center button,
.dark .planning-period button:first-child,
.dark .planning-period button:nth-child(3) { color: #94a3b8; }

.dark .planning-nav button:hover,
.dark .planning-period button:hover,
.dark .planning-view-switch button:hover,
.dark .planning-day-toggle:hover,
.dark .planning-day-open:hover {
    border-color: #60a5fa;
    background: #1e3a5f;
    color: #bfdbfe;
}

.dark .planning-nav { border-bottom-color: #263445; }
.dark .planning-nav-center h2,
.dark .planning-period h2 { color: #f9fafb; }
.dark .planning-view-switch { background: #0b1120; }

.dark .planning-view-switch button.is-active {
    border-color: #2563eb;
    background: #2563eb;
    color: #f9fafb;
}

.dark .planning-filter,
.dark .planning-area-filter { color: #94a3b8; }

.dark .planning-filter select,
.dark .planning-area-filter select {
    border-color: #374151;
    background: #1f2937;
    color: #e5e7eb;
}

.dark .planning-weekdays {
    border-bottom-color: #263445;
    background: #0b1120;
}

.dark .planning-weekdays div { color: #94a3b8; }

.dark .planning-day {
    border-right-color: #1f2b3a;
    border-bottom-color: #1f2b3a;
    background: #111827;
}

.dark .planning-day.is-outside { background: #0d1522; }
.dark .planning-day > header { color: #94a3b8; }
.dark .planning-day > header strong { color: #f9fafb; }

.dark .planning-day.is-today {
    background: #14202f;
    box-shadow: inset 0 0 0 2px rgba(96, 165, 250, .38);
}

.dark .planning-day > .planning-day-open,
.dark .planning-day-open { color: #f9fafb; }

.dark .planning-day.is-today .planning-day-open {
    background: #2563eb;
    color: #f9fafb;
}

.dark .planning-day-count {
    background: #1f2937;
    color: #cbd5e1;
}

.dark .planning-day-finalized {
    background: #1e3a5f;
    color: #bfdbfe;
}

.dark .planning-block-head { color: #94a3b8; }

.dark .planning-day-toggle {
    border-color: #374151;
    color: #94a3b8;
}

.dark .planning-empty { color: #64748b; }

.dark .planning-order {
    background: #1f2937;
    color: #cbd5e1;
}

.dark .planning-order strong { color: #f9fafb; }
.dark .planning-order:hover { filter: brightness(1.15); }

.dark .planning-order.is-gray { border-left-color: #94a3b8; background: #1f2937; }
.dark .planning-order.is-info { border-left-color: #60a5fa; background: #16283f; }
.dark .planning-order.is-warning { border-left-color: #f59e0b; background: #33260d; }
.dark .planning-order.is-purple { border-left-color: #a78bfa; background: #281d3f; }
.dark .planning-order.is-success { border-left-color: #34d399; background: #10281e; }
.dark .planning-order.is-danger { border-left-color: #f87171; background: #331616; }

.dark .planning-status-dot.is-gray { background: #94a3b8; }
.dark .planning-status-dot.is-info { background: #60a5fa; }
.dark .planning-status-dot.is-warning { background: #f59e0b; }
.dark .planning-status-dot.is-purple { background: #a78bfa; }
.dark .planning-status-dot.is-success { background: #34d399; }
.dark .planning-status-dot.is-danger { background: #f87171; }

.dark .planning-order-preview {
    border-color: #374151;
    background: #1f2937;
    box-shadow: 0 16px 34px rgba(0, 0, 0, .45);
    color: #cbd5e1;
}

.dark .planning-order-preview-head,
.dark .planning-order-preview-name { color: #f9fafb; }

.dark .planning-legend {
    border-top-color: #263445;
    background: #0b1120;
    color: #94a3b8;
}

/* Dagweergave */
.dark .planning-day-board-head {
    border-bottom-color: #263445;
    background: #0b1120;
}

.dark .planning-day-board-head > div { color: #94a3b8; }
.dark .planning-day-board-head strong { color: #cbd5e1; }
.dark .planning-day-board-row + .planning-day-board-row { border-top-color: #1f2b3a; }
.dark .planning-day-board-technician,
.dark .planning-day-board-cell { border-right-color: #1f2b3a; }
.dark .planning-day-board-technician strong { color: #f9fafb; }
.dark .planning-day-board-technician span { color: #94a3b8; }
.dark .planning-day-board-free { color: #374151; }

/* Rooster */
.dark .roster-technician {
    border-color: #263445;
    background: #111827;
}

.dark .roster-technician > header { border-bottom-color: #263445; }
.dark .roster-areas,
.dark .roster-hint,
.dark .roster-empty { color: #94a3b8; }
.dark .roster-areas.is-warning { color: #f87171; }

.dark .roster-grid {
    background: #263445;
    border-bottom-color: #263445;
}

.dark .roster-day { background: #111827; }
.dark .roster-day > header { color: #94a3b8; }
.dark .roster-day.is-outside { background: #0d1522; }
.dark .roster-day.is-today { background: #14202f; }
.dark .roster-day.is-today > header strong { color: #93c5fd; }

.dark .roster-chip { border-color: #374151; }

.dark .roster-chip.is-available,
.dark .roster-cell.is-available { background: #10281e; border-color: #1c5741; color: #6ee7b7; }

.dark .roster-chip.is-partial,
.dark .roster-cell.is-partial { background: #33260d; border-color: #6b4c11; color: #fcd34d; }

.dark .roster-chip.is-booked,
.dark .roster-cell.is-booked { background: #16283f; border-color: #2b4d76; color: #93c5fd; }

.dark .roster-chip.is-absent,
.dark .roster-cell.is-absent { background: #331616; border-color: #6d2727; color: #fca5a5; }

.dark .roster-chip.is-empty,
.dark .roster-cell.is-empty { background: #0d1522; border-color: #263445; color: #64748b; }

.dark .roster-cell:not(:disabled):hover { filter: brightness(1.2); }

/* Agendakoppeling */
.dark .calendar-link { color: #e5e7eb; }
.dark .calendar-link-copy > label { color: #94a3b8; }
.dark .calendar-link-scope > label,
.dark .calendar-link-scope > p { color: #94a3b8; }

.dark .calendar-link-scope select,
.dark .calendar-link-scope button {
    border-color: #374151;
    background: #1f2937;
    color: #e5e7eb;
}

.dark .calendar-link-scope button:hover { background: #263445; }

.dark .calendar-link-copy input {
    border-color: #374151;
    background: #0b1120;
    color: #e5e7eb;
}

.dark .calendar-link-copy button,
.dark .calendar-link-footer button {
    border-color: #374151;
    background: #1f2937;
    color: #e5e7eb;
}

.dark .calendar-link-copy button:hover,
.dark .calendar-link-footer button:hover { background: #263445; }

.dark .calendar-link-help li { color: #cbd5e1; }
.dark .calendar-link-footer { border-top-color: #263445; }
.dark .calendar-link-footer > span { color: #94a3b8; }

.dark .calendar-link-warning {
    border-color: #6b4c11;
    background: #33260d;
    color: #fcd34d;
}
