:root {
  --bg: #0b0b0c;
  --panel: #141416;
  --panel-2: #1b1b1f;
  --line: #26262b;
  --text: #ededf0;
  --muted: #8a8a93;
  --dim: #5c5c66;
  --accent: #b9f542;      /* bouwen */
  --accent-ink: #0b0b0c;
  --warn: #ff6b4a;        /* deadline */
  --blue: #6fa8ff;        /* onderhoud */
  --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { color-scheme: dark; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif; }
body { overscroll-behavior-y: contain; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
a { color: inherit; }

.app { max-width: 680px; margin: 0 auto; min-height: 100dvh; }

/* Login */
.login { padding: 30vh 24px 0; text-align: center; }
.login h1 { font-size: 28px; letter-spacing: -0.02em; margin: 0 0 24px; }
.login form { display: flex; flex-direction: column; gap: 10px; }
.login input { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 17px; }
.login button { background: var(--text); color: var(--bg); border-radius: 12px; padding: 14px; font-weight: 600; }
.err { color: var(--warn); font-size: 14px; min-height: 1em; }

/* Top */
.top { display: flex; align-items: center; justify-content: space-between; padding: calc(14px + var(--safe-t)) 18px 8px; }
.date { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; text-transform: capitalize; }
.sub { font-size: 12px; color: var(--dim); margin-top: 2px; }
.icon { width: 40px; height: 40px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); font-size: 18px; color: var(--muted); }
.icon.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Add */
.add { display: flex; gap: 8px; padding: 6px 14px 4px; position: sticky; top: 0; background: linear-gradient(var(--bg) 80%, transparent); z-index: 5; }
.add input { flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; font-size: 16px; }
.add input:focus { outline: none; border-color: var(--muted); }
.add button { width: 48px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-size: 24px; font-weight: 600; }
.add button:disabled { opacity: .5; }
.pending { padding: 4px 18px 0; font-size: 13px; color: var(--accent); }

main { padding: 8px 14px calc(90px + var(--safe-b)); }

/* Sections */
.section { margin-top: 18px; }
.section h2 { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin: 0 0 8px 4px; display: flex; justify-content: space-between; align-items: baseline; }
.section h2 .hint { letter-spacing: 0; text-transform: none; font-weight: 400; color: var(--dim); }
.note { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.note b { color: var(--text); font-weight: 600; }
.alert { background: #2a1912; border: 1px solid #4a2a1e; color: #ffb49f; border-radius: 12px; padding: 10px 12px; font-size: 14px; margin-top: 8px; }
.stale { background: #2a2512; border: 1px solid #4a4220; color: #ffd98a; border-radius: 12px; padding: 10px 12px; font-size: 14px; margin-top: 8px; }
.empty { color: var(--dim); font-size: 14px; padding: 14px 4px; }

/* Task cards */
.task { display: flex; align-items: flex-start; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 12px 12px 10px; margin-bottom: 8px; transition: opacity .25s, transform .25s; }
.task.big { padding: 18px 16px 18px 14px; border-color: #2d3a16; background: linear-gradient(160deg, #161a10, var(--panel) 70%); }
.task.deadline { border-color: #3a2420; }
.task.done { opacity: .45; }
.task.leaving { opacity: 0; transform: translateX(30px); }
.check { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--dim); margin-top: 1px; display: grid; place-items: center; color: transparent; font-size: 14px; }
.task.big .check { width: 30px; height: 30px; border-color: var(--accent); }
.task.deadline .check { border-color: var(--warn); }
.check.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.body { flex: 1; min-width: 0; }
.title { font-size: 16px; font-weight: 500; line-height: 1.3; word-wrap: break-word; }
.task.big .title { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.task.done .title { text-decoration: line-through; }
.why { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.tag { font-size: 11px; padding: 3px 8px; border-radius: 999px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.tag.bouwen { color: var(--accent); border-color: #2d3a16; }
.tag.onderhoud { color: var(--blue); border-color: #1e2a44; }
.tag.dl { color: var(--warn); border-color: #4a2a1e; }
.tag.dl.soon { background: #2a1912; }
.tag.stale { color: #ffd98a; border-color: #4a4220; }

/* Chips filter */
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; font-size: 13px; padding: 6px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Clients */
.brand { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.brand.today { border-color: #3a2420; }
.brand-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.brand-head .name { font-size: 17px; font-weight: 600; }
.brand-head .open { font-size: 12px; color: var(--dim); }
.brand-days { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--panel-2); margin-top: 10px; }
.bar i { display: block; height: 100%; }
.bar .b { background: var(--accent); } .bar .e { background: var(--blue); } .bar .c { background: var(--muted); }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.waiting { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.waiting a { display: flex; justify-content: space-between; gap: 8px; text-decoration: none; font-size: 14px; padding: 6px 0; color: var(--text); }
.waiting a span:last-child { color: var(--dim); font-size: 12px; flex: none; }
.notion-err { color: var(--warn); font-size: 14px; padding: 12px 4px; }

/* Tabs */
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; gap: 4px; padding: 8px 10px calc(10px + var(--safe-b)); background: rgba(11,11,12,.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.tabs button { flex: 1; max-width: 200px; padding: 10px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.tabs button.active { background: var(--panel-2); color: var(--text); }

/* Sheet */
.sheet { position: fixed; inset: 0; z-index: 20; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.sheet-body { position: absolute; left: 0; right: 0; bottom: 0; max-width: 680px; margin: 0 auto; background: var(--panel); border-radius: 18px 18px 0 0; padding: 8px 18px calc(18px + var(--safe-b)); border-top: 1px solid var(--line); max-height: 92dvh; overflow-y: auto; }
.handle { width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 14px; }
.e-title { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 8px 0 10px; font-size: 18px; font-weight: 600; }
.e-title:focus { outline: none; border-color: var(--muted); }
.row { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.row label { width: 90px; flex: none; font-size: 13px; color: var(--muted); }
.row input { flex: 1; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; min-width: 0; }
.seg { display: flex; flex: 1; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { flex: 1; padding: 8px; border-radius: 8px; color: var(--muted); font-size: 14px; }
.seg button.on { background: var(--text); color: var(--bg); font-weight: 600; }
.sheet-actions { display: flex; gap: 10px; margin-top: 20px; }
.sheet-actions button { flex: 1; padding: 13px; border-radius: 12px; font-weight: 600; }
.sheet-actions .primary { background: var(--accent); color: var(--accent-ink); }
.sheet-actions .danger { background: var(--panel-2); color: var(--warn); }
.meta { font-size: 12px; color: var(--dim); margin-top: 12px; text-align: center; }

.toast { position: fixed; left: 50%; bottom: calc(80px + var(--safe-b)); transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; z-index: 30; animation: toast 2.4s forwards; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 10px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

/* Pomodoro timer */
.timer { display: flex; gap: 14px; align-items: center; margin: 8px 14px 0; padding: 12px 14px; background: linear-gradient(160deg, #161a10, var(--panel) 70%); border: 1px solid #2d3a16; border-radius: var(--radius); }
.timer.paused { border-color: var(--line); background: var(--panel); }
.timer-ring { position: relative; width: 76px; height: 76px; flex: none; }
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-ring .bg { fill: none; stroke: var(--line); stroke-width: 7; }
.timer-ring .fg { fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 282.7; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear; }
.timer.paused .fg { stroke: var(--muted); }
.timer.over .fg { stroke: var(--warn); }
.timer-clock { position: absolute; inset: 0; display: grid; place-items: center; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.timer-body { flex: 1; min-width: 0; }
.timer-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.timer-ctl { display: flex; gap: 6px; margin-top: 8px; }
.timer-ctl button { width: 42px; height: 34px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); font-size: 14px; font-weight: 600; }
.timer-ctl #tDone { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.timer-ctl #tStop { color: var(--muted); }

/* Play knop op kaart */
.play { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); font-size: 13px; display: grid; place-items: center; align-self: center; }
.play.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.task.big .play { width: 40px; height: 40px; }
.tag.pomo { font-variant-numeric: tabular-nums; }
.tag.pomo.over { color: var(--warn); border-color: #4a2a1e; }

/* Tijd tab */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.stat .v { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }
.stat.b .v { color: var(--accent); } .stat.o .v { color: var(--blue); }
.days { display: flex; gap: 4px; align-items: flex-end; height: 90px; padding: 0 2px; }
.day { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; height: 100%; }
.day .col { width: 100%; display: flex; flex-direction: column-reverse; border-radius: 4px 4px 0 0; overflow: hidden; }
.day .col i { display: block; width: 100%; }
.day .col .b { background: var(--accent); } .day .col .o { background: var(--blue); }
.day .lbl { font-size: 10px; color: var(--dim); }
.day.today .lbl { color: var(--text); font-weight: 600; }
.trow { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 6px; font-size: 14px; }
.trow .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .n { font-variant-numeric: tabular-nums; color: var(--muted); flex: none; }
.trow .n.over { color: var(--warn); }

/* Stappenlijst */
.step .num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 1px; }
.step.big .num { width: 30px; height: 30px; background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-size: 14px; }
.step.deadline.big .num { background: var(--warn); border-color: var(--warn); color: #fff; }
.step .check.step-done { align-self: center; }

/* Hero: doe nu dit */
.hero { margin-top: 14px; padding: 20px 18px 16px; border-radius: 20px; background: linear-gradient(165deg, #1a2210, #121214 60%); border: 1px solid #2d3a16; }
.hero.deadline { background: linear-gradient(165deg, #2a1712, #121214 60%); border-color: #4a2a1e; }
.hero.onderhoud { background: linear-gradient(165deg, #121a2a, #121214 60%); border-color: #1e2a44; }
.hero-label { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.hero.deadline .hero-label { color: var(--warn); } .hero.onderhoud .hero-label { color: var(--blue); }
.hero-title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin-top: 8px; }
.hero-detail { font-size: 15px; color: var(--muted); margin-top: 8px; line-height: 1.4; }
.bar-wrap { height: 8px; border-radius: 4px; background: var(--panel-2); margin-top: 16px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width 1s linear; }
.hero.deadline .bar-fill { background: var(--warn); } .hero.onderhoud .bar-fill { background: var(--blue); }
.hero-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 8px; font-variant-numeric: tabular-nums; }
.hero-actions { display: flex; gap: 8px; margin-top: 14px; }
.hbtn { flex: 1; padding: 13px; border-radius: 12px; font-weight: 600; font-size: 15px; }
.hbtn.start { background: var(--text); color: var(--bg); }
.hbtn.start.on { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.hbtn.done { background: var(--accent); color: var(--accent-ink); }
.hero.deadline .hbtn.done { background: var(--warn); color: #fff; }
.footnote { font-size: 13px; color: var(--dim); padding: 14px 6px 0; line-height: 1.45; }
