/* FundusLearn – Design-System
   Helles, kühl-neutrales Theme. Azur-Primär + Koralle-Akzent, Erfolg-Grün, Tinte-Text.
   Schriften: Bricolage Grotesque (Headlines) + Hanken Grotesk (Body). */

:root {
  /* Flächen / Neutral (kühl getönt, kein reines Weiß/Schwarz) */
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --border: #e3e8f0;
  --border-strong: #cfd8e6;

  /* Primär – Azur */
  --primary: #2e6be6;
  --primary-600: #2056c9;
  --primary-700: #1a4699;
  --primary-soft: #e8effc;

  /* Akzent – Koralle (sparsam, für Energie/Spark) */
  --accent: #f2795f;
  --accent-soft: #fdece7;
  --accent-700: #b5462b;

  /* Status – auf Azur/Koralle/Erfolg abgestimmt; -700 = Text auf -soft */
  --success: #2fa876;
  --success-soft: #e4f5ee;
  --success-700: #1b6b4d;
  --warning: #e8a23c;
  --warning-soft: #fbeed6;
  --warning-700: #8a5a12;
  --danger: #df4a3e;
  --danger-soft: #fce7e4;
  --danger-700: #b23b32;

  /* Text */
  --ink: #1e2733;
  --muted: #5d6b78;
  --faint: #8d99a6;
  --on-primary: #ffffff;

  /* Radien */
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --r-pill: 999px;

  /* Schatten (weich, warm getönt) */
  --shadow-sm: 0 1px 2px rgba(30, 39, 51, 0.05);
  --shadow: 0 4px 14px rgba(30, 39, 51, 0.06);
  --shadow-lg: 0 14px 40px rgba(30, 39, 51, 0.10);

  /* Layout */
  --sidebar-w: 248px;
  --content-max: 1100px;

  --font-head: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  /* dezenter Marken-Wash: Azur oben-rechts, Koralle oben-links, Erfolg unten – sehr subtil */
  background-image:
    radial-gradient(1200px 520px at 92% -10%, rgba(46, 107, 230, 0.09), transparent 60%),
    radial-gradient(1000px 460px at -8% 2%, rgba(242, 121, 95, 0.06), transparent 58%),
    radial-gradient(1100px 760px at 50% 118%, rgba(47, 168, 118, 0.05), transparent 62%);
  background-attachment: fixed;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
  line-height: 1.15;
}

a { color: inherit; text-decoration: none; }
p { margin: 0; }

/* ---------- App-Shell ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  padding: 22px 16px;
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.03em;
}
.brand-logo {
  display: block;
  height: 40px;
  width: auto;
}

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--faint);
  padding: 0 10px; margin-bottom: 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-weight: 600;
  transition: background 140ms ease, color 140ms ease;
}
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-700); }
.nav-item.soon { color: var(--faint); cursor: default; }
.nav-item.soon:hover { background: transparent; color: var(--faint); }
.nav-item .tag {
  margin-left: auto; font-size: 10px; font-weight: 700;
  background: var(--surface-2); color: var(--faint);
  padding: 2px 7px; border-radius: var(--r-pill);
}

.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }

/* ---------- Konto (Sidebar-Fuss) ----------
   Avatar als Sechseck, nicht als Kreis: greift die Kristall-Silhouette
   des Logos auf. Ruhezustand zeigt nur die Identitaet, Aktionen liegen
   in der Klappe. */
.account { position: relative; }
.account > summary {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--r-sm);
  cursor: pointer; list-style: none;
  background: var(--surface); border: 1px solid var(--border);
  transition: background 140ms ease, border-color 140ms ease;
}
.account > summary::-webkit-details-marker { display: none; }
.account > summary::marker { content: ""; }
.account > summary:hover { background: var(--surface-2); border-color: var(--border-strong); }
.account[open] > summary { background: var(--surface-2); border-color: var(--border-strong); }
.account > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.account-mark { width: 30px; height: 34px; flex-shrink: 0; }
.account-mark polygon { fill: var(--primary); }
.account-mark text {
  font-family: var(--font-head); font-weight: 800; font-size: 12px;
  fill: var(--on-primary); text-anchor: middle; letter-spacing: 0.02em;
}

.account-id { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.account-name, .account-mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-name { font-weight: 700; font-size: 13px; color: var(--ink); }
.account-mail { font-size: 11.5px; color: var(--faint); }

.account-chev {
  width: 15px; height: 15px; margin-left: auto; flex-shrink: 0;
  color: var(--muted); transition: transform 160ms ease;
}
.account[open] .account-chev { transform: rotate(180deg); }

.account-menu {
  position: absolute; bottom: calc(100% + 6px); left: 0; right: 0;
  padding: 6px; z-index: 20;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); box-shadow: var(--shadow-lg);
}
.account-item {
  display: block; padding: 9px 10px; border-radius: 6px;
  font-weight: 600; font-size: 13px; color: var(--ink);
  transition: background 120ms ease;
}
.account-item:hover { background: var(--surface-2); }
.account-item:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.account-sep { height: 1px; margin: 4px 6px; background: var(--border); }

.account-quit {
  display: block; width: 100%; text-align: left;
  padding: 9px 10px; border: 0; border-radius: 6px;
  background: transparent; font: inherit; font-weight: 600; font-size: 13px;
  color: var(--ink); cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.account-quit:hover { background: var(--danger-soft); color: var(--danger-700); }
.account-quit:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

@media (prefers-reduced-motion: reduce) {
  .account > summary, .account-chev, .account-quit, .account-item { transition: none; }
}

/* ---------- Hauptbereich ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 36px;
  border-bottom: 1px solid var(--border);
  background: rgba(246, 248, 251, 0.72);
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 5;
}
.topbar .title { font-size: 21px; }
.topbar .sub { color: var(--muted); font-size: 13.5px; }
.topbar .spacer { flex: 1; }

.content { padding: 32px 36px 64px; width: 100%; max-width: var(--content-max); margin: 0 auto; }
.content > * + * { margin-top: 22px; }

.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; }
.page-head .lead { color: var(--muted); }

/* ---------- Karten ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card.pad-lg { padding: 28px; }
.card-title { font-size: 17px; margin-bottom: 4px; }
.card-sub { color: var(--muted); font-size: 13.5px; }

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* Kennzahl-Karte */
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .label { font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.stat .value { font-family: var(--font-head); font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.stat .value small { font-size: 15px; color: var(--faint); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-weight: 700; font-size: 14.5px;
  padding: 10px 18px; border-radius: var(--r-pill);
  border: 1px solid transparent; cursor: pointer;
  transition: transform 120ms ease, background 140ms ease, box-shadow 140ms ease;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-600); box-shadow: var(--shadow); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(0.96); }
.btn-sm { padding: 7px 13px; font-size: 13px; }

/* ---------- Badges / Pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; padding: 4px 11px;
  border-radius: var(--r-pill);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-ready { background: var(--success-soft); color: var(--success-700); }
.badge-processing { background: var(--warning-soft); color: var(--warning-700); }
.badge-todo { background: var(--surface-2); color: var(--muted); }
.badge-error { background: var(--danger-soft); color: var(--danger-700); }
.badge-primary { background: var(--primary-soft); color: var(--primary-700); }

/* ---------- Fortschritts-Ring & Balken ---------- */
.progress { height: 9px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--success)); }

/* ---------- Listen / Material-Karten ---------- */
.doc { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.doc:last-child { border-bottom: 0; }
.doc .ic {
  width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0;
  display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-700);
}
.doc .meta { min-width: 0; flex: 1; }
.doc .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc .info { font-size: 12.5px; color: var(--faint); }

/* ---------- Upload-Dropzone ---------- */
.dropzone {
  display: block;
  cursor: pointer;
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-lg);
  padding: 38px 24px;
  text-align: center;
  background: var(--surface-2);
  transition: border-color 140ms ease, background 140ms ease;
}
.dropzone:hover { border-color: var(--primary); background: var(--primary-soft); }
.dropzone .big { font-family: var(--font-head); font-size: 18px; font-weight: 700; }
.dropzone .hint { color: var(--muted); font-size: 13.5px; margin-top: 4px; }

/* ---------- Korrektur-Ansicht (Bild | Transkript) ---------- */
.correct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 950px) { .correct-grid { grid-template-columns: 1fr; } }
.correct-grid img { width: 100%; border-radius: var(--r); border: 1px solid var(--border); }
.correct-grid textarea {
  width: 100%; min-height: 420px; resize: vertical;
  font-family: var(--font-body); font-size: 15px; line-height: 1.7; color: var(--ink);
  padding: 16px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface);
}
.correct-grid textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }

/* ---------- Hinweis-Box ---------- */
.note {
  display: flex; gap: 12px; padding: 14px 16px;
  border-radius: var(--r); background: var(--primary-soft); color: var(--primary-700);
  font-size: 13.5px;
}
.note.warn { background: var(--warning-soft); color: var(--warning-700); }

/* ---------- Empty State ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .icn { width: 54px; height: 54px; margin: 0 auto 14px; color: var(--faint); }

/* ---------- Bento / zweispaltiges Layout ---------- */
.bento { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
.bento .col { display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 900px) { .bento { grid-template-columns: 1fr; } }

/* ---------- Prüfungsreife-Ring ---------- */
.readiness { display: flex; align-items: center; gap: 18px; }
.readiness .info { flex: 1; }
.readiness .ring { flex-shrink: 0; }
.readiness .pct { font-family: var(--font-head); font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.readiness .pct small { font-size: 16px; color: var(--faint); font-weight: 600; }

.band-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.band-legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); }
.band-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* Fokus-Symbol-Kreis (Karten-Header) */
.icon-chip { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.icon-chip.warn { background: var(--warning-soft); color: var(--warning-700); }
.icon-chip.primary { background: var(--primary-soft); color: var(--primary-700); }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head .left { display: flex; align-items: center; gap: 12px; }

/* Schwächen-Zeile */
.weak { display: flex; align-items: center; gap: 16px; }
.weak + .weak { margin-top: 18px; }
.weak .bar-wrap { flex: 1; }
.weak .bar-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.weak .bar-top .t { font-weight: 700; }
.weak .bar-top .v { font-size: 13px; color: var(--muted); font-weight: 700; }

/* zentrierte „Nächste Session"-Karte */
.session { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.session .ic { width: 60px; height: 60px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-700); display: grid; place-items: center; }

/* dekorativer Kreis im Hero */
.hero-emblem { width: 116px; height: 116px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; box-shadow: var(--shadow); flex-shrink: 0; }
@media (max-width: 720px) { .hero-emblem { display: none; } }

/* ---------- Formularfelder ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; color: var(--muted); }
.input, select.input {
  font-family: var(--font-body); font-size: 14.5px; color: var(--ink);
  padding: 10px 13px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface);
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }

/* ---------- Monatsbudget (Einstellungen) ----------
   Der Balken ist die einzige Stelle, an der die Deckelung sichtbar wird, bevor sie
   zuschlaegt. Farbe wechselt erst bei erschoepftem Budget -- ein dauerhaft rotes
   Element lernt man zu uebersehen. */
.budget { margin-top: 12px; }
.budget-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.budget-balken {
  height: 8px; margin-top: 8px; border-radius: var(--r-pill);
  background: var(--surface-2); overflow: hidden;
}
.budget-balken span {
  display: block; height: 100%; background: var(--primary);
  border-radius: var(--r-pill); transition: width 200ms ease;
}
.budget-hinweis { margin-top: 8px; }
