html, body {
    font-family: var(--schrift-text);
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: var(--verweis);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem var(--flaeche), 0 0 0 0.25rem var(--verweis);
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--gruen);
}

.invalid {
    outline: 1px solid var(--rot);
}

.validation-message {
    color: var(--rot);
}

#blazor-error-ui {
    color-scheme: light only;
    background: var(--rot-hell);
    color: var(--rot);
    bottom: 0;
    border-top: 1px solid var(--rot);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.5rem;
        top: 0.25rem;
        min-width: 44px;
        min-height: 44px;
        border: 0;
        background: transparent;
        color: var(--text);
        font-size: 1.5rem;
        line-height: 1;
    }

.blazor-error-boundary {
    background: var(--rot-hell);
    border-left: 4px solid var(--rot);
    padding: 1rem 1.25rem;
    color: var(--rot);
}

    .blazor-error-boundary::after {
        content: "Ein Fehler ist aufgetreten."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: var(--linie);
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--tally);
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Wird geladen");
    }

code {
    color: var(--text);
}

/* Zahlen in Tabellen (rechtsbündig) in Mono, gleich breite Ziffern */
.table td.text-end {
    font-family: var(--schrift-zahl);
    font-variant-numeric: tabular-nums;
}

/* Beschriftung neben einer grossen Zahl bleibt in der Textschrift */
.fs-4.fw-bold .fs-6, .fs-5.fw-bold .fs-6 {
    font-family: var(--schrift-text);
    font-weight: 400 !important;
}

/* Platz für Hinweise ist reserviert: erscheint oder verschwindet einer, springt nichts (Vorlage Design CI §12) */
.hinweisplatz.reserviert {
    min-height: 2.75rem;
}

/* Offline-Hinweis: ruhiges Band in der Linienfarbe, keine Warnfarbe */
.offline-band {
    border: 1px solid var(--tally-hell);
}

/* Schmale Bildschirme: breite Tabellen und Reiter scrollen in sich, nie die ganze Seite */
@media (max-width: 575.98px) {
    .content table.table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .content .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
    }

        .content .nav-tabs .nav-link {
            white-space: nowrap;
        }
}

/* Zeit erfassen auf dem Handy: grosse Felder, Hauptknopf über die ganze Breite */
@media (max-width: 575.98px) {
    .erfassung .form-control, .erfassung .form-select, .erfassung .btn-group .btn {
        min-height: 48px;
        font-size: 16px;
    }

    .erfassung .btn-erfassen {
        width: 100%;
        min-height: 52px;
        font-size: 17px;
        justify-content: center;
    }
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Rahmenknöpfe «secondary» (Schnellwahl, Pause, Blättern) nicht grau wie deaktiviert */
.btn-outline-secondary {
    --bs-btn-color: var(--text); --bs-btn-border-color: var(--feldrand);
    --bs-btn-hover-color: var(--text); --bs-btn-hover-bg: var(--akzent-hell); --bs-btn-hover-border-color: var(--text);
    --bs-btn-active-color: var(--auf-akzent); --bs-btn-active-bg: var(--akzent); --bs-btn-active-border-color: var(--akzent);
}

/* Tabellenzeilen, die eine Seite öffnen */
.zeile-link:hover > td { background-color: var(--tally-hell); }

/* Wochenliste: Einträge sind Knöpfe (Tastatur), sehen aber aus wie Text */
button.eintrag { color: inherit; font: inherit; }
button.eintrag:focus-visible { outline: 2px solid var(--verweis); outline-offset: 1px; }

/* Tippziele am Handy mindestens 44 px (Blättern, «heute») */
.tippziel { min-height: 44px; min-width: 44px; }

/* Objektkarte (swisstopo-Kacheln, wwwroot/js/karte.js) */
.karte { position: relative; height: 320px; overflow: hidden; touch-action: none; cursor: crosshair;
         border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); background: var(--grund); }
.karte-flaeche img { position: absolute; left: 0; top: 0; width: 256px; height: 256px; user-select: none; }
.karte-marke { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%;
               background: var(--signal); border: 3px solid var(--bs-body-bg); pointer-events: none; }
.karte-knoepfe { position: absolute; right: 8px; top: 8px; display: flex; flex-direction: column; gap: 4px; }
.karte-knoepfe button { min-width: 44px; min-height: 44px; border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius);
                        background: var(--bs-body-bg); color: var(--text); font-weight: 600; }
.karte-quelle { position: absolute; left: 4px; bottom: 2px; font-size: 11px; background: var(--bs-body-bg); padding: 0 4px; }

/* Link zur Video-Anleitung neben dem Seitentitel */
.hilfe-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--verweis); text-decoration: none; }
.hilfe-link:hover { text-decoration: underline; }

/* ===== CI Stufe 2 (docs/gestaltung/auftrag-ci-stufe-2.md) ===== */

/* A1: Umschalter als ruhige Segmente – gewählt = Text 600 mit Unterstrich innen, kein gefüllter Balken */
.btn-segment { background: var(--flaeche); border: 1px solid var(--feldrand); color: var(--matt); font-weight: 500; }
.btn-segment:hover { background: var(--flaeche); color: var(--text); border-color: var(--feldrand); }
.btn-segment[aria-pressed="true"] { color: var(--text); font-weight: 600; box-shadow: inset 0 -3px 0 var(--text); }
.btn-segment:focus-visible { outline: 2px solid var(--verweis); outline-offset: 1px; }

/* A3: Gesperrt sieht überall gleich aus – Rand linie, Text matt, kein Hover; der Zustand «✓ Gebucht» bleibt */
.btn:disabled:not(.btn-erfassen), .btn.disabled:not(.btn-erfassen) {
    background: var(--flaeche); border-color: var(--linie); color: var(--matt); opacity: 1; cursor: not-allowed; pointer-events: auto; }

/* F1: Auswahl-Kästchen sichtbar (Rand 3:1, 18 px) */
.form-check-input[type="checkbox"] { width: 18px; height: 18px; border: 1px solid var(--feldrand); }

/* C: Hinweis-Zeichen in Tabellen */
.text-warning { font-weight: 600; }

/* E1: «Zuletzt» als eine Zeile (am Handy seitlich wischbar) */
.zuletzt-zeile { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.zuletzt-zeile .btn { white-space: nowrap; border-radius: 999px; min-height: 36px; font-weight: 500; }
@media (max-width: 640.98px) {
    .zuletzt-zeile { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
    .zuletzt-zeile .btn { min-height: 44px; }
}

/* G: Timer läuft – ein atmender Punkt */
.laeuft { display: inline-flex; align-items: center; gap: 5px; font-size: .8125rem; font-weight: 600; }
.laeuft-punkt { width: 8px; height: 8px; border-radius: 50%; background: var(--tally); display: inline-block; }

/* F5: Ablagepfad unter dem Lieferanten ruhig in einer Zeile */
.pfad { font-size: 12px; color: var(--matt); max-width: 22rem; }

/* ===== CI Stufe 2 «hell und ruhig» – Startseite ===== */
.flaeche { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; padding: 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.flaeche-titel { margin: 0; font-size: 17px; font-weight: 600; font-family: var(--schrift-text); }
.start-kopf { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.start-kopf .datum { font-size: 14px; color: var(--matt); }
.start-kopf h1 { margin: 4px 0 0; font-size: 30px; line-height: 1.15; font-weight: 700; }
.start-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 20px; align-items: start; margin-bottom: 28px; }
.zahl-gross { font-family: var(--schrift-zahl); font-size: 40px; font-weight: 500; line-height: 1; }
.woche-summe { display: flex; align-items: baseline; gap: 10px; font-size: 15px; }
.woche-balken { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: end; height: 118px; }
.woche-balken .tag { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.woche-balken .wert { font-family: var(--schrift-zahl); font-size: 12px; color: var(--matt); }
.woche-balken .wert.heute { color: var(--tally); font-weight: 500; }
.woche-balken .name { font-size: 12px; }
.woche-balken .balken { width: 100%; border-radius: 3px; }
.woche-balken .balken.voll { background: var(--tally); }
.woche-balken .balken.leer { background: var(--grund); }
.woche-balken .balken.offen { border: 1.5px dashed var(--tally); box-sizing: border-box; }
.woche-fuss { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; color: var(--matt); border-top: 1px solid var(--linie); padding-top: 14px; }
.woche-fuss b { color: var(--text); font-weight: 500; }
.aufgabe { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--linie); color: var(--text); text-decoration: none; }
.aufgabe:last-child { border-bottom: 0; }
.aufgabe:hover .satz { text-decoration: underline; }
.aufgabe .zeichen { flex-shrink: 0; width: 34px; height: 34px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
                    font-family: var(--schrift-zahl); font-size: 14px; font-weight: 500; background: var(--grund); color: var(--matt); }
.aufgabe .zeichen.warn { background: var(--orange-hell); color: var(--orange); font-size: 13px; }
.aufgabe .zeichen.tally { background: var(--tally-hell); color: var(--tally); }
.aufgabe .text { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.aufgabe .satz { font-weight: 600; }
.aufgabe .neben { font-size: 13px; color: var(--matt); }
.aufgabe .pfeil { color: var(--matt); }
/* Gleich viele Zellen je Zeile, nie 3+1 mit grauer Restfläche: 4 → 4 oder 2×2, 3 → 3 oder 1 je Zeile (--kz = Anzahl, Home.razor) */
.kennzahlen { display: grid; grid-template-columns: repeat(var(--kz, 4), minmax(0, 1fr)); gap: 1px; background: var(--linie);
              border: 1px solid var(--linie); border-radius: 8px; overflow: hidden; }
.kz-1 { --kz: 1; } .kz-2 { --kz: 2; } .kz-3 { --kz: 3; }
@media (max-width: 1199.98px) { .kennzahlen.kz-4 { --kz: 2; } }
@media (max-width: 899.98px) { .kennzahlen.kz-3 { --kz: 1; } }
@media (max-width: 640.98px) { .kennzahlen { --kz: 1; } }
.kennzahl { background: var(--flaeche); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; color: var(--text); text-decoration: none; }
.kennzahl:hover { background: var(--kopfzelle); }
.kennzahl .titel, .kennzahl .neben { font-size: 13px; color: var(--matt); }
.kennzahl .wert { font-family: var(--schrift-zahl); font-size: 24px; font-weight: 500; }

/* ===== CI Stufe 2 «hell und ruhig» – Zeit erfassen ===== */
.zeit-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 20px; }
.zeit-kopf h1 { font-size: 28px; font-weight: 700; }
.heute-summe { font-size: 14px; color: var(--matt); }
.heute-summe .zahl { color: var(--text); }
.seg-klein { display: inline-flex; background: var(--flaeche); border: 1px solid var(--feldrand); border-radius: 6px; padding: 3px; gap: 3px; }
.seg-klein button { font: inherit; font-size: 14px; min-height: 36px; padding: 0 14px; border: 0; border-radius: 4px; background: transparent; color: var(--text); }
.seg-klein button[aria-pressed="true"] { background: var(--tally-hell); color: var(--tally); font-weight: 600; }
.zeit-raster { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.zeit-links { flex: 1 1 520px; min-width: 0; }
.erfassung { gap: 18px; }
.erfassung fieldset { border: 0; margin: 0; padding: 0; }
.stunden-feld { font-family: var(--schrift-zahl); font-size: 22px; font-weight: 500; text-align: right; border: 2px solid var(--text); width: 7.5rem; min-height: 48px; }
.rund { font: inherit; font-size: 14px; min-height: 44px; padding: 0 12px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 999px; color: var(--text); }
.rund.gewaehlt { border: 1.5px solid var(--tally); background: var(--tally-hell); color: var(--tally); font-weight: 600; }
.stunden-handy { display: none; }
.erfassen-leiste { display: flex; align-items: center; gap: 14px; border-top: 1px solid var(--linie); padding-top: 16px; }
.erfassen-leiste .btn-erfassen { min-height: 48px; padding: 0 28px; }
.woche-spalte { flex: 0 0 340px; padding: 18px 18px 8px; gap: 8px; }
.tag-zeile { display: flex; justify-content: space-between; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid var(--linie); background: none; color: var(--text); text-align: left; font: inherit; }
.tag-zeile.leer { color: var(--matt); }
.tag-zeile.offen { font-weight: 600; }
.eintrag-knopf { display: flex; gap: 10px; width: 100%; text-align: left; font: inherit; font-size: 14px; padding: 8px 10px; margin-bottom: 6px;
                 border: 1px solid var(--linie); border-radius: 4px; background: var(--grund); color: var(--text); }
.woche-total { display: flex; justify-content: space-between; padding: 12px 0; border-top: 2px solid var(--text); font-weight: 600; }

@media (max-width: 640.98px) {
    .zeit-kopf { gap: 8px 12px; }
    .zeit-kopf h1 { font-size: 24px; margin-right: auto !important; }
    .stunden-pc { display: none !important; }
    .stunden-handy { display: flex; align-items: center; justify-content: space-between; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; padding: 14px; }
    .stunden-handy button { width: 52px; height: 52px; border: 1px solid var(--feldrand); border-radius: 6px; background: var(--flaeche); font-size: 24px; color: var(--text); }
    .stunden-handy .wert { font-size: 36px; font-weight: 500; line-height: 1; }
    .erfassung { border: 0; background: none; padding: 0; }
    .woche-spalte { flex-basis: 100%; }
    /* «Erfassen» fest über der Navigation unten */
    .erfassen-leiste { position: fixed; left: 0; right: 0; bottom: calc(49px + env(safe-area-inset-bottom, 0px)); z-index: 20; margin: 0;
                       padding: 12px max(16px, env(safe-area-inset-left, 0px)); background: var(--grund); border-top: 1px solid var(--linie); }
    .erfassen-leiste .btn-erfassen { flex: 1; min-height: 52px; font-size: 17px; }
    .content:has(.erfassen-leiste) { padding-bottom: calc(10rem + env(safe-area-inset-bottom, 0px)); }
}
@media (min-width: 641px) {
    .heute-summe { display: none; }
}
.erfassung legend { font-size: 1rem; float: none; width: auto; }
.woche-titel { flex-direction: column; line-height: 1.3; }

/* CI Stufe 2, Listen: Kopf mit Zusammenfassung, Ansicht und Suche, dunkle Aktionsleiste bei Auswahl, Tabelle auf heller Fläche */
.liste-kopf { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.liste-kopf h1 { font-size: 30px; line-height: 1.1; margin: 0; }
.liste-kopf .zusammenfassung { display: block; color: var(--matt); margin-top: 4px; }
.liste-werkzeuge { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.liste-werkzeuge .seg-klein { flex-wrap: wrap; }
.seg-klein .anzahl { font-family: var(--schrift-zahl); font-size: 12px; margin-left: 6px; color: var(--matt); }
.seg-klein button[aria-pressed="true"] .anzahl { color: var(--tally); }
.liste-suche { max-width: 280px; min-height: 40px; }
.aktionsleiste { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--text); color: var(--flaeche); border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; }
.aktionsleiste .zahl { color: var(--flaeche); }
.aktionsleiste button { font: inherit; font-weight: 600; min-height: 36px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--flaeche); background: transparent; color: var(--flaeche); }
.aktionsleiste button.hell { background: var(--flaeche); color: var(--text); }
.aktionsleiste button:disabled { opacity: .6; }
.liste-flaeche { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; overflow-x: auto; }
.liste-flaeche table.table { margin: 0; border: 0; border-radius: 0; }
table.liste td .zweite, .listen-karten .zweite { display: block; font-size: 13px; color: var(--matt); }
table.liste td.klein { font-size: 13px; }
table.liste .auswahl { width: 36px; }
/* Sammelrechnung: Zwischensumme pro Auftrag */
tr.zwischensumme > td { font-weight: 600; border-bottom: 1px solid var(--linie); }

/* Lesezugriff (Treuhand): ruhiges Band über jeder Seite */
.nur-lesen-band { background: var(--neutral-hell); color: var(--text); border-radius: 6px; padding: 8px 12px; margin-bottom: 16px; font-size: 14px; }

/* Zeit erfassen: der Eintrag, der gerade im Formular bearbeitet wird */
.eintrag-knopf.gewaehlt { background: var(--tally-hell); border-color: var(--tally); }

/* Einstellungen → Personen: Eingaben schmal genug, dass die Zeile bei 1280 px passt */
.personen-tabelle td { padding: 6px; }
.personen-tabelle input.form-control { min-width: 6rem; }
.personen-tabelle td:nth-child(4) input.form-control { min-width: 12rem; }
.personen-tabelle td:last-child { min-width: 8.5rem; }

/* Abo-Positionen im Formular: je eine Fläche, abgelaufene matt */
.abo-position { border: 1px solid var(--linie); border-radius: 8px; padding: 12px; margin-bottom: 8px; background: var(--flaeche); }
.abo-position.vorbei { background: var(--kopfzelle); color: var(--matt); }
.abo-position .form-label.small { margin-bottom: 2px; color: var(--matt); }
button.listen-karte { width: 100%; font: inherit; color: inherit; }
/* Bis 1200 px Nebenspalten weg (Datum, Total, Gemahnt), damit die Liste bei 1024 ohne Scrollen passt; Rest scrollt in der Fläche */
@media (max-width: 1199.98px) { table.liste .ab-1200 { display: none; } }
table.liste tr.gewaehlt > td, .listen-karte.gewaehlt { background: var(--tally-hell); }
.listen-karten { display: grid; gap: 8px; }
.listen-karte { display: flex; gap: 12px; align-items: flex-start; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; padding: 12px; }
.listen-karte .form-check-input { margin-top: 4px; flex: none; }
.listen-karte-inhalt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
@media (max-width: 640.98px) { .nur-breit { display: none; } .liste-suche { max-width: none; flex: 1; } }
@media (min-width: 641px) { .nur-handy { display: none; } }

/* Alle übrigen Listen: weisse Fläche mit runden Ecken, ruhige Kopfzeile, keine Streifen (verschachtelte Tabellen und Karten ausgenommen) */
.content table.table:not(table table):not(.card table):not(.liste-flaeche table) {
    background: var(--flaeche); border-collapse: separate; border-spacing: 0; border: 1px solid var(--linie); border-radius: 8px; overflow: hidden;
}
.content table.table { --bs-table-striped-bg: transparent; --bs-table-bg: var(--flaeche); --bs-table-border-color: var(--linie); }
.content table.table > tbody > tr > * { border-bottom: 1px solid var(--linie); }
.content table.table > :not(caption) > * > * { padding: 10px 12px; }
.content table.table.table-sm > :not(caption) > * > * { padding: 7px 10px; }
.content table.table > thead th { font-size: 13px; font-weight: 600; color: var(--matt); border-bottom-color: var(--linie); white-space: nowrap; }
.content table.table > tbody > tr:last-child > * { border-bottom: 0; }
/* Bis 1200 px (Tablet, schmaler Bildschirm): eine zu breite Tabelle scrollt in ihrer Fläche, nie die ganze Seite */
@media (max-width: 1199.98px) {
    .content table.table:not(table table):not(.card table):not(.liste-flaeche table) { display: block; overflow-x: auto; overflow-y: hidden; }
}
