        :root {
            --bg-0: #eef3f8;
            --bg-1: #f7fafc;
            --ink-strong: #13202f;
            --ink: #24364a;
            --muted: #5f7288;
            --surface: #ffffff;
            --surface-edge: #d8e1eb;
            --focus: #1f7af6;
            --focus-2: #0a5bd7;
            --danger-bg: #fff3f1;
            --danger-edge: #f2c6c0;
            --danger-ink: #8e3022;
            --radius-lg: 16px;
            --radius-md: 12px;
            --shadow: 0 14px 34px rgba(24, 41, 66, 0.08);
        }
        * { box-sizing: border-box; }
        body {
            margin: 0;
            color: var(--ink);
            font-family: "Manrope", "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
            background:
                radial-gradient(1000px 420px at -5% -10%, rgba(34, 119, 255, 0.17), transparent 60%),
                radial-gradient(900px 400px at 110% 0%, rgba(13, 178, 122, 0.14), transparent 60%),
                linear-gradient(180deg, var(--bg-0), var(--bg-1));
        }
        .wrap {
            max-width: 1160px;
            margin: 0 auto;
            padding: 22px 16px 28px;
        }
        .header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 14px;
            padding: 14px 16px;
            margin-bottom: 14px;
            border: 1px solid var(--surface-edge);
            border-radius: var(--radius-lg);
            background: rgba(255, 255, 255, 0.74);
            backdrop-filter: blur(6px);
            box-shadow: var(--shadow);
        }
        .brand h1 {
            margin: 0;
            font-size: 1.18rem;
            line-height: 1.15;
            color: var(--ink-strong);
            letter-spacing: -0.01em;
        }
        .brand p {
            margin: 4px 0 0;
            color: var(--muted);
            font-size: 0.85rem;
        }
        .pill {
            border: 1px solid var(--surface-edge);
            background: #f9fbff;
            color: var(--ink);
            border-radius: 999px;
            padding: 8px 12px;
            font-size: 0.78rem;
            white-space: nowrap;
        }
        .card {
            background: var(--surface);
            border: 1px solid var(--surface-edge);
            border-radius: var(--radius-lg);
            padding: 16px;
            margin-bottom: 14px;
            box-shadow: var(--shadow);
        }
        .row {
            display: grid;
            gap: 12px;
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        }
        h1, h2, h3 { margin: 0 0 10px; color: var(--ink-strong); letter-spacing: -0.01em; }
        h2 { font-size: 1.06rem; }
        h3 { font-size: 0.97rem; }
        p { margin: 0 0 10px; }
        form { display: grid; gap: 9px; }
        input, select, textarea, button {
            width: 100%;
            font: inherit;
            border-radius: var(--radius-md);
            border: 1px solid #ccd8e4;
            padding: 10px 12px;
            color: var(--ink);
            background: #fff;
        }
        textarea { min-height: 84px; resize: vertical; }
        input:focus, select:focus, textarea:focus {
            outline: none;
            border-color: var(--focus);
            box-shadow: 0 0 0 3px rgba(31, 122, 246, 0.15);
        }
        button {
            border-color: var(--focus);
            background: linear-gradient(180deg, var(--focus), var(--focus-2));
            color: #fff;
            font-weight: 700;
            cursor: pointer;
            transition: transform 120ms ease, filter 120ms ease;
        }
        button:hover { filter: brightness(1.05); transform: translateY(-1px); }
        a { color: var(--focus-2); text-decoration: none; }
        a:hover { text-decoration: underline; }
        .muted { color: var(--muted); font-size: 0.9rem; }
        .topic {
            border: 1px solid var(--surface-edge);
            border-radius: var(--radius-md);
            padding: 12px;
            margin-bottom: 10px;
            background: #fbfdff;
        }
        .topic ul { margin: 6px 0 0 18px; padding: 0; }
        .topic li { margin: 5px 0; }
        .error {
            background: var(--danger-bg);
            border: 1px solid var(--danger-edge);
            color: var(--danger-ink);
            padding: 10px;
            border-radius: var(--radius-md);
            margin-bottom: 12px;
        }
        code {
            background: #eef4ff;
            color: #1f3f68;
            border: 1px solid #d6e3f7;
            border-radius: 7px;
            padding: 2px 5px;
            word-break: break-all;
        }
        table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
        th, td {
            border-bottom: 1px solid #e3eaf2;
            padding: 8px 6px;
            white-space: nowrap;
            font-size: 0.9rem;
            text-align: left;
        }
        td form { display: inline-block; margin-right: 6px; }
        td form button {
            width: auto;
            min-width: 88px;
            padding: 7px 9px;
            font-size: 0.78rem;
            border-radius: 9px;
        }
        .admin-module .module-grid {
            display: grid;
            gap: 12px;
            grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        }
        .admin-module .module-card {
            border: 1px solid var(--surface-edge);
            border-radius: var(--radius-md);
            padding: 12px;
            background: #fbfdff;
            margin-bottom: 10px;
        }
        .admin-module .toolbar {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 8px;
            margin-bottom: 8px;
        }
        .admin-module .toolbar button,
        .admin-module .toolbar select,
        .admin-module .toolbar input {
            width: auto;
            min-width: 120px;
        }
        .admin-module .toolbar .grow {
            flex: 1 1 220px;
            width: auto;
            min-width: 220px;
        }
        .admin-module .table-wrap {
            max-height: 300px;
            overflow: auto;
            border: 1px solid #e3eaf2;
            border-radius: 10px;
            background: #fff;
        }
        .admin-module .tiny {
            font-size: 0.78rem;
            color: var(--muted);
        }
        .admin-module pre {
            margin: 0;
            white-space: pre-wrap;
            word-break: break-word;
            background: #f2f7ff;
            border: 1px solid #d9e5f7;
            border-radius: 10px;
            padding: 10px;
            max-height: 210px;
            overflow: auto;
        }
        .admin-module .danger {
            border-color: #bc3f2f;
            background: linear-gradient(180deg, #d75845, #bc3f2f);
        }
        .admin-module .section-title {
            margin-top: 0;
            margin-bottom: 6px;
        }
        .admin-v2 {
            display: grid;
            grid-template-columns: 250px 1fr;
            gap: 14px;
            min-height: calc(100vh - 44px);
        }
        .admin-sidebar {
            position: sticky;
            top: 0;
            align-self: start;
            border: 1px solid var(--surface-edge);
            border-radius: var(--radius-lg);
            background: var(--surface);
            box-shadow: var(--shadow);
            padding: 16px 12px;
        }
        .admin-brand {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 14px;
            font-weight: 800;
            color: var(--ink-strong);
        }
        .admin-brand-dot {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            background: linear-gradient(145deg, #2ca56a, #0f6f45);
        }
        .admin-nav {
            display: grid;
            gap: 6px;
        }
        .admin-nav a {
            display: block;
            padding: 9px 11px;
            border-radius: 10px;
            color: var(--ink);
            border: 1px solid transparent;
            font-weight: 600;
        }
        .admin-nav a:hover {
            text-decoration: none;
            border-color: #cce3d8;
            background: #f3fbf6;
        }
        .admin-main {
            min-width: 0;
        }
        .admin-topbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            border: 1px solid var(--surface-edge);
            border-radius: var(--radius-lg);
            background: var(--surface);
            box-shadow: var(--shadow);
            padding: 12px;
            margin-bottom: 12px;
        }
        .admin-search {
            max-width: 520px;
            width: 100%;
        }
        .admin-top-actions {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .admin-user-pill {
            border: 1px solid #d9e5f7;
            border-radius: 999px;
            padding: 6px 10px;
            background: #f8fbff;
            font-size: 0.85rem;
        }
        .stats-grid {
            display: grid;
            gap: 10px;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        }
        .stat-card {
            border: 1px solid var(--surface-edge);
            border-radius: 14px;
            background: var(--surface);
            padding: 12px;
        }
        .stat-card.highlight {
            background: linear-gradient(145deg, #0f6f45, #2a9d66);
            color: #fff;
            border-color: #1f7f52;
        }
        .stat-card h3 {
            margin: 0 0 8px;
            font-size: 0.95rem;
            letter-spacing: 0;
        }
        .stat-card .big {
            font-size: 2rem;
            font-weight: 800;
            line-height: 1;
            margin-bottom: 6px;
        }
        .module-section {
            scroll-margin-top: 18px;
        }
        .drawer-btn {
            width: auto;
            min-width: 110px;
            border-radius: 999px;
        }
        .module-drawer-backdrop {
            position: fixed;
            inset: 0;
            background: rgba(20, 35, 55, 0.22);
            z-index: 40;
            display: none;
        }
        .module-drawer {
            position: fixed;
            right: 0;
            top: 0;
            height: 100vh;
            width: min(360px, 92vw);
            background: #f8fbff;
            border-left: 1px solid var(--surface-edge);
            box-shadow: -8px 0 24px rgba(24, 41, 66, 0.16);
            z-index: 50;
            transform: translateX(102%);
            transition: transform 180ms ease;
            padding: 14px;
            overflow: auto;
        }
        .module-drawer h3 {
            margin-bottom: 10px;
        }
        .module-drawer a {
            display: block;
            padding: 10px;
            border-radius: 10px;
            margin-bottom: 6px;
            border: 1px solid #d8e3ef;
            background: #fff;
            font-weight: 600;
        }
        .module-drawer a:hover {
            text-decoration: none;
            background: #f2f9ff;
        }
        .admin-v2.drawer-open .module-drawer-backdrop {
            display: block;
        }
        .admin-v2.drawer-open .module-drawer {
            transform: translateX(0);
        }
        @media (max-width: 820px) {
            .wrap { padding: 14px 10px 20px; }
            .header { flex-direction: column; align-items: flex-start; }
            .pill { width: 100%; text-align: center; }
            .card { padding: 13px; }
            .admin-v2 {
                grid-template-columns: 1fr;
            }
            .admin-sidebar {
                position: static;
            }

.admin-toast-root { position: fixed; right: 16px; bottom: 16px; z-index: 3000; display: grid; gap: 8px; }
.admin-toast { background: #13202f; color: #fff; padding: 10px 12px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.22); transition: opacity .2s ease, transform .2s ease; }
.admin-toast.error { background: #8e3022; }
.admin-toast.success { background: #0d724f; }
.admin-toast.hide { opacity: 0; transform: translateY(6px); }
.admin-modal-root { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 4000; }
.admin-modal-root.open { display: flex; }
.admin-modal-backdrop { position: absolute; inset: 0; background: rgba(13, 22, 33, 0.58); }
.admin-modal-card { position: relative; background: #fff; border: 1px solid #d8e1eb; border-radius: 14px; width: min(92vw, 520px); padding: 18px; box-shadow: 0 26px 48px rgba(20,32,49,.22); }
.admin-modal-card h3 { margin: 0 0 6px; }
.admin-modal-card p { margin: 0 0 10px; color: #4f647a; }
#adminModalInput { width: 100%; margin: 8px 0 0; }
.admin-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

.alerts-list { display: grid; gap: 10px; }
.alert-item { border: 1px solid #d8e1eb; border-radius: 10px; padding: 10px; display: grid; gap: 4px; }
.alert-item strong { color: #13202f; }
.alert-item span { color: #4f647a; font-size: .93rem; }
.alert-item.level-high { border-color: #f2c6c0; background: #fff3f1; }
.alert-item.level-medium { border-color: #ffe4b3; background: #fff8ec; }
.alert-item.level-info { border-color: #c8d9ff; background: #f3f8ff; }
.alert-item.level-ok { border-color: #c7e7da; background: #f2fcf8; }
