:root {
    --bg: #f6f5f2; --surface: #ffffff; --surface-2: #efede8; --text: #1d1c1a; --muted: #6b675f;
    --line: #e2dfd8; --accent: #2f5d50; --accent-ink: #ffffff;
    --hot: #b4412f; --hot-bg: #f8e4df; --mid: #9a6a12; --mid-bg: #f6ecd2; --low: #4a6a8a; --low-bg: #e3ebf3;
    --ok: #2f7a4f; --radius: 12px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #151513; --surface: #1f1e1b; --surface-2: #2a2926; --text: #ecebe6; --muted: #a09c93;
        --line: #34322e; --accent: #6fb49f; --accent-ink: #10201b;
        --hot: #f0907f; --hot-bg: #3a211c; --mid: #e3b657; --mid-bg: #3a2f17; --low: #8fb2d4; --low-bg: #1f2c3a;
        --ok: #6fc28f;
    }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.45; }
h1, h2, h3 { margin: 0; }
.muted { color: var(--muted); font-size: .9rem; margin: .25rem 0 0; }

.shell { max-width: 1280px; margin: 0 auto; padding: 24px 16px 64px; }
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.top h1 { font-size: 1.7rem; letter-spacing: -.02em; }

.btn { font: inherit; border: 1px solid var(--line); background: var(--surface); color: var(--text);
    padding: .55rem .9rem; border-radius: 8px; cursor: pointer; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.small { padding: .3rem .6rem; font-size: .85rem; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; }
.tile .num { font-size: 2rem; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile .lbl { color: var(--muted); font-size: .85rem; }
.tile.hot .num { color: var(--hot); }
.tile.ok .num { color: var(--ok); }

.progress-wrap { margin: 18px 0 26px; }
.progress-head { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: 6px; }
.progress { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar { height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .6s ease; }

.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.col { background: var(--surface-2); border-radius: var(--radius); padding: 12px; min-height: 120px; }
.col h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; display: flex; gap: 8px; align-items: center; }
.count { background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 0 .5rem; font-size: .75rem; color: var(--text); }
.empty { color: var(--muted); font-size: .9rem; margin: .5rem 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--low); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.card.prio-hoog { border-left-color: var(--hot); }
.card.prio-normaal { border-left-color: var(--mid); }
.card h3 { font-size: 1rem; margin: 6px 0 2px; }
.card-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.from { color: var(--muted); font-size: .82rem; margin: 0 0 6px; overflow-wrap: anywhere; }
.summary { font-size: .88rem; margin: 0 0 8px; }
.due { font-size: .78rem; color: var(--muted); }
.draft { display: inline-block; font-size: .8rem; color: var(--accent); margin-bottom: 8px; }
.card-actions { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.badge { font-size: .72rem; font-weight: 600; padding: .1rem .5rem; border-radius: 99px; }
.badge.hoog { background: var(--hot-bg); color: var(--hot); }
.badge.normaal { background: var(--mid-bg); color: var(--mid); }
.badge.laag { background: var(--low-bg); color: var(--low); }

select, input[type=text], input[type=email], input[type=password], input:not([type]) {
    font: inherit; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: .45rem .6rem; }
.card-actions select { font-size: .85rem; padding: .3rem .4rem; }

.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-top: 26px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.panel summary { cursor: pointer; font-weight: 600; }
.list { list-style: none; padding: 0; margin: 10px 0 0; }
.list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.list li div { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.tag { display: inline-block; font-size: .72rem; background: var(--surface-2); border-radius: 6px; padding: .05rem .4rem; margin-right: 6px; }
.rule-form { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.rule-form input { flex: 1; min-width: 160px; }

dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); max-width: 420px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
.dialog-actions { display: grid; gap: 8px; margin-top: 14px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg);
    padding: .6rem 1rem; border-radius: 10px; font-size: .9rem; max-width: calc(100% - 32px); }
.toast[hidden] { display: none; }

body.auth { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; width: 100%; max-width: 380px; }
.auth-card h1 { margin-bottom: 6px; }
.auth-card form { display: grid; gap: 14px; margin-top: 16px; }
.auth-card label { display: grid; gap: 4px; font-size: .9rem; }
.alert { background: var(--hot-bg); color: var(--hot); padding: .6rem .8rem; border-radius: 8px; font-size: .9rem; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.1rem; background: var(--surface-2); padding: .6rem .8rem; border-radius: 8px; overflow-wrap: anywhere; }

@media (max-width: 1000px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .board { grid-template-columns: 1fr; } .top h1 { font-size: 1.4rem; } }
