/* ==========================================================================
   To-Do Systeem - stylesheet
   --------------------------------------------------------------------------
   Eén zelfstandig bestand: geen build-stap, geen CDN, werkt dus ook als het
   internet van de bezoeker of de host een externe bron blokkeert.

   Kleuren volgen het afgesproken palet en staan als CSS-variabelen bovenaan,
   zodat een thema aanpassen op één plek gebeurt.

   Donkere modus: standaard volgt het systeem (prefers-color-scheme). Kiest de
   gebruiker zelf, dan zet app.js data-theme="dark|light" op <html>; die keuze
   wint altijd.
   ========================================================================== */

/* ---------------------------------------------------------------- tokens -- */
:root {
  color-scheme: light;

  --primary: #3b82f6;
  --primary-strong: #2563eb;
  --primary-soft: #eff6ff;
  --success: #10b981;
  --success-soft: #ecfdf5;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;
  --danger: #ef4444;
  --danger-soft: #fef2f2;

  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, .08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .16);

  --radius: 10px;
  --radius-lg: 14px;
  --sidebar-width: 260px;
  --header-height: 60px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --primary-soft: #172554;
    --success-soft: #052e23;
    --warning-soft: #422006;
    --danger-soft: #450a0a;

    --bg: #0b1220;
    --surface: #131c2e;
    --surface-2: #1a2438;
    --border: #253148;
    --border-strong: #33415c;
    --text: #e8eef7;
    --text-muted: #98a6bd;
    --text-subtle: #6b7b93;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .45);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --primary-soft: #172554;
  --success-soft: #052e23;
  --warning-soft: #422006;
  --danger-soft: #450a0a;

  --bg: #0b1220;
  --surface: #131c2e;
  --surface-2: #1a2438;
  --border: #253148;
  --border-strong: #33415c;
  --text: #e8eef7;
  --text-muted: #98a6bd;
  --text-subtle: #6b7b93;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, .45);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
}

/* ----------------------------------------------------------------- base -- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; font-weight: 650; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }

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

img, svg { max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Het hidden-attribuut moet altijd winnen. Zonder deze regel blijft een
   element met een eigen display-waarde (bijvoorbeeld .field-row met grid)
   gewoon zichtbaar, ook als JavaScript het op hidden zet. */
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--primary); color: #fff; padding: .6rem 1rem; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------------- header -- */
.app-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: .75rem;
  height: var(--header-height);
  padding: 0 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand__mark { width: 30px; height: 30px; flex: none; }
.brand__name { font-size: 1rem; letter-spacing: -.01em; }
.brand__name span { color: var(--text-subtle); font-weight: 500; }

.header-spacer { flex: 1 1 auto; }

.header-nav { display: none; gap: .25rem; margin-left: .75rem; }
.header-nav a {
  padding: .45rem .7rem; border-radius: var(--radius);
  color: var(--text-muted); font-weight: 500; font-size: .9rem;
}
.header-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.header-nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary-strong); }

@media (min-width: 900px) {
  .header-nav { display: flex; }
}

:root[data-theme="dark"] .header-nav a[aria-current="page"],
:root:not([data-theme="light"]) .header-nav a[aria-current="page"] { color: #93c5fd; }

/* ----------------------------------------------------------------- menu -- */
.menu { position: relative; }
.menu__panel {
  position: absolute; right: 0; top: calc(100% + .4rem); min-width: 210px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: .35rem; z-index: 50;
}
.menu__panel[hidden] { display: none; }
.menu__header { padding: .5rem .65rem; border-bottom: 1px solid var(--border); margin-bottom: .3rem; }
.menu__header strong { display: block; font-size: .9rem; }
.menu__header span { font-size: .78rem; color: var(--text-muted); word-break: break-all; }
.menu__item {
  display: flex; align-items: center; gap: .55rem; width: 100%;
  padding: .5rem .65rem; border: 0; border-radius: var(--radius);
  background: none; color: var(--text); font: inherit; font-size: .9rem;
  text-align: left; cursor: pointer;
}
.menu__item:hover { background: var(--surface-2); text-decoration: none; }
.menu__item--danger { color: var(--danger); }

/* De hoofdnavigatie staat op smalle schermen in het gebruikersmenu, omdat
   de balk bovenin daar geen ruimte voor heeft. */
@media (min-width: 900px) {
  .menu__item--nav { display: none; }
}

/* --------------------------------------------------------------- layout -- */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

@media (min-width: 1024px) {
  .layout { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); gap: 1.75rem; padding-inline: 1.5rem; }
}

.sidebar { display: flex; flex-direction: column; gap: 1rem; }

@media (max-width: 1023px) {
  .sidebar { order: 2; }
  .main { order: 1; }
}

.main { min-width: 0; display: flex; flex-direction: column; gap: 1.25rem; }

/* ----------------------------------------------------------------- card -- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card__header {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .85rem 1rem; border-bottom: 1px solid var(--border);
}
.card__header h2 { margin: 0; font-size: .95rem; }
.card__body { padding: 1rem; }
.card__body--tight { padding: .5rem; }

/* ---------------------------------------------------------------- stats -- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
@media (min-width: 680px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: .9rem 1rem; box-shadow: var(--shadow-sm);
  display: block; color: inherit;
}
a.stat:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.stat__value { display: block; font-size: 1.7rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.stat__label { display: block; font-size: .8rem; color: var(--text-muted); margin-top: .15rem; }
.stat--primary .stat__value { color: var(--primary); }
.stat--success .stat__value { color: var(--success); }
.stat--warning .stat__value { color: var(--warning); }
.stat--danger .stat__value { color: var(--danger); }

/* ------------------------------------------------------------- controls -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .5rem .85rem; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-size: .9rem; font-weight: 550; line-height: 1.2;
  cursor: pointer; white-space: nowrap;
  transition: background-color .12s ease, border-color .12s ease, opacity .12s ease;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
.btn--success { background: var(--success); border-color: var(--success); color: #fff; }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--ghost { border-color: transparent; background: transparent; color: var(--text-muted); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--sm { padding: .3rem .55rem; font-size: .82rem; }
.btn--icon { padding: .4rem; width: 34px; height: 34px; }
.btn--block { width: 100%; }

.field { margin-bottom: .9rem; }
.field:last-child { margin-bottom: 0; }
.field > label,
.field__label {
  display: block; font-size: .82rem; font-weight: 600;
  color: var(--text-muted); margin-bottom: .3rem;
}

.input, .select, .textarea {
  width: 100%; padding: .55rem .7rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: .92rem;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, .18);
}
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] {
  border-color: var(--danger); box-shadow: 0 0 0 3px rgba(239, 68, 68, .15);
}
.input::placeholder, .textarea::placeholder { color: var(--text-subtle); }

.field__error { display: block; margin-top: .3rem; font-size: .8rem; color: var(--danger); }
.field__hint { display: block; margin-top: .3rem; font-size: .8rem; color: var(--text-muted); }

.field-row { display: grid; gap: .9rem; }
@media (min-width: 640px) { .field-row--2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 640px) { .field-row--3 { grid-template-columns: repeat(3, 1fr); } }

.color-input { width: 44px; height: 38px; padding: 2px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; }

/* --------------------------------------------------------------- badges -- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .12rem .5rem; border-radius: 999px;
  font-size: .75rem; font-weight: 600; line-height: 1.5;
  border: 1px solid transparent; white-space: nowrap;
}
.badge--neutral { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); }
.badge--primary { background: var(--primary-soft); color: var(--primary-strong); }
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warning { background: var(--warning-soft); color: #b45309; }
.badge--danger  { background: var(--danger-soft); color: var(--danger); }

:root[data-theme="dark"] .badge--primary { color: #93c5fd; }
:root[data-theme="dark"] .badge--warning { color: #fcd34d; }
:root[data-theme="dark"] .badge--success { color: #6ee7b7; }
:root[data-theme="dark"] .badge--danger { color: #fca5a5; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge--primary { color: #93c5fd; }
  :root:not([data-theme="light"]) .badge--warning { color: #fcd34d; }
  :root:not([data-theme="light"]) .badge--success { color: #6ee7b7; }
  :root:not([data-theme="light"]) .badge--danger { color: #fca5a5; }
}

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

/* Een badge die tegelijk een keuzelijst is: de status wijzig je zo direct
   vanuit de lijst, zonder de kaart open te klappen. */
.badge-select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  font: inherit; font-size: .75rem; font-weight: 600; line-height: 1.5;
  padding: .12rem 1.15rem .12rem .5rem;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right .55rem center, right .38rem center;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
.badge-select:hover { filter: brightness(.97); }
.badge-select:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.badge-select:disabled { opacity: .6; cursor: progress; }
.badge-select option { color: var(--text); background: var(--surface); font-weight: 500; }

/* ------------------------------------------------------- categorielijst -- */
.category-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.category-list__link {
  display: flex; align-items: center; gap: .55rem;
  padding: .5rem .6rem; border-radius: var(--radius);
  color: var(--text); font-size: .9rem;
}
.category-list__link:hover { background: var(--surface-2); text-decoration: none; }
.category-list__link[aria-current="true"] { background: var(--primary-soft); font-weight: 600; }
.category-list__name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-list__count { font-size: .78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.category-list__edit { opacity: 0; border: 0; background: none; color: var(--text-muted); cursor: pointer; padding: 2px; border-radius: 4px; }
.category-list__link:hover .category-list__edit,
.category-list__edit:focus { opacity: 1; }

/* ------------------------------------------------------------ todo-kaart -- */
.todo-list { display: flex; flex-direction: column; gap: .6rem; }

.todo {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: .8rem .9rem;
  box-shadow: var(--shadow-sm);
}
.todo:hover { border-color: var(--border-strong); }
.todo--hoog { border-left-color: var(--danger); }
.todo--normaal { border-left-color: var(--primary); }
.todo--laag { border-left-color: var(--text-subtle); }
.todo--afgerond, .todo--gearchiveerd { opacity: .72; }
.todo--afgerond .todo__title, .todo--gearchiveerd .todo__title { text-decoration: line-through; }
.todo--overdue { border-left-color: var(--danger); background: var(--danger-soft); }
.todo.is-dragging { opacity: .4; }
.todo.is-drop-target { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(59, 130, 246, .25); }

.todo__check {
  appearance: none; -webkit-appearance: none;
  width: 20px; height: 20px; margin: 2px 0 0; flex: none;
  border: 2px solid var(--border-strong); border-radius: 6px;
  background: var(--surface); cursor: pointer; position: relative;
}
.todo__check:checked { background: var(--success); border-color: var(--success); }
.todo__check:checked::after {
  content: ""; position: absolute; left: 5px; top: 1px;
  width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.todo__main { min-width: 0; }
.todo__title { font-weight: 600; font-size: .95rem; color: var(--text); display: inline-block; }
.todo__title:hover { color: var(--primary); text-decoration: none; }
.todo__description {
  margin: .2rem 0 0; font-size: .85rem; color: var(--text-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.todo__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .45rem; }
.todo__actions { display: flex; align-items: center; gap: .25rem; }
.todo__handle { cursor: grab; color: var(--text-subtle); background: none; border: 0; padding: 4px; }
.todo__handle:active { cursor: grabbing; }

@media (max-width: 560px) {
  .todo { grid-template-columns: auto minmax(0, 1fr); }
  .todo__actions { grid-column: 2; justify-content: flex-end; }
}

/* -------------------------------------------------------------- filters -- */
.filters { display: grid; gap: .6rem; }
.filters__row { display: grid; gap: .6rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .filters__row--3 { grid-template-columns: repeat(3, 1fr); } }

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
  justify-content: space-between;
}
.toolbar__group { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }

/* --------------------------------------------------------------- tabels -- */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: .6rem .7rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

/* --------------------------------------------------------------- modals -- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(15, 23, 42, .55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 1rem; overflow-y: auto;
  backdrop-filter: blur(2px);
}
.modal-backdrop[hidden] { display: none; }
.modal {
  width: 100%; max-width: 620px; margin: 3vh auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.modal--sm { max-width: 440px; }
.modal__header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem 1.1rem; border-bottom: 1px solid var(--border);
}
.modal__header h2 { margin: 0; font-size: 1.05rem; }
.modal__body { padding: 1.1rem; }
.modal__footer {
  display: flex; justify-content: flex-end; gap: .5rem;
  padding: .85rem 1.1rem; border-top: 1px solid var(--border);
}

/* --------------------------------------------------------------- toasts -- */
.toasts {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 80;
  display: flex; flex-direction: column; gap: .5rem;
  max-width: min(380px, calc(100vw - 2rem));
}
.toast {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .7rem .85rem; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-lg); font-size: .9rem;
  animation: toast-in .18s ease-out;
}
.toast--success { border-left-color: var(--success); }
.toast--error { border-left-color: var(--danger); }
.toast--warning { border-left-color: var(--warning); }
.toast__close { margin-left: auto; border: 0; background: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; line-height: 1; }

@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- login -- */
.auth {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 1.5rem; background: var(--bg);
}
.auth__box { width: 100%; max-width: 400px; }
.auth__brand { display: flex; align-items: center; justify-content: center; gap: .6rem; margin-bottom: 1.25rem; }
.auth__brand span { font-size: 1.15rem; font-weight: 700; }
.auth__card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 1.5rem; }
.auth__footer { margin-top: 1rem; text-align: center; font-size: .82rem; color: var(--text-muted); }

/* --------------------------------------------------------------- alerts -- */
.alert {
  display: flex; gap: .6rem; align-items: flex-start;
  padding: .7rem .85rem; border-radius: var(--radius);
  border: 1px solid var(--border); font-size: .88rem; margin-bottom: 1rem;
}
.alert--error { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.alert--success { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.alert--info { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-strong); }
.alert--warning { background: var(--warning-soft); border-color: var(--warning); color: #b45309; }

/* ----------------------------------------------------- lege staat / misc -- */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--text-muted); }
.empty__icon { color: var(--text-subtle); margin-bottom: .5rem; }
.empty h3 { color: var(--text); }

.muted { color: var(--text-muted); }
.small { font-size: .82rem; }
.mono { font-family: var(--mono); font-size: .85em; }
.stack { display: flex; flex-direction: column; gap: .6rem; }
.inline { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.spacer { flex: 1 1 auto; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }

.attachment {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .7rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface-2); font-size: .88rem;
}
.attachment__name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment__size { color: var(--text-muted); font-size: .8rem; }

/* ------------------------------------------------------------ herhaling -- */
.weekdays { display: flex; flex-wrap: wrap; gap: .35rem; }

.weekday { cursor: pointer; }
.weekday input {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.weekday span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.4rem; padding: .3rem .5rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text-muted);
  font-size: .85rem; font-weight: 600; text-transform: lowercase;
  transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}
.weekday:hover span { border-color: var(--primary); }
.weekday input:checked + span {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
.weekday input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ----------------------------------------------------------- deelpunten -- */
.subtasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }

.subtask {
  display: flex; align-items: center; gap: .5rem;
  padding: .35rem .4rem; border-radius: var(--radius);
  border: 1px solid transparent;
}
.subtask:hover { background: var(--surface-2); }
.subtask.is-dragging { opacity: .4; }
.subtask.is-drop-target { border-color: var(--primary); }

.subtask__handle {
  border: 0; background: none; color: var(--text-subtle); cursor: grab;
  padding: 2px; flex: none; opacity: 0;
}
.subtask:hover .subtask__handle { opacity: 1; }
.subtask__handle:active { cursor: grabbing; }

.subtask__check { width: 18px; height: 18px; margin: 0; }
.subtask__check:checked::after { left: 4px; top: 0; width: 5px; height: 9px; }

.subtask__title {
  flex: 1 1 auto; min-width: 0;
  border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--text);
  font: inherit; font-size: .92rem; padding: .25rem .4rem;
}
.subtask__title:hover { border-color: var(--border); }
.subtask__title:focus {
  outline: none; background: var(--surface);
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, .15);
}

.subtask__deadline input {
  border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--text-muted);
  font: inherit; font-size: .8rem; padding: .2rem .3rem; width: 8.5rem;
}
.subtask__deadline input:hover { border-color: var(--border); }
.subtask__deadline input:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.subtask__deadline input:invalid { color: var(--text-subtle); }

.subtask__relative { color: var(--text-muted); white-space: nowrap; }
.subtask__relative--late { color: var(--danger); font-weight: 600; }

.subtask--done .subtask__title { text-decoration: line-through; color: var(--text-muted); }
.subtask--overdue .subtask__title { color: var(--danger); }

/* Op een telefoon past een deelpunt niet op één regel. Dan zetten we de titel
   bovenaan en de deadline eronder, in plaats van alles te laten omvallen. */
@media (max-width: 560px) {
  .subtask {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: .1rem .5rem;
    padding: .5rem .4rem;
  }
  .subtask__handle { display: none; }
  .subtask__check { grid-column: 1; grid-row: 1; }
  .subtask__title { grid-column: 2; grid-row: 1; }
  .subtask [data-subtask-delete] { grid-column: 3; grid-row: 1; }
  .subtask__deadline { grid-column: 2; grid-row: 2; }
  .subtask__deadline input { width: 100%; max-width: 9rem; }
  .subtask__relative { grid-column: 3; grid-row: 2; justify-self: end; align-self: center; }
}

.subtask-add { display: flex; gap: .4rem; align-items: center; }
.subtask-add .input { flex: 1 1 auto; }
.subtask-add__date { flex: 0 0 9.5rem; }

@media (max-width: 560px) {
  .subtask-add { flex-wrap: wrap; }
  .subtask-add .input { flex: 1 1 100%; }
  .subtask-add__date { flex: 1 1 auto; }
}

.dropzone {
  display: block;
  border: 2px dashed var(--border-strong); border-radius: var(--radius-lg);
  padding: 1.25rem; text-align: center; color: var(--text-muted);
  background: var(--surface-2); cursor: pointer;
}
.dropzone.is-over { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); }

.progress { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.progress__bar { height: 100%; width: 0; background: var(--primary); transition: width .15s ease; }

@media print {
  .app-header, .sidebar, .todo__actions, .toasts { display: none !important; }
  body { background: #fff; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
