/* =========================================================
   Kommandozentrale – Design (dunkles Glas, pinker Akzent)
   ========================================================= */

:root {
  --bg: #0d0e12;
  --bg-2: #14151b;
  --card: rgba(255, 255, 255, 0.035);
  --card-strong: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-highlight: rgba(255, 255, 255, 0.06);
  --text: #f3f3f6;
  --text-2: #b9bac4;
  --muted: #7d7f8c;
  --line: rgba(255, 255, 255, 0.07);
  --input: rgba(255, 255, 255, 0.05);

  --accent: #f0508a;
  --accent-2: #d6336c;
  --accent-soft: rgba(240, 80, 138, 0.15);
  --green: #4ade80;
  --blue: #38bdf8;
  --violet: #a78bfa;
  --orange: #fbbf24;
  --red: #f87171;

  --radius: 22px;
  --radius-sm: 12px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --sidebar-w: 76px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #eef0f5;
  --bg-2: #ffffff;
  --card: rgba(255, 255, 255, 0.7);
  --card-strong: rgba(255, 255, 255, 0.9);
  --card-border: rgba(15, 20, 40, 0.08);
  --card-highlight: rgba(255, 255, 255, 0.9);
  --text: #16171d;
  --text-2: #4a4c58;
  --muted: #868895;
  --line: rgba(15, 20, 40, 0.08);
  --input: rgba(15, 20, 40, 0.05);
  --accent-soft: rgba(240, 80, 138, 0.12);
  --shadow: 0 20px 40px -24px rgba(30, 30, 60, 0.25);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(800px 500px at 15% -10%, rgba(240, 80, 138, 0.12), transparent 60%),
    radial-gradient(700px 500px at 100% 0%, rgba(56, 189, 248, 0.07), transparent 60%),
    radial-gradient(900px 600px at 50% 110%, rgba(167, 139, 250, 0.07), transparent 60%);
}

svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

/* ---------- Seitenleiste ---------- */
.sidebar {
  position: fixed;
  top: 16px; bottom: 16px; left: 16px;
  width: calc(var(--sidebar-w) - 16px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 14px 0;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.logo {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #ff6b9d, var(--accent-2));
  box-shadow: 0 8px 20px -6px rgba(240, 80, 138, 0.6);
}

.nav-items { display: flex; flex-direction: column; gap: 6px; flex: 1; }

.nav-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0; border-radius: 12px;
  background: transparent;
  color: var(--muted);
  transition: background .2s, color .2s;
}
.nav-btn:hover { color: var(--text); background: var(--card-strong); }
.nav-btn.active { color: var(--text); background: var(--card-strong); box-shadow: inset 0 0 0 1px var(--card-border); }

.avatar {
  position: relative;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6, var(--accent));
}
.sync-dot {
  position: absolute; right: -1px; bottom: -1px;
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  background: var(--muted);
}
.sync-dot.server { background: var(--green); }
.sync-dot.error { background: var(--red); }

/* ---------- Fokus-Insel ---------- */
.island {
  position: fixed;
  top: 14px; left: calc(50% + var(--sidebar-w) / 2);
  transform: translateX(-50%);
  z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 7px 16px 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: #050506;
  color: #f3f3f6;
  font-size: 12.5px; font-weight: 600;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.8);
  transition: transform .3s, opacity .3s;
}
.island-dot { width: 8px; height: 8px; border-radius: 50%; background: #555; }
.island.running .island-dot { background: var(--orange); box-shadow: 0 0 10px var(--orange); animation: pulse 1.6s infinite; }
.island.paused .island-dot { background: var(--blue); }
.island-time { font-variant-numeric: tabular-nums; color: var(--orange); min-width: 40px; text-align: right; }
.island:not(.running):not(.paused) .island-time { color: #9a9ba5; }

@keyframes pulse { 50% { opacity: .35; } }

/* ---------- Hauptbereich ---------- */
.main {
  position: relative;
  z-index: 1;
  margin-left: calc(var(--sidebar-w) + 16px);
  padding: 64px 28px 40px 12px;
  max-width: 1400px;
}

.topbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.topbar h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.subline { margin: 4px 0 0; color: var(--muted); }

.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.icon-group {
  display: flex; gap: 2px; padding: 4px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--card-border);
}
.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--text-2);
}
.icon-btn:hover { background: var(--card-strong); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--card-strong);
  font-weight: 600; font-size: 13px;
  white-space: nowrap;
  transition: transform .15s, background .2s, filter .2s;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: scale(.97); }
.btn svg { width: 16px; height: 16px; }
.btn-ghost { background: var(--card); }
.btn-accent {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, #ff6b9d, var(--accent-2));
  box-shadow: 0 10px 24px -10px rgba(240, 80, 138, 0.7);
}
.btn-danger { color: var(--red); }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ---------- Kennzahlen ---------- */
.kpis { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.kpi {
  min-width: 110px;
  padding: 10px 16px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
}
.kpi-label { display: block; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.kpi-value { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.kpi-value small { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi.warn .kpi-value { color: var(--red); }
.kpi.exam .kpi-value { color: var(--accent); }

/* ---------- Views ---------- */
.view { display: none; }
.view.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } }

/* ---------- Raster ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card-today { grid-column: span 4; }
.card-next { grid-column: span 5; }
.card-side { grid-column: span 3; }
.card-focus { grid-column: span 5; }
.card-tasks { grid-column: span 7; }
.card-week { grid-column: span 8; }
.card-links { grid-column: span 4; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack > .card { flex: 1; }

/* ---------- Karten ---------- */
.card {
  position: relative;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card-highlight), transparent 40%), var(--card);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  min-width: 0;
}

.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-title { margin: 0; font-size: 15px; font-weight: 650; }
.card-sub { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.card-link {
  border: 0; background: none; padding: 2px 0;
  color: var(--accent); font-size: 12.5px; font-weight: 600;
}
.card-link:hover { text-decoration: underline; }

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

/* ---------- Tagesringe ---------- */
.rings-wrap { display: flex; align-items: center; gap: 22px; padding: 6px 0; }
.rings { width: 150px; height: 150px; flex-shrink: 0; }
.rings svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rings circle { fill: none; stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1); }
.rings .track { stroke: var(--line); }
.ring-legend { display: flex; flex-direction: column; gap: 12px; }
.legend-item { display: flex; gap: 10px; align-items: stretch; }
.legend-bar { width: 3px; border-radius: 3px; }
.legend-item span { display: block; font-size: 12px; color: var(--muted); }
.legend-item strong { font-size: 18px; }
.legend-item strong small { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---------- Als Nächstes ---------- */
.next-hero {
  padding: 16px;
  border-radius: 16px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.28), rgba(56, 189, 248, 0.12));
  border: 1px solid rgba(129, 140, 248, 0.25);
}
.next-hero.cat-schule { background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(99, 102, 241, 0.12)); border-color: rgba(56, 189, 248, 0.3); }
.next-hero.cat-feuerwehr { background: linear-gradient(135deg, rgba(248, 113, 113, 0.28), rgba(251, 191, 36, 0.1)); border-color: rgba(248, 113, 113, 0.3); }
.next-hero.cat-arbeit { background: linear-gradient(135deg, rgba(167, 139, 250, 0.28), rgba(99, 102, 241, 0.1)); border-color: rgba(167, 139, 250, 0.3); }
.next-hero.cat-privat { background: linear-gradient(135deg, rgba(74, 222, 128, 0.22), rgba(56, 189, 248, 0.08)); border-color: rgba(74, 222, 128, 0.28); }
.next-hero.cat-ap2 { background: linear-gradient(135deg, rgba(240, 80, 138, 0.3), rgba(167, 139, 250, 0.1)); border-color: rgba(240, 80, 138, 0.35); }
.next-when { font-size: 11.5px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.next-title { margin: 4px 0 2px; font-size: 18px; font-weight: 700; }
.next-meta { color: var(--text-2); font-size: 12.5px; }
.next-note { margin-top: 8px; font-size: 12.5px; color: var(--text-2); }

.event-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.event-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 4px;
  border-radius: 10px;
}
.event-row:hover { background: var(--card-strong); }
.event-bar { width: 3px; align-self: stretch; border-radius: 3px; background: var(--muted); }
.event-name { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.c-schule { --c: var(--blue); }
.c-feuerwehr { --c: var(--red); }
.c-arbeit { --c: var(--violet); }
.c-privat { --c: var(--green); }
.c-ap2 { --c: var(--accent); }
.event-bar[class*="c-"] { background: var(--c); }

/* ---------- AP2-Countdown ---------- */
.exam-days { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; background: linear-gradient(135deg, #ff8fb3, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.exam-label { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.progress { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: 14px; }
.progress > span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #ff6b9d, var(--accent-2)); transition: width 1s; }
.exam-foot { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 11.5px; }

/* ---------- Wetter ---------- */
.weather-now { display: flex; align-items: center; gap: 12px; }
.weather-icon { font-size: 38px; line-height: 1; }
.weather-temp { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
.weather-desc { color: var(--text-2); font-size: 12.5px; }
.weather-days { display: flex; justify-content: space-between; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.weather-day { text-align: center; font-size: 12px; color: var(--muted); }
.weather-day b { display: block; color: var(--text); font-size: 13px; }
.weather-day .wd-icon { font-size: 18px; display: block; margin: 2px 0; }

/* ---------- Fokus-Timer ---------- */
.card-focus { display: flex; flex-direction: column; }
.focus-body { flex: 1; display: flex; align-items: center; gap: 26px; padding: 8px 0; }
.focus-ring { position: relative; width: 168px; height: 168px; flex-shrink: 0; }
.focus-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.focus-ring circle { fill: none; stroke-width: 7; stroke-linecap: round; }
.focus-ring .track { stroke: var(--line); }
.focus-ring .bar { stroke: var(--orange); transition: stroke-dashoffset .5s linear; filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.45)); }
.focus-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.focus-time { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; color: var(--orange); }
.focus-state { font-size: 12px; color: var(--muted); }
.focus-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.focus-side h3 { margin: 0; font-size: 15px; }
.focus-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--card);
  font-size: 12px; font-weight: 600; color: var(--text-2);
}
.chip:hover { color: var(--text); }
.chip.active { background: var(--accent-soft); color: var(--accent); border-color: rgba(240, 80, 138, 0.35); }
.chip:disabled { opacity: .45; cursor: not-allowed; }
.focus-stats { display: flex; gap: 18px; color: var(--muted); font-size: 12px; }
.focus-stats b { display: block; color: var(--text); font-size: 15px; }

/* ---------- Aufgaben ---------- */
.quick-add {
  display: flex; gap: 8px;
  margin-bottom: 10px;
}
.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: var(--input);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus, .select:focus, .textarea:focus { border-color: rgba(240, 80, 138, 0.6); box-shadow: 0 0 0 3px var(--accent-soft); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.select option { background: var(--bg-2); color: var(--text); }
.textarea { min-height: 70px; resize: vertical; }

.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.task {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 6px;
  border-radius: 12px;
  border-bottom: 1px solid var(--line);
}
.task:last-child { border-bottom: 0; }
.task:hover { background: var(--card-strong); }
.check {
  width: 20px; height: 20px; flex-shrink: 0;
  display: grid; place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--muted);
  background: transparent;
  transition: all .2s;
}
.check:hover { border-color: var(--accent); }
.check svg { width: 12px; height: 12px; stroke-width: 3; opacity: 0; color: #fff; }
.task.done .check { background: var(--accent); border-color: var(--accent); }
.task.done .check svg { opacity: 1; }
.task-main { flex: 1; min-width: 0; cursor: pointer; }
.task-title { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task.done .task-title { color: var(--muted); text-decoration: line-through; }
.task-meta { display: flex; gap: 6px; align-items: center; margin-top: 3px; flex-wrap: wrap; }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  background: var(--card-strong);
  color: var(--text-2);
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--muted)); }
.due { font-size: 11.5px; color: var(--muted); }
.due.overdue { color: var(--red); font-weight: 600; }
.due.today { color: var(--orange); font-weight: 600; }
.prio {
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 11px; font-weight: 700;
  white-space: nowrap;
}
.prio-urgent { color: var(--red); background: rgba(248, 113, 113, 0.12); }
.prio-high { color: var(--orange); background: rgba(251, 191, 36, 0.12); }
.del-btn {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 0; border-radius: 8px;
  background: transparent; color: var(--muted);
  opacity: 0; transition: opacity .2s;
}
.del-btn svg { width: 15px; height: 15px; }
.del-btn:hover { color: var(--red); background: rgba(248, 113, 113, 0.1); }
.task:hover .del-btn, .event-row:hover .del-btn, .link-row:hover .del-btn { opacity: 1; }
@media (hover: none) { .del-btn { opacity: 1; } }

.card-tasks .task-list { max-height: 360px; overflow-y: auto; }

/* ---------- Woche ---------- */
.week-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.week-total { font-size: 28px; font-weight: 700; }
.week-text { color: var(--text-2); font-size: 13px; }
.trend-up { color: var(--green); font-weight: 600; font-size: 12.5px; }
.trend-down { color: var(--red); font-weight: 600; font-size: 12.5px; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; height: 170px; align-items: end; }
.bar-col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.bar-slot { position: relative; width: 100%; flex: 1; display: flex; align-items: flex-end; border-radius: 12px; background: var(--card-strong); overflow: hidden; }
.bar-fill { width: 100%; border-radius: 12px; background: linear-gradient(180deg, #ff8fb3, var(--accent-2)); transition: height .8s cubic-bezier(.2,.8,.2,1); min-height: 0; }
.bar-col.future .bar-fill { opacity: .35; }
.bar-col.today .bar-slot { box-shadow: inset 0 0 0 1px rgba(240, 80, 138, 0.5); }
.bar-value { position: absolute; top: 6px; left: 0; right: 0; text-align: center; font-size: 11px; font-weight: 700; color: var(--text-2); }
.bar-label { font-size: 11.5px; color: var(--muted); }
.bar-col.today .bar-label { color: var(--accent); font-weight: 700; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--card-strong); border: 1px solid var(--card-border); }
.seg button { border: 0; background: none; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--muted); }
.seg button.active { background: var(--bg-2); color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); }

/* ---------- Links ---------- */
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.link-tile {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 12px 6px;
  border-radius: 14px;
  text-decoration: none;
  background: var(--card-strong);
  border: 1px solid transparent;
  transition: border-color .2s, transform .15s;
  min-width: 0;
}
.link-tile:hover { border-color: var(--card-border); transform: translateY(-2px); }
.link-icon {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 11px;
  font-weight: 800; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 80% 62%), hsl(calc(var(--h) + 30) 70% 48%));
}
.link-name { font-size: 12px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-add { border: 1px dashed var(--card-border); background: transparent; color: var(--muted); }
.link-add .link-icon { background: var(--card-strong); color: var(--muted); }

.link-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); border-radius: 10px; }
.link-row:hover { background: var(--card-strong); }
.link-row .link-icon { width: 32px; height: 32px; font-size: 13px; }
.link-row-main { flex: 1; min-width: 0; }
.link-row-main a { font-weight: 600; text-decoration: none; }
.link-row-main a:hover { text-decoration: underline; }
.link-url { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Detailansichten ---------- */
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.view-head h2 { margin: 0; font-size: 20px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.day-group { margin-bottom: 18px; }
.day-title { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin: 0 0 6px 4px; }
.day-title.is-today { color: var(--accent); }
.repeat-badge { font-size: 11px; color: var(--muted); }

/* Statistik */
.stat-big { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat-box { padding: 14px; border-radius: 14px; background: var(--card-strong); }
.stat-box span { display: block; font-size: 12px; color: var(--muted); }
.heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(14px, 1fr)); gap: 4px; }
.heat i { aspect-ratio: 1; border-radius: 4px; background: var(--card-strong); }
.heat i[data-l="1"] { background: rgba(240, 80, 138, 0.3); }
.heat i[data-l="2"] { background: rgba(240, 80, 138, 0.55); }
.heat i[data-l="3"] { background: rgba(240, 80, 138, 0.8); }
.heat i[data-l="4"] { background: var(--accent); }
.heat-legend { display: flex; gap: 6px; align-items: center; justify-content: flex-end; color: var(--muted); font-size: 11px; margin-top: 8px; }
.heat-legend i { width: 11px; height: 11px; display: inline-block; border-radius: 3px; }

/* Einstellungen */
.settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; }
.settings h3 { grid-column: 1 / -1; margin: 10px 0 -8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field small { color: var(--muted); font-size: 11.5px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.status-line .sync-dot { position: static; border: 0; }

/* ---------- Modal ---------- */
.modal {
  width: min(480px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--card-border);
  border-radius: 24px;
  background: var(--bg-2);
  color: var(--text);
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.7);
}
.modal::backdrop { background: rgba(5, 5, 8, 0.6); backdrop-filter: blur(6px); }
.modal[open] { animation: pop .2s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
.modal-form { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-form h2 { margin: 0; font-size: 18px; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; }
.modal-actions .row { margin-left: auto; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px;
  transform: translate(-50%, 20px);
  z-index: 100;
  padding: 10px 18px;
  border-radius: 999px;
  background: #050506;
  color: #f3f3f6;
  font-weight: 600; font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .card-today { grid-column: span 6; }
  .card-next { grid-column: span 6; }
  .card-side { grid-column: span 12; flex-direction: row; }
  .card-focus { grid-column: span 12; }
  .card-tasks { grid-column: span 12; }
  .card-week { grid-column: span 12; }
  .card-links { grid-column: span 12; }
}

@media (max-width: 760px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    top: auto; left: 10px; right: 10px; bottom: 10px;
    width: auto; height: 62px;
    flex-direction: row; justify-content: space-around;
    padding: 0 10px;
  }
  .sidebar .logo { display: none; }
  .nav-items { flex-direction: row; justify-content: space-around; flex: 1; }
  .avatar { width: 32px; height: 32px; }
  .main { margin-left: 0; padding: 62px 14px 96px; }
  .island { left: 50%; }
  .topbar h1 { font-size: 24px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .grid > *, .card-side { grid-column: 1 / -1 !important; }
  .card-side { flex-direction: column; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .rings-wrap { justify-content: center; }
  .focus-body { flex-direction: column; text-align: center; }
  .focus-side { align-items: center; }
  .settings { grid-template-columns: minmax(0, 1fr); }
  .modal-grid { grid-template-columns: 1fr; }
  .bars { gap: 6px; height: 140px; }
  .btn-accent { display: none; }
}

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