/* assets/css/shell.css — каркас админки Centers в едином стиле LEXARO-админок.
 *
 * Владелец, 2026-08-06: "дизайн должен быть похожим на остальные мои админки"
 * + "что можно — скопировать с основной системы". Токены (:root) и правила
 * каркаса — прямой перенос из multipage-node (полной копии BASE-админки):
 * тема — дефолтная тёмная красная из admin/index.php's $themes['red'],
 * плотность comfortable, радиусы soft, эффекты включены, семантические
 * цвета те же и намеренно НЕ зависят от акцента. Переключателя тем здесь
 * нет сознательно: Centers — одиночный инструмент владельца, один аккаунт,
 * одна тема; понадобится — переносится тем же способом из admin/index.php.
 *
 * Компонентная библиотека (карточки/бейджи/кнопки/поля/таблицы/пилюли/
 * savebar) живёт в соседнем admin.css — это ДОСЛОВНАЯ копия
 * modules/multipage/public/assets/css/admin.css с теми же именами классов
 * mp-*, чтобы куски разметки переносились между проектами 1:1 без
 * переименований. Этот файл — только то, чего у модульной библиотеки нет:
 * шрифт, токены, сайдбар, шапка страницы, мобильное поведение. */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/assets/fonts/inter-cyrillic-ext.woff2') format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/assets/fonts/inter-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/assets/fonts/inter-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/assets/fonts/inter-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
    /* $themes['red'] (тёмная) — байт-в-байт из multipage-node/admin/index.php */
    --bg: #050505; --surface: #101010; --surface-2: #171717; --input: #050505;
    --text: #ffffff; --muted: #8b8b8b;
    --main: #e74c3c; --main-dark: #c0392b; --main-glass: rgba(231, 76, 60, 0.12);
    --border: #242424; --shadow-color: rgba(231, 76, 60, .14);
    /* comfortable / soft / effects on */
    --space: 16px; --nav-pad-y: 13px; --nav-font: 14px;
    --content-pad: clamp(16px, 3vw, 34px); --content-scale: 1;
    --radius: 13px; --radius-lg: 20px;
    --effects: 1;
    --card-shadow: 0 18px 45px rgba(0, 0, 0, .28), 0 0 22px var(--shadow-color);
    /* Семантика — независима от акцентной темы (как в BASE) */
    --danger: #e74c3c; --success: #2ecc71; --info: #3498db; --warning: #f39c12; --upsell: #9b59b6;
    --main-contrast: #fff;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--main); }

.layout {
    display: flex;
    min-height: 100vh;
}

/* ── Сайдбар ─────────────────────────────────────────────────────────── */
.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: none;
    padding: 22px 14px 16px;
}

.sidebar::-webkit-scrollbar { display: none; }

.brand-logo { margin-bottom: 18px; padding: 0 8px; }

.main-brand {
    font-size: 21px;
    font-weight: 900;
    letter-spacing: .22em;
    color: var(--main);
    text-shadow: 0 0 18px var(--shadow-color);
}

.sub-brand {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .34em;
    color: var(--muted);
    margin-top: 3px;
    text-transform: uppercase;
}

.admin-user-chip {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 16px;
}

.admin-user-chip b {
    display: block;
    color: var(--text);
    font-size: 14px;
    margin-bottom: 2px;
}

.nav-scroll { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nav-group-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: none;
    border: none;
    color: var(--muted);
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .09em;
    padding: 14px 10px 6px;
    cursor: pointer;
    transition: color .15s ease;
}

.nav-group-toggle:hover { color: var(--main); }

.nav-group-toggle .chev {
    margin-left: auto;
    transition: transform .25s cubic-bezier(.4, 0, .2, 1);
}

.nav-group-toggle[aria-expanded="false"] .chev { transform: rotate(-90deg); }

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.nav-group.collapsed { display: none; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: var(--nav-pad-y) 12px;
    border-radius: var(--radius);
    color: var(--muted);
    text-decoration: none;
    font-size: var(--nav-font);
    font-weight: 600;
    transition: background .15s ease, color .15s ease, transform .12s ease;
    position: relative;
}

.nav-link svg { width: 17px; height: 17px; flex-shrink: 0; }

.nav-link:hover { color: var(--text); background: var(--surface-2); transform: translateX(2px); }

.nav-link.active {
    color: var(--main);
    background: var(--main-glass);
    font-weight: 700;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 22%;
    bottom: 22%;
    width: 3px;
    border-radius: 3px;
    background: var(--main);
    box-shadow: 0 0 10px var(--shadow-color);
}

.nav-draft-dot {
    margin-left: auto;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--warning);
    opacity: .8;
    flex-shrink: 0;
}

.sidebar-footer {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-version {
    font-size: 10px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: center;
    opacity: .7;
}

.nav-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: color-mix(in srgb, var(--danger) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
    border-radius: var(--radius);
    color: var(--danger);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 10px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.nav-logout-btn:hover { background: var(--danger); color: #fff; }

.nav-settings-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 700;
    padding: 9px;
    text-decoration: none;
    transition: color .15s ease, border-color .15s ease;
}

.nav-settings-link:hover { color: var(--main); border-color: var(--main); }

/* ── Контент ─────────────────────────────────────────────────────────── */
.content {
    flex: 1;
    min-width: 0;
    padding: var(--content-pad);
    animation: page-fade-in .35s cubic-bezier(.4, 0, .2, 1) both;
}

@keyframes page-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Мобильный сайдбар ───────────────────────────────────────────────── */
.mobile-topbar { display: none; }

@media (max-width: 860px) {
    .layout { flex-direction: column; }

    .mobile-topbar {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        position: sticky;
        top: 0;
        z-index: 90;
    }

    .mobile-topbar .main-brand { font-size: 16px; }

    .burger-btn {
        margin-left: auto;
        background: var(--surface-2);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        color: var(--text);
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 100;
        transform: translateX(-105%);
        transition: transform .3s cubic-bezier(.4, 0, .2, 1);
        box-shadow: 0 0 60px rgba(0, 0, 0, .6);
        width: min(300px, 84vw);
    }

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

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .55);
        z-index: 95;
        opacity: 0;
        pointer-events: none;
        transition: opacity .3s ease;
    }

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

/* ── Экран логина / setup (без сайдбара) ─────────────────────────────── */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 34px 30px;
    box-shadow: var(--card-shadow);
    animation: page-fade-in .4s cubic-bezier(.4, 0, .2, 1) both;
}

.auth-card .brand-logo { text-align: center; margin-bottom: 22px; padding: 0; }

@media (prefers-reduced-motion: reduce) {
    .content, .auth-card, .nav-link, .sidebar { animation: none !important; transition: none !important; }
}
