/* ================================================
   Admin — Layout & Component Styles
   ================================================ */

body.admin-body {
    background: #F9F1F4;
    overflow-x: hidden;
    /* Remove flex column from body set in style.css */
    display: block;
}

/* ── Full-page admin layout ── */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
.admin-sidebar {
    width: 220px;
    min-width: 220px;
    flex-shrink: 0;
    min-height: 100vh;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    /* NOT fixed — stays in flow so main content sits beside it */
}

/* ── Main area ── */
.admin-main {
    flex: 1;
    min-width: 0; /* prevent flex overflow */
    display: flex;
    flex-direction: column;
    background: #F9F1F4;
}

/* ── Topbar ── */
.admin-topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.admin-topbar h1 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text);
    margin: 0;
}
.admin-topbar .breadcrumb {
    font-size: .75rem;
    color: var(--text-light);
    margin-top: 2px;
}

/* ── Content area ── */
.admin-content {
    padding: 24px 28px;
    flex: 1;
}

/* ── Stat card hover ── */
.stat-card {
    transition: box-shadow .2s, transform .2s;
    cursor: default;
}
.stat-card:hover {
    box-shadow: 0 4px 20px var(--shadow);
    transform: translateY(-2px);
}

/* ── Inline code ── */
code {
    background: var(--pink-pale);
    color: var(--magenta);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: .8em;
    font-family: 'Courier New', monospace;
}

/* ── Table row: show actions on hover ── */
tr .action-btns { opacity: .6; transition: opacity .15s; }
tr:hover .action-btns { opacity: 1; }

/* ── Checkbox ── */
input[type="checkbox"] {
    accent-color: var(--red);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ── File input ── */
input[type="file"].form-control {
    padding: 6px 10px;
    cursor: pointer;
}

/* ── Form section heading ── */
.form-section-title {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-light);
    margin: 20px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

/* ── Mobile overlay ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 199;
}
.sidebar-overlay.active { display: block; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .admin-layout {
        display: block;
    }

    .admin-sidebar {
        position: fixed;
        top: 0;
        left: -220px;
        height: 100vh;
        z-index: 200;
        transition: left .28s ease;
        /* override sticky from desktop */
    }
    .admin-sidebar.open {
        left: 0;
        box-shadow: 4px 0 24px rgba(0,0,0,.3);
    }

    .admin-main {
        margin-left: 0;
        width: 100%;
    }

    #adminSidebarToggle {
        display: inline-flex !important;
    }

    .admin-topbar {
        padding: 12px 16px;
        position: sticky;
        top: 0;
        z-index: 50;
    }

    .admin-content {
        padding: 14px 16px;
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}