/* Global shell layout styles (fallback when scoped CSS bundle scope IDs drift after rebuild/hot reload).
   Sidebar-specific rules are scoped under .sidebar so they do not leak into content-area
   Bootstrap components (nav-pills, .bi icon fonts) or the full-page login. */

.page {
    position: relative;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.sidebar {
    background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
}

.sidebar .top-row {
    background-color: rgba(0, 0, 0, 0.4);
    min-height: 3.5rem;
    border-bottom: 1px solid #d6d5d5;
    justify-content: flex-end;
    height: 3.5rem;
    display: flex;
    align-items: center;
}

.sidebar .top-row a,
.sidebar .top-row .btn-link {
    white-space: nowrap;
    margin-left: 1.5rem;
    text-decoration: none;
}

.sidebar .top-row a:hover,
.sidebar .top-row .btn-link:hover {
    text-decoration: underline;
}

@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }

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

.sidebar .navbar-toggler {
    appearance: none;
    cursor: pointer;
    width: 3.5rem;
    height: 2.5rem;
    color: white;
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") no-repeat center/1.75rem rgba(255, 255, 255, 0.1);
}

.sidebar .navbar-toggler:checked {
    background-color: rgba(255, 255, 255, 0.5);
}

.sidebar .navbar-brand {
    font-size: 1.1rem;
}

/* Custom SVG-background nav icons (sidebar only). Do not affect CDN Bootstrap Icons font glyphs. */
.sidebar .bi[class*="-nav-menu"],
.sidebar .bi-gear-config-mgmt,
.sidebar .bi-user-mgmt-icon {
    display: inline-block;
    position: relative;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    top: -1px;
    background-size: cover;
}

.bi-house-door-fill-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-house-door-fill' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5Z'/%3E%3C/svg%3E");
}

.bi-plus-square-fill-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-plus-square-fill' viewBox='0 0 16 16'%3E%3Cpath d='M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm6.5 4.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3a.5.5 0 0 1 1 0z'/%3E%3C/svg%3E");
}

.bi-shield-lock-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-shield-lock' viewBox='0 0 16 16'%3E%3Cpath d='M5.338 1.59a61.44 61.44 0 0 0-2.837.856.48.48 0 0 0-.328.39c-.554 4.157.726 7.19 2.253 9.188a10.7 10.7 0 0 0 2.287 2.233c.346.244.652.42.893.533.12.057.219.095.293.118a.55.55 0 0 0 .101.025.6.6 0 0 0 .1-.025c.076-.023.174-.061.294-.118.24-.113.547-.29.893-.533a10.7 10.7 0 0 0 2.287-2.233c1.527-1.997 2.807-5.031 2.253-9.188a.48.48 0 0 0-.328-.39c-.651-.213-1.75-.56-2.837-.855C9.552 1.29 8.531 1.067 8 1.067c-.53 0-1.552.223-2.662.524zM5.072.56C6.157.265 7.31 0 8 0s1.843.265 2.928.56c1.11.3 2.229.655 2.887.87a1.54 1.54 0 0 1 1.044 1.262c.596 4.477-.787 7.795-2.465 9.99a11.8 11.8 0 0 1-2.517 2.453 7 7 0 0 1-1.048.625c-.28.132-.581.24-.829.24s-.548-.108-.829-.24a7 7 0 0 1-1.048-.625 11.8 11.8 0 0 1-2.517-2.453C1.928 10.487.545 7.169 1.141 2.692A1.54 1.54 0 0 1 2.185 1.43 63 63 0 0 1 5.072.56'/%3E%3Cpath d='M9.5 6.5a1.5 1.5 0 0 1-1 1.415V9.5a.5.5 0 0 1-1 0V7.915A1.5 1.5 0 1 1 9.5 6.5'/%3E%3C/svg%3E");
}

.bi-list-nested-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-list-nested' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M4.5 11.5A.5.5 0 0 1 5 11h10a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 3 7h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 1 3h10a.5.5 0 0 1 0 1H1a.5.5 0 0 1-.5-.5z'/%3E%3C/svg%3E");
}

.bi-gear-config-mgmt {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-gear' viewBox='0 0 16 16'%3E%3Cpath d='M8 4.754a3.246 3.246 0 1 0 0 6.492 3.246 3.246 0 0 0 0-6.492zM5.754 8a2.246 2.246 0 1 1 4.492 0 2.246 2.246 0 0 1-4.492 0z'/%3E%3Cpath d='M9.796 1.343c-.527-1.79-3.065-1.79-3.592 0l-.094.319a.873.873 0 0 1-1.255.52l-.292-.16c-1.64-.892-3.433.902-2.54 2.541l.159.292a.873.873 0 0 1-.52 1.255l-.319.094c-1.79.527-1.79 3.065 0 3.592l.319.094a.873.873 0 0 1 .52 1.255l-.16.292c-.892 1.64.901 3.434 2.541 2.54l.292-.159a.873.873 0 0 1 1.255.52l.094.319c.527 1.79 3.065 1.79 3.592 0l.094-.319a.873.873 0 0 1 1.255-.52l.292.16c1.64.893 3.434-.902 2.54-2.541l-.159-.292a.873.873 0 0 1 .52-1.255l.319-.094c1.79-.527 1.79-3.065 0-3.592l-.319-.094a.873.873 0 0 1-.52-1.255l.16-.292c.893-1.64-.902-3.433-2.541-2.54l-.292.159a.873.873 0 0 1-1.255-.52l-.094-.319zm-2.633.283c.246-.835 1.428-.835 1.674 0l.094.319a1.873 1.873 0 0 0 2.693 1.115l.291-.16c.764-.415 1.6.42 1.184 1.185l-.159.292a1.873 1.873 0 0 0 1.116 2.692l.318.094c.835.246.835 1.428 0 1.674l-.319.094a1.873 1.873 0 0 0-1.115 2.693l.16.291c.415.764-.42 1.6-1.185 1.184l-.291-.159a1.873 1.873 0 0 0-2.693 1.116l-.094.318c-.246.835-1.428.835-1.674 0l-.094-.319a1.873 1.873 0 0 0-2.692-1.115l-.292.16c-.764.415-1.6-.42-1.184-1.185l.159-.291A1.873 1.873 0 0 0 1.945 8.93l-.319-.094c-.835-.246-.835-1.428 0-1.674l.319-.094a1.873 1.873 0 0 0 1.115-2.693l-.16-.291c-.415-.764.42-1.6 1.185-1.184l.291.159a1.873 1.873 0 0 0 2.693-1.116l.094-.318z'/%3E%3C/svg%3E");
}

.bi-user-mgmt-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-person-gear' viewBox='0 0 16 16'%3E%3Cpath d='M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6z'/%3E%3Cpath d='M5.216 14A2.238 2.238 0 0 1 5 13c0-.502.168-.975.45-1.354C6.121 10.936 7.388 10 9 10s2.879.936 3.55 1.646c.282.379.45.852.45 1.354 0 .332-.052.65-.146.948A5.022 5.022 0 0 1 13 15H5a5.022 5.022 0 0 1-.784-1z'/%3E%3Cpath fill-rule='evenodd' d='M13.646 9.854a.5.5 0 0 1 0-.708l.646-.647a.5.5 0 1 1 .708.708l-.647.646a.5.5 0 0 1-.707 0zM11.5 8.5a.5.5 0 0 1 .5-.5h1.293a.5.5 0 1 1 0 1H12a.5.5 0 0 1-.5-.5zm-2.646-.354a.5.5 0 0 1 .707 0l.647.647a.5.5 0 1 1-.708.708l-.646-.647a.5.5 0 0 1 0-.708zM9.5 11.5a.5.5 0 0 1 .5-.5h.293a.5.5 0 1 1 0 1H10a.5.5 0 0 1-.5-.5zm1.354 2.146a.5.5 0 0 1-.707 0l-.647-.646a.5.5 0 1 1 .708-.708l.646.647a.5.5 0 0 1 0 .707zM13.5 12a.5.5 0 0 1-.5.5h-1.293a.5.5 0 1 1 0-1H13a.5.5 0 0 1 .5.5zM12.146 13.646a.5.5 0 0 1 0 .708l-.646.646a.5.5 0 1 1-.708-.708l.647-.646a.5.5 0 0 1 .707 0z'/%3E%3C/svg%3E");
}

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

.sidebar .nav-item:first-of-type {
    padding-top: 1rem;
}

.sidebar .nav-item:last-of-type {
    padding-bottom: 1rem;
}

.sidebar .nav-item .nav-link {
    color: #d7d7d7;
    background: none;
    border: none;
    border-radius: 4px;
    height: 3rem;
    display: flex;
    align-items: center;
    line-height: 3rem;
    width: 100%;
}

.sidebar .nav-item a.active {
    background-color: rgba(255, 255, 255, 0.37);
    color: white;
}

.sidebar .nav-item .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar .nav-scrollable {
    display: none;
}

.sidebar .navbar-toggler:checked ~ .nav-scrollable {
    display: block;
}

@media (min-width: 641px) {
    .sidebar .navbar-toggler {
        display: none;
    }

    .sidebar .nav-scrollable {
        display: block;
        height: calc(100vh - 3.5rem);
        overflow-y: auto;
    }
}

.sidebar .nav-auth-signed-in {
    box-sizing: border-box;
    max-width: 100%;
    padding: 0.5rem 0.35rem;
    border-radius: 0.375rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar .nav-auth-header {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
    min-width: 0;
}

.sidebar .nav-auth-check {
    font-size: 1.1rem;
    flex-shrink: 0;
    line-height: 1.2;
    margin-top: 0.05rem;
}

.sidebar .nav-auth-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    text-align: left;
}

.sidebar .nav-auth-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.2;
}

.sidebar .nav-auth-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar .login-container {
    box-sizing: border-box;
    max-width: 100%;
    width: 100%;
    padding: 0.35rem 0 0.75rem;
}

.sidebar .login-card {
    max-width: 100%;
    width: 100%;
}

.sidebar .login-header {
    padding: 1.25rem 0.85rem;
}

.sidebar .login-header h2 {
    font-size: clamp(1rem, 2.8vw, 1.35rem);
    line-height: 1.25;
}

.sidebar .login-header p {
    font-size: 0.8rem;
    line-height: 1.35;
}

.sidebar .login-body {
    padding: 0.9rem 0.85rem 1rem;
}

.sidebar .login-identity-options .form-check-label,
.sidebar .login-identity-options .form-text {
    color: rgba(255, 255, 255, 0.92);
}

.sidebar .login-identity-options .form-text {
    color: rgba(255, 255, 255, 0.72);
}

.sidebar .login-dual-or {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0 0.5rem;
}

.sidebar .login-dual-or-text {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    padding: 0 0.5rem;
}

.sidebar .login-header-compact {
    padding-bottom: 0.85rem;
}

.sidebar .login-icon {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.sidebar .login-mode-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    margin: 0 0.85rem;
    padding: 0.3rem;
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.1);
}

.sidebar .login-mode-btn {
    border: 0;
    border-radius: 0.5rem;
    padding: 0.4rem 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    background: transparent;
    transition: all 0.2s ease;
}

.sidebar .login-mode-btn.active {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}
