/* ==========================================================================
   HUK-Companion – Basis-Stylesheet
   Reines CSS, keine Frameworks. Farben aus dem HUK-Logo.
   ========================================================================== */

:root {
    /* Marke */
    --huk-gelb:        #ffed00;
    --huk-gelb-dunkel: #e6d500;
    --huk-blau:        #002e5f;
    --huk-blau-hell:   #0a4a8f;
    --huk-blau-tief:   #001b39;

    /* Flächen */
    --flaeche:      #ffffff;
    --flaeche-2:    #f4f6f9;
    --flaeche-3:    #e8ecf2;
    --rand:         #d6dce6;
    --rand-stark:   #b6c0ce;

    /* Text */
    --text:         #16202e;
    --text-leise:   #5c6b7f;
    --text-invers:  #ffffff;

    /* Signale */
    --erfolg:       #0f7b4a;
    --erfolg-bg:    #e6f5ee;
    --fehler:       #b3261e;
    --fehler-bg:    #fdeceb;
    --hinweis:      #8a6100;
    --hinweis-bg:   #fff6e0;

    /* Form */
    --radius:       10px;
    --radius-klein: 6px;
    --schatten:     0 1px 2px rgba(16, 32, 56, .06), 0 2px 8px rgba(16, 32, 56, .06);
    --schatten-hoch:0 8px 30px rgba(16, 32, 56, .18);

    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "Consolas", "SF Mono", "Menlo", "Courier New", monospace;

    --kopf-hoehe: 60px;
}

* { box-sizing: border-box; }

/* Muss vor allem anderen stehen: Ein explizites display (z. B. inline-flex am
   .btn) schlägt sonst die display:none-Regel des Browsers für [hidden], und
   ausgeblendete Schaltflächen wären trotzdem sichtbar. */
[hidden] { display: none !important; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--flaeche-2);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }

a { color: var(--huk-blau-hell); }

/* Für Screenreader da, für Sehende nicht. */
.nur-vorlesen {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--huk-gelb);
    color: var(--huk-blau);
    padding: .6rem 1rem;
    z-index: 100;
    border-radius: 0 0 var(--radius-klein) 0;
}
.skip-link:focus { left: 0; }

/* --- Fokus: überall deutlich sichtbar, das ist hier zentral -------------- */
:focus-visible {
    outline: 3px solid var(--huk-blau-hell);
    outline-offset: 2px;
    border-radius: 3px;
}

/* ==========================================================================
   Anmeldung / Einrichtung
   ========================================================================== */

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background:
        radial-gradient(1200px 600px at 50% -10%, var(--huk-blau-hell) 0%, transparent 60%),
        linear-gradient(160deg, var(--huk-blau) 0%, var(--huk-blau-tief) 100%);
}

.login-karte {
    width: 100%;
    max-width: 380px;
    background: var(--flaeche);
    border-radius: 16px;
    box-shadow: var(--schatten-hoch);
    /* Ohne Logo und Überschrift wirkt die Karte oben schnell kopflastig –
       deshalb gleichmäßige Innenabstände. */
    padding: 2rem;
    text-align: center;
    /* Oben ein gelber Streifen als Markenakzent */
    border-top: 5px solid var(--huk-gelb);
}
.login-karte--breit { max-width: 640px; text-align: left; padding: 2.25rem 2rem; }

.login-logo {
    width: 148px;
    height: auto;
    margin: 0 auto .75rem;
    display: block;
}
.login-karte--breit .login-logo { margin-left: 0; }

.login-titel {
    font-size: 1.5rem;
    color: var(--huk-blau);
    margin-bottom: .15rem;
}
.login-unter {
    margin: 0 0 1.5rem;
    color: var(--text-leise);
    font-size: .9rem;
}

.login-karte .feld { text-align: left; }

/* ==========================================================================
   Formularelemente
   ========================================================================== */

.feld { margin-bottom: 1rem; }
.feld--voll { grid-column: 1 / -1; }

.feld label,
.dlg-inhalt label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-leise);
    margin-bottom: .3rem;
    letter-spacing: .01em;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="search"],
input[type="tel"],
select,
textarea {
    width: 100%;
    font: inherit;
    color: var(--text);
    background: var(--flaeche);
    border: 1px solid var(--rand-stark);
    border-radius: var(--radius-klein);
    padding: .55rem .7rem;
    transition: border-color .12s, box-shadow .12s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--huk-blau-hell);
    box-shadow: 0 0 0 3px rgba(10, 74, 143, .16);
}

input:disabled, select:disabled, textarea:disabled {
    background: var(--flaeche-3);
    color: var(--text-leise);
}

textarea { resize: vertical; min-height: 80px; }

.hilfe {
    font-size: .82rem;
    color: var(--text-leise);
    margin: .35rem 0 0;
}

.raster { display: grid; gap: 0 1rem; }
.raster--2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 620px) {
    .raster--2 { grid-template-columns: 1fr; }
}

.abschnitt {
    font-size: 1rem;
    color: var(--huk-blau);
    margin: 1.5rem 0 .75rem;
    padding-bottom: .35rem;
    border-bottom: 2px solid var(--flaeche-3);
}

/* Hotkey-Buchstabe: dezent, wird erst sichtbar, wenn Alt gedrückt wird. */
.hk { text-decoration: none; }
body.alt-aktiv .hk {
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 700;
    color: var(--huk-blau);
}

/* ==========================================================================
   Schaltflächen
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Kein gap: der Hotkey-Buchstabe ist ein eigenes Flex-Element
       (<span class="hk">N</span>euer Eintrag) und würde sonst vom Wort
       abgetrennt – "N euer Eintrag". */
    gap: 0;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    padding: .55rem .95rem;
    border: 1px solid var(--rand-stark);
    border-radius: var(--radius-klein);
    background: var(--flaeche);
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background .12s, border-color .12s, transform .04s;
}
.btn:hover { background: var(--flaeche-2); border-color: var(--rand-stark); }
.btn:active { transform: translateY(1px); }

.btn--primaer {
    background: var(--huk-gelb);
    border-color: var(--huk-gelb-dunkel);
    color: var(--huk-blau);
}
.btn--primaer:hover { background: var(--huk-gelb-dunkel); }

.btn--gefahr { color: var(--fehler); border-color: #e7bcb9; background: var(--flaeche); }
.btn--gefahr:hover { background: var(--fehler-bg); }

.btn--schlicht {
    background: transparent;
    border-color: transparent;
    color: var(--text-leise);
    font-weight: 500;
}
.btn--schlicht:hover { background: rgba(255,255,255,.14); color: var(--text-invers); }

.btn--breit { width: 100%; margin-top: .5rem; }
.btn--klein { padding: .3rem .55rem; font-size: .82rem; }

/* ==========================================================================
   Kopf / Navigation
   ========================================================================== */

.kopf {
    height: var(--kopf-hoehe);
    background: var(--huk-blau);
    border-bottom: 3px solid var(--huk-gelb);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 20;
}

.kopf-marke {
    display: flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    flex-shrink: 0;
}
.kopf-logo {
    height: 26px;
    width: auto;
    background: var(--flaeche);
    padding: 3px 6px;
    border-radius: 4px;
}
.kopf-name {
    color: var(--text-invers);
    font-weight: 700;
    letter-spacing: .02em;
}

.kopf-nav {
    display: flex;
    align-items: center;
    gap: .25rem;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
}

.nav-punkt {
    color: rgba(255,255,255,.82);
    text-decoration: none;
    font-weight: 600;
    font-size: .9rem;
    padding: .4rem .7rem;
    border-radius: var(--radius-klein);
    white-space: nowrap;
}
.nav-punkt:hover { background: rgba(255,255,255,.12); color: var(--text-invers); }
.nav-punkt.ist-aktiv {
    background: var(--huk-gelb);
    color: var(--huk-blau);
}

.nav-trenner {
    width: 1px;
    height: 22px;
    background: rgba(255,255,255,.22);
    margin: 0 .4rem;
    flex-shrink: 0;
}

.kopf-benutzer {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-shrink: 0;
}
.abmelden-form { margin: 0; }

.benutzer-chip {
    display: flex;
    align-items: center;
    gap: .5rem;
    text-decoration: none;
    padding: .25rem .5rem;
    border-radius: 999px;
}
.benutzer-chip:hover { background: rgba(255,255,255,.12); }

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--huk-gelb);
    color: var(--huk-blau);
    display: grid;
    place-items: center;
    font-size: .72rem;
    font-weight: 700;
    flex-shrink: 0;
}
.benutzer-name {
    color: var(--text-invers);
    font-size: .88rem;
    font-weight: 500;
}

@media (max-width: 780px) {
    .benutzer-name { display: none; }
    .kopf-name { display: none; }
}

/* ==========================================================================
   Inhalt
   ========================================================================== */

.inhalt {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

/* Volle Fensterbreite (nur etwas Abstand zum Rand) – für Seiten mit breiten
   Tabellen wie das Journal. Aktiviert über $vollbreite in der jeweiligen Seite. */
.inhalt--voll {
    max-width: none;
    padding-inline: clamp(1rem, 2vw, 2.5rem);
}

.karte {
    background: var(--flaeche);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    box-shadow: var(--schatten);
    overflow: hidden;
}
.karte--leer { padding: 2rem; text-align: center; }

.seiten-kopf {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.seiten-titel {
    font-size: 1.35rem;
    color: var(--huk-blau);
    margin: 0;
}
.seiten-titel .zaehler {
    font-size: .85rem;
    font-weight: 500;
    color: var(--text-leise);
    margin-left: .5rem;
}

.werkzeuge {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Das Suchformular bleibt in EINER Zeile (nowrap) – seine Felder brechen nicht
   einzeln um. Wird der Platz knapp, schrumpft das Suchfeld; die Umschalter und
   der „Neu"-Knopf rutschen über die äußere .werkzeuge (flex-wrap) sauber in die
   zweite Zeile. */
.werkzeuge--suche {
    flex-wrap: nowrap;
}

/* Zeitraum-Felder (Von/Bis) im Suchformular. */
.werkzeuge-datum {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-leise);
    white-space: nowrap;
}
.werkzeuge-datum input[type="date"] {
    width: auto;
    flex: 0 0 auto;
}

/* Wird der Platz knapp, schrumpft das Suchfeld – statt dass der Knopf
   umbricht. min-width: 0 hebt die Vorgabe von Flex auf, sonst schrumpft
   ein Eingabefeld nie unter seine Standardbreite. */
.suchfeld {
    flex: 1 1 200px;
    min-width: 0;
    max-width: 280px;
}

/* Auch die Filter-Auswahlfelder dürfen nicht einzeln umbrechen. */
.werkzeuge--suche select {
    width: auto;
    flex: 0 0 auto;
}

/* Umschalter Offen/Erledigt/Alle */
.schalter {
    display: inline-flex;
    border: 1px solid var(--rand-stark);
    border-radius: var(--radius-klein);
    overflow: hidden;
    background: var(--flaeche);
}
.schalter a {
    padding: .5rem .8rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-leise);
    text-decoration: none;
    border-right: 1px solid var(--rand);
}
.schalter a:last-child { border-right: 0; }
.schalter a:hover { background: var(--flaeche-2); }
.schalter a.ist-aktiv {
    background: var(--huk-blau);
    color: var(--text-invers);
}

/* ==========================================================================
   Meldungen
   ========================================================================== */

.alert {
    padding: .7rem 1rem;
    border-radius: var(--radius-klein);
    margin-bottom: 1rem;
    font-size: .9rem;
    border: 1px solid transparent;
}
.alert--erfolg  { background: var(--erfolg-bg); color: var(--erfolg); border-color: #b8e0cd; }
.alert--fehler  { background: var(--fehler-bg); color: var(--fehler); border-color: #f0c4c1; }
.alert--hinweis { background: var(--hinweis-bg); color: var(--hinweis); border-color: #ecd9a4; }

.code-block {
    background: var(--huk-blau-tief);
    color: #d6e4f5;
    padding: 1rem;
    border-radius: var(--radius-klein);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: .8rem;
    line-height: 1.5;
}

/* ==========================================================================
   Tabellen
   ========================================================================== */

.tabelle-wrap { overflow-x: auto; }

table.liste {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

/* Bewusst nicht sticky: .tabelle-wrap ist wegen overflow-x ein eigener
   Scroll-Container, in dem sich ein sticky <thead> über die erste Zeile legt
   statt am Fensterrand zu haften. */
table.liste th {
    text-align: left;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-leise);
    background: var(--flaeche-2);
    padding: .6rem .8rem;
    border-bottom: 1px solid var(--rand);
    white-space: nowrap;
}

table.liste td {
    padding: .65rem .8rem;
    border-bottom: 1px solid var(--flaeche-3);
    vertical-align: middle;
}

table.liste tbody tr { cursor: pointer; }
table.liste tbody tr:hover { background: var(--flaeche-2); }

/* Zeilenauswahl per Tastatur */
table.liste tbody tr.ist-gewaehlt {
    background: #e8f0fb;
    box-shadow: inset 3px 0 0 var(--huk-blau-hell);
}
table.liste tbody tr:focus-visible {
    outline: 2px solid var(--huk-blau-hell);
    outline-offset: -2px;
}

table.liste tr.ist-erledigt td:not(.spalte-aktion) {
    color: var(--text-leise);
}
table.liste tr.ist-erledigt .kunde-name { text-decoration: line-through; }

.spalte-eng { width: 1%; white-space: nowrap; }
.spalte-aktion { width: 1%; white-space: nowrap; text-align: right; }
.zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.kunde-name { font-weight: 600; }
.leise { color: var(--text-leise); font-size: .84rem; }

/* Eine Telefonnummer über zwei Zeilen ist schlecht ablesbar und beim
   Abtippen fehleranfällig – deshalb nie umbrechen. */
.telefon { white-space: nowrap; }

tfoot.summe td {
    background: var(--flaeche-2);
    font-weight: 700;
    border-top: 2px solid var(--rand);
    border-bottom: 0;
}

.leer-hinweis {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-leise);
}
.leer-hinweis p { margin: .25rem 0 1rem; }

/* Merkmale */
.marke {
    display: inline-block;
    padding: .12rem .5rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}
.marke--offen    { background: var(--hinweis-bg); color: var(--hinweis); }
.marke--erledigt { background: var(--erfolg-bg);  color: var(--erfolg); }
.marke--neutral  { background: var(--flaeche-3);  color: var(--text-leise); }
.marke--art      { background: #e8f0fb; color: var(--huk-blau-hell); }

/* Angebots-Status */
.marke--status-erstellt   { background: var(--flaeche-3);  color: var(--text-leise); }
.marke--status-versendet  { background: var(--hinweis-bg); color: var(--hinweis); }
.marke--status-angenommen { background: var(--erfolg-bg);  color: var(--erfolg); }
.marke--status-abgelehnt  { background: var(--fehler-bg);  color: var(--fehler); }

.notiz-zahl {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    font-size: .78rem;
    color: var(--text-leise);
}

/* ==========================================================================
   Dialoge
   ========================================================================== */

dialog.dialog {
    padding: 0;
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    box-shadow: var(--schatten-hoch);
    width: min(680px, calc(100vw - 2rem));
    max-height: calc(100vh - 3rem);
    background: var(--flaeche);
    color: var(--text);
}
dialog.dialog--schmal { width: min(460px, calc(100vw - 2rem)); }

dialog.dialog::backdrop {
    background: rgba(0, 27, 57, .55);
    backdrop-filter: blur(2px);
}

dialog.dialog > form {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 3rem);
}

.dlg-titel {
    background: var(--huk-blau);
    color: var(--text-invers);
    padding: .8rem 1.2rem;
    font-weight: 700;
    font-size: 1rem;
    border-bottom: 3px solid var(--huk-gelb);
    flex-shrink: 0;
}

.dlg-inhalt {
    padding: 1.2rem;
    overflow-y: auto;
    flex: 1;
}

.dlg-fuss {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    padding: .9rem 1.2rem;
    background: var(--flaeche-2);
    border-top: 1px solid var(--rand);
    flex-shrink: 0;
}
.dlg-fuss .links { margin-right: auto; }

/* ==========================================================================
   Notizen im Journal-Dialog
   ========================================================================== */

.notiz-bereich {
    margin-top: 1.25rem;
    border-top: 2px solid var(--flaeche-3);
    padding-top: 1rem;
}

.notiz-liste {
    list-style: none;
    margin: 0 0 .75rem;
    padding: 0;
    max-height: 190px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.notiz {
    background: var(--flaeche-2);
    border: 1px solid var(--rand);
    border-left: 3px solid var(--huk-blau-hell);
    border-radius: var(--radius-klein);
    padding: .5rem .7rem;
}
.notiz-kopf {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    font-size: .74rem;
    color: var(--text-leise);
    margin-bottom: .15rem;
}
.notiz-autor { font-weight: 700; color: var(--huk-blau); }
.notiz-text { white-space: pre-wrap; word-break: break-word; font-size: .88rem; }

.notiz-leer {
    color: var(--text-leise);
    font-size: .85rem;
    font-style: italic;
    padding: .5rem 0;
}

.notiz-neu { display: flex; gap: .5rem; align-items: flex-start; }
.notiz-neu textarea { min-height: 44px; }

/* ==========================================================================
   Combobox (Vertragsart)
   ========================================================================== */

.combo { position: relative; }

/* position: fixed, nicht absolute – sonst schneidet der scrollende
   .dlg-inhalt die Liste am unteren Fensterrand ab. Die Koordinaten setzt
   app.js beim Aufklappen. */
.combo-liste {
    position: fixed;
    z-index: 30;
    margin: 0;
    padding: .25rem;
    list-style: none;
    background: var(--flaeche);
    border: 1px solid var(--rand-stark);
    border-radius: var(--radius-klein);
    box-shadow: var(--schatten-hoch);
    max-height: 220px;
    overflow-y: auto;
}
.combo-liste[hidden] { display: none; }

.combo-liste li {
    padding: .42rem .6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: .9rem;
}
.combo-liste li[aria-selected="true"] {
    background: var(--huk-blau);
    color: var(--text-invers);
}
.combo-liste li.combo-leer {
    color: var(--text-leise);
    font-style: italic;
    cursor: default;
}

/* ==========================================================================
   Fuß
   ========================================================================== */

.fuss {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1rem 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-leise);
    font-size: .82rem;
}
/* Fußzeile bündig zur vollbreiten Tabelle. */
.fuss--voll {
    max-width: none;
    padding-inline: clamp(1rem, 2vw, 2.5rem);
}
.fuss .btn--schlicht { color: var(--text-leise); }
.fuss .btn--schlicht:hover { background: var(--flaeche-3); color: var(--text); }

kbd {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: .74rem;
    background: var(--flaeche-2);
    border: 1px solid var(--rand-stark);
    border-bottom-width: 2px;
    border-radius: 4px;
    padding: .05rem .35rem;
    color: var(--text);
}

.tasten-tabelle { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tasten-tabelle td { padding: .35rem .5rem; border-bottom: 1px solid var(--flaeche-3); }
.tasten-tabelle td:first-child { white-space: nowrap; width: 1%; }

/* ==========================================================================
   Profil
   ========================================================================== */

.profil-raster {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
    align-items: start;
}

.karte-block { padding: 1.25rem; }
.karte-block h2 {
    font-size: 1rem;
    color: var(--huk-blau);
    margin-bottom: 1rem;
    padding-bottom: .4rem;
    border-bottom: 2px solid var(--flaeche-3);
}

.schalter-zeile {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    padding: .5rem 0;
}
.schalter-zeile input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: .15rem;
    accent-color: var(--huk-blau);
    flex-shrink: 0;
}
.schalter-zeile label { margin: 0; font-size: .92rem; color: var(--text); font-weight: 600; }
.schalter-zeile .hilfe { margin-top: .15rem; }

.info-liste { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.info-liste li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .45rem 0;
    border-bottom: 1px solid var(--flaeche-3);
}
.info-liste li:last-child { border-bottom: 0; }
.info-liste .bezeichnung { color: var(--text-leise); }
.info-liste .wert { font-weight: 600; text-align: right; }

@media (max-width: 620px) {
    .inhalt { padding: 1rem .75rem 2rem; }
    .seiten-kopf { align-items: stretch; }
    .werkzeuge { width: 100%; }
    .suchfeld { flex: 1; min-width: 0; max-width: none; }
    table.liste th { position: static; }
}

/* ==========================================================================
   Dashboard – serverseitige Balkendiagramme (kein JS; Breite per Inline-Style)
   ========================================================================== */
.dashboard-sektion {
    margin-bottom: 1.1rem;
    padding: 1.1rem 1.35rem 1.3rem;
}

.dashboard-kopf {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: 1rem;
    padding-bottom: .85rem;
    border-bottom: 1px solid var(--rand);
}
.dashboard-kopf h2 { margin: 0; font-size: 1.05rem; color: var(--huk-blau); }
.dashboard-kopf h2 .zaehler {
    font-size: .8rem;
    font-weight: 500;
    color: var(--text-leise);
    margin-left: .5rem;
}
/* Zeitraum-Schnellwahl oben rechts */
.dashboard-schnellwahl { flex: 0 0 auto; }

.balken-liste {
    display: flex;
    flex-direction: column;
    gap: .45rem;
}
.balken-zeile {
    display: grid;
    grid-template-columns: minmax(120px, 200px) 1fr auto;
    align-items: center;
    gap: .6rem;
}
.balken-label {
    font-size: .9rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.balken-spur {
    background: var(--flaeche-2);
    border-radius: var(--radius-klein);
    height: 20px;
    overflow: hidden;
}
.balken-fuellung {
    display: block;
    height: 100%;
    min-width: 2px;
    background: var(--huk-blau-hell);
    border-radius: var(--radius-klein);
}
.balken-wert {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--text-leise);
    min-width: 2ch;
    text-align: right;
}
.balken--grau    { background: var(--text-leise); }
.balken--hinweis { background: var(--hinweis); }
.balken--erfolg  { background: var(--erfolg); }
.balken--fehler  { background: var(--fehler); }

.dashboard-doppel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.dashboard-teil h3 {
    margin: 0 0 .6rem;
    font-size: .95rem;
    color: var(--text-leise);
}

@media (max-width: 720px) {
    .dashboard-doppel { grid-template-columns: 1fr; }
    .balken-zeile { grid-template-columns: minmax(90px, 140px) 1fr auto; }
}
