/* Weekly Review — Dionysius Analytics palette (assets/auth.css), calm and roomy.
   Layout follows design-explorations/weeklyreview-deze-week-A.reference.html. */

:root {
  --bg: #FBF7F0;
  --bg-alt: #F4EDE1;
  --track: #EDE5D7;
  --card: #ffffff;
  --ink: #16233F;
  --ink-soft: #3D4A63;
  --muted: #5F6673;
  --line: #E7DFD1;
  --line-soft: #F0E9DD;
  --accent: #E07124;
  --accent-text: #B9551A;
  --accent-soft: #FBE3CC;
  --accent-deep: #8A3E12;
  --plum: #5A2A5D;
  --plum-soft: #F1E6F1;
  --series: #2F5FA8;
  --danger: #A8321E;
  --ok: #1F6B45;
  --radius: 14px;
  --font: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --tabs-h: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ink); }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
main:focus, h1:focus { outline: none; }

.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; text-decoration: none; }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Shell ---------- */
.topbar { background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 760px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; letter-spacing: -0.02em; text-decoration: none; }
.brand-mark { width: 10px; height: 10px; border-radius: 2px; background: var(--accent); }
.save-status { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.save-status.is-error { color: var(--danger); font-weight: 600; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: #fff; border-top: 1px solid var(--line);
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
}
.tabs a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0; font-size: 11.5px; font-weight: 500; color: var(--muted); text-decoration: none; border-radius: 10px;
}
.tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.tabs a[aria-current="page"] svg { stroke-width: 2.2; }

main { max-width: 760px; margin: 0 auto; padding: 20px 16px calc(var(--tabs-h) + 40px + env(safe-area-inset-bottom)); }

@media (min-width: 860px) {
  .tabs { position: static; display: flex; gap: 4px; padding: 0; border: 0; background: none; margin-left: 24px; }
  .tabs a { flex-direction: row; gap: 7px; font-size: 14px; padding: 8px 12px; }
  .tabs a[aria-current="page"] { background: var(--bg-alt); }
  .tabs svg { width: 18px; height: 18px; }
  main { padding: 36px 16px 80px; }
}


.boot { min-height: 60vh; display: grid; place-content: center; gap: 14px; text-align: center; color: var(--muted); padding: 24px; }

/* ---------- Generic pieces ---------- */
.eyebrow { font-size: 12.5px; color: var(--muted); }
.h1 { font-size: 22px; font-weight: 600; }
.lead { color: var(--ink-soft); margin-top: 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.section { margin-top: 28px; }
.section-h { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin: 0 0 8px; }
.section-h.section { margin-top: 28px; }
.h2 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.stack > * + * { margin-top: 12px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 12px; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.card-h h3 { font-size: 16px; font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--ink);
  background: var(--ink); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-small { min-height: 34px; padding: 6px 13px; font-size: 13.5px; }
.btn-danger { background: #fff; color: var(--danger); border-color: #E5C3BC; }
.link-btn { background: none; border: 0; padding: 0; color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn-row.end { justify-content: space-between; }

.tag { display: inline-block; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--plum-soft); color: var(--plum); }
.tag.o { background: var(--accent-soft); color: var(--accent-deep); }

.chk { appearance: none; -webkit-appearance: none; margin: 0; flex: none; width: 24px; height: 24px; border: 1.8px solid #8A909C; border-radius: 7px; background: #fff; cursor: pointer; display: grid; place-content: center; }
.chk:checked { background: var(--ink); border-color: var(--ink); }
.chk:checked::after { content: ''; width: 10px; height: 5px; border-left: 2.2px solid #fff; border-bottom: 2.2px solid #fff; transform: translateY(-1px) rotate(-45deg); }
.chk:disabled { cursor: not-allowed; opacity: 0.45; }

/* ---------- Forms ---------- */
.field { display: block; }
.field + .field { margin-top: 14px; }
.field > span, .field-label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field small { display: block; font-weight: 400; color: var(--muted); margin-top: 2px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #D5CCBC; border-radius: 10px; background: #fff;
}
textarea.input { min-height: 88px; resize: vertical; line-height: 1.45; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-2 > *, .grid-2 .input { min-width: 0; }
.radio-row { display: flex; gap: 10px; }
.radio-row label { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border: 1px solid #D5CCBC; border-radius: 10px; background: #fff; cursor: pointer; }
.radio-row input { width: 18px; height: 18px; accent-color: var(--ink); margin: 0; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { padding: 0; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }

.notice { border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.notice + .notice { margin-top: 8px; }
.notice.warn { background: var(--accent-soft); color: var(--accent-deep); }
.notice.err { background: #F8E1DC; color: var(--danger); }
.notice.info { background: var(--bg-alt); color: var(--ink-soft); }

/* ---------- Deze week (variant A) ---------- */
.wk-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.wk-week { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.pill { font-size: 13px; font-weight: 600; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; white-space: nowrap; }
.pill small { color: var(--muted); font-weight: 500; font-size: 13px; }
.bar { position: relative; height: 8px; background: var(--track); border-radius: 99px; margin: 4px 0 6px; }
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--ink); border-radius: 99px; }
.bar b { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--accent-text); }
.bar.thin { height: 6px; }
.bar.thin b { top: -3px; bottom: -3px; }
.bar-lbl { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); margin-bottom: 20px; }
.bar-lbl em { font-style: normal; color: var(--accent-text); font-weight: 600; }

.due { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--ink); color: #F7F3EA; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 20px; }
.due p { font-size: 14px; }
.due strong { display: block; font-size: 15px; }
.due .btn { background: #F7F3EA; color: var(--ink); border-color: #F7F3EA; white-space: nowrap; }

.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 22px; }
.day { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 8px 0 7px; text-align: center; cursor: pointer; min-width: 0; }
.day span { display: block; font-size: 11.5px; color: var(--muted); }
.day strong { display: block; font-size: 16px; font-weight: 600; }
.day i { display: block; width: 6px; height: 6px; margin: 4px auto 0; border-radius: 99px; background: var(--line); }
.day i.full { background: var(--ink); }
.day i.part { background: linear-gradient(90deg, var(--ink) 50%, var(--line) 50%); }
.day.is-today strong { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.day[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #FBF7F0; }
.day[aria-selected="true"] span { color: rgba(251, 247, 240, 0.78); }
.day[aria-selected="true"] i { background: #E9955A; }
.day[aria-selected="true"] i.none { background: rgba(251, 247, 240, 0.35); }

.list { list-style: none; margin: 0 0 22px; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.list li { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line-soft); min-height: 56px; }
.list li:first-child { border-top: 0; }
.list label, .list .grow { flex: 1; min-width: 0; cursor: pointer; }
.list .grow { cursor: default; }
.list .t { display: block; font-weight: 500; }
.list .s { display: block; font-size: 12.5px; color: var(--muted); }
.list .count { font-size: 13px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.plus { font-size: 13px; font-weight: 600; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 99px; padding: 0 12px; min-height: 34px; min-width: 44px; cursor: pointer; }
.plus:disabled { opacity: 0.45; cursor: not-allowed; }
.empty { background: #fff; border: 1px dashed #D9CDB8; border-radius: var(--radius); padding: 16px; color: var(--ink-soft); font-size: 14px; margin-bottom: 22px; }

/* ---------- Wizards ---------- */
.wiz-head { margin-bottom: 22px; }
.wiz-head .h1 { margin-top: 2px; }
.steps { list-style: none; display: flex; gap: 4px; padding: 0; margin: 14px 0 0; }
.steps li { flex: 1; height: 5px; border-radius: 3px; background: var(--track); }
.steps li.done { background: var(--ink); }
.steps li[aria-current="step"] { background: var(--accent); }
.step-lbl { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.wiz-q { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.wiz-help { color: var(--ink-soft); margin: 8px 0 20px; }
.wiz-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }
.wiz-foot .later { font-size: 13px; color: var(--muted); }

.rv-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.rv-row:first-of-type { border-top: 0; }
.rv-name { font-weight: 500; min-width: 0; }
.rv-name small { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); }
.rv-check { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.whynot { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.whynot .input { min-height: 40px; padding: 8px 10px; font-size: 14px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.stepper button { width: 40px; height: 38px; border: 0; background: none; font-size: 18px; font-weight: 600; cursor: pointer; border-radius: 999px; color: var(--ink); }
.stepper button:disabled { opacity: 0.35; cursor: default; }
.stepper output { min-width: 62px; text-align: center; font-size: 14px; font-weight: 600; }
.chip { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }

.scorecard { background: var(--ink); color: #F7F3EA; border-radius: 18px; padding: 18px; margin-top: 20px; }
.scorecard .big { font-size: 52px; font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.scorecard .big small { font-size: 20px; }
.scorecard p { color: rgba(247, 243, 234, 0.82); font-size: 14px; margin-top: 6px; }
.scorecard .chart { margin-top: 14px; background: #fff; border-radius: 12px; padding: 8px 6px 2px; }

.kpi-prog { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.goal-why { font-size: 13.5px; color: var(--muted); margin: -2px 0 8px; }

.pl-row { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.pl-row:first-of-type { border-top: 0; }
.pl-line { display: grid; grid-template-columns: 1fr 150px auto; gap: 8px; align-items: center; }
.pl-line label { font-weight: 500; }
.daychips { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.daychips button { min-width: 40px; min-height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font-size: 13px; cursor: pointer; }
.daychips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.daychips button:disabled { opacity: 0.4; cursor: not-allowed; }
.daychips-lbl { font-size: 12px; color: var(--muted); margin-top: 6px; }
.add-form { display: grid; grid-template-columns: 1fr 130px auto; gap: 8px; margin-top: 12px; }
.add-form.actions { grid-template-columns: 1fr 1fr; }
.add-form.actions .input:first-child { grid-column: 1 / -1; }
@media (max-width: 480px) {
  .add-form { grid-template-columns: 1fr 1fr; }
  .add-form .input:first-child { grid-column: 1 / -1; }
  .pl-line { grid-template-columns: 1fr 128px auto; }
}
.act-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.act-row:first-child { border-top: 0; }
.act-row .grow { flex: 1; min-width: 0; }

.summary-list { list-style: none; margin: 0; padding: 0; }
.summary-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.summary-list li:first-child { border-top: 0; }

.ob-goal + .ob-goal { margin-top: 10px; }
.row-input { display: flex; gap: 8px; align-items: center; }
.row-input + .row-input { margin-top: 8px; }
.row-input .input { flex: 1; }
.row-input select.input { flex: 0 0 140px; }
.icon-btn { flex: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 18px; color: var(--muted); }

/* ---------- Dashboard ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 8px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.tile b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.tile span { font-size: 12px; color: var(--muted); }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line-soft); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.chart .thr { stroke: var(--accent-text); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart .thr-lbl { fill: var(--accent-text); font-size: 10px; font-weight: 600; font-family: var(--font); }
.chart .val { fill: var(--ink); font-size: 10.5px; font-weight: 600; font-family: var(--font); }
.chart .barm { fill: var(--series); }
.chart .barm.partial { fill: url(#hatch); }
.chart .hl { stroke: var(--ink); stroke-width: 2; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:focus-visible { outline: none; fill: rgba(47, 95, 168, 0.08); }
.chart .line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--series); stroke: #fff; stroke-width: 2; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--series); }
.legend i.p { background: repeating-linear-gradient(135deg, var(--series) 0 2px, #fff 2px 4px); border: 1px solid var(--series); }
.legend i.t { height: 0; width: 16px; border-top: 2px dashed var(--accent-text); border-radius: 0; background: none; }
details.table-view { margin-top: 10px; font-size: 13.5px; }
details.table-view summary { cursor: pointer; color: var(--ink-soft); font-weight: 600; }
.data-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13.5px; }
.data-table th, .data-table td { text-align: left; padding: 6px 4px; border-top: 1px solid var(--line-soft); }
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }

.kpi-card { display: grid; grid-template-columns: 1fr 130px; gap: 12px; align-items: center; }
.kpi-now { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.kpi-now small { font-size: 14px; font-weight: 500; color: var(--muted); }
.trend { font-size: 12.5px; font-weight: 600; }
.trend.beter { color: var(--ok); }
.trend.slechter { color: var(--danger); }
.trend.gelijk { color: var(--muted); }

.refl { padding: 14px 0; border-top: 1px solid var(--line-soft); }
.refl:first-child { border-top: 0; padding-top: 0; }
.refl-h { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 6px; }
.refl-h h4 { font-size: 15px; font-weight: 600; }
.refl dl { margin: 0; display: grid; gap: 6px; font-size: 14px; }
.refl dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.refl dd { margin: 0; white-space: pre-wrap; }
.refl mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 2px; }
.learn-badge { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: #E3EEE7; color: var(--ok); }

/* ---------- Floating ---------- */
.tooltip { position: fixed; z-index: 60; pointer-events: none; background: var(--ink); color: #fff; font-size: 12.5px; padding: 6px 9px; border-radius: 8px; max-width: 220px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabs-h) + 20px + env(safe-area-inset-bottom)); z-index: 50; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: calc(100% - 32px); display: none; }
.toast.is-visible { display: block; }
@media (min-width: 860px) { .toast { bottom: 24px; } }

@media (forced-colors: active) {
  .chk:checked, .day[aria-selected="true"], .daychips button[aria-pressed="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText; }
}
.empty-plan { background: #fff; border: 1px dashed #D9CDB8; border-radius: var(--radius); padding: 16px; margin-bottom: 20px; display: grid; gap: 12px; justify-items: start; font-size: 14.5px; color: var(--ink-soft); }
.empty-plan strong { color: var(--ink); }
.week-foot { border-top: 1px solid var(--line); padding-top: 14px; font-size: 13.5px; }
.pl-line .icon-btn { width: 36px; height: 36px; }
