/* =============================
   БАЗА
================================ */

:root {
    --admin-bg: #0f172a;
    --admin-bg-soft: #111827;
    --admin-accent: #3b82f6;
    --admin-accent-soft: rgba(59, 130, 246, 0.15);
    --admin-text: #e5e7eb;
    --admin-text-muted: #9ca3af;
    --admin-border-soft: rgba(148, 163, 184, 0.25);
    --admin-card-bg: #ffffff;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f3f4f6;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: #111827;
}

/* =============================
   LAYOUT WRAP
================================ */

.admin-wrap {
    min-height: 100vh;
}

/* =============================
   SIDEBAR (fixed + mobile off-canvas)
================================ */

.admin-sidebar {
    position: fixed;
    z-index: 1040;
    top: 0;
    left: 0;
    bottom: 0;
    width: 250px;
    background: radial-gradient(circle at top left, #1e293b 0, #020617 55%);
    padding: 16px 14px;
    color: var(--admin-text);
    display: flex;
    flex-direction: column;

    /* базово – выдвижная панель для мобилки */
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.55);
}

/* когда открыта на мобильном */
body.sidebar-open .admin-sidebar {
    transform: translateX(0);
}

/* =============================
   SIDEBAR HEADER
================================ */

.admin-sidebar-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.admin-brand {
    display: flex;
    align-items: center;
}

.admin-brand-logo {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 0, #f97316, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    margin-right: 8px;
}

.admin-brand-title {
    font-size: 15px;
    font-weight: 600;
}

.admin-brand-subtitle {
    font-size: 11px;
    color: var(--admin-text-muted);
}

/* =============================
   SIDEBAR NAV
================================ */

.admin-sidebar-divider {
    border-bottom: 1px solid var(--admin-border-soft);
    margin: 8px 0 10px;
}

.admin-nav-scroll {
    flex: 1;
    overflow-y: auto;
}

.admin-nav-section-title {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--admin-text-muted);
    margin: 14px 0 6px;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    border-radius: 9px;
    padding: 7px 8px;
    margin-bottom: 4px;
    font-size: 13.5px;

    color: var(--admin-text);
    text-decoration: none;

    transition: background .15s ease;
}

.admin-nav-link:hover {
    background: rgba(15,23,42,0.85);
}

.admin-nav-link.active {
    background: var(--admin-accent-soft);
}

.admin-nav-link-icon {
    width: 22px;
    display: inline-flex;
    justify-content: center;
    margin-right: 8px;
}

.admin-sidebar-footer {
    padding-top: 10px;
    border-top: 1px dashed var(--admin-border-soft);
}

/* =============================
   OVERLAY (только мобильный)
================================ */

.admin-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

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

/* =============================
   MAIN LAYOUT
================================ */

.admin-main {
    display: flex;
    flex-direction: column;
}

/* =============================
   TOPBAR
================================ */

.admin-topbar {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-menu-toggle {
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    padding: 5px 9px;
    margin-right: 8px;
    font-size: 18px;
}

.admin-topbar-title {
    font-size: 18px;
    font-weight: 600;
}

.admin-topbar-actions {
    margin-left: auto;
}

/* =============================
   CONTENT
================================ */

.admin-content {
    flex: 1;
    padding: 16px 20px;
}

/* =============================
   DESKTOP (≥ 992px)
   — на десктопе sidebar всегда виден и фиксирован,
     контент сдвинут вправо, поэтому меню
     остаётся на месте при скролле страницы.
================================ */

@media (min-width: 992px) {

    .admin-wrap {
        /* просто контейнер для main, сайдбар фиксирован */
    }

    .admin-sidebar {
        /* на десктопе панель всегда показана */
        transform: none !important;
        box-shadow: none;
    }

    .admin-main {
        margin-left: 250px; /* ширина сайдбара */
    }

    .admin-overlay {
        display: none !important;
    }

    .admin-content {
        padding: 18px 22px;
    }
}

/* =============================
   MOBILE (≤ 575px)
================================ */

@media (max-width: 575.98px) {

    .admin-topbar-title {
        font-size: 16px;
    }

    .admin-content {
        padding: 12px;
    }
}
