/* Farben, Schrift und Formen aus dem Papierkram-Designsystem (Website
   papierkram.de, tokens.json): Tinte auf Weiss und blassen Toenen, ein
   Markenblau fuer Aktionen, Fira Sans. Die Namen links bleiben die der App,
   rechts steht das Token, aus dem der Wert kommt. Das System kennt nur ein
   helles Thema; das dunkle unten ist aus seinen Farben fuer dunkle Flaechen
   (color-ink, color-on-dark, ...) abgeleitet. */

@font-face { font-family: "Fira Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/fira-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/fira-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/fira-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/fira-sans-latin-700-normal.woff2") format("woff2"); }

:root {
    --bg: #f4f8fa;            /* color-mist-50 */
    --surface: #ffffff;       /* color-white */
    --surface-2: #e6f3fa;     /* color-mist-100: Tabellenkopf, Hover */
    --border: #d6e3ea;        /* color-line: Karten, Trennlinien */
    --border-field: #b7c9d3;  /* color-border: Felder, Pillen */
    --text: #102f40;          /* color-ink */
    --text-muted: #4b606c;    /* color-muted */
    --accent: #006b9f;        /* color-brand: Links, Knoepfe, Fokus */
    --accent-hover: #00527d;  /* color-brand-hover */
    --accent-soft: #d9f0fc;   /* color-sky-soft */
    --positive: #276923;      /* color-success */
    --negative: #8c1d18;      /* color-error */
    --negative-soft: #fdecea; /* color-error-soft */
    --on-accent: #ffffff;     /* Text auf Markenblau */
    /* Das System hat keine Warnfarbe fuer Text (color-sun nur als Flaeche);
       das Braunorange bleibt, 5:1 auf Weiss. */
    --warning: #b45309;

    /* Diagrammfarben. Hellblau, Sonne und Hellblau-hell sind laut System
       Flaechenfarben (zu wenig Kontrast fuer Linien und Text): nur fuer
       Balken. Linien nehmen Markenblau, Gruen, Petrol, Rot und Braunorange. */
    --chart-teal: #0d7482;      /* color-insights-accent: Preisanpassungen */
    --chart-sky: #03a9f4;       /* color-accent */
    --chart-sky-light: #7bd5fd; /* color-on-dark */
    --chart-sun: #ffc845;       /* color-sun */

    --radius: 16px;           /* radius-tile: Karten, Tabellenrahmen */
    --radius-control: 7px;    /* radius-button: Knoepfe, Umschalter, kleine Auswahlfelder */
    --radius-field: 12px;     /* radius-small: Eingabefelder, Menues */
    --shadow: none;           /* flache Karten: Rahmen in color-line statt Schatten */
    --shadow-panel: 0 18px 40px #102f401f; /* shadow-panel */
    --focus-halo: 0 0 0 3px #006b9f33;     /* shadow-focus-field */

    /* Mandantenfarben: Rot steht fuer Testdaten, Tinte fuer den Echtbetrieb.
       Beide heben sich bewusst vom Markenblau der Bedienelemente ab, damit
       die Kennzeichnung nicht mit gewoehnlichen Links verschwimmt. */
    --mandant-test: #b42318;
    --mandant-live: #102f40;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b2230;
        --surface: #102f40;       /* color-ink */
        --surface-2: #163a4e;
        --border: #24485c;
        --border-field: #4b606c;
        --text: #f4f8fa;
        --text-muted: #c9dbe5;    /* color-on-dark-muted */
        --accent: #7bd5fd;        /* color-on-dark */
        --accent-hover: #a9e4fe;
        --accent-soft: #0b5f8c;   /* color-night-blue */
        --positive: #54c147;      /* color-leaf */
        --negative: #f0766a;
        --negative-soft: #3b1a1a;
        --on-accent: #102f40;     /* Tinte auf color-on-dark, wie der Anmeldeknopf auf Dunkel */
        --warning: #e0a145;
        --chart-teal: #9fd0d9;    /* color-insights-line */
        --chart-sun: #fff1c2;     /* color-sun-soft: heller als die Warnfarbe, sonst gleichen sich Aus Free und Contraction */
        --mandant-test: #ff7a6b;
        --mandant-live: #7bd5fd;
        --focus-halo: 0 0 0 3px #7bd5fd40;
    }
}

* { box-sizing: border-box; }

/* Der aktive Mandant faerbt saemtliche Kennzeichen ueber eine einzige
   Variable. Ein Streifen am oberen Rand bleibt beim Scrollen stehen, damit
   nie unklar ist, welche Daten man gerade sieht – die Verwechslung von
   Testdaten mit echten ist der teuerste Irrtum hier. */
body.nicht-produktiv { --mandant: var(--mandant-test); }
body.produktiv       { --mandant: var(--mandant-live); }

/* Die Farbe faerbt, was Auswahl und Zustand anzeigt: Streifen, Umschalter,
   aktiver Navigationseintrag, Schaltflaeche und Eingabefokus. Diagramme und
   Kennzahlen behalten ihre eigenen Farben – dort steht Farbe fuer die
   Bedeutung der Daten und darf nicht mit dem Mandanten wechseln. */

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--mandant);
    z-index: 100;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    /* Fira Sans wie auf papierkram.de; nur echte Schnitte, keine
       errechneten. Die Groesse bleibt dashboardtypisch dichter als die
       16 px der Website. */
    font: 15px/1.55 "Fira Sans", Arial, Helvetica, sans-serif;
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--accent-hover); }

/* Fokus wie im System: kraeftiger Rahmen in Markenblau, auf dunklem Grund color-on-dark */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }

header.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    white-space: nowrap;
}

/* Inline-SVG, damit die Schrift des Logos der Textfarbe folgt (dunkles Thema) */
.brand .logo {
    display: block;
    height: 26px;
    width: auto;
    color: var(--text);
}
.profile-switch {
    display: flex;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
}

.profile-switch a {
    padding: 4px 11px;
    border-radius: var(--radius-control);
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}
.profile-switch a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }

 /* Jeder Eintrag zeigt die Farbe seines Mandanten, nicht die des gerade
    gewaehlten – so ist schon vor dem Klick erkennbar, wohin er fuehrt. */
.profile-switch a { --eintrag: var(--mandant-test); }
.profile-switch a.produktiv { --eintrag: var(--mandant-live); }

.profile-switch a:hover {
    background: color-mix(in srgb, var(--eintrag) 10%, transparent);
    color: var(--eintrag);
}

.profile-switch a.active {
    background: color-mix(in srgb, var(--eintrag) 16%, transparent);
    color: var(--eintrag);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--eintrag) 40%, transparent);
}

.profile-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--mandant) 16%, transparent);
    color: var(--mandant);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mandant) 40%, transparent);
    white-space: nowrap;
}

.brand span {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    margin-left: 4px;
}

/* Zeitraumwahl: eine Zeile aus Auswahlfeld und freier Spanne */
.zeitraum {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}

.zeitraum label { display: flex; align-items: center; gap: 5px; }
.zeitraum span { font-size: 12px; color: var(--text-muted); }

.zeitraum select,
.zeitraum input {
    font: inherit;
    font-size: 13px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-field);
    border-radius: var(--radius-control);
    padding: 5px 8px;
}
.zeitraum select { padding-right: 24px; cursor: pointer; }
.zeitraum select:focus,
.zeitraum input:focus { outline: 2px solid var(--mandant); outline-offset: -1px; box-shadow: var(--focus-halo); }

.zeitraum button {
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--mandant);
    background: color-mix(in srgb, var(--mandant) 13%, transparent);
    border: 1px solid transparent;
    border-radius: var(--radius-control);
    padding: 5px 12px;
    cursor: pointer;
}
.zeitraum button:hover { border-color: var(--mandant); }

/* Ein aktiver Branchenfilter soll nicht zu uebersehen sein */
.zeitraum select.gefiltert { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.filterhinweis {
    display: flex; gap: 12px; align-items: baseline; justify-content: space-between; flex-wrap: wrap;
    margin: 0 0 16px; padding: 10px 14px; border-radius: var(--radius-field); font-size: 13.5px;
    background: color-mix(in srgb, var(--accent) 9%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.filterhinweis a { white-space: nowrap; font-weight: 600; }

/* Navigation als Spalte links, Inhalt rechts daneben */
.shell {
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

main { padding: 24px; min-width: 0; }

.seitennav {
    position: sticky;
    top: 62px;
    padding: 24px 0 24px 24px;
}

.seitennav nav { display: flex; flex-direction: column; gap: 2px; }

.seitennav a {
    padding: 8px 12px;
    border-radius: var(--radius-control);
    color: var(--text-muted);
    font-size: 14px;
    border-left: 2px solid transparent;
}
.seitennav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.seitennav a.active {
    background: color-mix(in srgb, var(--mandant) 13%, transparent);
    color: var(--mandant);
    font-weight: 500;
    border-left-color: var(--mandant);
}
/* Betrieb statt Auswertung: abgesetzt unter den Seiten */
.seitennav a.betrieb { margin-top: 14px; font-size: 13px; }
.seitennav a.betrieb + a.betrieb { margin-top: 0; }

h1 { font-size: 26px; font-weight: 500; line-height: 1.15; margin: 0 0 6px; letter-spacing: -.012em; text-wrap: balance; }
h2 { font-size: 16px; margin: 0 0 16px; font-weight: 600; text-wrap: balance; }
.page-note { color: var(--text-muted); font-size: 13px; margin: 0 0 24px; }

.kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
/* Sechs Kennzahlen in einer Reihe, etwa im Akquise-Kanal */
.kpis.sechs { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

.kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
}
/* Was Aufmerksamkeit braucht, ueber den Kacheln des Ueberblicks */
.hinweisleiste { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 18px; }
.hinweisleiste a {
    font-size: 13px;
    padding: 6px 12px;
    border-radius: var(--radius-control);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
}
.hinweisleiste a:hover { text-decoration: none; border-color: var(--accent); }
.hinweisleiste a.negativ { border-left: 3px solid var(--negative); }
.hinweisleiste a.warnung { border-left: 3px solid var(--warning); }

/* Kachel, die zur Heimatseite ihrer Kennzahl fuehrt (Ueberblick) */
a.kpi { display: block; color: inherit; transition: border-color .15s; }
a.kpi:hover { text-decoration: none; border-color: var(--accent); }
a.kpi .label::after { content: ' →'; opacity: 0; transition: opacity .15s; }
a.kpi:hover .label::after { opacity: 1; }
.kpi .label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 26px; font-weight: 600; margin: 6px 0 2px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12.5px; color: var(--text-muted); }
.kpi .vorjahr {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--border);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    white-space: nowrap;
}
.kpi .vorjahr span {
    overflow: hidden;
    text-overflow: ellipsis;
}
.kpi .vorjahr b { font-weight: 600; font-variant-numeric: tabular-nums; }

.positiv { color: var(--positive); }
.negativ { color: var(--negative); }
.warnung { color: var(--warning); }

.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* Zwei Trichter gehoeren nebeneinander, sonst vergleicht man ueber eine
   Bildschirmhoehe hinweg. Dafuer duerfen sie enger stehen als die uebrigen
   Zweispalter – 400px je Spalte passen im Inhaltsbereich nicht. */
.grid.nebeneinander { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    min-width: 0;
}
.card.wide { grid-column: 1 / -1; }
.card .hint { font-size: 12.5px; color: var(--text-muted); margin: -10px 0 14px; }

.chart-wrap { position: relative; height: 300px; }
.chart-wrap.tall { height: 360px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border); }
th {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }

/* Die Zeile, deren Detailansicht gerade offen ist. Der Streifen am linken
   Rand bindet Tabelle und Detailkarte sichtbar aneinander. */
tbody tr.hervorgehoben { background: var(--surface-2); }
tbody tr.hervorgehoben td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

td.muted, tr.muted td, span.muted { color: var(--text-muted); }

/* Summenzeile: abgesetzt, damit sie sich nicht wie eine weitere Zeile liest. */
tfoot td { border-top: 2px solid var(--border); font-weight: 600; padding-top: 10px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-scroll { overflow-x: auto; }

.sub-hinweis {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 500;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.badge.ok { color: var(--positive); border-color: color-mix(in srgb, var(--positive) 35%, transparent); }
.badge.fehler { color: var(--negative); border-color: color-mix(in srgb, var(--negative) 35%, transparent); }
.badge.warnung { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 35%, transparent); }

.cohort {
    font-size: 12px;
    border-collapse: separate;
    border-spacing: 2px;
    /* nicht auf volle Breite dehnen, sonst driften die Spalten auseinander */
    width: auto;
}
.cohort td.label, .cohort th:first-child, .cohort th:nth-child(2) { padding-right: 18px; }
.cohort th { padding: 4px 6px; }
.cohort td {
    padding: 6px 4px;
    text-align: center;
    border: none;
    border-radius: 5px;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    min-width: 52px;
    width: 52px;
}
.cohort td.empty { background: transparent; color: var(--text-muted); }
.cohort td.label { text-align: left; background: transparent; font-weight: 500; white-space: nowrap; width: auto; min-width: 0; }

.empty-state {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 32px;
    text-align: center;
}
.empty-state h1 { margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); margin: 0 0 20px; }
code, pre.command {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    padding: 2px 6px;
}
pre.command { padding: 12px 16px; display: inline-block; text-align: left; margin: 0; }

footer { color: var(--text-muted); font-size: 12.5px; padding: 8px 0 32px; text-align: center; }

@media (max-width: 1100px) {
    .shell { grid-template-columns: 1fr; }
    .seitennav {
        position: static;
        padding: 16px 24px 0;
        order: -1;
    }
    .seitennav nav { flex-direction: row; flex-wrap: wrap; }
    .seitennav a { border-left: none; border-bottom: 2px solid transparent; }
    .seitennav a.active { border-left-color: transparent; border-bottom-color: var(--accent); }
    .seitennav a.betrieb { margin-top: 0; margin-left: auto; }
}

@media (max-width: 760px) {
    .topbar-inner, main, .seitennav { padding-left: 16px; padding-right: 16px; }
    .zeitraum { margin-left: 0; }
    .grid.cols-2, .grid.cols-3, .grid.nebeneinander { grid-template-columns: 1fr; }
    .chart-wrap { height: 260px; }
}

/* Auswahl einer zweiten Aktion zum Vergleich, im Detail einer Aktion. */
.vergleich-waehlen {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.vergleich-waehlen label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.vergleich-waehlen select {
    font: inherit;
    font-size: 13px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-field);
    border-radius: var(--radius-control);
    padding: 5px 24px 5px 8px;
    cursor: pointer;
    max-width: 100%;
}

.vergleich-waehlen select:focus { outline: 2px solid var(--mandant); outline-offset: -1px; }

/* Einordnung einer Kennzahl gegen die Richtgroessen ihres Segments. */
.kpi .ampel {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 5px;
    vertical-align: middle;
    cursor: help;
}

/* Eigene Toene statt der Textfarben: als achtpunktgrosser Kreis laesst sich
   das dunkle Braunorange der Warnfarbe kaum von Rot unterscheiden. Gruen
   und Gelb sind die hellen Flaechenfarben des Systems, Rot setzt sich durch
   seine Helligkeit ab. */
.kpi .ampel.gut     { background: #54c147; } /* color-leaf */
.kpi .ampel.mittel  { background: #ffc845; } /* color-sun */
.kpi .ampel.schwach { background: #b42318; }

/* Umschaltung eines Diagramms zwischen Groessen, die sich nur im Faktor
   unterscheiden – etwa MRR und ARR. */
.chart-umschalter {
    display: flex;
    gap: 4px;
    margin: -4px 0 10px;
}

.chart-umschalter button {
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    padding: 3px 10px;
    cursor: pointer;
}

.chart-umschalter button:hover { color: var(--text); }

.chart-umschalter button.aktiv {
    color: var(--mandant);
    border-color: var(--mandant);
    background: var(--accent-soft);
}

/* Sortierbare Tabellen */
th.sortierbar { cursor: pointer; user-select: none; }
th.sortierbar:hover, th.sortierbar:focus-visible { color: var(--text); outline: none; }
th.sortierbar::after { content: ' ↕'; opacity: .3; font-size: 10px; }
th.sortierbar[aria-sort="ascending"]::after { content: ' ▲'; opacity: .8; }
th.sortierbar[aria-sort="descending"]::after { content: ' ▼'; opacity: .8; }
tr.summe td { border-top: 2px solid var(--border); font-weight: 600; }
/* Zusatzzeile vor der Summe, etwa Kosten ohne Kanal: abgesetzt, aber nicht fett */
tr.summe.zusatz td { font-weight: 400; color: var(--text-muted); }
tr.summe.zusatz + tr.summe td { border-top-width: 1px; }

/* Reiter: mehrere Diagramme in einer Karte */
.reiter {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    margin: -2px 0 14px;
}
.reiter [role="tab"] {
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: 7px 12px;
    cursor: pointer;
}
.reiter [role="tab"]:hover { color: var(--text); }
/* Reiter einer Seite: Links, jede Ansicht mit eigener Adresse */
.seitenreiter { margin: 8px 0 20px; }
.seitenreiter a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: 8px 14px;
}
.seitenreiter a:hover { color: var(--text); text-decoration: none; }
.seitenreiter a[aria-current="page"] { color: var(--mandant); border-bottom-color: var(--mandant); }
.reiter [role="tab"][aria-selected="true"] { color: var(--mandant); border-bottom-color: var(--mandant); }
.reiter [role="tab"]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }
.reiter-karte .chart-wrap.tall { height: 440px; }
@media (max-width: 720px) {
    .reiter-karte .chart-wrap.tall { height: 320px; }
}

/* ── Uebersicht und Detail ─────────────────────────────────────────────── */
tr[data-href] { cursor: pointer; }
tr[data-href]:hover td:first-child a { text-decoration: underline; }
table.master td:first-child { white-space: nowrap; }
.brotkrumen { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); margin: 0 0 6px; }
.brotkrumen form { margin: 0; }
.brotkrumen select {
    font: inherit; color: var(--text); background: var(--surface);
    border: 1px solid var(--border-field); border-radius: var(--radius-control); padding: 3px 6px;
}

/* Trichter: mittige Balken, so breit wie der Anteil der Anfragen, dazwischen
   ein Uebergang, der sich auf den naechsten Schritt verjuengt */
.trichter { margin: 4px 0 18px; font-size: 12.5px; }
.trichter-schritt, .trichter-uebergang {
    display: grid; grid-template-columns: 118px 1fr 76px; gap: 10px; align-items: center;
}
.trichter-uebergang { grid-template-columns: 118px 1fr 76px; }
.trichter-uebergang > .trichter-spur { grid-column: 2; }
.trichter-spur { position: relative; display: flex; justify-content: center; }
.trichter-balken { height: 30px; background: var(--accent); border-radius: 3px; }
.trichter-uebergang .trichter-spur { height: 22px; }
.trichter-trapez { position: absolute; inset: 0; background: var(--accent-soft); }
.trichter-quote {
    position: relative; align-self: center; font-size: 11px; color: var(--text-muted);
    background: var(--surface); padding: 0 6px; border-radius: var(--radius-control);
}
.trichter-name { color: var(--text); }
.trichter-wert { text-align: right; font-variant-numeric: tabular-nums; line-height: 1.25; }
.trichter-wert strong { display: block; font-weight: 600; }
.trichter-wert span { font-size: 11px; color: var(--text-muted); }

/* Zweite, kleinere Angabe unter einem Tabellenwert, etwa der Anteil unter der Anzahl */
.unterzeile { display: block; font-size: 11px; color: var(--text-muted); }

/* Richtungspfeil beim Vergleich zweier Trichter. */
.pfeil {
    margin-left: 5px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.pfeil.hoch   { color: var(--positive); }
.pfeil.runter { color: var(--negative); }
.pfeil.gleich { color: var(--text-muted); }

/* Veraenderung gegen den Zeitraum davor, klein unter dem Wert. */
.delta {
    display: block;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 1px;
}

.delta.hoch   { color: var(--positive); }
.delta.runter { color: var(--negative); }
.delta.gleich { color: var(--text-muted); font-weight: 500; }

/* Kleine Verlaufslinie in einer eigenen, schmalen Spalte: sie steht neben
   der Zahl und soll sie nicht ueberstimmen, deshalb duenn und zurueckgenommen. */
.spark-spalte {
    width: 74px;
    padding-right: 4px;
}

.spark {
    display: block;
    margin: 0;
    overflow: visible;
}

.spark polyline {
    fill: none;
    stroke: var(--accent);
    stroke-width: 1.2;
    stroke-linejoin: round;
    stroke-linecap: round;
    opacity: .75;
}

.spark circle {
    fill: var(--accent);
}

/* Stand der Daten unter der Navigation: eine Randnotiz, die da sein soll,
   wenn man sie sucht, und sonst nicht auffaellt. */
.seitennav .datenstand {
    margin: 18px 14px 0;
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-muted);
}

/* ── Anmeldung und Verwaltung ─────────────────────────────────────────── */

.formular { display: grid; gap: 12px; max-width: 520px; }
.formular label { display: grid; gap: 4px; font-size: 13px; color: var(--text-muted); }
.formular label.haken { display: flex; align-items: center; gap: 8px; color: var(--text); }
.formular input[type=text],
.formular input[type=password] {
    font: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-field);
    border-radius: var(--radius-field);
    padding: 9px 12px;
}
.formular input:focus { outline: 2px solid var(--accent); outline-offset: -1px; box-shadow: var(--focus-halo); }
.formular fieldset { border: 1px solid var(--border); border-radius: var(--radius-field); padding: 10px 14px; margin: 0; }
.formular legend { font-size: 12px; color: var(--text-muted); padding: 0 4px; }

.knopf {
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--on-accent);
    background: var(--accent);
    border: 1px solid transparent;
    border-radius: var(--radius-control);
    padding: 9px 16px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: transform .2s, background-color .2s;
}
.knopf:hover { text-decoration: none; color: var(--on-accent); background: var(--accent-hover); transform: translateY(-2px); }
.knopf.leise { color: var(--accent); background: var(--surface); border-color: var(--accent); }
.knopf.leise:hover { color: var(--accent); background: var(--accent-soft); }
.knopf.gefahr { color: var(--negative); background: transparent; border-color: var(--negative); }
.knopf.gefahr:hover { color: var(--negative); background: var(--negative-soft); }
@media (prefers-reduced-motion: reduce) { .knopf { transition: none; } .knopf:hover { transform: none; } }
.knoepfe { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.meldung { padding: 10px 14px; border-radius: var(--radius-field); margin-bottom: 14px; font-size: 13.5px; border: 1px solid var(--border); }
.meldung.ok { color: var(--positive); border-color: color-mix(in srgb, var(--positive) 35%, transparent); }
.meldung.fehler { color: var(--negative); background: var(--negative-soft); border-color: transparent; }
.meldung.warnung { color: var(--text); background: color-mix(in srgb, var(--warning) 14%, transparent); border-color: color-mix(in srgb, var(--warning) 45%, transparent); }

/* Karten einer Rolle: je Seite ein Block mit Haken */
.karten-wahl { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; max-width: none; align-items: start; }
.karten-wahl fieldset { display: grid; gap: 4px; align-content: start; }
.karten-wahl .reiter-titel { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-top: 6px; }
.karten-wahl .alle { font-size: 12px; margin-bottom: 4px; }

.anmeldung-seite { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.anmeldung-seite .card { width: 100%; max-width: 380px; }
.anmeldung-seite h1 { font-size: 18px; margin: 0 0 16px; }

.benutzer-box { margin-top: 18px; font-size: 12.5px; color: var(--text-muted); }
.benutzer-box form { margin-top: 4px; }
.benutzer-box button { font: inherit; font-size: 12.5px; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }
