/* =================================================================
   Finanzuebersicht
   Farbwelt: tiefes Marineblau als Grundton, kuehles Papier als
   Flaeche, ein gesaettigtes Blau als einzige Signalfarbe.
   Zahlen laufen in einer Monospace, damit Spalten untereinander
   stehen wie in einer Abrechnung.
   ================================================================= */

:root {
  --ink-900: #070E22;
  --ink-700: #101C44;
  --ink-500: #35447A;
  --ink-300: #78849F;   /* AA auf --surface */
  --ink-200: #A9B2C8;

  --canvas:  #EEF1F7;
  --surface: #FFFFFF;
  --surface-2: #F7F9FC;
  --line:    #DFE4EF;
  --line-2:  #EDF0F6;

  --brand:      #1B4FE0;
  --brand-dark: #0F2F92;
  --brand-soft: #E8EEFE;

  --good: #0A7F58;
  --good-soft: #E2F4EC;
  --warn: #A9631A;
  --warn-soft: #FBEEDC;
  --bad:  #B32B44;
  --bad-soft: #FBE7EA;

  --radius: 14px;
  --radius-sm: 9px;
  --schatten: 0 1px 2px rgb(16 28 68 / .05), 0 8px 24px -12px rgb(16 28 68 / .18);
  --schatten-tief: 0 2px 4px rgb(16 28 68 / .06), 0 20px 48px -20px rgb(16 28 68 / .28);

  --sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink-700);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; letter-spacing: -0.022em; color: var(--ink-900); font-weight: 700; }
h1 { font-size: clamp(1.45rem, 1.1rem + 1.4vw, 1.9rem); }
h2 { font-size: 1.05rem; }
h3 { font-size: .9rem; }
p  { margin: 0 0 .75rem; }
a  { color: var(--brand); }

.zahl, td.zahl, .betrag {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: -0.02em;
}

.skip {
  position: absolute; left: -9999px;
  background: var(--ink-900); color: #fff;
  padding: .6rem 1rem; border-radius: 0 0 var(--radius-sm) 0; z-index: 99;
}
.skip:focus { left: 0; top: 0; }

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* -----------------------------------------------------------------
   Grundgeruest
   ----------------------------------------------------------------- */

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

.seitenleiste {
  width: 236px;
  flex: 0 0 236px;
  background: var(--ink-900);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.marke { display: flex; align-items: center; gap: .65rem; padding: 0 .5rem 1.6rem; }
.marke-zeichen {
  width: 26px; height: 26px; border-radius: 8px; flex: 0 0 26px;
  background: linear-gradient(145deg, #4E7BFF, var(--brand));
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .22);
  position: relative;
}
.marke-zeichen::after {
  content: ""; position: absolute; inset: 7px 8px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  border-radius: 0 0 0 2px; opacity: .9;
}
.marke-text { font-weight: 800; letter-spacing: -.02em; font-size: 1rem; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-punkt {
  display: flex; align-items: center; gap: .7rem;
  padding: .6rem .7rem;
  border-radius: 10px;
  color: #B9C4E4;
  text-decoration: none;
  font-weight: 500;
  font-size: .92rem;
  transition: background .15s ease, color .15s ease;
}
.nav-punkt svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-punkt:hover { background: rgb(255 255 255 / .07); color: #fff; }
.nav-punkt.ist-aktiv { background: var(--brand); color: #fff; font-weight: 600; }

.seitenleiste-fuss { margin-top: auto; padding: 0 .5rem; font-size: .82rem; }
.wer { display: block; color: #8D9AC0; }
.abmelden { color: #C9D3EE; text-decoration: none; font-weight: 600; }
.abmelden:hover { text-decoration: underline; }

.inhalt {
  flex: 1 1 auto;
  min-width: 0;
  padding: 2rem clamp(1rem, 3vw, 2.5rem) 4rem;
  max-width: 1180px;
}

/* -----------------------------------------------------------------
   Kopfzeile und Monatswechsler
   ----------------------------------------------------------------- */

.seitenkopf {
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: center; justify-content: space-between;
  margin-bottom: 1.6rem;
}
.seitenkopf .unterzeile { color: var(--ink-300); font-size: .9rem; margin: .15rem 0 0; }

.monatswechsler {
  display: inline-flex; align-items: center; gap: .2rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: .2rem; box-shadow: var(--schatten);
}
.mw-label { padding: 0 .8rem; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.mw-pfeil {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 999px;
  color: var(--ink-500); text-decoration: none;
}
.mw-pfeil svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mw-pfeil:hover { background: var(--brand-soft); color: var(--brand-dark); }

/* -----------------------------------------------------------------
   Karten
   ----------------------------------------------------------------- */

.karte {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: 1.25rem;
  margin-bottom: 1.1rem;
}
.karte-kopf {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem;
}
.karte-kopf .hinweis { color: var(--ink-300); font-size: .82rem; }

.raster { display: grid; gap: 1.1rem; }
.raster--kennzahlen { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 1.1rem; }
.raster--zwei { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }

.kennzahl { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.05rem 1.15rem; box-shadow: var(--schatten); }
.kennzahl .etikett {
  display: block; font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .075em;
  color: var(--ink-300); margin-bottom: .45rem;
}
.kennzahl .wert { font-family: var(--mono); font-size: 1.5rem; font-weight: 600; color: var(--ink-900); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.kennzahl .fussnote { font-size: .8rem; color: var(--ink-300); margin-top: .3rem; }
.kennzahl--gut  .wert { color: var(--good); }
.kennzahl--warn .wert { color: var(--warn); }
.kennzahl--kritisch .wert { color: var(--bad); }

/* -----------------------------------------------------------------
   Signaturelement: der Lohnstreifen
   Ein Abrechnungsstreifen mit perforiertem Rand. Er zeigt in einem
   Balken, wohin der Netto-Lohn des Monats geht.
   ----------------------------------------------------------------- */

.streifen {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--schatten-tief);
  padding: 1.3rem 1.4rem 1.4rem 2.1rem;
  margin-bottom: 1.1rem;
  overflow: hidden;
}
.streifen::before {
  content: "";
  position: absolute; left: .55rem; top: .8rem; bottom: .8rem;
  width: 6px;
  background-image: radial-gradient(circle at 3px 3px, var(--line) 2.6px, transparent 2.8px);
  background-size: 6px 13px;
}
.streifen-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: .55rem; margin-bottom: 1rem; }
.streifen-kopf h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-300); font-weight: 700; }
.streifen-kopf .basis { font-family: var(--mono); font-size: .82rem; color: var(--ink-500); }

.balken {
  display: flex; width: 100%; height: 34px;
  border-radius: 8px; overflow: hidden;
  background: var(--line-2);
  box-shadow: inset 0 0 0 1px rgb(16 28 68 / .05);
}
.balken-teil { position: relative; min-width: 3px; transition: filter .15s ease; }
.balken-teil:hover { filter: brightness(1.12); }
.balken-teil--rest { background: repeating-linear-gradient(135deg, #DCE2EF, #DCE2EF 5px, #E7EBF4 5px, #E7EBF4 10px); }

.legende { list-style: none; margin: .95rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); gap: .5rem 1.6rem; }
.legende li { display: flex; align-items: baseline; gap: .5rem; font-size: .87rem; border-bottom: 1px dotted var(--line); padding-bottom: .3rem; }
.legende .punkt { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 9px; transform: translateY(-1px); }
.legende .name { color: var(--ink-500); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legende .betrag {
  margin-left: auto; white-space: nowrap;
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-weight: 500; color: var(--ink-900); font-size: .84rem;
}

/* -----------------------------------------------------------------
   Fortschritt je Glaeubiger
   ----------------------------------------------------------------- */

.schuldliste { list-style: none; margin: 0; padding: 0; }
.schuldliste li { padding: .95rem 0; border-bottom: 1px solid var(--line-2); }
.schuldliste li:last-child { border-bottom: 0; padding-bottom: 0; }
.schuldliste li:first-child { padding-top: 0; }

.zeile-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.zeile-kopf .titel { font-weight: 600; color: var(--ink-900); text-decoration: none; }
.zeile-kopf .titel:hover { color: var(--brand); }
.zeile-kopf .rest { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; }

.fortschritt { height: 7px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.fortschritt span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), #4E7BFF); }
.fortschritt.ist-fertig span { background: linear-gradient(90deg, var(--good), #17B47E); }

.zeile-fuss { display: flex; flex-wrap: wrap; gap: .35rem .9rem; margin-top: .45rem; font-size: .8rem; color: var(--ink-300); }

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

.tabellenhuelle { overflow-x: auto; margin: 0 -1.25rem -1.25rem; padding: 0 1.25rem 1.25rem; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead th {
  text-align: left; font-size: .71rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-300); padding: 0 .7rem .55rem; white-space: nowrap;
}
tbody td { padding: .65rem .7rem; border-top: 1px solid var(--line-2); vertical-align: middle; }
tbody tr:hover { background: var(--surface-2); }
th.rechts, td.rechts { text-align: right; }
td.zahl { font-weight: 500; }
td .nebentext { color: var(--ink-300); font-size: .8rem; }

.abzeichen {
  display: inline-block; padding: .12rem .5rem; border-radius: 99px;
  font-size: .72rem; font-weight: 600; letter-spacing: .01em;
}
.abzeichen--offen    { background: var(--brand-soft); color: var(--brand-dark); }
.abzeichen--ruhend   { background: var(--warn-soft);  color: var(--warn); }
.abzeichen--erledigt { background: var(--good-soft);  color: var(--good); }

/* -----------------------------------------------------------------
   Formulare
   ----------------------------------------------------------------- */

.formular { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
.feld { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.feld--breit { grid-column: 1 / -1; }
.feld label { font-size: .78rem; font-weight: 600; color: var(--ink-500); }
.feld .hilfe { font-size: .76rem; color: var(--ink-300); }

input[type=text], input[type=password], input[type=number], input[type=date],
input[type=month], select, textarea {
  width: 100%;
  font: inherit;
  font-size: .92rem;
  color: var(--ink-900);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .55rem .7rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input[type=number] { font-family: var(--mono); font-variant-numeric: tabular-nums; }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  outline: none;
}
textarea { min-height: 74px; resize: vertical; }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 600; font-size: .9rem;
  padding: .58rem 1.1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--brand); color: #fff;
  cursor: pointer; text-decoration: none;
  transition: background .15s ease, transform .06s ease;
}
.knopf:hover { background: var(--brand-dark); }
.knopf:active { transform: translateY(1px); }
.knopf--leise { background: var(--surface); color: var(--ink-700); border-color: var(--line); }
.knopf--leise:hover { background: var(--surface-2); color: var(--ink-900); }
.knopf--gefahr { background: transparent; color: var(--bad); border-color: transparent; padding: .3rem .5rem; font-size: .82rem; }
.knopf--gefahr:hover { background: var(--bad-soft); }
.knopf--klein { padding: .35rem .8rem; font-size: .82rem; }

/* -----------------------------------------------------------------
   Meldungen, Leerzustaende
   ----------------------------------------------------------------- */

.meldung { border-radius: var(--radius-sm); padding: .7rem 1rem; font-size: .9rem; font-weight: 500; margin-bottom: 1.1rem; }
.meldung--ok      { background: var(--good-soft); color: var(--good); }
.meldung--fehler  { background: var(--bad-soft);  color: var(--bad); }
.meldung--hinweis { background: var(--brand-soft); color: var(--brand-dark); }

.leer { color: var(--ink-300); font-size: .9rem; margin: 0; }
.leerzustand { text-align: center; padding: 2rem 1rem; color: var(--ink-300); }
.leerzustand strong { display: block; color: var(--ink-700); font-size: 1rem; margin-bottom: .3rem; }

.kurve { width: 100%; height: auto; display: block; }

/* -----------------------------------------------------------------
   Anmeldeseite
   ----------------------------------------------------------------- */

.anmeldung {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(1000px 520px at 15% -10%, #16307E 0%, transparent 62%),
    radial-gradient(900px 480px at 92% 108%, #123A9E 0%, transparent 58%),
    var(--ink-900);
}
.anmeldung-karte {
  width: 100%; max-width: 396px;
  background: var(--surface);
  border-radius: 18px;
  padding: 2.1rem 1.9rem;
  box-shadow: 0 30px 70px -30px rgb(0 0 0 / .7);
}
.anmeldung-karte .marke { justify-content: center; padding-bottom: 1.3rem; }
.anmeldung-karte .marke-text { color: var(--ink-900); }
.anmeldung-karte h1 { font-size: 1.25rem; text-align: center; margin-bottom: .3rem; }
.anmeldung-karte .unterzeile { text-align: center; color: var(--ink-300); font-size: .88rem; margin-bottom: 1.5rem; }
.anmeldung-karte .knopf { width: 100%; margin-top: .35rem; }
.anmeldung-karte .feld { margin-bottom: .85rem; }

/* -----------------------------------------------------------------
   Schmale Bildschirme
   ----------------------------------------------------------------- */

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .seitenleiste {
    width: 100%; flex: none; height: auto; position: sticky; top: 0; z-index: 20;
    flex-direction: row; align-items: center; gap: .8rem;
    padding: .6rem .8rem;
    overflow-x: auto;
  }
  .marke { padding: 0 .4rem 0 .2rem; }
  .marke-text { display: none; }
  .nav { flex-direction: row; gap: .2rem; }
  .nav-punkt { padding: .45rem .7rem; white-space: nowrap; }
  .nav-punkt span { font-size: .85rem; }
  .seitenleiste-fuss { margin: 0 0 0 auto; padding: 0 .3rem; }
  .wer { display: none; }
  .inhalt { padding: 1.4rem 1rem 3rem; }
  .streifen { padding-left: 1.5rem; }
  .streifen::before { left: .45rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Druckansicht: die Uebersicht auf Papier */
@media print {
  .seitenleiste, .monatswechsler, .knopf, form { display: none !important; }
  body { background: #fff; }
  .karte, .kennzahl, .streifen { box-shadow: none; border-color: #ccc; break-inside: avoid; }
}
