html, body {
    font-family: 'Segoe UI', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa; /* Heller Hintergrund für Content */
    height: 100%;
}

/* --- Layout Grid --- */
.page {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

main {
    flex: 1;
    overflow-y: auto; /* Content scrollt, Sidebar bleibt fest */
    display: flex;
    flex-direction: column;
}

/* --- Sidebar (Linkes Menü) --- */
.sidebar {
    background-image: linear-gradient(180deg, #0F172A 0%, #1E293B 70%);
    color: white;
    min-width: 250px;
    display: flex;
    flex-direction: column;
}

/* Sidebar Header / Brand */
.top-row {
    height: 3.5rem;
    background-color: rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    padding-left: 1.5rem;
}

.navbar-brand {
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Navigation Links */
.nav-scrollable {
    flex: 1;
    overflow-y: auto;
    padding-top: 1rem;
}

.nav-item {
    font-size: 0.9rem;
    padding-bottom: 0.5rem;
}

    .nav-item ::deep a {
        color: #cbd5e1;
        border-radius: 4px;
        height: 3rem;
        display: flex;
        align-items: center;
        line-height: 3rem;
        padding: 0 1rem;
        margin: 0 1rem;
        text-decoration: none;
        transition: all 0.2s;
    }

        .nav-item ::deep a.active {
            background-color: rgba(255,255,255,0.1);
            color: white;
            font-weight: 600;
            border-left: 4px solid #3b82f6; /* Blauer Akzent */
        }

        .nav-item ::deep a:hover {
            background-color: rgba(255,255,255,0.05);
            color: white;
        }

/* Icons in der Nav (Falls Sie Bi-Icons nutzen) */
.bi {
    display: inline-block;
    position: relative;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    top: -1px;
    background-size: cover;
}

/* --- Desktop Ansicht (Sidebar links fest) --- */
@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 250px;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    .top-row {
        position: sticky;
        top: 0;
        z-index: 1;
    }

        .top-row.auth {
            justify-content: flex-end;
        }

        .top-row a:first-child {
            flex: 1;
            text-align: right;
            width: 0;
        }
}

/* --- Mobile Ansicht --- */
@media (max-width: 640.98px) {
    .sidebar {
        position: static;
        height: auto;
        min-width: 100%;
    }

    .top-row {
        position: sticky;
        top: 0;
        z-index: 1000;
        justify-content: space-between;
        padding-right: 1.5rem;
    }

    /* Collapse Logic für Mobile (wird von NavMenu gesteuert) */
    .collapse {
        display: none;
    }

        .collapse.in {
            display: block;
        }
}

/* --- Fehler UI --- */
#blazor-error-ui {
    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;
    }
