/* ---------- App-Shell: Sidebar (Desktop) ---------- */
.fm-shell { display: flex; min-height: 100vh; }
.fm-sidebar {
    width: 232px;
    flex: none;
    background-color: var(--fm-surface-1);
    border-right: 0.5px solid var(--fm-border);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 1rem 0.85rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.fm-sidebar-brand {
    min-height: 44px;
    display: grid;
    grid-template-columns: 42px 1fr;
    align-items: center;
    gap: 0.7rem;
    color: var(--fm-text-primary);
    text-decoration: none;
    margin-bottom: 0.25rem;
}
.fm-sidebar-brand:hover { color: var(--fm-text-primary); text-decoration: none; }
.fm-sidebar-brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background-color: var(--fm-accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.fm-sidebar-brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}
.fm-sidebar-brand-copy strong { font-size: 0.98rem; }
.fm-sidebar-brand-copy small { color: var(--fm-text-muted); font-size: 0.78rem; }
.fm-nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.fm-nav-section-title {
    color: var(--fm-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
    padding: 0.5rem 0.55rem 0.15rem;
}
.fm-nav-item {
    min-height: 38px;
    border-radius: 10px;
    display: grid;
    grid-template-columns: 28px 1fr;
    align-items: center;
    gap: 0.45rem;
    color: var(--fm-text-secondary);
    font-size: 0.92rem;
    font-weight: 500;
    padding: 0.45rem 0.55rem;
    border: 0;
    background: transparent;
    text-decoration: none;
    text-align: left;
}
.fm-nav-item i {
    font-size: 1.1rem;
    display: inline-flex;
    justify-content: center;
}
.fm-nav-item:hover { background-color: var(--fm-surface-2); color: var(--fm-text-primary); text-decoration: none; }
.fm-nav-item.active { background-color: var(--fm-accent-bg); color: var(--fm-accent-text); }
.fm-main { flex: 1; min-width: 0; min-height: 100vh; }
.fm-content { max-width: 1180px; margin: 0 auto; padding: 1.25rem 1.5rem 3rem; }
.fm-mobile-header { display: none; }

/* ---------- App-Shell: Bottom-Nav (Mobile) ---------- */
.fm-bottomnav { display: none; }
@media (max-width: 991.98px) {
    .fm-sidebar { display: none; }
    .fm-page-title { display: none !important; }
    .fm-mobile-header {
        --fm-mobile-header-height: calc(5.75rem + env(safe-area-inset-top, 0px));
        position: sticky;
        top: 0;
        z-index: 1025;
        display: flex;
        height: var(--fm-mobile-header-height);
        flex-direction: column;
        justify-content: center;
        gap: 0.5rem;
        padding: calc(0.65rem + env(safe-area-inset-top, 0px)) 1rem 0.7rem;
        border-bottom: 0.5px solid var(--fm-border);
        background-color: var(--fm-surface-1);
    }
    .fm-mobile-header-brand-row {
        display: flex;
        min-width: 0;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }
    .fm-mobile-header-brand {
        display: inline-flex;
        min-width: 0;
        align-items: center;
        gap: 0.6rem;
        color: var(--fm-text-primary);
        text-decoration: none;
        font-size: 0.95rem;
    }
    .fm-mobile-header-brand:hover { color: var(--fm-text-primary); text-decoration: none; }
    .fm-mobile-header-brand img { width: 30px; height: 30px; flex: none; }
    .fm-mobile-header-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .fm-mobile-header-brand strong { font-weight: 700; }
    .fm-mobile-header-action {
        display: inline-flex;
        width: 34px;
        height: 34px;
        flex: none;
        align-items: center;
        justify-content: center;
        border: 0.5px solid var(--fm-border-strong);
        border-radius: 50%;
        background-color: transparent;
        color: var(--fm-text-secondary);
        font-size: 1rem;
    }
    .fm-mobile-header-action:hover { background-color: var(--fm-surface-2); color: var(--fm-text-primary); }
    .fm-mobile-header-title {
        overflow: hidden;
        color: var(--fm-text-primary);
        font-size: 1.35rem;
        font-weight: 700;
        line-height: 1.15;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .fm-content { padding: 1rem 0.9rem 5.5rem; }
    .fm-bottomnav {
        display: flex;
        align-items: center;
        justify-content: space-around;
        position: fixed;
        left: 0; right: 0; bottom: 0;
        background-color: var(--fm-surface-2);
        border-top: 0.5px solid var(--fm-border);
        padding: 0.5rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
        z-index: 1030;
    }
    .fm-legal-footer {
        display: none;
    }
    .fm-bottomnav .fm-tab {
        display: flex; flex-direction: column; align-items: center; gap: 2px;
        font-size: 0.66rem; color: var(--fm-text-muted); text-decoration: none; flex: 1;
        border: 0; background: transparent; padding: 0; line-height: 1.15;
    }
    .fm-bottomnav .fm-tab i { font-size: 1.35rem; }
    .fm-bottomnav .fm-tab.active { color: var(--fm-accent-text); }
    .fm-bottomnav .fm-tab-fab {
        width: 52px; height: 52px; border-radius: 50%; border: 0;
        background-color: var(--fm-accent); color: #fff;
        display: flex; align-items: center; justify-content: center;
        font-size: 1.65rem; margin: -24px 0 0; flex: none; text-decoration: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
    .fm-sheet-backdrop {
        position: fixed;
        inset: 0;
        border: 0;
        background: rgba(0, 0, 0, 0.45);
        backdrop-filter: blur(2px);
        z-index: 1035;
    }
    .fm-mobile-sheet {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: calc(86vh - env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
        overscroll-behavior: contain;
        background: var(--fm-surface-2);
        border: 0;
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -18px 48px rgba(0, 0, 0, 0.28);
        z-index: 1040;
        padding: 0.75rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
        will-change: transform;
    }
    .fm-sheet-handle {
        width: 42px;
        height: 4px;
        border-radius: 99px;
        background: var(--fm-border-strong);
        margin: 0.1rem auto 0.8rem;
        cursor: grab;
        touch-action: none;
    }
    .fm-sheet-header {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 1rem;
        padding: 0.15rem 0 0.65rem;
        cursor: grab;
        touch-action: none;
    }
    .fm-sheet-header h2 {
        font-size: 1.05rem;
        margin: 0;
    }
    .fm-sheet-close {
        display: none;
    }
    .fm-sheet-section { margin-top: 0.85rem; }
    .fm-sheet-section h3 {
        font-size: 0.76rem;
        font-weight: 700;
        color: var(--fm-text-muted);
        text-transform: uppercase;
        letter-spacing: 0;
        margin: 0 0 0.35rem 0.25rem;
    }
    .fm-sheet-list {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
    }
    .fm-sheet-item {
        display: grid;
        grid-template-columns: 38px 1fr auto;
        align-items: center;
        gap: 0.6rem;
        min-height: 48px;
        width: 100%;
        border: 0.5px solid var(--fm-border);
        border-radius: 12px;
        padding: 0.45rem 0.65rem;
        color: var(--fm-text-primary);
        background: var(--fm-surface-1);
        text-decoration: none;
        text-align: left;
    }
    .fm-sheet-item:hover,
    .fm-sheet-item.active {
        color: var(--fm-accent-text);
        background: var(--fm-accent-bg);
        text-decoration: none;
    }
    .fm-sheet-item-danger { color: var(--fm-danger-text); }
    .fm-sheet-icon {
        width: 34px;
        height: 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        color: var(--fm-accent-text);
        background: var(--fm-accent-bg);
        font-size: 1.05rem;
    }
}

/* ---------- Kopfzeile im Content ---------- */
.fm-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }

/* Blazor-Fehler-UI dezent an Theme */
#blazor-error-ui { background: var(--fm-warning-bg); color: var(--fm-warning-text); }
