/* ============ Finanzen · Gestaltung ============ */
:root {
  --akzent: #0F766E;
  --akzent-dunkel: #115E59;
  --akzent-hell: #E6F2F1;
  --grund: #F4F6F8;
  --karte: #FFFFFF;
  --linie: #E2E8F0;
  --balken: #EEF2F5;
  --text: #0F172A;
  --leise: #475569;
  --warn-grund: #FFFBEB;
  --warn-linie: #FCD34D;
  --warn-text: #92400E;
  --rot: #B91C1C;
  --radius: 14px;
  --schrift: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--grund); color: var(--text); font-family: var(--schrift); font-size: 15px; line-height: 1.45; }
a { color: var(--akzent); }
a:hover { color: var(--akzent-dunkel); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { flex-shrink: 0; }

.laden { padding: 64px 24px; text-align: center; color: var(--leise); }
.leise { color: var(--leise); }
.klein { font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.3px; }
.plus { color: var(--akzent); }
.negativ { color: var(--rot); }

/* ---------- Kopfzeile ---------- */
.kopf { background: var(--karte); border-bottom: 1px solid var(--linie); position: sticky; top: 0; z-index: 10; }
.kopf-innen { max-width: 1200px; margin: 0 auto; padding: 0 24px; min-height: 64px; display: flex; align-items: center; gap: 24px; }
.marke { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; color: var(--text); text-decoration: none; }
.marke:hover { color: var(--text); }
.logo { width: 32px; height: 32px; border-radius: 8px; background: var(--akzent); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.logo.gross { width: 48px; height: 48px; border-radius: 12px; }
.hauptnav { display: flex; gap: 4px; flex: 1 1 auto; flex-wrap: wrap; }
.hauptnav a { padding: 10px 14px; border-radius: 8px; color: #334155; font-size: 14px; text-decoration: none; }
.hauptnav a:hover { background: var(--grund); }
.hauptnav a.aktiv { background: var(--akzent-hell); color: var(--akzent); font-weight: 600; }

.menue { position: relative; margin-left: auto; }
.menue summary { list-style: none; width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--leise); }
.menue summary::-webkit-details-marker { display: none; }
.menue summary:hover { background: var(--grund); }
.menue-liste { position: absolute; right: 0; top: 50px; background: var(--karte); border: 1px solid var(--linie); border-radius: 12px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12); padding: 8px; min-width: 240px; z-index: 20; }
.menue-liste button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 12px; border-radius: 8px; cursor: pointer; min-height: 44px; }
.menue-liste button:hover { background: var(--grund); }
.menue-info { padding: 8px 12px; font-size: 13px; color: var(--leise); border-bottom: 1px solid var(--linie); margin-bottom: 4px; word-break: break-all; }

/* ---------- Inhalt ---------- */
.inhalt { max-width: 1200px; margin: 0 auto; padding: 32px 24px 48px; display: flex; flex-direction: column; gap: 24px; }
.seitenkopf { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.seitenkopf h1 { font-size: 28px; font-weight: 700; }
.seitenkopf p { margin-top: 6px; font-size: 14px; color: var(--leise); }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 8px; }

.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 24px; min-width: 0; }
.karte h2 { font-size: 17px; font-weight: 600; }
.karte-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }

.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.kennzahl { padding: 20px; }
.kennzahl .titel { font-size: 13px; color: var(--leise); }
.kennzahl .wert { margin-top: 8px; font-size: 30px; font-weight: 700; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.kennzahl .info { margin-top: 6px; font-size: 13px; color: var(--leise); }
.kennzahl .info.gut { color: var(--akzent); font-weight: 600; }
.kennzahl.warn { background: var(--warn-grund); border-color: var(--warn-linie); }
.kennzahl.warn .titel, .kennzahl.warn .wert, .kennzahl.warn .info { color: var(--warn-text); }
.kennzahl.hervor { background: var(--akzent); border-color: var(--akzent); }
.kennzahl.hervor .titel, .kennzahl.hervor .wert, .kennzahl.hervor .info { color: #fff; }

.reihe { display: flex; flex-wrap: wrap; gap: 24px; }
.reihe > .breit { flex: 999 1 560px; }
.reihe > .schmal { flex: 1 1 320px; }

/* Balken */
.balken-liste { display: flex; flex-direction: column; gap: 14px; }
.balken-zeile { display: grid; grid-template-columns: minmax(90px, 150px) minmax(0, 1fr) 90px; align-items: center; gap: 12px; font-size: 14px; }
.balken-zeile .betrag { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.balken { height: 10px; border-radius: 5px; background: var(--balken); overflow: hidden; }
.balken > span { display: block; height: 100%; border-radius: 5px; background: var(--akzent); }
.fuss { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--linie); font-size: 13px; color: var(--leise); }

/* Hinweise */
.hinweise { display: flex; flex-direction: column; gap: 12px; }
.hinweis { display: block; width: 100%; text-align: left; border: 0; padding: 14px; border-radius: 10px; background: var(--warn-grund); cursor: pointer; }
.hinweis.neutral { background: #F1F5F9; }
.hinweis strong { display: block; font-size: 14px; }
.hinweis span { display: block; margin-top: 4px; font-size: 13px; color: var(--warn-text); }
.hinweis.neutral span { color: var(--leise); }
.alles-gut { padding: 14px; border-radius: 10px; background: var(--akzent-hell); color: var(--akzent-dunkel); font-size: 14px; }

/* Tabellen-Listen */
.liste { display: flex; flex-direction: column; }
.listeneintrag { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--linie); }
.listeneintrag:first-child { border-top: 0; }
.listeneintrag .links { display: flex; gap: 14px; align-items: baseline; min-width: 0; }
.listeneintrag .datum { color: var(--leise); font-size: 13px; width: 48px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.listeneintrag .name { font-weight: 500; font-size: 14px; }
.listeneintrag .unter { font-size: 12px; color: var(--leise); }
.listeneintrag .betrag { font-weight: 600; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.summe { display: flex; justify-content: space-between; padding-top: 12px; border-top: 2px solid var(--linie); font-weight: 600; }

/* Knöpfe */
.knopf { min-height: 44px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--akzent); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.knopf:hover { background: var(--akzent-dunkel); color: #fff; }
.knopf.breit { width: 100%; }
.knopf-zweit { min-height: 44px; padding: 0 16px; border: 1px solid var(--linie); border-radius: 10px; background: var(--karte); font-weight: 600; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: var(--text); }
.knopf-zweit:hover { background: var(--grund); color: var(--text); }
.knopf-link { min-height: 44px; padding: 0 8px; border: 0; background: none; color: var(--akzent); font-weight: 600; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; text-decoration: none; }
.knopf-link:hover { text-decoration: underline; }
.knopf-gefahr { min-height: 44px; padding: 0 16px; border: 1px solid #FECACA; border-radius: 10px; background: #FEF2F2; color: var(--rot); font-weight: 600; font-size: 14px; cursor: pointer; }
.knopf-gefahr.bestaetigen { background: var(--rot); color: #fff; border-color: var(--rot); }

/* Konten */
.kartengitter { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.konto { display: flex; flex-direction: column; gap: 6px; }
.konto-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.konto h3 { font-size: 16px; font-weight: 600; }
.etikett { font-size: 12px; font-weight: 600; color: var(--akzent); background: var(--akzent-hell); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.etikett.grau { color: var(--leise); background: #F1F5F9; }
.betrag-gross { margin-top: 8px; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mit-symbol { display: flex; align-items: center; gap: 6px; }
.konto .aktionen { margin-top: auto; }
.aktionen { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--linie); align-items: center; }

/* Verträge */
.zeilen { display: flex; flex-direction: column; gap: 10px; }
.zeile { display: flex; justify-content: space-between; gap: 16px; width: 100%; text-align: left; background: var(--karte); border: 1px solid var(--linie); border-radius: 12px; padding: 16px 18px; cursor: pointer; }
.zeile:hover { border-color: #CBD5E1; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05); }
.zeile.gedimmt { opacity: 0.65; }
.zeile-haupt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.zeile-name { font-weight: 600; font-size: 15px; }
.zeile-betrag { display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 3px; white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
.zeile-betrag .leise { font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip { font-size: 12px; color: var(--leise); background: #F1F5F9; padding: 2px 8px; border-radius: 999px; }
.chip.warn { color: var(--warn-text); background: #FEF3C7; font-weight: 600; }
.abschnitt-titel { font-size: 13px; font-weight: 600; color: var(--leise); text-transform: uppercase; letter-spacing: 0.5px; margin: 8px 0 -8px; }
.leer { text-align: center; padding: 40px 24px; }
.leer p { color: var(--leise); margin: 8px auto 20px; max-width: 460px; }

/* ---------- Dialog / Formulare ---------- */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: 0 24px 64px rgba(15, 23, 42, 0.25); }
dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
.formular { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.formular h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.feld { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #334155; }
.feld input, .feld select, .feld textarea { font-weight: 400; font-size: 16px; min-height: 44px; padding: 10px 12px; border: 1px solid #CBD5E1; border-radius: 10px; background: #fff; width: 100%; }
.feld textarea { min-height: 72px; resize: vertical; }
.feld input:focus, .feld select:focus, .feld textarea:focus { outline: 2px solid var(--akzent); outline-offset: 0; border-color: var(--akzent); }
.feld small { font-weight: 400; color: var(--leise); font-size: 12px; }
.zwei { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.haken { display: flex; align-items: center; gap: 10px; font-size: 14px; min-height: 44px; }
.haken input { width: 20px; height: 20px; accent-color: var(--akzent); }
.formular details { border: 1px solid var(--linie); border-radius: 12px; padding: 0 14px; }
.formular details[open] { padding-bottom: 14px; }
.formular details summary { cursor: pointer; font-weight: 600; font-size: 14px; min-height: 44px; display: flex; align-items: center; }
.formular details .innen { display: flex; flex-direction: column; gap: 14px; }
.formular [data-nur] { display: none; }
.formular[data-art="versicherung"] [data-nur~="versicherung"],
.formular[data-art="abo"] [data-nur~="abo"],
.formular[data-art="vertrag"] [data-nur~="vertrag"],
.formular[data-art="einkunft"] [data-nur~="einkunft"] { display: flex; }
.formular[data-art="versicherung"] .zwei[data-nur~="versicherung"] { display: grid; }
.dialog-knoepfe { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.dialog-knoepfe .platz { flex: 1; }
.formular .fehler { color: var(--rot); font-size: 14px; }
.formular .fehler:empty { display: none; }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-karte { width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px; }
.login-karte h1 { font-size: 24px; }
.meldung { font-size: 14px; color: var(--rot); }
.meldung.ok { color: var(--akzent); }
.meldung:empty { display: none; }

/* ---------- Hinweis-Meldung ---------- */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--text); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 100; max-width: calc(100vw - 32px); }
#toast.zeigen { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.fehler { background: var(--rot); }

/* ---------- Untere Navigation (Handy) ---------- */
.untennav { display: none; }

@media (max-width: 760px) {
  body { font-size: 15px; }
  .hauptnav { display: none; }
  .kopf-innen { padding: 0 16px; min-height: 56px; }
  .inhalt { padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); gap: 16px; }
  .seitenkopf h1 { font-size: 24px; }
  .karte { padding: 16px; }
  .kennzahlen { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kennzahl { padding: 14px; }
  .kennzahl.hervor, .kennzahl:last-child { grid-column: 1 / -1; }
  .kennzahl .wert { font-size: 22px; }
  .kennzahl.hervor .wert { font-size: 32px; }
  .kennzahl .info { font-size: 12px; }
  .reihe { gap: 16px; }
  .reihe > .breit, .reihe > .schmal { flex-basis: 100%; }
  .balken-zeile { grid-template-columns: minmax(0, 1fr) 80px; row-gap: 6px; }
  .balken-zeile .balken { grid-column: 1 / -1; grid-row: 2; }
  .zeile { padding: 14px; }
  .zwei { grid-template-columns: minmax(0, 1fr); }
  #toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
  .untennav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--karte); border-top: 1px solid var(--linie); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .untennav a { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 48px; padding-top: 4px; font-size: 10.5px; color: var(--leise); text-decoration: none; text-align: center; }
  .untennav a.aktiv { color: var(--akzent); font-weight: 600; }
}
