html, body {
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: #1f2933;
    background: #f4f7fa;
    line-height: 1.5;
}

*, *::before, *::after {
    box-sizing: border-box;
}

:focus-visible {
    outline: 3px solid rgba(21, 101, 192, 0.35);
    outline-offset: 2px;
}

button, a, input, select, textarea {
    font: inherit;
}

.mud-paper {
    border-color: #e0e7ef;
}

@media (max-width: 600px) {
    .mud-button-root {
        min-height: 42px;
    }

    /* Kalendertage bleiben ausgenommen: MudBlazor bemisst sie fest mit 36 px + 4 px
       Rand in einer 310 px breiten Kalenderfläche. Bei 42 px passen nur sechs Tage
       in eine Zeile, der siebte bricht um — die Kopfzeile bleibt siebenspaltig. */
    .mud-icon-button:not(.mud-picker-calendar-day) {
        min-width: 42px;
        min-height: 42px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4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2Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

/* Verbindungsverlust. Blazor setzt die Zustandsklassen selbst: -show/-retrying waehrend
   des Wiederverbindens, -failed/-rejected/-resume-failed, wenn nur noch Neuladen hilft.
   -paused bleibt absichtlich unsichtbar: eine pausierte Verbindung (Seite im Hintergrund)
   ist kein Fehler und wird bei der naechsten Bedienung von selbst fortgesetzt. */
#components-reconnect-modal {
    display: none;
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-retrying,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected,
#components-reconnect-modal.components-reconnect-resume-failed {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(31, 41, 51, 0.55);
}

#components-reconnect-modal .reconnect-card {
    max-width: 22rem;
    padding: 20px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    text-align: center;
    color: #1f2933;
}

#components-reconnect-modal .reconnect-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
}

#components-reconnect-modal p {
    margin: 0 0 12px;
    font-size: 0.9rem;
}

#components-reconnect-modal .reconnect-attempt {
    display: block;
    margin-top: 4px;
    color: #6b7785;
    font-size: 0.8rem;
}

#components-reconnect-modal button {
    min-height: 42px;
    padding: 0 20px;
    border: none;
    border-radius: 6px;
    background: #1565c0;
    color: #fff;
    font-weight: 500;
    cursor: pointer;
}

/* Standardfall ist das Wiederverbinden - dort waere Neuladen die falsche Empfehlung.
   Die Umschaltung haengt an den Fehlerzustaenden, nicht an -show: so bleibt sie richtig,
   auch wenn Blazor -show zusammen mit einem Fehlerzustand stehen laesst. */
#components-reconnect-modal .reconnect-failed,
#components-reconnect-modal button {
    display: none;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected .reconnect-failed,
#components-reconnect-modal.components-reconnect-resume-failed .reconnect-failed {
    display: block;
}

#components-reconnect-modal.components-reconnect-failed button,
#components-reconnect-modal.components-reconnect-rejected button,
#components-reconnect-modal.components-reconnect-resume-failed button {
    display: inline-block;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-retry,
#components-reconnect-modal.components-reconnect-rejected .reconnect-retry,
#components-reconnect-modal.components-reconnect-resume-failed .reconnect-retry {
    display: none;
}

#components-reconnect-modal.components-reconnect-hide {
    display: none !important;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    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.75rem;
    top: 0.5rem;
}

/* Kompaktere MudTable Card-Darstellung auf Tablet/Mobile */
.mud-table-container .mud-table-body .mud-table-row td::before {
    font-size: 0.8rem;
    font-weight: 600;
}

.mud-table-container .mud-table-body .mud-table-row td {
    padding-top: 4px;
    padding-bottom: 4px;
}

.mud-table-container .mud-table-body .mud-table-row {
    border-bottom: 1px solid #e0e0e0;
}

.mud-table-container .mud-table-body .mud-table-row:last-child {
    border-bottom: none;
}
