/* =============================================
   Admin Layout — Persistent Left Sidebar
   ============================================= */

/* ── Sidebar ── */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid rgba(255, 255, 255, 0.03);
}

.admin-sidebar-brand {
    padding: 22px 22px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--sidebar-divider);
    flex-shrink: 0;
}

.admin-sidebar-brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.admin-sidebar-brand-icon .material-symbols-outlined {
    font-size: 20px;
}

.admin-sidebar-brand-text {
    font-size: 0.92rem;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: -0.02em;
}

/* ── Nav ── */
.admin-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 10px 24px;
}

.admin-sidebar-group {
    margin-bottom: 2px;
}

.admin-sidebar-group-label {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--sidebar-group-text);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 20px 14px 8px;
}

.admin-sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.15s ease;
    position: relative;
    margin-bottom: 2px;
    letter-spacing: -0.01em;
}

.admin-sidebar-item .material-symbols-outlined {
    font-size: 20px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: all 0.15s ease;
}

.admin-sidebar-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--sidebar-text-hover);
}

.admin-sidebar-item:hover .material-symbols-outlined {
    opacity: 1;
    color: var(--sidebar-accent);
}

.admin-sidebar-item.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 600;
}

.admin-sidebar-item.active .material-symbols-outlined {
    opacity: 1;
}

.admin-sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    bottom: 7px;
    width: 3px;
    background: var(--sidebar-accent);
    border-radius: 0 3px 3px 0;
}

.admin-sidebar-divider {
    height: 1px;
    background: var(--sidebar-divider);
    margin: 10px 14px;
}

/* ── Footer ── */
.admin-sidebar-footer {
    padding: 14px 18px;
    border-top: 1px solid var(--sidebar-divider);
    flex-shrink: 0;
}

.admin-sidebar-footer .btn {
    width: 100%;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--sidebar-text);
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    transition: all 0.15s;
}

.admin-sidebar-footer .btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
}

/* ── Main Content Area ── */
.admin-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    background: var(--content-bg);
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Header ── */
.admin-header {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 0 28px;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Mobile hamburger ── */
.admin-hamburger {
    display: flex;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background 0.15s;
    flex-shrink: 0;
    margin-right: 8px;
}

.admin-hamburger:hover {
    background: var(--bg-hover);
}

.admin-hamburger .material-symbols-outlined {
    font-size: 22px;
}

/* ── Mobile overlay ── */
.admin-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    backdrop-filter: blur(4px);
}

.admin-sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        z-index: 300;
        box-shadow: 4px 0 24px rgba(15, 23, 42, 0.15);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .admin-hamburger {
        display: flex;
    }

    .admin-header {
        padding: 0 16px;
    }
}

/* ── Desktop Collapsed State ── */
@media (min-width: 769px) {
    body.sidebar-closed .admin-sidebar {
        transform: translateX(-100%);
    }

    body.sidebar-closed .admin-main {
        margin-left: 0;
    }
}