html,
body {
    font-family: "Segoe UI", "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: #F8FAFC;
    color: #1E293B;
}

a,
.btn-link {
    color: #2563EB;
    text-decoration: none;
}

    a:hover,
    .btn-link:hover {
        color: #1D4ED8;
    }

/* Primäre Buttons */

.btn-primary {
    color: #FFFFFF;
    background-color: #2563EB;
    border-color: #2563EB;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.2s ease;
}

    .btn-primary:hover {
        background-color: #1D4ED8;
        border-color: #1D4ED8;
    }

    .btn-primary:active,
    .btn-primary:focus {
        background-color: #1E40AF;
        border-color: #1E40AF;
    }

/* Deaktivierte primäre Buttons deutlich ausgegraut (sonst überdeckt die Farbe oben die Bootstrap-Optik) */
.btn-primary:disabled,
.btn-primary.disabled {
    color: #9CA3AF;
    background-color: #E5E7EB;
    border-color: #E5E7EB;
    opacity: 1;
    cursor: not-allowed;
}

/* Fokus-Effekte */

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    border-color: #93C5FD;
    box-shadow: 0 0 0 0.1rem #FFFFFF, 0 0 0 0.25rem rgba(37, 99, 235, 0.25);
}

.content {
    padding-top: 1.1rem;
}

h1,
h2,
h3,
h4,
h5 {
    color: #0F172A;
    font-weight: 600;
}

    h1:focus {
        outline: none;
    }

/* Validierung */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #22C55E;
    border-radius: 6px;
}

.invalid {
    outline: 1px solid #EF4444;
    border-radius: 6px;
}

.validation-message {
    color: #DC2626;
    font-size: 0.875rem;
}

/* Fehleranzeige */

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2...) no-repeat 1rem center/1.5rem, #FEF2F2;
    border: 1px solid #FECACA;
    border-left: 5px solid #EF4444;
    border-radius: 12px;
    padding: 1rem 1rem 1rem 3.7rem;
    color: #991B1B;
    margin: 1rem 0;
}

    .blazor-error-boundary::after {
        content: "Ein Fehler ist aufgetreten.";
    }

/* Checkboxen */

.darker-border-checkbox.form-check-input {
    border-color: #94A3B8;
}

.form-check-input:checked {
    background-color: #2563EB;
    border-color: #2563EB;
}

/* Floating Labels */

.form-floating > .form-control,
.form-floating > .form-control-plaintext {
    border-radius: 10px;
    border-color: #CBD5E1;
}

    .form-floating > .form-control:focus {
        border-color: #93C5FD;
    }

    .form-floating > .form-control-plaintext::placeholder,
    .form-floating > .form-control::placeholder {
        color: #94A3B8;
        text-align: end;
    }

    .form-floating > .form-control-plaintext:focus::placeholder,
    .form-floating > .form-control:focus::placeholder {
        text-align: start;
    }

/* Karten / Container */

.card {
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

/* Tabellen */

.table {
    background: #FFFFFF;
}

    .table thead {
        background: #EEF6FF;
        color: #1E293B;
    }


.hero-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 6rem 1.5rem;
    text-align: center;
    /*background-color: #FFFFFF;*/
}

/* Badge oben */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    color: #1D431F;
    background-color: #F6F9F6;
    border: 1px solid #DCEEDD;
    margin-bottom: 2rem;
}

    .hero-badge .dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background-color: #5FB8AE;
    }

/* Headline */
.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: #1F1F1F;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

/* Subtext */
.hero-subtitle {
    font-size: 1.1rem;
    color: #4D6A4E;
    max-width: 700px;
    margin: 0 auto 2.5rem auto;
}

/* Actions */
.hero-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* Button (dein Brand + größer wie im Screenshot) */
.hero-btn {
    padding: 0.9rem 2rem;
    font-size: 1rem;
    border-radius: 10px;
}

/* Link unter Button */
.hero-link {
    font-size: 0.95rem;
    color: #3A5A40;
    text-decoration: none;
}

.hero-link:hover {
    text-decoration: underline;
}

/* =========================
   FOOTER (sticky bottom)
========================= */

.app-footer {
    margin-top: auto;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #3A5A40;
    border-top: 1px solid #e5e7eb;
    /*background: #ffffff;*/
}

    .app-footer a,
    .app-footer a:visited {
        color: #3A5A40 !important;
        text-decoration: none !important;
    }

        .app-footer a:hover {
            color: #111827;
            text-decoration: underline !important;
        }

.app-topbar a.topbar-link {
    color: #3A5A40 !important;
}

    .app-topbar a.topbar-link[class*="active"] {
        color: #3A5A40 !important;
    }

/* Toast entfernen, wenn leer*/
.e-toast-container:has(.e-toast:empty) {
    display: none !important;
}

/* =========================
   PAGE LAYOUT
========================= */

.page {
    min-height: 100vh;
    display: flex;
}

    .page main {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        flex: 1;
    }


        /* =========================
   CONTENT
========================= */

        .page main .content {
            flex: 1;
        }


/* =========================
   FOOTER
========================= */

.app-footer {
    flex-shrink: 0;
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #2563eb;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
}

.app-footer a,
.app-footer a:visited 
{
        color: #2563eb !important;
        text-decoration: none !important;
}

.app-footer a:hover {
    color: #1d4ed8 !important;
    text-decoration: underline !important;
}

/* =========================
   TOUCH-BEDIENUNG (Tablet / Handy)
   Gilt fuer Geraete mit Fingereingabe, unabhaengig von Bildschirmgroesse und Pixeldichte.
========================= */

@media (pointer: coarse) {

    .btn,
    .nav-link,
    .e-acrdn-header {
        min-height: 44px;
    }

    .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .btn-sm {
        min-height: 40px;
    }

    .form-control,
    .form-select {
        min-height: 44px;
    }
}

/* iOS zoomt in Eingabefelder mit < 16px Schrift automatisch hinein */
@media (pointer: coarse) and (max-width: 1024.98px) {

    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea,
    .form-control,
    .form-select {
        font-size: 16px;
    }
}


/* =========================
   TABELLEN (Syncfusion Grid) auf Touch-Geraeten
========================= */

@media (pointer: coarse) {

    /* Zeilen und Kopf hoeher, damit Zeilen und Buttons mit dem Finger getroffen werden */
    .e-grid .e-row {
        height: 48px;
    }

    .e-grid .e-headercell {
        height: 48px;
    }

    /* Aktionsbuttons (Bearbeiten / Loeschen) nicht kleiner als 44 px */
    .e-grid .e-unboundcell .e-btn,
    .e-grid .e-unboundcell .e-btn.e-flat {
        min-width: 44px;
        min-height: 44px;
    }

    /* Seitenumschaltung unter der Tabelle */
    .e-grid .e-gridpager .e-numericitem,
    .e-grid .e-gridpager .e-prev,
    .e-grid .e-gridpager .e-next,
    .e-grid .e-gridpager .e-first,
    .e-grid .e-gridpager .e-last {
        min-width: 44px;
        min-height: 44px;
    }
}


/* =========================
   TABELLEN: letzte Spalte (Aktionen) bleibt am rechten Rand sichtbar
   Verwendung: <div class="grid-sticky-actions"><SfGrid ...>...</SfGrid></div>
   Nur wirksam, wenn das Grid horizontal scrollt. (Syncfusion Freeze ist hier nicht verwendbar.)
========================= */

.grid-sticky-actions .e-grid .e-headercell:last-child,
.grid-sticky-actions .e-grid td.e-rowcell:last-child {
    position: sticky;
    right: 0;
    z-index: 2;
}

/* Schatten links der Aktionsspalte nur, solange rechts noch Tabelleninhalt verdeckt ist (Klasse setzt app.js) */
.grid-sticky-actions.has-overflow-right .e-grid .e-headercell:last-child,
.grid-sticky-actions.has-overflow-right .e-grid td.e-rowcell:last-child {
    box-shadow: -6px 0 8px -6px rgba(0, 0, 0, 0.25);
}

/* Schmale Aktionsspalte: wenig Zellenabstand, Buttons zentriert */
.grid-sticky-actions .e-grid td.e-unboundcell {
    padding-left: 4px;
    padding-right: 4px;
    text-align: center;
}

/* --grid-header-bg / --grid-row-bg setzt app.js aus den Nachbarzellen; die Werte danach gelten nur als Rueckfall */
.grid-sticky-actions .e-grid .e-headercell:last-child {
    background: var(--grid-header-bg, var(--color-sf-content-bg-color-alt1, #fff));
}

.grid-sticky-actions .e-grid td.e-rowcell:last-child {
    background: var(--grid-row-bg, var(--color-sf-content-bg-color-alt1, #fff));
}

.grid-sticky-actions .e-grid .e-row:hover td.e-rowcell:last-child {
    background: var(--color-sf-table-bg-color-hover, #f5f5f5);
}

/* ---- Benutzermenü oben rechts (Web) ---- */

.user-menu {
    position: relative;
}

.user-menu > summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .3rem .7rem .3rem .35rem;
    border-radius: 999px;
    cursor: pointer;
    color: #0F172A;
    user-select: none;
    transition: background-color .15s ease;
}

.user-menu > summary::-webkit-details-marker {
    display: none;
}

.user-menu > summary:hover,
.user-menu[open] > summary {
    background-color: #E2E8F0;
}

.user-menu .user-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 2rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #2563EB;
    color: #FFFFFF;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .02em;
}

.user-menu .user-name {
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.user-menu .user-caret {
    font-size: .7rem;
    color: #64748B;
    transition: transform .15s ease;
}

.user-menu[open] .user-caret {
    transform: rotate(180deg);
}

.user-menu .user-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + .4rem);
    z-index: 1050;
    min-width: 15rem;
    padding: .4rem;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .14);
}

.user-menu .user-menu-head {
    padding: .55rem .75rem .65rem;
    margin-bottom: .3rem;
    border-bottom: 1px solid #E2E8F0;
    font-size: .8rem;
    color: #64748B;
}

.user-menu .user-menu-head strong {
    display: block;
    font-size: .95rem;
    color: #0F172A;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shell-topbar-content .user-menu .user-menu-panel a.user-menu-item {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin: 0;
    padding: .6rem .75rem;
    border-radius: 10px;
    color: #334155;
    text-decoration: none;
}

.shell-topbar-content .user-menu .user-menu-panel a.user-menu-item:hover {
    background: #EEF6FF;
    color: #1D4ED8;
    text-decoration: none;
}

.user-menu .user-menu-item .fa-solid {
    width: 1.1rem;
    text-align: center;
    color: #64748B;
}

.user-menu .user-menu-item:hover .fa-solid {
    color: #2563EB;
}

/* ---- Konto / Sicherheit (Account-Seiten) ---- */

.form-page {
    max-width: 880px;
}

.form-page.wide {
    max-width: 1100px;
}

.page-head {
    margin-bottom: 1.25rem;
}

.page-head h3 {
    margin-bottom: .15rem;
}

.page-head p {
    margin: 0;
    color: #64748B;
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: 1rem;
    font-weight: 600;
    color: #0F172A;
    margin-bottom: 1rem;
}

.form-section-title .fa-solid {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: .55rem;
    background: rgba(37, 99, 235, .12);
    color: #2563EB;
    font-size: .95rem;
}

.form-page .form-label {
    font-weight: 500;
    color: #0F172A;
    margin-bottom: .3rem;
}

.manage-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    border-radius: 10px;
    color: #334155;
}

.manage-nav .nav-link .fa-solid {
    width: 1.1rem;
    text-align: center;
    color: #64748B;
}

.manage-nav .nav-link:hover {
    background: #EEF6FF;
    color: #1D4ED8;
}

.manage-nav .nav-link.active {
    background: #2563EB;
    color: #FFFFFF;
}

.manage-nav .nav-link.active .fa-solid {
    color: #FFFFFF;
}

.sec-status {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sec-status .sec-icon {
    display: grid;
    place-items: center;
    flex: 0 0 3rem;
    width: 3rem;
    height: 3rem;
    border-radius: .9rem;
    font-size: 1.3rem;
}

.sec-status .sec-icon.on {
    background: rgba(34, 197, 94, .14);
    color: #15803D;
}

.sec-status .sec-icon.off {
    background: rgba(245, 158, 11, .18);
    color: #B45309;
}

.sec-status h4 {
    margin: 0;
    font-size: 1.1rem;
}

.sec-status p {
    margin: .1rem 0 0;
    color: #64748B;
}

.sec-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 0;
    border-top: 1px solid #E2E8F0;
}

.sec-row:first-of-type {
    border-top: 0;
}

.sec-row .sec-row-title {
    font-weight: 600;
    color: #0F172A;
}

.sec-row .sec-row-text {
    color: #64748B;
    font-size: .9rem;
}

.sec-row .sec-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: flex-end;
}

.recovery-codes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: .6rem;
}

.recovery-codes code.recovery-code {
    display: block;
    padding: .55rem .8rem;
    text-align: center;
    font-size: 1rem;
    letter-spacing: .06em;
    color: #0F172A;
    background: #EEF6FF;
    border: 1px dashed #93C5FD;
    border-radius: .55rem;
}

.step-list {
    list-style: none;
    counter-reset: step;
    padding: 0;
    margin: 0;
}

.step-list > li {
    counter-increment: step;
    position: relative;
    padding: 0 0 1.4rem 3rem;
}

.step-list > li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #2563EB;
    color: #FFFFFF;
    font-weight: 600;
}

.step-list > li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: .95rem;
    top: 2.2rem;
    bottom: .2rem;
    width: 2px;
    background: #E2E8F0;
}

.qr-box {
    display: inline-block;
    padding: .75rem;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: .9rem;
}


/* =========================
   DIALOGE (Syncfusion SfDialog): nie groesser als der sichtbare Bereich
   Viele Dialoge haben feste Pixelbreiten (450-900px). Auf kleineren Bildschirmen schrumpfen sie jetzt auf die Viewport-Breite,
   die Hoehe wird begrenzt; der Inhalt (.e-dlg-content) scrollt, Kopf und Fusszeile bleiben stehen.
   dvh = sichtbare Hoehe ohne Browserleisten; vh als Rueckfall fuer aeltere Engines.
========================= */

.e-dialog {
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
}

/* Kleine blaue Aktionsknöpfe an Adressfeldern ("Adresse wählen", "Karte", ...). Gleiche Werte wie der Style-Block im EditTourDialog,
   hier global, damit sie auch außerhalb davon (Zwischenziele, Sammelfahrt-Dialog) gleich aussehen. */
.address-action {
    color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.08);
    border: none;
    padding: 3px 8px;
    font-size: 0.85rem;
    border-radius: 6px;
}

.address-action:hover {
    color: #0a58ca;
    background-color: rgba(13, 110, 253, 0.15);
}

/* Schatten über der Fußzeile eines SfDialog: deutet an, dass darüber weiterer Inhalt scrollbar ist.
   Wie .etd-foot im EditTourDialog. Verwendung: CssClass="dialog-footer-shadow" am SfDialog (FooterTemplate). */
.e-dialog.dialog-footer-shadow .e-footer-content {
    position: relative;
    z-index: 1;
    box-shadow: 0 -8px 10px -6px rgba(0, 0, 0, 0.18);
}

/* =========================
   AKTIONSLEISTE (Speichern / Abbrechen) am unteren Rand
   Bleibt beim Scrollen langer Formulare sichtbar, auf Seiten ebenso wie in Dialogen.
   Verwendung: <div class="form-actions d-flex justify-content-end gap-2"> ...Buttons... </div> als letztes Kind des Formulars.
========================= */

.form-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--color-sf-flyout-bg-color, #fff);
    border-top: 1px solid #e2e8f0;
}

/* Schatten nach oben nur, solange die Leiste festklebt und darunter noch Inhalt zu scrollen ist (Klasse setzt app.js) */
.form-actions.is-stuck {
    box-shadow: 0 -8px 10px -6px rgba(0, 0, 0, 0.18);
}


/* =========================
   MULTISELECT (Syncfusion, Mode Box): Chips auf Touch-Geraeten einzeln loeschbar
   Das Lösch-Icon (x) ist nur 16x16 px. Bei Fingereingabe legt Chrome den Tipp auf das benachbarte, "klickbar" wirkende
   Chip-Element (e-chipcontent) um: das Chip wird nur markiert statt entfernt. Mit >= 36 px trifft der Tipp das Icon selbst.
========================= */

@media (pointer: coarse) {
    .e-multi-select-wrapper .e-chips .e-chips-close {
        min-width: 36px;
        min-height: 36px;
        align-items: center;
        justify-content: center;
    }
}


/* Mehrfachauswahl (Box-Modus), in der mindestens drei Symbol-Chips nebeneinander passen sollen.
   Chip ca. 56 px (Maus) bzw. ca. 76 px (Touch, wegen des 36-px-Loesch-Icons) plus Luecken und Innenabstand. */
.multiselect-min-3-chips {
    min-width: min(17rem, 100%);
}

@media (pointer: coarse) {
    .multiselect-min-3-chips {
        min-width: min(21rem, 100%);
    }
}


/* Felder ohne Tippen (Klasse no-typing, siehe app.js): kein blinkender Textcursor, Hand statt Textcursor */
input.no-typing {
    caret-color: transparent;
    cursor: pointer;
}


/* =========================
   FEHLERMELDUNG UNTER EINEM EINGABEFELD
   Der Platz bleibt immer reserviert, auch ohne Meldung. Sonst verschiebt sich die Seite, wenn die Meldung verschwindet (z.B. beim
   Klick auf Speichern: das Feld verliert den Fokus, die Meldung verschwindet, der Button rutscht nach oben) und der Klick auf den
   Button geht verloren.
   Hoehe 1,25rem mit -0,25rem unterem Rand = 1rem Platz, genau wie ein "mb-3" unter dem Feld. Das Feldblock-Element selbst bekommt "mb-0".
========================= */

.field-message {
    height: 1.25rem;
    margin-bottom: -0.25rem;
    line-height: 1.25rem;
}

    .field-message .validation-message {
        line-height: 1.25rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }


/* Eigene Fehler am Eingabefeld (z.B. "gibt es bereits", Pflichtfeld ohne Blazor-Validierung): Aussehen wie ein ungueltiges Feld (.invalid).
   Blazor kennt diesen Fehler nicht und markiert das Feld sonst zusaetzlich gruen (.valid.modified). Die Regel hat deshalb hoehere Spezifitaet. */
.form-control.field-error,
.form-control.field-error.valid.modified:not([type=checkbox]) {
    outline: 1px solid #EF4444;
    border-radius: 6px;
}


/* Abschnittsueberschrift in Formularen und Dialogen (Edit-Seiten, Dialoge): kleine Grossbuchstaben mit Trennlinie */
.section-title {
    margin: 0 0 1rem 0;
    padding-bottom: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7280;
    border-bottom: 1px solid #eef0f3;
}


/* =========================
   FILTERZEILEN: Bootstrap-Felder/-Buttons neben Syncfusion-Eingabefeldern auf gleiche Hoehe (Maus; Touch bleibt bei 44 px)
   Verwendung: Container mit class="filter-row"
========================= */
@media (pointer: fine) {
    .filter-row .form-control,
    .filter-row .btn {
        height: 32px;
        min-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        display: inline-flex;
        align-items: center;
    }

    .filter-row .form-control {
        display: block;
    }
}

/* Touch: Syncfusion-Felder in Filterzeilen auf dieselbe Hoehe wie Bootstrap-Felder (44 px) */
@media (pointer: coarse) {
    .filter-row .e-input-group.e-control-wrapper,
    .filter-row .e-input-group {
        min-height: 44px;
    }

    .filter-row .e-input-group input.e-input,
    .filter-row .e-input-group.e-control-wrapper input.e-input {
        min-height: 42px;
        font-size: 16px;
    }
}

/* Dialoge mit mehreren/langen Buttons: bei schmalem Bildschirm umbrechen die Buttons mit Abstand zwischen den Zeilen. */
.e-dialog.wrap-footer-buttons .e-footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}
.e-dialog.wrap-footer-buttons .e-footer-content .e-btn {
    margin: 0;
}
