/* Design-Tokens: dataviz-Referenzpalette (validiert, dark-first) */
:root {
  --page:      #0d0d0d;
  --surface:   #1a1a19;
  --surface-2: #232322;
  --ink:       #ffffff;
  --ink-2:     #c3c2b7;
  --muted:     #898781;
  --grid:      #2c2c2a;
  --border:    rgba(255, 255, 255, 0.10);

  --accent:      #3987e5; /* categorical slot 1 – blue */
  --accent-soft: #184f95;
  --violet:      #9085e9; /* categorical slot 5 – Timm */
  --violet-soft: #4a3aa7;
  --aqua:        #199e70; /* categorical slot 2 – Beide */
  --aqua-soft:   #1baf7a;

  --good:     #0ca30c;
  --warning:  #fab219;
  --serious:  #ec835a;
  --critical: #d03b3b;

  --r:  14px;
  --r2: 10px;
}
@media (prefers-color-scheme: light) {
  :root {
    --page:      #f9f9f7;
    --surface:   #fcfcfb;
    --surface-2: #f2f1ee;
    --ink:       #0b0b0b;
    --ink-2:     #52514e;
    --muted:     #898781;
    --grid:      #e1e0d9;
    --border:    rgba(11, 11, 11, 0.10);

    --accent:      #2a78d6;
    --accent-soft: #9ec5f4;
    --violet:      #4a3aa7;
    --violet-soft: #d9d5f7;
    --aqua:        #1baf7a;
    --aqua-soft:   #bdeedb;

    --good: #006300;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--ink);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--page) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--grid);
  padding: 28px 20px 20px;
}
.hero-inner { max-width: 720px; margin: 0 auto; }
.hero-flag { font-size: 12px; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.hero-title { font-size: clamp(1.5rem, 5vw, 2.1rem); font-weight: 750; letter-spacing: -0.01em; margin-bottom: 6px; }
.hero-sub { font-size: 13.5px; color: var(--ink-2); margin-bottom: 20px; }
.hero-sub strong { color: var(--ink); font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r2); padding: 10px 12px; }
.tile .value { font-size: 20px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.tile .label { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }

.countdown {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--accent-soft), var(--violet-soft));
  border: 1px solid var(--border); border-radius: 99px;
  padding: 8px 16px; font-size: 13px; color: var(--ink); margin-top: 14px;
}
.countdown strong { font-variant-numeric: tabular-nums; }

/* ── Nav ── */
.nav { background: var(--page); border-bottom: 1px solid var(--grid); position: sticky; top: 0; z-index: 10; }
.nav-inner { max-width: 720px; margin: 0 auto; display: flex; overflow-x: auto; scrollbar-width: none; padding: 0 12px; }
.nav-inner::-webkit-scrollbar { display: none; }
.tab {
  appearance: none; background: none; border: 0; cursor: pointer;
  padding: 13px 14px; font: inherit; font-size: 13.5px; font-weight: 550;
  color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }

/* ── Content ── */
main { max-width: 720px; margin: 0 auto; padding: 18px 16px 48px; }
.pane { display: none; }
.pane.active { display: block; }

.section-title { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 22px 0 8px; }
.section-title:first-child { margin-top: 0; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; margin-bottom: 12px; }
.card-pad { padding: 14px 16px; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 650; white-space: nowrap; border: 1px solid transparent; }
.b-ok    { background: rgba(12,163,12,.12); color: var(--good); border-color: rgba(12,163,12,.3); }
.b-open  { background: rgba(57,135,229,.12); color: var(--accent); border-color: rgba(57,135,229,.3); }
.b-warn  { background: rgba(250,178,25,.14); color: var(--warning); border-color: rgba(250,178,25,.35); }
.b-crit  { background: rgba(208,59,59,.12); color: var(--critical); border-color: rgba(208,59,59,.3); }

.who { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; font-size: 10.5px; font-weight: 750; flex-shrink: 0; }
.who-P  { background: var(--accent-soft); color: var(--accent); }
.who-T  { background: var(--violet-soft); color: var(--violet); }
.who-PT { background: var(--aqua-soft); color: var(--aqua); }

/* ── Timeline / Route ── */
.leg { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--grid); }
.leg:last-child { border-bottom: 0; }
.leg .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.leg .body { flex: 1; min-width: 0; }
.leg .date { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: 2px; }
.leg .title { font-size: 14.5px; font-weight: 650; margin-bottom: 3px; }
.leg .sub { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.leg .badge { margin-top: 6px; }

/* ── Transport ── */
.flight { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--grid); }
.flight:last-child { border-bottom: 0; }
.flight .icon { font-size: 20px; width: 30px; text-align: center; flex-shrink: 0; }
.flight .body { flex: 1; min-width: 0; }
.flight .route { font-size: 13.5px; font-weight: 650; }
.flight .info { font-size: 12px; color: var(--muted); margin-top: 1px; }
.flight .right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }

/* ── Todos ── */
.filter-bar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.chip {
  font-size: 13px; padding: 6px 14px; border-radius: 99px; font-weight: 550;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.active.f-T { background: var(--violet); border-color: var(--violet); }

.progress-card { padding: 14px 16px; }
.progress-head { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 8px; }
.progress-head .nums { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.progress-track { height: 6px; border-radius: 4px; background: var(--grid); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; background: var(--accent); transition: width .4s ease; }

.todo-group-head { padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--grid); display: flex; justify-content: space-between; align-items: center; }
.todo-group-head .name { font-size: 12.5px; font-weight: 650; }
.todo-group-head .count { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.todo { display: flex; align-items: flex-start; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--grid); cursor: pointer; transition: background .1s; }
.todo:last-child { border-bottom: 0; }
.todo:hover { background: var(--surface-2); }
.todo input[type=checkbox] { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--accent); flex-shrink: 0; cursor: pointer; }
.todo .body { flex: 1; min-width: 0; }
.todo .text { font-size: 13.5px; font-weight: 550; }
.todo .text.done { color: var(--muted); text-decoration: line-through; }
.todo .detail { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.todo .links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.link-btn {
  display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 550;
  padding: 3px 10px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-2); color: var(--accent);
}
.link-btn:hover { text-decoration: none; border-color: var(--accent); }

/* ── Budget & Belege meters ── */
.tile-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.tile-row .tile .value { font-size: 18px; }
.value.neg { color: var(--critical); }
.value.pos { color: var(--good); }

.meter-row { padding: 12px 16px; border-bottom: 1px solid var(--grid); }
.meter-row:last-child { border-bottom: 0; }
.meter-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.meter-head .cat { font-weight: 550; }
.meter-head .nums { color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 12px; }
.meter-track { height: 6px; border-radius: 4px; background: var(--grid); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 4px; background: var(--accent); }
.meter-fill.warn { background: var(--warning); }
.meter-fill.over { background: var(--critical); }

.budget-total { background: linear-gradient(135deg, rgba(12,163,12,.10), rgba(57,135,229,.10)); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; text-align: center; margin-top: 12px; }
.budget-total .num { font-size: 30px; font-weight: 750; }
.budget-total .label { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.saldo-card { padding: 16px; text-align: center; }
.saldo-card .num { font-size: 24px; font-weight: 750; font-variant-numeric: tabular-nums; }
.saldo-card .label { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }

/* ── Impfungen ── */
.impf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.impf-card { display: flex; gap: 12px; padding: 14px; }
.impf-card .prio { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.impf-card .name { font-size: 13.5px; font-weight: 650; margin-bottom: 3px; }
.impf-card .why { font-size: 12px; color: var(--muted); line-height: 1.45; }
.impf-card .badge { margin-top: 6px; }

.notice { padding: 14px 16px; border: 1px solid rgba(250,178,25,.35); border-radius: var(--r); background: rgba(250,178,25,.08); font-size: 12.5px; color: var(--ink-2); margin-top: 14px; }
.notice strong { color: var(--warning); }

/* ── Form ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 5px; }
input, select {
  font: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--page); border: 1px solid var(--border);
  border-radius: var(--r2); padding: 9px 11px; width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.who-chips { display: flex; gap: 6px; }
.who-chip { flex: 1; padding: 8px; border-radius: var(--r2); border: 1px solid var(--border); background: var(--page); color: var(--ink-2); font-size: 12.5px; font-weight: 600; cursor: pointer; text-align: center; }
.who-chip.active.w-P  { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.who-chip.active.w-T  { background: var(--violet-soft); border-color: var(--violet); color: var(--violet); }
.who-chip.active.w-PT { background: var(--aqua-soft); border-color: var(--aqua); color: var(--aqua); }
.form-actions { display: flex; gap: 8px; }
button.primary, button.secondary {
  font: inherit; font-size: 13.5px; font-weight: 650; padding: 10px 16px; border-radius: var(--r2); cursor: pointer;
}
button.primary { background: var(--accent); border: 1px solid var(--accent); color: #fff; }
button.secondary { background: transparent; border: 1px solid var(--border); color: var(--ink-2); }

/* ── Belege / expense list ── */
.exp { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--grid); }
.exp:last-child { border-bottom: 0; }
.exp .body { flex: 1; min-width: 0; }
.exp .desc { font-size: 13.5px; font-weight: 600; }
.exp .meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.exp .cat { display: inline-block; margin-top: 5px; padding: 2px 8px; border-radius: 99px; font-size: 10.5px; font-weight: 650; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2); }
.exp .right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.exp .amount { font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.exp .del { background: none; border: 0; color: var(--muted); font-size: 12px; cursor: pointer; padding: 2px 4px; }
.exp .del:hover { color: var(--critical); }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); font-size: 13px; }

/* ── Responsive ── */
@media (max-width: 560px) {
  .hero { padding: 22px 16px 16px; }
  main { padding: 14px 12px 40px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tile-row { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .impf-grid { grid-template-columns: 1fr; }
}
