/* Hausbuch — Design „Hell & Aufgeräumt" (Richtung A, siehe design/Main.dc.html).
   Alle Farben und Abstände hängen an diesen Variablen; neue Oberfläche benutzt
   die Variablen und erfindet keine neuen Hexwerte. */

:root {
  --flaeche: #F7F6F3;
  --karte: #FFFFFF;
  --rand: #E8E5DE;
  --rand-fein: #F1EFEA;
  --tinte: #23211C;
  --tinte-2: #6B675D;
  --tinte-3: #98938A;
  --akzent: #1E6E50;
  --akzent-dunkel: #14523B;
  --akzent-hell: #E7F1EC;
  --akzent-rand: #CFE2D8;
  --rot: #B3403A;
  --rot-dunkel: #8E2F2A;
  --rot-hell: #F7E9E8;
  --rot-rand: #F0DCDA;
  --gelb-text: #7A5415;
  --gelb-hell: #F6EFDF;
  --balken-blass: #A3C6B6;
  --radius: 12px;
  --radius-klein: 9px;
  --schrift: 'Figtree', 'Segoe UI', system-ui, sans-serif;
  --schrift-titel: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--flaeche);
  color: var(--tinte);
  font-family: var(--schrift);
  font-size: 15px;
}

h1, h2, h3 { font-family: var(--schrift-titel); margin: 0; }
h1 { font-size: 25px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 700; }

a { color: var(--akzent); text-decoration: none; font-weight: 600; }
a:hover { color: var(--akzent-dunkel); }

/* ---------- Grundgerüst ---------- */

.app { display: flex; min-height: 100vh; }

.seitenleiste {
  width: 232px;
  flex-shrink: 0;
  background: var(--karte);
  border-right: 1px solid var(--rand);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.wortmarke { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; }
.wortmarke .zeichen {
  width: 34px; height: 34px; border-radius: var(--radius-klein);
  background: var(--akzent); display: flex; align-items: center; justify-content: center;
}
.wortmarke .name { font-family: var(--schrift-titel); font-weight: 700; font-size: 19px; }

.navigation { display: flex; flex-direction: column; gap: 4px; }
.nav-punkt {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--radius-klein);
  color: var(--tinte-2); font-weight: 500; font-size: 14px;
  cursor: pointer; border: none; background: none; text-align: left;
  font-family: var(--schrift);
}
.nav-punkt:hover { background: var(--flaeche); color: var(--tinte); }
.nav-punkt.aktiv { background: var(--akzent-hell); color: var(--akzent-dunkel); font-weight: 600; }
.nav-punkt svg { flex-shrink: 0; }

.leisten-fuss { margin-top: auto; }
.leisten-trenner { border-top: 1px solid var(--rand); margin: 10px 8px; }
.benutzer-zeile { display: flex; align-items: center; gap: 10px; padding: 6px 8px 4px; }
.benutzer-kreis {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--akzent-hell); color: var(--akzent-dunkel);
  font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.benutzer-name { font-size: 13px; font-weight: 600; }
.benutzer-rolle { font-size: 11.5px; color: var(--tinte-3); }

.inhalt { flex: 1; min-width: 0; padding: 20px 28px 40px; max-width: 1360px; }

.seiten-kopf { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.seiten-kopf .untertitel { font-size: 13px; color: var(--tinte-3); margin-top: 3px; }
.dehner { flex: 1; }

/* ---------- Karten & Kennzahlen ---------- */

.karte {
  background: var(--karte);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  padding: 14px 18px;
}
.karten-kopf { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

.kpi-reihe { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi { display: flex; flex-direction: column; gap: 5px; }
.kpi .beschriftung { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tinte-3); font-weight: 600; }
.kpi .wert { font-size: 26px; font-weight: 700; }
.kpi .zusatz { font-size: 12px; color: var(--tinte-2); }
.wert.gruen { color: var(--akzent-dunkel); }
.wert.rot { color: var(--rot); }

.zwei-spalten { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 14px; align-items: start; }
.spalte { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* ---------- Tabellen ---------- */

.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th {
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--tinte-3); font-weight: 600; text-align: left;
  padding: 6px 8px; border-bottom: 1px solid var(--rand);
  white-space: nowrap;
}
.tabelle td { padding: 9px 8px; border-bottom: 1px solid var(--rand-fein); font-size: 13.5px; vertical-align: middle; }
.tabelle tr:last-child td { border-bottom: none; }
.tabelle .zahl, .tabelle th.zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabelle .summe td { border-top: 1px solid var(--rand); font-weight: 700; }
.tabelle .gedaempft { color: var(--tinte-3); }
.zelle-titel { font-weight: 600; }
.zelle-unter { font-size: 11.5px; color: var(--tinte-3); }
.betrag-offen { color: var(--rot); font-weight: 600; }
.tabellen-hinweis { font-size: 12px; color: var(--tinte-3); margin-top: 8px; }

/* ---------- Pillen & Abzeichen ---------- */

.pille {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 3px 10px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.pille.bezahlt { background: var(--akzent-hell); color: var(--akzent-dunkel); }
.pille.offen { background: var(--rot-hell); color: var(--rot-dunkel); }
.pille.teilweise { background: var(--gelb-hell); color: var(--gelb-text); }
.pille.ohne { background: var(--rand-fein); color: var(--tinte-3); }

.abzeichen {
  display: inline-block; border: 1px solid var(--rand); border-radius: 5px;
  padding: 0 5px; font-size: 10px; font-weight: 700; color: var(--tinte-2);
  text-transform: uppercase; letter-spacing: 0.03em;
}
.zaehler { background: var(--rot-hell); color: var(--rot-dunkel); border-radius: 999px; padding: 1px 8px; font-size: 11.5px; font-weight: 700; }

/* ---------- Knöpfe ---------- */

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-klein); padding: 9px 15px;
  font-size: 13.5px; font-weight: 600; font-family: var(--schrift);
  cursor: pointer; border: 1px solid transparent;
}
.knopf.primaer { background: var(--akzent); color: #FFFFFF; }
.knopf.primaer:hover { background: var(--akzent-dunkel); }
.knopf.geist { background: var(--karte); color: var(--tinte); border-color: var(--rand); }
.knopf.geist:hover { border-color: var(--tinte-3); }
.knopf.gruen-geist { background: var(--karte); color: var(--akzent-dunkel); border-color: var(--akzent-rand); }
.knopf.gruen-geist:hover { background: var(--akzent-hell); }
.knopf.gefahr { background: var(--karte); color: var(--rot-dunkel); border-color: var(--rot-rand); }
.knopf.gefahr:hover { background: var(--rot-hell); }
.knopf.klein { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.knopf.winzig { padding: 2px 8px; font-size: 11.5px; border-radius: 6px; }
.knopf:disabled { opacity: 0.5; cursor: default; }

.monat-schalter {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--karte); border: 1px solid var(--rand);
  border-radius: var(--radius-klein); padding: 6px 10px;
}
.monat-schalter .anzeige { font-size: 13.5px; font-weight: 600; min-width: 118px; text-align: center; }
.monat-schalter button { border: none; background: none; cursor: pointer; padding: 2px 4px; display: flex; color: var(--tinte-2); }
.monat-schalter button:hover { color: var(--tinte); }

/* ---------- Formulare & Dialoge ---------- */

.feld { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.feld label { font-size: 12.5px; font-weight: 600; color: var(--tinte-2); }
.feld input, .feld select, .feld textarea {
  font-family: var(--schrift); font-size: 14px; color: var(--tinte);
  background: var(--karte); border: 1px solid var(--rand);
  border-radius: 8px; padding: 9px 11px; width: 100%;
}
.feld input:focus, .feld select:focus, .feld textarea:focus {
  outline: 2px solid var(--akzent-rand); border-color: var(--akzent);
}
.feld .hinweis { font-size: 11.5px; color: var(--tinte-3); }
.feld-reihe { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

dialog {
  border: 1px solid var(--rand); border-radius: var(--radius);
  padding: 0; width: min(480px, calc(100vw - 40px));
  box-shadow: 0 18px 50px rgba(35, 33, 28, 0.18);
}
dialog::backdrop { background: rgba(35, 33, 28, 0.35); }
.dialog-kopf { display: flex; align-items: center; gap: 10px; padding: 16px 20px 0; }
.dialog-rumpf { padding: 14px 20px 4px; }
.dialog-fuss { display: flex; justify-content: flex-end; gap: 10px; padding: 10px 20px 18px; }
.formular-fehler {
  background: var(--rot-hell); color: var(--rot-dunkel);
  border: 1px solid var(--rot-rand); border-radius: 8px;
  padding: 9px 12px; font-size: 13px; margin-bottom: 12px;
}

/* ---------- Listen (offene Posten, Ausgaben) ---------- */

.posten {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--rot-rand); background: #FBF5F4;
  border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
}
.posten .betrag { font-size: 14px; font-weight: 700; color: var(--rot); font-variant-numeric: tabular-nums; }

.ausgabe-zeile { display: flex; align-items: center; gap: 11px; padding: 7px 0; }
.datei-kachel {
  width: 36px; height: 36px; border-radius: var(--radius-klein);
  background: var(--rand-fein); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ---------- Diagramm ---------- */

.diagramm { position: relative; height: 190px; }
.diagramm .grundlinie { position: absolute; left: 0; right: 0; bottom: 18px; border-top: 1px solid #D8D4CB; }
.diagramm .hilfslinie { position: absolute; left: 44px; right: 8px; border-top: 1px solid var(--rand-fein); }
.diagramm .hilfswert { position: absolute; left: 0; font-size: 10.5px; color: var(--tinte-3); }
.diagramm .balkenreihe {
  position: absolute; left: 44px; right: 8px; top: 0; bottom: 18px;
  display: flex; align-items: flex-end; justify-content: space-between;
}
.diagramm .balken { width: 22px; border-radius: 4px 4px 0 0; background: var(--balken-blass); min-height: 1px; }
.diagramm .balken.aktuell { background: var(--akzent); }
.diagramm .balken-spalte { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.diagramm .balken-wert { font-size: 11px; font-weight: 600; color: var(--tinte-2); font-variant-numeric: tabular-nums; }
.diagramm .monatsreihe { position: absolute; left: 44px; right: 8px; bottom: 0; display: flex; justify-content: space-between; }
.diagramm .monatsname { width: 26px; text-align: center; font-size: 10.5px; color: var(--tinte-3); }
.diagramm .monatsname.aktuell { color: var(--tinte-2); font-weight: 600; }

/* ---------- Anmeldung / Einrichtung ---------- */

.anmelde-buehne {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--flaeche);
}
.anmelde-karte {
  background: var(--karte); border: 1px solid var(--rand); border-radius: 16px;
  padding: 32px 34px; width: min(430px, 100%);
  box-shadow: 0 14px 44px rgba(35, 33, 28, 0.08);
}
.anmelde-karte .wortmarke { justify-content: center; padding-bottom: 8px; }
.anmelde-karte h1 { font-size: 21px; text-align: center; margin-bottom: 4px; }
.anmelde-karte .erklaerung { text-align: center; font-size: 13px; color: var(--tinte-2); margin: 0 0 18px; }

/* ---------- Meldungen & Leerzustände ---------- */

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--tinte); color: #FFFFFF; border-radius: 10px;
  padding: 10px 18px; font-size: 13.5px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(35, 33, 28, 0.25);
  opacity: 0; transition: opacity 0.25s; pointer-events: none; z-index: 50;
}
.toast.sichtbar { opacity: 1; }

.leer {
  text-align: center; color: var(--tinte-2); font-size: 13.5px;
  padding: 26px 16px;
}
.leer .gross { font-size: 15px; font-weight: 600; color: var(--tinte); margin-bottom: 4px; }

.laden { text-align: center; color: var(--tinte-3); padding: 40px 0; font-size: 13.5px; }

/* ---------- Chips (Belege, Filter) ---------- */

.chip-reihe { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.beleg-chip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--rand); border-radius: 7px;
  padding: 3px 8px; font-size: 12px; font-weight: 600; color: var(--tinte-2);
  cursor: pointer; background: var(--karte); font-family: var(--schrift);
}
.beleg-chip:hover { border-color: var(--akzent); color: var(--akzent-dunkel); }
.filter-chip {
  border: 1px solid var(--rand); border-radius: 999px; padding: 5px 13px;
  font-size: 12.5px; font-weight: 600; color: var(--tinte-2);
  cursor: pointer; background: var(--karte); font-family: var(--schrift);
}
.filter-chip.aktiv { background: var(--akzent-hell); color: var(--akzent-dunkel); border-color: var(--akzent-rand); }

/* ---------- Kleinbild (schmale Fenster) ---------- */

@media (max-width: 980px) {
  .app { flex-direction: column; }
  .seitenleiste {
    width: 100%; height: auto; position: static; flex-direction: row;
    align-items: center; gap: 4px; padding: 10px 12px; overflow-x: auto;
  }
  .navigation { flex-direction: row; }
  .nav-punkt { padding: 8px 10px; white-space: nowrap; }
  .nav-punkt span { display: none; }
  .wortmarke { padding: 0 8px 0 0; }
  .wortmarke .name { display: none; }
  .leisten-fuss { margin: 0 0 0 auto; }
  .leisten-trenner, .benutzer-zeile .benutzer-text { display: none; }
  .kpi-reihe { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .zwei-spalten { grid-template-columns: 1fr; }
  .inhalt { padding: 16px 14px 32px; }
  .tabellen-rollen { overflow-x: auto; }
}

/* ---------- Druck ---------- */

@media print {
  .seitenleiste, .knopf, .monat-schalter button, .toast, .filter-chip { display: none !important; }
  .inhalt { padding: 0; max-width: none; }
  .karte { border: none; padding: 0 0 14px; }
  body { background: #FFFFFF; font-size: 12px; }
}
