/* ══ Buchhaltung — Gestaltung ══════════════════════════════════════════════
   BUCH-V1 (28.09.2026)

   Farben aus dem Event-Manager (dunkel, Gold), aber luftiger gesetzt und für
   einen Full-HD-Laptop ausgelegt: 1920×1080, ohne Zoom vollständig lesbar.

   Barrierefreiheit ist Pflicht, nicht Zugabe:
     · Text nie dunkler als #ccc
     · Bedienbares nie kleiner als 0.8rem
     · Klickflächen mindestens 38px hoch
     · Erklärungen als Karte beim Zeigen, nicht als Fließtext in der Seite
   ══════════════════════════════════════════════════════════════════════════ */

:root {
    color-scheme: dark;

    --grund:      #1a1a1a;   /* Seitenhintergrund */
    --flaeche:    #242424;   /* Karten, Kästen */
    --flaeche-2:  #2c2c2c;   /* darin nochmal abgesetzt */
    --rand:       #3a3a3a;
    --rand-hell:  #4a4a4a;

    --text:       #d8d8dc;   /* Grundtext — heller als die Mindestgrenze */
    --text-leise: #a8a8b0;   /* Nebensachen, nie für Bedienbares */
    --gold:       #f5c518;
    --gold-matt:  #c9a213;

    --gut:        #5fb87a;
    --warn:       #e0b341;
    --schlecht:   #e07a6b;
    --hinweis:    #6fa8dc;

    --radius:     10px;
    --schatten:   0 2px 12px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
    margin: 0;
    background: var(--grund);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
}

/* ══ Seitengerüst ═════════════════════════════════════════════════════════ */

/* Die Kopfzeile wächst mit, statt Reiter zu verstecken (NAVUMBRUCH-V1,
   28.09.2026). Vorher hatte sie eine feste Höhe und die Navigation
   scrollte waagerecht — mit ausgeblendeter Scrollbar. Bei 150 % Zoom
   waren dadurch vier von neun Reitern unsichtbar, ohne jeden Hinweis
   darauf, dass es sie gibt.

   Jetzt bricht sie um: erst rutscht die Navigation in eine eigene Zeile,
   dann die Reiter untereinander. Die Kopfzeile wird höher — das ist der
   richtige Preis dafür, dass alles erreichbar bleibt. */
.kopf {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 22px;
    padding: 9px 26px;
    min-height: 62px;
    background: #202020;
    border-bottom: 1px solid var(--rand);
    position: sticky;
    top: 0;
    z-index: 40;
}

.marke {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: .01em;
    white-space: nowrap;
    /* Ein langer Firmenname darf die Navigation nicht wegdrängen:
       er wird gekürzt, der volle Name steht in der Erklär-Karte. */
    max-width: 22ch;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
    cursor: help;
}
@media (max-width: 1500px) { .marke { max-width: 14ch; } }
@media (max-width: 1280px) { .marke .klein { display: none; } }
.marke .klein { color: var(--text-leise); font-weight: 400; font-size: .92rem; margin-left: 8px; }

/* flex-basis 460px heißt: Unterschreitet der Platz diese Breite, rutscht
   die ganze Navigation in eine eigene Zeile, statt sich zu stauchen. */
.navi { display: flex; flex-wrap: wrap; gap: 3px; flex: 1 1 460px; min-width: 0; }

.navi a {
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 13px;
    flex-shrink: 0;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: .95rem;
    white-space: nowrap;
    transition: background .12s, color .12s;
}
.navi a:hover { background: var(--flaeche-2); }
.navi a.hier  { background: var(--flaeche-2); color: var(--gold); font-weight: 600; }
.navi a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Schmaler Raum: engere Reiter, damit seltener umgebrochen werden muss.
   Die Schrift bleibt unangetastet — sie ist das Letzte, woran gespart
   werden darf. */
@media (max-width: 1100px) {
    .navi a { padding: 0 9px; }
    .kopf { gap: 8px 14px; padding: 8px 14px; }
}

.kopf-rechts { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

/* Jahreswahl — immer sichtbar, sie bestimmt alles auf der Seite */
.jahrwahl { display: flex; gap: 3px; background: #191919; padding: 4px; border-radius: 9px; border: 1px solid var(--rand); }
.jahrwahl a {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 62px; height: 32px;
    border-radius: 6px;
    color: var(--text-leise);
    text-decoration: none;
    font-size: .92rem;
    font-weight: 600;
}
.jahrwahl a:hover { color: var(--text); background: var(--flaeche-2); }
.jahrwahl a.hier  { background: var(--gold); color: #1a1a1a; }
.jahrwahl a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.wer { font-size: .92rem; color: var(--text-leise); white-space: nowrap; }
.wer b { color: var(--text); font-weight: 600; }

.inhalt { max-width: 1680px; margin: 0 auto; padding: 24px 26px 60px; }

/* ══ Überschriften ════════════════════════════════════════════════════════ */

h1 { font-size: 1.5rem; font-weight: 700; color: var(--gold); margin: 0 0 4px; }
h2 { font-size: 1.12rem; font-weight: 700; color: var(--text); margin: 0 0 12px; }
.unterzeile { color: var(--text-leise); font-size: .95rem; margin: 0 0 22px; }

/* ══ Karten ═══════════════════════════════════════════════════════════════ */

.karte {
    background: var(--flaeche);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 18px;
}
.karte > h2:first-child { margin-top: 0; }

.reihe { display: grid; gap: 18px; }
.reihe.z2 { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.reihe.z3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* ══ Zahlenkacheln ════════════════════════════════════════════════════════ */

.kacheln { display: flex; flex-wrap: wrap; gap: 12px; }

.kachel {
    position: relative;
    flex: 0 0 auto;
    min-width: 168px;
    padding: 12px 16px;
    background: var(--flaeche-2);
    border: 1px solid var(--rand);
    border-radius: 9px;
    cursor: help;
}
.kachel .wert  { font-size: 1.32rem; font-weight: 700; color: var(--gold); line-height: 1.25; }
.kachel .lbl   { font-size: .8rem; color: var(--text-leise); margin-top: 3px; }
.kachel.gut  .wert { color: var(--gut); }
.kachel.warn .wert { color: var(--warn); }
.kachel.schlecht .wert { color: var(--schlecht); }
.kachel.klickbar { cursor: pointer; }
.kachel.klickbar:hover { border-color: var(--gold); background: #333; }

/* ══ Erklär-Karte (statt title=) ══════════════════════════════════════════
   Der Browser-Hinweis ist klein, blass und nach einer Sekunde weg. Diese
   Karte bleibt, solange man zeigt, und ist lesbar. */

.tip {
    position: fixed;
    z-index: 200;
    max-width: 330px;
    padding: 12px 14px;
    background: #15151a;
    border: 1px solid var(--rand-hell);
    border-radius: 9px;
    box-shadow: var(--schatten);
    font-size: .9rem;
    line-height: 1.45;
    color: var(--text);
    pointer-events: none;
    opacity: 0;
    transition: opacity .12s;
}
.tip.an { opacity: 1; }
.tip .tip-kopf { font-weight: 700; color: var(--gold); margin-bottom: 5px; font-size: .95rem; }
.tip .tip-wert { float: right; color: var(--text-leise); font-weight: 400; }

/* ══ Formulare ════════════════════════════════════════════════════════════ */

.feld { margin-bottom: 15px; }
.feld label {
    display: block;
    font-size: .85rem;
    color: var(--text-leise);
    margin-bottom: 5px;
    font-weight: 600;
}
.feld label .pflicht { color: var(--gold); margin-left: 2px; }
.feld label .frage {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; margin-left: 6px;
    border: 1px solid var(--rand-hell); border-radius: 50%;
    font-size: .68rem; color: var(--text-leise); cursor: help;
    vertical-align: -3px;
}
.feld label .frage:hover { border-color: var(--gold); color: var(--gold); }

input[type=text], input[type=password], input[type=date], input[type=number],
input[type=search], input[type=email], select, textarea {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    background: #191919;
    border: 1px solid var(--rand);
    border-radius: 7px;
    color: var(--text);
    font-size: .95rem;
    font-family: inherit;
}
textarea { height: auto; min-height: 84px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
select { cursor: pointer; }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(245,197,24,.18);
}
input::placeholder, textarea::placeholder { color: #6a6a72; }

input.falsch, select.falsch, textarea.falsch {
    border-color: var(--schlecht);
    box-shadow: 0 0 0 3px rgba(224,122,107,.16);
}
.feld .meldung {
    display: none;
    margin-top: 5px;
    font-size: .84rem;
    color: var(--schlecht);
}
.feld .meldung.an { display: block; }

.betrag { text-align: right; font-variant-numeric: tabular-nums; }

/* ══ Knöpfe ═══════════════════════════════════════════════════════════════ */

.knopf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 18px;
    border: 1px solid var(--rand-hell);
    border-radius: 8px;
    background: var(--flaeche-2);
    color: var(--text);
    font-size: .95rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .12s, border-color .12s;
}
.knopf:hover { background: #343434; border-color: #5a5a5a; }
.knopf:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.knopf[disabled] { opacity: .45; cursor: not-allowed; }

.knopf.wichtig { background: var(--gold); border-color: var(--gold); color: #1a1a1a; }
.knopf.wichtig:hover { background: #ffd633; border-color: #ffd633; }
.knopf.gefahr { border-color: #7a3a33; color: var(--schlecht); }
.knopf.gefahr:hover { background: #3a2220; }
.knopf.schmal { height: 32px; padding: 0 12px; font-size: .88rem; }

.knopfreihe { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.knopfreihe.rechts { justify-content: flex-end; }

/* ══ Tabellen ═════════════════════════════════════════════════════════════ */

.tabelle { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabelle th {
    text-align: left;
    padding: 9px 12px;
    font-size: .8rem;
    font-weight: 700;
    color: var(--text-leise);
    border-bottom: 1px solid var(--rand);
    white-space: nowrap;
    position: sticky;
    top: 62px;
    background: var(--flaeche);
    z-index: 5;
}
.tabelle td { padding: 9px 12px; border-bottom: 1px solid #2e2e2e; vertical-align: middle; }
.tabelle tbody tr:hover { background: #2a2a2a; }
.tabelle td.zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabelle tr.offen td { background: rgba(224,178,65,.07); }
.tabelle tr.offen:hover td { background: rgba(224,178,65,.12); }

.leer { padding: 34px 20px; text-align: center; color: var(--text-leise); font-size: .95rem; }

/* ══ Zustands-Marken ══════════════════════════════════════════════════════ */

.marke-z {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: help;
}
.marke-z.erledigt  { background: rgba(95,184,122,.14); color: var(--gut);      border: 1px solid rgba(95,184,122,.35); }
.marke-z.offen     { background: rgba(224,178,65,.14); color: var(--warn);     border: 1px solid rgba(224,178,65,.35); }
.marke-z.unbekannt { background: rgba(224,122,107,.14); color: var(--schlecht); border: 1px solid rgba(224,122,107,.35); }
.marke-z.neutral   { background: #303030; color: var(--text-leise); border: 1px solid var(--rand); }

/* ══ Hinweisbalken ════════════════════════════════════════════════════════ */

.balken {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 16px;
    border-radius: 9px;
    margin-bottom: 18px;
    font-size: .95rem;
    border: 1px solid;
}
.balken .zeichen { font-size: 1.1rem; line-height: 1.3; flex-shrink: 0; }
.balken.warn     { background: rgba(224,178,65,.08);  border-color: rgba(224,178,65,.3);  color: #e8d5a0; }
.balken.schlecht { background: rgba(224,122,107,.08); border-color: rgba(224,122,107,.3); color: #e8b8b0; }
.balken.hinweis  { background: rgba(111,168,220,.08); border-color: rgba(111,168,220,.3); color: #bcd6ee; }
.balken.gut      { background: rgba(95,184,122,.08);  border-color: rgba(95,184,122,.3);  color: #b8dcc4; }
.balken a { color: inherit; font-weight: 600; }

/* ══ Modal ════════════════════════════════════════════════════════════════
   Schließt NICHT beim Klick daneben und NICHT mit Esc, solange etwas
   eingegeben wurde. Eine halb ausgefüllte Buchung soll nicht durch ein
   Verrutschen der Maus verlorengehen. */

.modal-hg {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.72);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 50px 20px;
    z-index: 100;
    overflow-y: auto;
}
.modal-hg[hidden] { display: none; }

.modal {
    width: 100%;
    max-width: 760px;
    background: var(--flaeche);
    border: 1px solid var(--rand-hell);
    border-radius: 13px;
    box-shadow: 0 12px 48px rgba(0,0,0,.6);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 100px);
}
.modal.breit { max-width: 1160px; }

.modal-kopf {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 17px 22px;
    border-bottom: 1px solid var(--rand);
    flex-shrink: 0;
}
.modal-kopf h3 { margin: 0; font-size: 1.1rem; font-weight: 700; color: var(--gold); flex: 1; }
.modal-zu {
    width: 34px; height: 34px;
    border: 1px solid var(--rand); border-radius: 7px;
    background: none; color: var(--text-leise);
    font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.modal-zu:hover { background: var(--flaeche-2); color: var(--text); border-color: var(--rand-hell); }
.modal-zu:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.modal-rumpf { padding: 20px 22px; overflow-y: auto; flex: 1; }
.modal-fuss {
    display: flex; gap: 10px; justify-content: flex-end; align-items: center;
    padding: 15px 22px;
    border-top: 1px solid var(--rand);
    flex-shrink: 0;
}
.modal-fuss .links { margin-right: auto; font-size: .88rem; color: var(--text-leise); }

/* ══ Kurzmeldung ══════════════════════════════════════════════════════════ */

.meldungen { position: fixed; right: 22px; bottom: 22px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.kurz {
    min-width: 260px; max-width: 420px;
    padding: 13px 16px;
    background: var(--flaeche);
    border: 1px solid var(--rand-hell);
    border-left: 3px solid var(--gold);
    border-radius: 9px;
    box-shadow: var(--schatten);
    font-size: .93rem;
    animation: rein .18s ease-out;
}
.kurz.gut      { border-left-color: var(--gut); }
.kurz.schlecht { border-left-color: var(--schlecht); }
.kurz.warn     { border-left-color: var(--warn); }
@keyframes rein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ══ Anmeldung ════════════════════════════════════════════════════════════ */

.anmelden-seite {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.anmelden-kasten {
    width: 100%;
    max-width: 400px;
    background: var(--flaeche);
    border: 1px solid var(--rand);
    border-radius: 13px;
    padding: 34px 32px;
    box-shadow: var(--schatten);
}
.anmelden-kasten h1 { text-align: center; margin-bottom: 4px; }
.anmelden-kasten .unterzeile { text-align: center; margin-bottom: 26px; }

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