/**
 * Modern sidebar layout — structural shell (theme colours via CSS vars).
 */
body.atom-layout-modern {
    overflow-x: hidden;
}

/* Sidebar links must not inherit global accent link colour on dark bar */
body.atom-layout-modern .atom-sidebar a {
    text-decoration: none;
}

.atom-app-modern {
    display: flex;
    min-height: 100vh;
}

.atom-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--pt-navbar-bg, #212529);
    color: #f8f9fa;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    transition: transform 0.2s ease;
}

.atom-sidebar-brand {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.atom-sidebar-brand a {
    color: #fff !important;
}

.atom-sidebar-brand .atom-brand-text {
    color: #fff !important;
    font-weight: 700;
    font-size: 1.1rem;
}

.atom-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.5rem;
}

.atom-nav-group {
    margin-bottom: 0.35rem;
}

.atom-nav-group-toggle {
    width: calc(100% - 0.5rem);
    margin: 0 0.25rem 0.35rem;
    text-align: left;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    color: #f1f3f5 !important;
    padding: 0.5rem 0.75rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.atom-nav-group-toggle:hover,
.atom-nav-group-toggle:focus {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff !important;
}

.atom-nav-group-toggle[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.14);
    border-color: var(--pt-highlight, #ffc107);
}

.atom-nav-group-toggle .atom-chevron {
    transition: transform 0.15s;
    font-size: 0.65rem;
    opacity: 0.9;
}

.atom-nav-group-toggle[aria-expanded="true"] .atom-chevron {
    transform: rotate(90deg);
}

.atom-nav-list {
    list-style: none;
    margin: 0;
    padding: 0 0.25rem 0.5rem 0.25rem;
}

.atom-nav-list li {
    margin-bottom: 0.35rem;
}

.atom-nav-list a,
.atom-sidebar .atom-sidebar-btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.85rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #f8f9fa !important;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.atom-nav-list a i {
    width: 1.1rem;
    text-align: center;
    opacity: 0.95;
}

.atom-nav-list a span:not(.badge) {
    flex: 1;
}

.atom-nav-list a .badge {
    margin-left: auto;
}

.atom-nav-list a:hover,
.atom-nav-list a:focus {
    background: #fff;
    border-color: #fff;
    color: var(--pt-navbar-bg, #212529) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.atom-nav-list a:hover i,
.atom-nav-list a:focus i {
    color: inherit;
}

.atom-nav-list a:active {
    background: var(--pt-surface, #e9ecef);
    border-color: var(--pt-accent, #0d6efd);
    color: var(--pt-text, #212529) !important;
}

.atom-sidebar-user {
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.92);
}

.atom-sidebar-user-name {
    display: inline-block;
    padding: 0.4rem 0.65rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    width: 100%;
}

.atom-main-wrap {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--pt-body-bg, #f8f9fa);
}

.atom-main-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--pt-surface, #fff);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.atom-main-header .atom-sidebar-toggle {
    color: var(--pt-text, #212529);
    text-decoration: none;
}

.atom-page-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--pt-text, #212529);
}

.atom-header-search {
    align-items: center;
    max-width: 320px;
}

.atom-main-content {
    flex: 1;
    padding: 1.25rem 1.5rem 2rem;
    scroll-margin-top: 0;
}

/* Tab panes must not pull page scroll when targeted by hash */
.atom-main-content .tab-pane {
    scroll-margin-top: 5rem;
}

.atom-app-modern .atom-app-footer {
    margin-left: 0;
}

@media (max-width: 991.98px) {
    .atom-sidebar {
        transform: translateX(-100%);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
    }

    .atom-sidebar.is-open {
        transform: translateX(0);
    }

    .atom-main-wrap {
        margin-left: 0;
    }
}
