/* Inter (variable), selbst gehostet; Lizenz: /fonts/OFL.txt */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("/fonts/InterVariable.woff2") format("woff2");
}

/* Hinweis- und Statuspaare, je Hintergrund / Text:
   info = Info, notice = Hinweis (chip-text: Text in Chips), neutral = Neutral, dietary = Ernährung;
   input-border = Rahmen von Eingabefeldern, auch für Umschalter und „gilt nicht“-Chips;
   print-ink / print-line = Druckansicht der Bestellübersicht (overview-print.css): Text und kräftige Linien bzw. feine Linien.
   Der Druck ist immer hell und kontrastreich (schwarz-weiß tauglich), die beiden Werte stehen deshalb fest und hängen nicht vom Theme ab. */
:root {
    --kantine-input-border: #A0AEC0;
    --kantine-info-bg: #E8F1FA;
    --kantine-info-text: #0B4F8A;
    --kantine-notice-bg: #FEF0DC;
    --kantine-notice-text: #5C3A00;
    --kantine-notice-chip-text: #7A4A00;
    --kantine-neutral-bg: #EEF0F3;
    --kantine-neutral-text: #4A5563;
    --kantine-dietary-bg: #E7F4EA;
    --kantine-dietary-text: #2F6B3B;
    --kantine-print-ink: #111111;
    --kantine-print-line: #D5DAE1;
}

/* FocusOnNavigate setzt den Fokus auf die Überschrift – ohne Rahmen */
h1:focus {
    outline: none;
}

/* Seitentitel: 22 px Smartphone, 28 px Desktop */
.kantine-page-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--mud-palette-primary);
}

/* Inhaltsbereich: Mitarbeitende max. 1280 px zentriert, Kantine max. 1200 px; Rand 16 px bzw. 32 px */
.kantine-content {
    --kantine-gutter: 16px;
    max-width: calc(var(--kantine-content-max) + 2 * var(--kantine-gutter));
    margin-inline: auto;
    padding: var(--kantine-gutter) var(--kantine-gutter) 32px;
}

.kantine-content--employee {
    --kantine-content-max: 1280px;
}

.kantine-content--canteen {
    --kantine-content-max: 1200px;
    margin-inline-start: 0;
}

/* Kennzeichen „Verwaltung“ in der App-Bar */
.kantine-badge {
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 12px;
    font-weight: 600;
}

/* Avatar-Menü in der App-Bar: weißer Kreis mit Personen-Icon */
.kantine-avatar .mud-icon-button {
    color: var(--mud-palette-primary);
}

.kantine-avatar .mud-icon-button-label {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--mud-palette-surface);
}

/* Linke Navigation des Kantinenbereichs */
.kantine-nav {
    border-right: 1px solid var(--mud-palette-lines-default);
}

.kantine-nav .mud-nav-link {
    min-height: 44px;
}

.kantine-nav .mud-navmenu .mud-nav-link.active:not(.mud-nav-link-disabled) {
    background-color: var(--kantine-info-bg);
    color: var(--kantine-info-text);
    font-weight: 700 !important; /* überstimmt die !important-Regel von MudBlazor */
}

.kantine-nav .mud-nav-link.active:not(.mud-nav-link-disabled) .mud-nav-link-icon {
    color: inherit;
}

.kantine-nav .kantine-nav-switch {
    color: var(--mud-palette-info);
}

@media (min-width: 960px) {
    .kantine-page-title {
        font-size: 28px;
    }

    .kantine-content {
        --kantine-gutter: 32px;
        padding-block: 28px 48px;
    }
}

/* Seite „Kein Zugriff“: Karte mit Radius 12 px, Schloss-Icon in den Info-Farben */
.kantine-no-access {
    max-width: 480px;
    margin-inline: auto;
    border-radius: 12px;
    text-align: center;
}

.kantine-no-access-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--kantine-info-bg);
    color: var(--kantine-info-text);
}

/* Die Kartenüberschrift bleibt auch auf dem Desktop bei 22 px; 28 px gelten nur für Seitentitel */
.kantine-no-access .kantine-page-title {
    font-size: 22px;
}

/* Dialoge: Titel in primary, fett */
.mud-dialog-title .mud-typography {
    font-weight: 700;
    color: var(--mud-palette-primary);
}

/* Seite „Einstellungen“ – Seitenlayout: Die Spalten stehen nebeneinander, solange
   beide Platz haben (560 + 400 + 20 px Inhaltsbreite), sonst – also auch unter 960 px – untereinander. */
.kantine-settings {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.kantine-settings-columns {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 20px;
}

.kantine-settings-main {
    flex: 1 1 560px;
    min-width: 0;
}

/* Rechte Spalte: Karten untereinander (Bestellfrist, Schließzeiten) */
.kantine-settings-side {
    flex: 1 1 400px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Karte: weiß, 1 px Rahmen, Radius 12 px, ohne Schatten; Abschnittstitel 18 px */
.kantine-card {
    background-color: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
}

.kantine-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.kantine-card-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--mud-palette-primary);
}

.kantine-card-empty {
    margin: 0;
    padding: 20px;
    color: var(--mud-palette-text-secondary);
}

/* Abschnittslabels und Spaltenköpfe: 12 px, 600, Großbuchstaben, Laufweite 0,4 px, text-muted */
.kantine-label,
.kantine-table th,
.kantine-conflict-table th {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

/* Timeslot-Tabelle: nur sie scrollt auf schmalen Bildschirmen waagerecht */
.kantine-table-scroll {
    overflow-x: auto;
}

.kantine-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
}

.kantine-table th {
    padding: 10px 12px;
    background-color: var(--mud-palette-background);
    text-align: start;
}

.kantine-table td {
    padding: 12px;
}

.kantine-table th:first-child,
.kantine-table td:first-child {
    padding-inline-start: 20px;
}

.kantine-table th:last-child,
.kantine-table td:last-child {
    padding-inline-end: 20px;
}

.kantine-table td:last-child {
    text-align: end;
}

.kantine-table tbody tr {
    border-top: 1px solid var(--mud-palette-lines-default);
}

/* Inaktive Zeilen gedämpft */
.kantine-table .kantine-row-inactive {
    color: var(--mud-palette-text-secondary);
}

.kantine-time {
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
}

.kantine-seats {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Wochentags-Chips: „gilt“ in Info-Farben, „gilt nicht“ mit gestricheltem Rahmen */
.kantine-weekday-chips {
    display: inline-flex;
    gap: 4px;
}

.kantine-weekday-chip {
    min-width: 32px;
    padding: 3px 0;
    border-radius: 6px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
}

.kantine-weekday-chip--on {
    border: 1px solid var(--kantine-info-bg);
    background-color: var(--kantine-info-bg);
    color: var(--kantine-info-text);
}

.kantine-weekday-chip--off {
    border: 1px dashed var(--kantine-input-border);
    background-color: var(--mud-palette-surface);
    color: var(--mud-palette-text-secondary);
}

/* Schalter (Button mit role="switch"): Zustand über aria-checked. Der Button ist 44 px hoch; Spur (::before, 44 × 26 px) und Knopf
   (::after) liegen mittig darin. Spur im Zustand „an“ in interaction. */
.kantine-switch {
    position: relative;
    flex: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.kantine-switch::before {
    content: "";
    position: absolute;
    inset: 9px 0;
    border-radius: 13px;
    background-color: var(--kantine-input-border);
}

.kantine-switch[aria-checked="true"]::before {
    background-color: var(--mud-palette-info);
}

.kantine-switch::after {
    content: "";
    position: absolute;
    top: 12px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 10px;
    background-color: var(--mud-palette-surface);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: left 0.15s;
}

.kantine-switch[aria-checked="true"]::after {
    left: 21px;
}

.kantine-switch:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Sichtbarer Fokus in interaction: beim Schalter um die Spur, beim Wochentags-Umschalter um den Button */
.kantine-switch:focus-visible {
    outline: none;
}

.kantine-switch:focus-visible::before {
    outline: 2px solid var(--mud-palette-info);
    outline-offset: 2px;
}

.kantine-weekday-toggle:focus-visible {
    outline: 2px solid var(--mud-palette-info);
    outline-offset: 2px;
}

/* Übersicht je Wochentag: bei 5 Kacheln nebeneinander mindestens 96 px je Kachel, auf dem Smartphone mehrere Reihen */
.kantine-day-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.kantine-day-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 8px;
}

.kantine-day-tile {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    font-size: 12px;
}

.kantine-day-tile-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--mud-palette-primary);
}

.kantine-day-tile-times {
    color: var(--mud-palette-text-secondary);
}

/* Dialog „Timeslot bearbeiten“: Uhrzeit und Sitzplätze nebeneinander, solange es der Dialog hergibt */
.kantine-field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.kantine-weekday-field {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.kantine-weekday-field legend {
    margin-bottom: 8px;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
}

.kantine-weekday-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Umschalter für einen Wochentag: ausgewählt = 2 px Rahmen interaction auf Info-Hintergrund, Radius 10 px */
.kantine-weekday-toggle {
    min-width: 60px;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--kantine-input-border);
    border-radius: 10px;
    background-color: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.kantine-weekday-toggle[aria-pressed="true"] {
    border: 2px solid var(--mud-palette-info);
    background-color: var(--kantine-info-bg);
    color: var(--kantine-info-text);
}

.kantine-field-error {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--mud-palette-error);
}

.kantine-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--mud-palette-lines-default);
    font-weight: 600;
}

/* Einstellungen, rechte Spalte, Karte „Bestellfrist“: Titel, Beschriftung und Uhrzeitzeile untereinander */
.kantine-card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px 20px;
}

.kantine-deadline-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.kantine-deadline-time {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kantine-deadline-field {
    width: 140px;
}

/* Karte „Schließzeiten“: Liste mit Trennlinien zwischen den Einträgen, darunter das Formular. Die Zeile, die gerade bearbeitet wird,
   steht im Info-Hintergrund. */
.kantine-closure-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.kantine-closure-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px 10px 20px;
}

.kantine-closure-item + .kantine-closure-item {
    border-top: 1px solid var(--mud-palette-lines-default);
}

.kantine-closure-item--editing {
    background-color: var(--kantine-info-bg);
}

.kantine-closure-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.kantine-closure-range {
    font-size: 15px;
    font-weight: 600;
}

.kantine-closure-reason {
    font-size: 13px;
    color: var(--mud-palette-text-secondary);
    overflow-wrap: anywhere;
}

.kantine-closure-actions {
    display: flex;
    flex: none;
    gap: 2px;
}

.kantine-closure-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px 20px;
    border-top: 1px solid var(--mud-palette-lines-default);
}

/* Ohne Liste dazwischen (Ladefehler) liegt das Formular direkt unter der Kopfzeile, die schon eine Linie hat */
.kantine-card-header + .kantine-closure-form {
    border-top: 0;
}

.kantine-closure-form-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}

/* Chips (StatusChip, DietaryChip): vollständig rund, der Status steht immer als Text im Chip. Die Farbpaare kommen aus den
   Variablen oben; „accent“ ist das orange Paar aus dem Theme (secondary mit Navy-Text, nur für „Heute“). Ein Icon im Chip ist 14 px groß. */
.kantine-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.kantine-chip .mud-icon-root {
    font-size: 14px;
}

.kantine-chip--info {
    background-color: var(--kantine-info-bg);
    color: var(--kantine-info-text);
}

.kantine-chip--notice {
    background-color: var(--kantine-notice-bg);
    color: var(--kantine-notice-chip-text);
}

.kantine-chip--neutral {
    background-color: var(--kantine-neutral-bg);
    color: var(--kantine-neutral-text);
}

.kantine-chip--dietary {
    padding: 1px 8px;
    background-color: var(--kantine-dietary-bg);
    color: var(--kantine-dietary-text);
    font-weight: 600;
}

.kantine-chip--accent {
    background-color: var(--mud-palette-secondary);
    color: var(--mud-palette-secondary-text);
}

/* Segmentschalter (DietaryLabelToggle; Seite „Gerichte“ und Dialog „Neues Gericht“): Rahmen mit drei gleich breiten Segmenten, ausgewählt = primary mit
   weißem Text. Die Segmente sind 44 px hoch; mit 2 px Innenabstand ist der Schalter 48 px hoch. */
.kantine-segments {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 10px;
}

.kantine-segment {
    min-height: 44px;
    padding: 0 8px;
    border: 0;
    border-radius: 8px;
    background-color: transparent;
    color: var(--mud-palette-primary);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.kantine-segment[aria-pressed="true"] {
    background-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
}

.kantine-segment:focus-visible {
    outline: 2px solid var(--mud-palette-info);
    outline-offset: 2px;
}

/* Konflikt-Dialog (Komponente CancellationDialog): In der Titelzeile steht vor dem Titel ein Warn-Icon im Kreis (Hinweis-Paar).
   Satz und Chips sind unter den Titeltext eingerückt (Kreis 44 px + Abstand 14 px). Die Chips sind StatusChips (Neutral); der Grund ist freier Text und darf überall umbrechen. */
.kantine-conflict-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.kantine-conflict-icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--kantine-notice-bg);
    color: var(--kantine-notice-text);
}

.kantine-conflict-text {
    margin: 0 0 8px;
    padding-inline-start: 58px;
    font-size: 15px;
    line-height: 1.5;
}

.kantine-conflict-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-inline-start: 58px;
}

.kantine-conflict-chips .kantine-chip {
    overflow-wrap: anywhere;
}

/* Tabelle „Betroffene Bestellungen“: Rahmen mit Radius 10 px; nur sie scrollt auf schmalen Bildschirmen waagerecht. Die Spaltenköpfe teilen sich die Schrift mit .kantine-table (oben). */
.kantine-conflict-table-wrap {
    margin-top: 16px;
    overflow-x: auto;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 10px;
}

.kantine-conflict-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.kantine-conflict-table th,
.kantine-conflict-table td {
    padding: 9px 14px;
    text-align: start;
}

.kantine-conflict-table th {
    background-color: var(--mud-palette-background);
}

.kantine-conflict-table tbody tr {
    border-top: 1px solid var(--mud-palette-lines-default);
}

.kantine-conflict-table .kantine-conflict-slot {
    font-weight: 600;
    white-space: nowrap;
}

.kantine-conflict-table .kantine-conflict-dish {
    color: var(--mud-palette-text-secondary);
}

.kantine-conflict-table .kantine-conflict-portion {
    text-align: end;
    font-variant-numeric: tabular-nums;
}

.kantine-conflict-table .kantine-conflict-more td {
    font-size: 13px;
    color: var(--mud-palette-text-secondary);
}

/* Hinweis auf die Folge einer Änderung im Hinweis-Paar: Warn-Icon (MudIcon, aria-hidden) und Text (span) nebeneinander. Gedacht für Dialog „Timeslot bearbeiten“
   (role="status"); das Icon ist 18 px groß, egal welche Größe MudIcon sonst setzt. */
.kantine-conflict-hint {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    background-color: var(--kantine-notice-bg);
    color: var(--kantine-notice-text);
    font-size: 14px;
    line-height: 1.45;
}

.kantine-conflict-hint .mud-icon-root {
    flex: none;
    margin-top: 1px;
    font-size: 18px;
}

/* Fehlerleiste von Blazor */
#blazor-error-ui {
    display: none;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 2000;
    padding: 12px 56px 12px 16px;
    background: var(--kantine-notice-bg);
    color: var(--kantine-notice-text);
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
}

#blazor-error-ui .reload {
    margin-inline-start: 12px;
    color: inherit;
    font-weight: 600;
}

#blazor-error-ui .dismiss {
    position: absolute;
    inset-block-start: 0;
    inset-inline-end: 4px;
    min-width: 44px;
    min-height: 44px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 24px;
    cursor: pointer;
}
