/* ============================================================
   DESIGN TOKENS – light mode (standaard)
   ============================================================ */
:root {
    /* Achtergrond */
    --bg:          #f5f5f5;
    --bg-surface:  #ffffff;
    --bg-elevated: #ffffff;
    --bg-hover:    #f0f0f0;

    /* Tekst */
    --text:        #111111;
    --text-muted:  #6b7280;
    --text-faint:  #9ca3af;

    /* Borders */
    --border:      #e5e7eb;
    --border-focus: #2563eb;

    /* Accentkleuren */
    --accent:       #2563eb;
    --accent-hover: #1d4ed8;

    /* Status */
    --overdue:       #dc2626;
    --overdue-bg:    #fef2f2;
    --today:         #d97706;
    --today-bg:      #fffbeb;
    --upcoming:      #2563eb;
    --upcoming-bg:   #eff6ff;

    /* Formulieren */
    --input-bg:     #ffffff;
    --input-border: #d1d5db;

    /* Schaduwen */
    --shadow-sm:  0 1px 2px rgba(0,0,0,.06);
    --shadow:     0 2px 8px rgba(0,0,0,.08);
    --shadow-lg:  0 8px 24px rgba(0,0,0,.12);

    /* Afmetingen */
    --radius-sm:   4px;
    --radius:      8px;
    --radius-lg:  12px;
    --sidebar-w:  220px;
    --header-h:    56px;
}

/* Dark mode */
[data-theme="dark"] {
    --bg:          #111111;
    --bg-surface:  #1c1c1e;
    --bg-elevated: #2c2c2e;
    --bg-hover:    #2c2c2e;

    --text:        #f5f5f5;
    --text-muted:  #a1a1aa;
    --text-faint:  #71717a;

    --border:      #3a3a3c;
    --border-focus: #60a5fa;

    --accent:       #3b82f6;
    --accent-hover: #2563eb;

    --overdue:       #f87171;
    --overdue-bg:    rgba(239,68,68,.12);
    --today:         #fbbf24;
    --today-bg:      rgba(251,191,36,.1);
    --upcoming:      #60a5fa;
    --upcoming-bg:   rgba(96,165,250,.08);

    --input-bg:     #2c2c2e;
    --input-border: #3a3a3c;

    --shadow-sm:  0 1px 2px rgba(0,0,0,.3);
    --shadow:     0 2px 8px rgba(0,0,0,.4);
    --shadow-lg:  0 8px 24px rgba(0,0,0,.5);
}

/* ============================================================
   RESET & BASIS
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

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

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

button { cursor: pointer; font: inherit; }
input, textarea, select { font: inherit; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell {
    display: flex;
    min-height: 100dvh;
}

/* ============================================================
   ZIJBALK (desktop)
   ============================================================ */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem .75rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text);
    letter-spacing: -.02em;
}

.theme-toggle {
    background: none;
    border: none;
    padding: .25rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-toggle:hover { background: var(--bg-hover); }

[data-theme="light"] .icon-dark  { display: none; }
[data-theme="dark"]  .icon-light { display: none; }

.mobile-theme-btn {
    display: none;
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + .5rem);
    right: .75rem;
    z-index: 150;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    box-shadow: var(--shadow-sm);
}

.nav-list {
    list-style: none;
    padding: .5rem 0;
}

.nav-section-label {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-faint);
    padding: .75rem 1rem .25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem .75rem;
    margin: .1rem .5rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: .875rem;
    transition: background .12s, color .12s;
    text-decoration: none;
    background: none;
    border: none;
    width: calc(100% - 1rem);
    text-align: left;
}
.nav-link:hover       { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.nav-link.is-active   { background: var(--bg-hover); color: var(--text); font-weight: 600; }

.nav-icon { width: 18px; height: 18px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }

.client-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.client-dot--large {
    width: 12px;
    height: 12px;
    margin-right: .25rem;
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding: .5rem 0;
}

.logout-form { display: contents; }

/* ============================================================
   HOOFDINHOUD
   ============================================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    padding: 1.5rem 2rem;
    max-width: 860px;
}

/* ============================================================
   TAKENLIJST HEADER
   ============================================================ */
.task-list-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.task-list-title-row {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.task-list-title {
    font-size: 1.375rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .4rem;
}

/* Gebruikersfilter bij klantweergave */
.user-filter {
    display: flex;
    gap: .25rem;
}
.filter-btn {
    padding: .25rem .625rem;
    border-radius: 999px;
    font-size: .8rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
    transition: background .12s, color .12s;
}
.filter-btn:hover, .filter-btn.is-active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    text-decoration: none;
}

/* ============================================================
   TAAKGROEPEN
   ============================================================ */
.task-group { margin-bottom: 1.5rem; }

.task-group-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .5rem;
    padding-bottom: .375rem;
    border-bottom: 1px solid var(--border);
}

.task-group-label {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.task-group-count {
    font-size: .75rem;
    color: var(--text-faint);
}

/* Totaal ingeplande uren per groep: rechts uitgelijnd als badge in de groepskleur.
   Horizontale padding = die van .task-item, zodat de getallen boven de taakuren uitlijnen */
.task-group-hours {
    margin-left: auto;
    padding: .125rem .625rem;
    border-radius: 999px;
    font-size: .875rem;
    font-weight: 700;
    color: var(--upcoming);
    background: var(--upcoming-bg);
    font-variant-numeric: tabular-nums;
}
.task-group--overdue  .task-group-hours { color: var(--overdue); background: var(--overdue-bg); }
.task-group--today    .task-group-hours,
.task-group--tomorrow .task-group-hours { color: var(--today); background: var(--today-bg); }
.task-group--later       .task-group-hours,
.task-group--no-deadline .task-group-hours { color: var(--text-muted); background: var(--bg-hover); }
/* Lege dag (0 u): onopvallend, zodat ingeplande dagen eruit springen */
.task-group .task-group-hours--empty { color: var(--text-faint); background: none; font-weight: 600; }

.task-group--overdue   .task-group-label { color: var(--overdue); }
.task-group--today     .task-group-label { color: var(--today); }
.task-group--tomorrow  .task-group-label { color: var(--today); }
.task-group--day       .task-group-label { color: var(--upcoming); }
.task-group--later     .task-group-label { color: var(--text-muted); }
.task-group--no-deadline .task-group-label { color: var(--text-faint); }
.task-group--completed   .task-group-label { color: var(--text-faint); }

/* ============================================================
   TAAK-ITEM
   ============================================================ */
.task-item {
    display: flex;
    align-items: flex-start;
    gap: .625rem;
    padding: .5rem .625rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background .1s;
    position: relative;
    user-select: none;
}
.task-item:hover { background: var(--bg-hover); }

.task-checkbox-wrap { padding-top: .1rem; flex-shrink: 0; }

.task-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: border-color .12s, background .12s;
    flex-shrink: 0;
    background: var(--bg-surface);
}
.task-checkbox:hover          { border-color: var(--accent); }
.task-checkbox:checked        { background: var(--accent); border-color: var(--accent); }
.task-checkbox:checked::after {
    content: '';
    position: absolute;
    top: 3px; left: 5px;
    width: 5px; height: 8px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(40deg);
}
.task-checkbox:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }

.task-body { flex: 1; min-width: 0; }

.task-title-row {
    display: flex;
    align-items: center;
    gap: .375rem;
    line-height: 1.35;
}

.task-star {
    color: #f59e0b;
    font-size: .875rem;
    flex-shrink: 0;
}

.task-unseen-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

.task-title {
    font-size: .9375rem;
    color: var(--text);
    word-break: break-word;
}
.task-item--completed .task-title {
    text-decoration: line-through;
    color: var(--text-faint);
}

.task-meta {
    display: flex;
    align-items: center;
    gap: .375rem;
    margin-top: .2rem;
    flex-wrap: wrap;
}

.task-meta-client {
    display: flex;
    align-items: center;
    gap: .25rem;
    font-size: .78rem;
    color: var(--text-muted);
}

.task-meta-sep { color: var(--text-faint); font-size: .75rem; }

.task-due {
    font-size: .78rem;
    color: var(--text-muted);
}
.task-due--overdue { color: var(--overdue); font-weight: 600; }
.task-due--today   { color: var(--today);   font-weight: 600; }

.task-assignee {
    font-size: .78rem;
    color: var(--text-faint);
}

/* Urenschatting per taak, rechts uitgelijnd (onder het groepstotaal) */
.task-hours {
    flex-shrink: 0;
    padding-top: .1rem;
    font-size: .875rem;
    font-weight: 600;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   KNOPPEN
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    padding: .5rem 1rem;
    border-radius: var(--radius);
    font-size: .875rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: background .12s, color .12s, border-color .12s;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
.btn:hover { text-decoration: none; }

.btn--primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn--secondary {
    background: var(--bg-surface);
    color: var(--text);
    border-color: var(--border);
}
.btn--secondary:hover { background: var(--bg-hover); }

.btn--danger {
    background: none;
    color: var(--overdue);
    border-color: var(--overdue);
}
.btn--danger:hover { background: var(--overdue-bg); }

.btn--ghost {
    background: none;
    color: var(--text-muted);
    border-color: transparent;
}
.btn--ghost:hover { background: var(--bg-hover); color: var(--text); }

.btn--full { width: 100%; }
.btn--sm   { padding: .3rem .75rem; font-size: .8125rem; }

.add-task-btn { white-space: nowrap; }

/* FAB – mobiele + knop */
.fab {
    display: none;
    position: fixed;
    bottom: calc(1.5rem + env(safe-area-inset-bottom));
    right: 1.5rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    border: none;
    box-shadow: var(--shadow-lg);
    z-index: 200;
    transition: background .12s, transform .12s;
}
.fab:hover    { background: var(--accent-hover); transform: scale(1.05); }
.fab:active   { transform: scale(.97); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s;
}
.modal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%);
    width: min(640px, calc(100vw - 2rem));
    max-height: calc(100dvh - 4rem);
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 400;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity .18s, transform .18s;
}
.modal.is-open {
    opacity: 1;
    transform: translate(-50%, -50%);
}
.modal[hidden] { display: none; }

.modal-inner {
    overflow-y: auto;
    flex: 1;
    padding: 1.5rem;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.modal-title {
    font-size: 1.0625rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    padding: .25rem;
    border-radius: var(--radius-sm);
    line-height: 1;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text); }

/* ============================================================
   FORMULIEREN (in modal)
   ============================================================ */
.form-group { margin-bottom: 1rem; }

.form-group label {
    display: block;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: .3rem;
}

.form-input {
    width: 100%;
    padding: .5rem .75rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius);
    color: var(--text);
    transition: border-color .12s, box-shadow .12s;
}
.form-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.form-input--title {
    font-size: 1rem;
    font-weight: 600;
    padding: .625rem .75rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

/* Deadline snelkeuzes */
.deadline-shortcuts {
    display: flex;
    gap: .375rem;
    flex-wrap: wrap;
    margin-bottom: .5rem;
}
.shortcut-btn {
    padding: .25rem .625rem;
    border-radius: 999px;
    font-size: .8rem;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: background .1s, color .1s, border-color .1s;
}
.shortcut-btn:hover, .shortcut-btn.is-active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* Inklapbare omschrijving */
.desc-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    margin-bottom: .3rem;
    color: var(--text-muted);
    font-size: .8125rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
}
.desc-chevron {
    transition: transform .15s;
    flex-shrink: 0;
    color: var(--text-faint);
}
.desc-toggle[aria-expanded="true"] .desc-chevron { transform: rotate(180deg); }
.desc-body { margin-top: .3rem; }

/* Checkbox veld */
.form-group--checkbox { display: flex; align-items: center; gap: .5rem; }
.form-group--checkbox label { margin: 0; color: var(--text); font-weight: 400; }
.checkbox-label {
    display: flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    font-size: .875rem;
}

/* Rich text editor */
.trix-wrapper {
    border: 1px solid var(--input-border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--input-bg);
}
.trix-wrapper:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
trix-toolbar { border-bottom: 1px solid var(--border); }
trix-editor {
    min-height: 80px;
    padding: .625rem .75rem;
    color: var(--text);
    outline: none;
    font-size: .9375rem;
    line-height: 1.6;
}
trix-editor ul, trix-editor ol { padding-left: 1.25rem; }

/* Verberg knoppen die we niet ondersteunen (spec: alleen vet, cursief, lijsten, links) */
trix-toolbar .trix-button--icon-strike,
trix-toolbar .trix-button--icon-heading-1,
trix-toolbar .trix-button--icon-quote,
trix-toolbar .trix-button--icon-code,
trix-toolbar .trix-button--icon-code-block,
trix-toolbar .trix-button--icon-attach,
trix-toolbar .trix-button--icon-increase-nesting-level,
trix-toolbar .trix-button--icon-decrease-nesting-level,
trix-toolbar .trix-button-group--file-tools,
trix-toolbar .trix-button-group--history-tools {
    display: none;
}

/* Opslaan-status */
.save-status {
    font-size: .8rem;
    color: var(--text-faint);
    margin-left: auto;
}
.save-status--saving  { color: var(--text-muted); }
.save-status--saved   { color: #059669; }
.save-status--error   { color: var(--overdue); }

/* Formulier voettekst */
.modal-footer {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.modal-footer-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-left: auto;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
    position: fixed;
    bottom: calc(1rem + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    pointer-events: none;
    min-width: 260px;
    max-width: calc(100vw - 2rem);
}

.toast {
    padding: .625rem 1rem;
    border-radius: var(--radius);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    font-size: .875rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    pointer-events: auto;
    animation: toastIn .18s ease;
}
.toast--error { border-color: var(--overdue); background: var(--overdue-bg); color: var(--overdue); }

.toast-undo {
    background: none;
    border: none;
    color: var(--accent);
    font-size: .8125rem;
    font-weight: 600;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    white-space: nowrap;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   LEGE STATES & LOADING
   ============================================================ */
.task-list-loading, .empty-state {
    text-align: center;
    color: var(--text-faint);
    padding: 3rem 1rem;
    font-size: .9375rem;
}

/* ============================================================
   ARCHIEF
   ============================================================ */
.archive-list { display: flex; flex-direction: column; gap: .5rem; }

.archive-item {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .5rem .75rem;
    border-radius: var(--radius);
    background: var(--bg-surface);
}

.archive-title {
    font-size: .9375rem;
    text-decoration: line-through;
    color: var(--text-faint);
}

.archive-meta {
    font-size: .78rem;
    color: var(--text-faint);
    display: flex;
    align-items: center;
    gap: .25rem;
}

/* ============================================================
   LOGIN PAGINA
   ============================================================ */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100dvh; }

.login-container {
    width: min(400px, calc(100vw - 2rem));
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: -.02em;
}

.login-form .form-group { margin-bottom: 1rem; }
.login-form label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .3rem; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: .875rem;
}
.alert--error { background: var(--overdue-bg); color: var(--overdue); }

/* ============================================================
   FOUTPAGINA
   ============================================================ */
.error-page { display: flex; align-items: center; justify-content: center; min-height: 100dvh; }
.error-container { text-align: center; padding: 2rem; }
.error-container h1 { margin-bottom: 1rem; }
.error-container p  { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ============================================================
   BOTTOM NAVIGATIE (mobiel)
   ============================================================ */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 100;
    flex-direction: row;
    justify-content: space-around;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    padding: .5rem .25rem;
    color: var(--text-faint);
    font-size: .7rem;
    flex: 1;
    text-align: center;
    text-decoration: none;
    transition: color .12s;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.bottom-nav-item.is-active { color: var(--accent); }
.bottom-nav-item:hover { color: var(--text); text-decoration: none; }

.bottom-nav-icon { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }
.bottom-nav-label { line-height: 1.2; }

/* Klantenpicker sheet (mobiel) */
.client-sheet-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 210;
}
.client-sheet-overlay.is-open { display: block; }

.client-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 211;
    padding-bottom: calc(.5rem + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform .22s ease;
}
.client-sheet.is-open { transform: translateY(0); }

.client-sheet-handle {
    width: 2.5rem;
    height: .25rem;
    background: var(--border);
    border-radius: 99px;
    margin: .75rem auto .5rem;
}

.client-sheet-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .8rem 1.25rem;
    color: var(--text);
    text-decoration: none;
    font-size: .9375rem;
}
.client-sheet-item.is-active { color: var(--accent); font-weight: 600; }
.client-sheet-item:active { background: var(--bg-hover); }

/* ============================================================
   TRIX DARK MODE OVERRIDES
   ============================================================ */
[data-theme="dark"] trix-toolbar {
    background: var(--bg-elevated);
    border-color: var(--border);
}
[data-theme="dark"] trix-toolbar .trix-button {
    color: var(--text-muted);
    border-color: var(--border);
}
[data-theme="dark"] trix-toolbar .trix-button:hover {
    background: var(--bg-hover);
    color: var(--text);
}
[data-theme="dark"] trix-toolbar .trix-button.trix-active {
    background: var(--bg-hover);
    color: var(--text);
}
[data-theme="dark"] trix-toolbar .trix-button-group {
    border-color: var(--border);
}

/* ============================================================
   MOBIEL
   ============================================================ */
@media (max-width: 768px) {
    .sidebar {
        display: none; /* vervangen door bottom nav */
    }

    .bottom-nav {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem 1rem calc(5rem + env(safe-area-inset-bottom));
    }

    .task-list-header { flex-direction: column; align-items: stretch; }
    .add-task-btn { display: none; }
    .fab {
        display: flex;
        align-items: center;
        justify-content: center;
        bottom: calc(4.5rem + env(safe-area-inset-bottom));
    }

    .modal {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        transform: translateY(8px);
        width: 100%;
        max-height: 92dvh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    .modal.is-open { transform: translateY(0); }

    /* Datum/tijd rij: naast elkaar op één balk */
    .form-row { grid-template-columns: 1fr; }
    .form-row > * { min-width: 0; }
    .date-time-row { grid-template-columns: 3fr 2fr; }

    /* iOS Safari: verwijder native weergave zodat onze CSS de hoogte bepaalt */
    input[type="date"],
    input[type="time"] {
        -webkit-appearance: none;
        appearance: none;
        min-width: 0;
        width: 100%;
        text-align: left;
    }

    /* Compactere modal op mobiel */
    .modal-inner { padding: 1rem; }
    .form-group { margin-bottom: .75rem; }
    trix-editor { min-height: 60px; }

    .mobile-theme-btn { display: flex; }
}

/* ============================================================
   DESKTOP FOCUS UITBREIDING
   ============================================================ */
@media (min-width: 769px) {
    .fab { display: none; }
}
