/* ==========================================================================
   KappersFlow — moderne UI (2026 refresh)
   Glas-effecten, zachte schaduwen, soepele animaties, dark mode.
   ========================================================================== */

:root {
    --bg: #f4f6fb;
    --panel: #ffffff;
    --panel-2: #f9fafc;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e6e9f2;
    --line-strong: #d9deea;

    --accent: #0c66e4;
    --accent-2: #579dff;
    --accent-hover: #0055cc;
    --accent-soft: #e9f2ff;
    --accent-ink: #0055cc;
    --gradient: linear-gradient(135deg, #0c66e4 0%, #0055cc 100%);

    /* Trello-achtige bord-canvas */
    --board-bg: var(--bg);
    --klist-bg: #f1f2f4;
    --kcard-bg: #ffffff;
    --kcard-ink: #172b4d;
    --kcard-muted: #44546f;
    --kcard-shadow: 0 1px 1px rgba(9,30,66,.25), 0 0 1px rgba(9,30,66,.31);

    --danger: #e11d48;
    --danger-soft: #ffe4e6;
    --ok: #059669;
    --ok-soft: #d1fae5;
    --warn: #d97706;
    --warn-soft: #fef3c7;
    --info-soft: #e0e7ff;
    --info-ink: #3730a3;

    --radius: 8px;
    --radius-lg: 12px;
    --radius-sm: 6px;

    --shadow-sm: 0 1px 1px rgba(9,30,66,.13), 0 0 1px rgba(9,30,66,.13);
    --shadow: 0 4px 8px -2px rgba(9,30,66,.25), 0 0 1px rgba(9,30,66,.31);
    --shadow-lg: 0 8px 24px -6px rgba(9,30,66,.31), 0 0 1px rgba(9,30,66,.31);
    --shadow-glow: 0 0 0 2px rgba(12,102,228,.25);

    --topbar-h: 58px;
    --ease: cubic-bezier(.22,1,.36,1);
}

/* ---------- dark mode ---------- */
html[data-theme="dark"] {
    --bg: #0b1120;
    --panel: #151b2e;
    --panel-2: #1a2138;
    --ink: #e8ecf7;
    --muted: #8b94ad;
    --line: #262f4d;
    --line-strong: #303a5c;
    --accent: #579dff;
    --accent-hover: #85b8ff;
    --accent-soft: #1c2b41;
    --accent-ink: #85b8ff;
    --info-soft: #1c2b41;
    --info-ink: #85b8ff;
    --danger-soft: #4c1d2f;
    --ok-soft: #064e3b;
    --warn-soft: #4a3512;
    --klist-bg: #161a1d;
    --kcard-bg: #22272b;
    --kcard-ink: #b6c2cf;
    --kcard-muted: #8c9bab;
    --kcard-shadow: 0 1px 1px rgba(3,4,4,.7), 0 0 1px rgba(3,4,4,.8);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --shadow: 0 4px 16px -2px rgba(0,0,0,.45);
    --shadow-lg: 0 24px 48px -12px rgba(0,0,0,.6);
}
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) { color-scheme: dark; }
    html:not([data-theme="light"]) {
        --bg: #0b1120; --panel: #151b2e; --panel-2: #1a2138; --ink: #e8ecf7;
        --muted: #8b94ad; --line: #262f4d; --line-strong: #303a5c;
        --accent: #579dff; --accent-hover: #85b8ff; --accent-soft: #1c2b41; --accent-ink: #85b8ff;
        --info-soft: #1c2b41; --info-ink: #85b8ff; --danger-soft: #4c1d2f;
        --ok-soft: #064e3b; --warn-soft: #4a3512;
        --klist-bg: #161a1d; --kcard-bg: #22272b; --kcard-ink: #b6c2cf;
        --kcard-muted: #8c9bab;
        --kcard-shadow: 0 1px 1px rgba(3,4,4,.7), 0 0 1px rgba(3,4,4,.8);
        --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
        --shadow: 0 4px 16px -2px rgba(0,0,0,.45);
        --shadow-lg: 0 24px 48px -12px rgba(0,0,0,.6);
    }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    transition: background .25s, color .25s;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; margin: 0; display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 15px; margin: 0 0 10px; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 14px; margin: 0 0 8px; font-weight: 650; }
h4 { font-size: 11px; margin: 0 0 6px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
img { max-width: 100%; }
code { background: var(--accent-soft); padding: 2px 6px; border-radius: 6px; font-size: 12px; color: var(--accent-ink); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pad { padding: 0 12px; }
.right { text-align: right; }
.spacer { flex: 1; }
.danger-text { color: var(--danger); font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.muted-link { color: var(--muted); }

/* pagina-fade bij laden */
.content > * { animation: fadeUp .25s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- scrollbars ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- knoppen ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 6px; justify-content: center;
    padding: 6px 12px; border: 0; border-radius: var(--radius-sm);
    background: var(--panel-2); color: var(--ink); font-size: 14px; font-weight: 500;
    cursor: pointer; font-family: inherit; min-height: 36px;
    transition: background .15s; white-space: nowrap;
    box-shadow: inset 0 0 0 1px var(--line-strong);
}
.btn:hover { background: var(--line); text-decoration: none; }
.btn:active { background: var(--line-strong); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: none; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { background: var(--danger); color: #fff; box-shadow: none; }
.btn-danger:hover { background: #b30f3d; }
.btn-sm { padding: 4px 10px; min-height: 32px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-google { gap: 8px; }
.linklike { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: inherit; padding: 0; font-family: inherit; }
.linklike.danger, .danger { color: var(--danger); }
.icon-btn { background: none; border: 0; cursor: pointer; font-size: 17px; position: relative; width: 32px; height: 32px; border-radius: var(--radius-sm); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; transition: background .15s; }
.icon-btn.sm { font-size: 13px; width: 26px; height: 26px; }
.icon-btn:hover { background: rgba(9,30,66,.08); text-decoration: none; }
html[data-theme="dark"] .icon-btn:hover { background: rgba(255,255,255,.1); }
.inline { display: inline; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.row { display: flex; gap: 12px; }
.row > label { flex: 1; }
.badge {
    position: absolute; top: -2px; right: -2px; background: var(--accent); color: #fff;
    font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center; padding: 0 5px;
    border: 2px solid var(--panel); box-sizing: content-box;
}
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); font-size: 11px; font-weight: 600; color: var(--accent-ink); }
.pill.done { background: var(--ok-soft); color: var(--ok); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }

/* ---------- formulieren ---------- */
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 12px 0 0; }
input, select, textarea {
    width: 100%; padding: 8px 12px; border: 2px solid var(--line-strong); border-radius: var(--radius-sm);
    font: inherit; margin-top: 5px; background: var(--panel-2); color: var(--ink);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: none; background: var(--panel); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .7; }
input[type="checkbox"], input[type="file"], input[type="color"], input[type="datetime-local"], input[type="date"], input[type="search"], input[type="number"] { width: auto; }
input[type="checkbox"] { accent-color: var(--accent); width: 17px; height: 17px; }
.checkline { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--ink); }
.inline-form input, .inline-form select { width: auto; }

/* ---------- topbar (glas) ---------- */
.topbar {
    height: var(--topbar-h); display: flex; align-items: center; gap: 14px; padding: 0 18px;
    position: sticky; top: 0; z-index: 50;
    background: var(--panel);
    background: color-mix(in srgb, var(--panel) 82%, transparent);
    backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
    border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; color: var(--ink); font-size: 16px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 30px; width: 30px; object-fit: contain; border-radius: 8px; }
.hamburger { display: none; background: none; border: 0; font-size: 20px; cursor: pointer; color: var(--ink); border-radius: 8px; }
.topbar-search { flex: 1; max-width: 440px; position: relative; }
.topbar-search input {
    width: 100%; margin: 0; border-radius: 999px; background: var(--panel-2);
    border-color: var(--line); padding-left: 16px;
}
.topbar-search input:focus { background: var(--panel); }
.search-suggest {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--panel);
    border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 60;
    overflow: hidden;
}
.suggest-item { display: block; padding: 10px 14px; color: var(--ink); font-size: 13px; }
.suggest-item:hover { background: var(--accent-soft); text-decoration: none; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ---------- dropdown ---------- */
.dropdown { position: relative; }
.dropdown-menu {
    display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 200px;
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); z-index: 70; padding: 6px; text-align: left;
    animation: popIn .15s var(--ease);
}
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.dropdown-right { left: auto; right: 0; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none; border-radius: 8px; color: var(--ink); font-size: 13px; cursor: pointer; font-family: inherit; }
.dropdown-item:hover { background: var(--accent-soft); text-decoration: none; }
.dropdown-head { padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 13px; }
.avatar-btn { background: none; border: 0; cursor: pointer; padding: 0; border-radius: 50%; transition: box-shadow .15s; }
.avatar-btn:hover { box-shadow: var(--shadow-glow); }

/* ---------- avatar ---------- */
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; display: inline-block; }
.avatar-initials { display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.xs { width: 20px; height: 20px; font-size: 9px; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-row { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }

/* ---------- layout ---------- */
.shell { display: flex; min-height: calc(100vh - var(--topbar-h)); }
.sidebar {
    width: 232px; flex-shrink: 0; padding: 16px 10px; overflow-y: auto;
    background: transparent; border-right: 1px solid var(--line);
}
.sidebar-heading { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 10px 6px; font-weight: 700; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 6px 12px; border-radius: var(--radius-sm); color: var(--muted); font-size: 14px; font-weight: 500; transition: background .15s; }
.nav-item:hover { background: rgba(9,30,66,.06); color: var(--ink); text-decoration: none; }
html[data-theme="dark"] .nav-item:hover { background: rgba(255,255,255,.08); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-ink); }
.nav-item.ws-sub { padding-left: 34px; font-size: 13px; color: var(--muted); }
.nav-item.ws-sub::before { content: "▸"; margin-right: 2px; opacity: .5; }
.ws-dot { width: 10px; height: 10px; border-radius: 4px; display: inline-block; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.ws-dot.lg, .project-dot.lg { width: 14px; height: 14px; }
.content { flex: 1; padding: 24px; min-width: 0; max-width: 1500px; }

/* ---------- flash/toast ---------- */
.flash { padding: 11px 15px; border-radius: var(--radius); margin-bottom: 12px; font-size: 13px; font-weight: 500; border: 1px solid transparent; }
.flash-success { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.flash-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.flash-info { background: var(--info-soft); color: var(--info-ink); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.toast-root { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 12px; opacity: 0; transform: translateY(8px); transition: all .3s var(--ease); box-shadow: var(--shadow-lg); font-weight: 500; }
.toast.show { opacity: 1; transform: none; }
.toast-error { background: var(--danger); color: #fff; }

/* ---------- panelen & statistieken ---------- */
.panel {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow-sm);
    transition: border-color .15s, background .25s;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px; display: flex; flex-direction: column; gap: 2px; color: var(--ink);
    box-shadow: var(--shadow-sm); transition: box-shadow .15s;
}
.stat:hover { text-decoration: none; box-shadow: var(--shadow); }
.stat b { font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat.warn b { color: var(--warn); }
.stat.urgent b { color: var(--danger); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }

.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.view-tabs { display: flex; gap: 2px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 3px; }
.view-tabs a { padding: 6px 14px; border-radius: var(--radius-sm); color: var(--muted); font-size: 13px; font-weight: 550; transition: background .15s; }
.view-tabs a.active { background: var(--panel); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm); }
.view-tabs a:not(.active):hover { color: var(--ink); text-decoration: none; }

/* ---------- tabellen ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; padding: 9px 12px; border-bottom: 2px solid var(--line); color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--panel-2); }
.table tr.overdue td { background: var(--warn-soft); }

/* ---------- tags, prioriteiten ---------- */
.tag { padding: 2px 9px; border-radius: 4px; background: var(--accent-soft); background: color-mix(in srgb, var(--c, #0c66e4) 14%, transparent); color: var(--ink); font-size: 11px; font-weight: 550; }
.due { font-size: 11px; color: var(--muted); }
.due.overdue { color: var(--danger); font-weight: 700; }
.prio { font-size: 11px; padding: 2px 8px; border-radius: 7px; font-weight: 700; }
.prio-geen { background: var(--panel-2); color: var(--muted); }
.prio-laag { background: #e0f2fe; color: #0369a1; }
.prio-normaal { background: var(--accent-soft); color: var(--accent-ink); }
.prio-hoog { background: var(--warn-soft); color: var(--warn); }
.prio-urgent { background: var(--danger-soft); color: var(--danger); }
html[data-theme="dark"] .prio-laag { background: #0c2f44; color: #7dd3fc; }
.progress { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 6px 0; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s var(--ease); }
.progress.flex { flex: 1; margin: 0 8px; }
.bar-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }

/* ---------- kaarttegels (projecten/borden) ---------- */
.project-card, .board-card {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px; display: flex; flex-direction: column; gap: 6px; color: var(--ink); position: relative;
    box-shadow: var(--shadow-sm); transition: box-shadow .15s;
}
.project-card:hover, .board-card:hover { text-decoration: none; box-shadow: var(--shadow); }
.project-dot { width: 10px; height: 10px; border-radius: 4px; display: inline-block; margin-right: 4px; }
.status-pill { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 4px; background: var(--panel-2); background: color-mix(in srgb, var(--c, #64748b) 14%, transparent); color: var(--c, #64748b); align-self: flex-start; }
.star { position: absolute; top: 12px; right: 14px; color: #f59e0b; }

.task-list, .notif-list, .ws-list, .activity-list, .invite-list, .result-list, .comment-list, .attach-list, .check-items { list-style: none; margin: 0; padding: 0; }
.task-list li, .notif-list li, .ws-list li { padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.notif-list li { flex-direction: row; justify-content: space-between; align-items: flex-start; gap: 10px; }
.notif-list li.unread { background: var(--accent-soft); margin: 0 -18px; padding: 9px 18px; border-radius: var(--radius); border-bottom-color: transparent; }
.task-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ws-list li { flex-direction: row; align-items: center; gap: 8px; }
.ws-list li.archived { opacity: .5; }
.member-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 550; }
.chip.clickable { cursor: pointer; }
.chip.clickable:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.label-dot { width: 10px; height: 10px; border-radius: 4px; display: inline-block; }
.activity-list li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.activity-list li small { color: var(--muted); margin-left: 6px; }

/* ---------- kanban (Trello-look) ---------- */
.board-wrap {
    margin: -24px; padding: 18px 20px 90px;
    min-height: calc(100vh - var(--topbar-h));
    background: var(--board-bg);
}

.kanban {
    display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 16px;
    align-items: flex-start; touch-action: pan-x pan-y;
}
.klist {
    background: var(--klist-bg);
    border-radius: 12px;
    width: 272px; flex-shrink: 0; padding: 8px;
    max-height: calc(100vh - 190px); display: flex; flex-direction: column;
    box-shadow: var(--kcard-shadow);
}
.klist-head { display: flex; align-items: center; gap: 6px; padding: 8px 8px 6px; cursor: default; }
.klist-head b { flex: 1; font-size: 14px; font-weight: 600; color: var(--kcard-ink); }
.klist-head .count { color: var(--kcard-muted); font-size: 12px; font-weight: 500; }
.klist-head .icon-btn { color: var(--kcard-muted); }
.klist-head .icon-btn:hover { background: rgba(9,30,66,.08); }
html[data-theme="dark"] .klist-head .icon-btn:hover { background: rgba(255,255,255,.1); }
.klist-head[data-list-handle] { cursor: grab; touch-action: none; }
.klist-cards { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 8px; flex: 1; padding: 0 4px 4px; scrollbar-width: thin; }
.klist-cards.drop-hint { outline: 2px dashed var(--accent); outline-offset: -2px; border-radius: 8px; }
.kcard {
    background: var(--kcard-bg); color: var(--kcard-ink);
    border-radius: 8px; padding: 8px 12px 6px; cursor: pointer;
    box-shadow: var(--kcard-shadow); position: relative; border: 0;
    transition: box-shadow .12s var(--ease);
}
.kcard:hover { box-shadow: var(--kcard-shadow), inset 0 0 0 2px var(--accent); transform: none; }
.kcard.overdue .due { color: var(--danger); font-weight: 700; }
.kcard.done { opacity: .65; }
.kcard.done .kcard-title { text-decoration: line-through; }
.kcard-title { font-size: 14px; font-weight: 400; line-height: 1.45; }
.kcard-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.klabel {
    display: inline-block; min-width: 40px; height: 8px; border-radius: 4px;
    font-size: 0; vertical-align: top; transition: height .15s var(--ease), min-width .15s;
}
.klist:hover .klabel, .kcard:active .klabel {
    height: auto; min-width: 0; font-size: 12px; line-height: 20px; padding: 0 8px;
    color: #fff; font-weight: 600;
}
.kcard-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 4px; font-size: 12px; color: var(--kcard-muted); align-items: center; }
.kcard-meta .sub.done { color: var(--ok); font-weight: 600; }
.kcard-meta .due { padding: 2px 6px; border-radius: 4px; }
.kcard-meta .due.overdue { background: var(--danger); color: #fff; }
.kcard .prio { font-size: 11px; padding: 1px 6px; border-radius: 4px; }
.kcard-members { display: flex; gap: 3px; margin: 4px 0 2px; justify-content: flex-end; }
.kcard-members .avatar { box-shadow: 0 0 0 2px var(--kcard-bg); }
.kcard.drag-src { opacity: .4; }
.kcard .drag-grip { display: none; position: absolute; right: 4px; top: 4px; color: var(--kcard-muted); font-size: 14px; padding: 6px; cursor: grab; touch-action: none; }
body.bulk-mode .kcard .drag-grip { display: none !important; }
@media (pointer: coarse) { .kcard .drag-grip { display: block; } }
.drag-ghost { position: fixed; z-index: 1000; pointer-events: none; opacity: .95; box-shadow: var(--shadow-lg); transform: rotate(3deg); border-radius: 8px; }
.dragging { user-select: none; }
.bulk-check { display: none; position: absolute; top: 6px; right: 6px; margin: 0; z-index: 2; }
body.bulk-mode .bulk-check { display: block; }
.bulk-bar {
    position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
    background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 12px;
    display: flex; gap: 12px; align-items: center; z-index: 80; box-shadow: var(--shadow-lg);
}
.bulk-bar .btn { min-height: 34px; }
.bulk-bar form { display: flex; gap: 8px; margin: 0; }
.bulk-bar select { margin: 0; background: var(--panel-2); color: var(--ink); }

/* "+ Kaart toevoegen" als Trello ghost-button */
.add-card input {
    background: transparent; border: 0; margin: 0; padding: 8px 10px; border-radius: 8px;
    color: var(--kcard-muted); font-weight: 500; font-size: 14px;
}
.add-card input::placeholder { color: var(--kcard-muted); font-weight: 500; }
.add-card:hover input, .add-card input:hover { background: rgba(9,30,66,.08); }
html[data-theme="dark"] .add-card:hover input { background: rgba(255,255,255,.08); }
.add-card input:focus { background: var(--kcard-bg); color: var(--kcard-ink); box-shadow: var(--kcard-shadow); }
.add-card input:focus::placeholder { color: transparent; }

/* "+ Lijst toevoegen" als transparante Trello-tegel */
.add-list { background: var(--panel-2); border: 1px dashed var(--line-strong); box-shadow: none; }
html[data-theme="dark"] .add-list { background: var(--panel-2); }
.add-list form { display: flex; flex-direction: column; gap: 8px; padding: 4px; }
.add-list input { margin: 0; background: var(--kcard-bg); color: var(--kcard-ink); border: 0; box-shadow: var(--kcard-shadow); }

/* ---------- prullenbak ---------- */
.trash-panel { max-width: 720px; }
.trash-list { list-style: none; margin: 0; padding: 0; }
.trash-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.trash-list li:last-child { border-bottom: 0; }
.trash-info { min-width: 0; }
.trash-actions { display: flex; gap: 8px; flex-shrink: 0; }
.trash-actions form { margin: 0; }

/* ---------- kaart-detail / modal ---------- */
.modal {
    position: fixed; inset: 0; background: rgba(10,14,26,.5); z-index: 100;
    display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px;
    overflow-y: auto; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal[hidden] { display: none; }
body.modal-open { overflow: hidden; }
.modal-card {
    background: var(--panel); border-radius: var(--radius-lg); padding: 22px; width: 100%;
    max-width: 460px; box-shadow: var(--shadow-lg); border: 1px solid var(--line);
    animation: popIn .2s var(--ease);
}
.card-modal-card { max-width: 900px; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }
.card-detail-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-grid { display: grid; grid-template-columns: 1fr 240px; gap: 22px; }
.card-section { border-top: 1px solid var(--line); padding: 16px 0; }
.checklist { margin-bottom: 16px; }
.checklist-head { display: flex; align-items: center; gap: 8px; }
.check-items li { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.check-items li.done .check-text { text-decoration: line-through; color: var(--muted); }
.check-toggle { background: none; border: 0; cursor: pointer; font-size: 17px; padding: 0 5px; color: var(--muted); }
.check-toggle:hover { color: var(--accent); }
.comment-list li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.comment-body { flex: 1; }
.comment-body p { margin: 4px 0 0; }
.attach-list li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.attach-thumb { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.side-block { margin-bottom: 18px; }

/* ---------- kalender ---------- */
.calendar { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-sm); }
.cal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cal-head h2 { margin: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-days b { font-size: 10px; text-transform: uppercase; color: var(--muted); text-align: center; letter-spacing: .05em; }
.cal-cell { min-height: 92px; border: 1px solid var(--line); border-radius: 10px; padding: 5px; overflow: hidden; background: var(--panel-2); transition: border-color .15s; }
.cal-cell:hover { border-color: var(--accent); }
.cal-cell.empty { border: 0; background: transparent; }
.cal-cell.today { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--shadow-glow); }
.cal-day { font-size: 11px; font-weight: 700; color: var(--muted); }
.cal-cell.today .cal-day { color: var(--accent); }
.cal-event { display: block; font-size: 11px; font-weight: 550; padding: 2px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--ink); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event:hover { text-decoration: none; filter: brightness(.97); }
.cal-event.overdue { background: var(--danger-soft); color: var(--danger); }
.cal-event.prio-urgent { background: var(--danger-soft); color: var(--danger); }
.cal-event.prio-hoog { background: var(--warn-soft); color: var(--warn); }

/* ---------- tijdlijn ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.timeline li.overdue .tl-dates { color: var(--danger); font-weight: 600; }
.timeline li.done { opacity: .55; }
.tl-dates { min-width: 180px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-body { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- overig ---------- */
.pagination { display: flex; gap: 5px; margin-top: 14px; }
.pagination a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font-weight: 550; }
.pagination a:hover { border-color: var(--accent); text-decoration: none; }
.pagination a.active { background: var(--accent); color: #fff; border-color: transparent; }
.error-page { text-align: center; padding: 90px 20px; }
.error-page h1 { font-size: 72px; justify-content: center; font-weight: 800; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.log-view { white-space: pre-wrap; font-size: 12px; max-height: 60vh; overflow: auto; background: var(--panel-2); padding: 14px; border-radius: var(--radius); font-family: ui-monospace, "SF Mono", Consolas, monospace; }
.print-card { max-width: 700px; margin: 30px auto; font-family: Arial, sans-serif; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 16px 0; }
.divider::before, .divider::after { content: ''; flex: 1; border-top: 1px solid var(--line); }

/* ---------- auth ---------- */
.auth-body {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
    background: #f7f8f9;
}
html[data-theme="dark"] .auth-body { background: var(--bg); }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .auth-body { background: var(--bg); } }
.auth-card {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 32px 40px; width: 100%; max-width: 400px; box-shadow: var(--shadow);
}
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; margin-bottom: 20px; letter-spacing: -.02em; }
.auth-form { margin-bottom: 10px; }
.auth-links { display: flex; justify-content: space-between; font-size: 13px; margin-top: 16px; }

/* ---------- responsive ---------- */

/* Tablet & kleine laptop (≤900px) */
@media (max-width: 900px) {
    .grid-2 { grid-template-columns: 1fr; }
    .card-grid { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; left: 0; top: var(--topbar-h); bottom: 0; z-index: 95;
        transform: translateX(-100%); transition: transform .25s var(--ease);
        width: 270px; background: var(--panel); box-shadow: none;
    }
    .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
    .sidebar-scrim {
        position: fixed; inset: var(--topbar-h) 0 0 0; background: rgba(10,14,26,.45);
        z-index: 94; opacity: 0; pointer-events: none; transition: opacity .2s;
        backdrop-filter: blur(3px);
    }
    body.sidebar-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
    body.sidebar-open { overflow: hidden; }
    .hamburger { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; }
    .topbar { gap: 8px; padding: 0 10px; }
    .topbar-search input { font-size: 16px; }
    .content { padding: 14px; min-height: calc(100vh - var(--topbar-h)); }
    .board-wrap { margin: -14px; padding: 14px; }
    .klist { width: min(272px, 80vw); max-height: calc(100vh - 195px); }
    .modal { padding: 0; align-items: stretch; }
    .modal-card { max-width: 100%; border-radius: 0; min-height: 100dvh; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
    .cal-cell { min-height: 62px; }
    .tl-dates { min-width: 110px; }
    .table { font-size: 12px; }
    .toast-root { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); }
    .toast { text-align: center; }
    .bulk-bar { left: 10px; right: 10px; transform: none; width: auto; flex-wrap: wrap; }
    .view-tabs { overflow-x: auto; max-width: 100%; }
}

/* Telefoon (≤640px) */
@media (max-width: 640px) {
    body { font-size: 13px; }
    h1 { font-size: 17px; }

    .btn, .dropdown-item, .nav-item, .pagination a { min-height: 42px; }
    .btn-sm { min-height: 38px; padding: 6px 12px; }
    .icon-btn { width: 40px; height: 40px; font-size: 19px; }
    input, select, textarea { font-size: 16px; padding: 11px 13px; }
    .check-toggle { font-size: 22px; padding: 4px 8px; }

    .brand span { display: none; }
    .topbar-search { position: static; }
    .topbar-search .search-suggest { position: fixed; left: 10px; right: 10px; top: var(--topbar-h); }

    .content { padding: 10px; }
    .board-wrap { margin: -10px; padding: 10px; }
    .panel { padding: 14px; border-radius: var(--radius); }
    .page-head { flex-direction: column; align-items: stretch; }
    .page-actions { justify-content: flex-start; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat { padding: 12px; }
    .stat b { font-size: 19px; }

    .row { flex-direction: column; gap: 0; }

    .kanban { gap: 10px; padding: 4px 4px 14px; scroll-snap-type: x mandatory; }
    .klist { width: 86vw; scroll-snap-align: start; }
    .kcard { padding: 13px; }

    .card-grid { gap: 12px; }
    .card-side { order: 2; border-top: 1px solid var(--line); padding-top: 14px; }

    .calendar { padding: 10px; }
    .cal-cell { min-height: 54px; padding: 3px; border-radius: 8px; }
    .cal-event { font-size: 10px; padding: 1px 4px; }

    .timeline li { flex-direction: column; gap: 2px; }
    .tl-dates { min-width: 0; }

    .table-wrap { margin: 0 -12px; padding: 0 12px; }

    .notif-list li { flex-direction: column; gap: 6px; }
    .ws-list li { flex-wrap: wrap; }

    .auth-card { padding: 22px; border-radius: 16px; }
    .auth-body { align-items: flex-start; padding-top: 8vh; }
}

/* Print: nette kaart zonder UI-chroom */
@media print {
    .topbar, .sidebar, .sidebar-scrim, .bulk-bar, .toast-root, .hamburger { display: none !important; }
    .content { padding: 0; }
    .board-wrap { margin: 0; padding: 0; background: #fff; }
    body { background: #fff; }
}

/* Verminderde animaties respecteren */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
