/* =================================================================
   Консоль управления сервером (/dashboard/…) — body.is-console.
   Структура как у современных ботовых панелей: меню на всю высоту с группами,
   парящая верхняя панель с крошками, плоские тёмные карточки секций, спокойный
   нейтральный фон и один фиолетовый акцент. Публичные страницы остаются в «Aurora».
   Подключается после aurora.css.
   ================================================================= */
body.is-console {
  --brand: #4955D4;
  --brand-600: #3f4abf;
  --brand-grad: linear-gradient(135deg, #4955D4, #4955D4);
  --brand-glow: none;
  --aurora: linear-gradient(120deg, #4955D4, #4955D4);
  --bg: #f5f5f8;
  --surface: #ffffff;
  --surface-2: #f4f4f7;
  --surface-3: #ebebf0;
  --border: #e4e4ea;
  --border-strong: #d2d2db;
  --text: #18181b;
  --text-2: #55555f;
  --text-3: #8b8b97;
  --brand-50: #f0eafe;
  --brand-100: #e5dbfd;
  --brand-text: #3a45bd;
  --shadow-card: none;
  --shadow-hover: 0 8px 24px -12px rgba(30, 20, 80, 0.25);
  --r-sm: 10px;
  --r-md: 10px;
  --r-lg: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.is-console {
    --brand: #4955D4;
    --bg: #111113;
    --surface: #18181b;
    --surface-2: #1f1f24;
    --surface-3: #28282e;
    --border: #2a2a31;
    --border-strong: #3b3b44;
    --text: #f4f4f6;
    --text-2: #a3a3ae;
    --text-3: #727280;
    --brand-50: #231b3d;
    --brand-100: #2d2250;
    --brand-text: #aab3ff;
    --shadow-hover: 0 8px 24px -12px rgba(0, 0, 0, 0.7);
  }
}
:root[data-theme="dark"] body.is-console {
  --brand: #4955D4;
  --bg: #111113;
  --surface: #18181b;
  --surface-2: #1f1f24;
  --surface-3: #28282e;
  --border: #2a2a31;
  --border-strong: #3b3b44;
  --text: #f4f4f6;
  --text-2: #a3a3ae;
  --text-3: #727280;
  --brand-50: #231b3d;
  --brand-100: #2d2250;
  --brand-text: #aab3ff;
  --shadow-hover: 0 8px 24px -12px rgba(0, 0, 0, 0.7);
}

body.is-console { background: var(--bg); color: var(--text); }
body.is-console::before { display: none; }

/* ---------- каркас ---------- */
.is-console .shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 0; padding: 0; min-height: 100vh; background: transparent; }
.is-console .main { min-width: 0; }
.is-console .side {
  top: 0; height: 100vh; padding: 14px 10px 12px; gap: 10px;
  background: var(--surface); border: 0; border-right: 1px solid var(--border); border-radius: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
}
@media (max-width: 960px) {
  .is-console .shell { grid-template-columns: 1fr; }
  .is-console .side { border-radius: 0 16px 16px 0; }
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 6px; color: var(--text); font: 700 1.05rem var(--font-head); letter-spacing: -0.02em; text-decoration: none; }
.side-brand:hover { text-decoration: none; }
.side-brand img, .side-brand .mark { width: 30px; height: 30px; border-radius: 50%; flex: none; box-shadow: none; }
.is-console .switcher-btn { background: var(--surface-2); box-shadow: none; border: 1px solid var(--border); border-radius: 12px; padding: 8px; }
.is-console .switcher-btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.is-console .switcher-list { border-radius: 12px; }

.is-console .side-nav { gap: 1px; }
.is-console .nav-label { margin: 0; padding: 16px 10px 5px; font: 500 0.76rem var(--font); letter-spacing: 0; text-transform: none; color: var(--text-3); }
.is-console .nav-item { min-height: 34px; padding: 0 10px; gap: 10px; border-radius: 9px; font-size: 0.88rem; font-weight: 500; color: var(--text-2); }
.is-console .nav-item:hover { transform: none; background: var(--surface-2); color: var(--text); }
.is-console .nav-item > .icon:first-child, .is-console .nav-item .emoji {
  box-sizing: border-box; width: 18px; height: 18px; padding: 0; border-radius: 0; background: none; box-shadow: none; transform: none; color: var(--text-3);
}
.is-console .nav-item .emoji .icon { width: 18px; height: 18px; }
.is-console .nav-item:hover > .icon:first-child, .is-console .nav-item:hover .emoji { color: var(--text-2); }
.is-console .nav-item[aria-current="page"] { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand-text); font-weight: 600; box-shadow: none; }
.is-console .nav-item[aria-current="page"] > .icon:first-child, .is-console .nav-item[aria-current="page"] .emoji { background: none; box-shadow: none; transform: none; color: var(--brand-text); }
.is-console .nav-item.add > .icon:first-child { border: 0; }
.nav-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.nav-count { flex: none; min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: var(--r-pill); background: var(--surface-3); color: var(--text-2); font-size: 0.72rem; font-weight: 600; }
.nav-item[aria-current="page"] .nav-count { background: color-mix(in srgb, var(--brand) 30%, transparent); color: var(--brand-text); }
.nav-tag { flex: none; padding: 2px 8px; border-radius: var(--r-pill); background: var(--brand-grad); color: #fff; font-size: 0.6rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.is-console .side-foot { border-top: 1px solid var(--border); padding-top: 10px; }

/* ---------- верхняя панель ---------- */
.topbar { position: sticky; top: 10px; z-index: 20; display: flex; align-items: center; gap: 12px; min-height: 52px; margin: 10px 24px 0; padding: 0 10px 0 18px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--border); border-radius: 14px; }
.topbar .crumbs { flex: 1; min-width: 0; padding: 0; }
.topbar-side { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar .user-chip .name { font-size: 0.88rem; }
@media (max-width: 960px) { .topbar { margin: 8px 12px 0; padding-left: 8px; } }

/* ---------- контент и карточки ---------- */
.is-console .content { max-width: 1120px; padding: 26px 24px 80px; }
@media (max-width: 960px) { .is-console .content { padding: 18px 12px 60px; } }
.is-console .page-head { padding: 0; margin-bottom: 22px; }
.is-console .page-head h1 { font-family: var(--font-head); font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; }
.is-console .page-head .title-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--brand-50); box-shadow: none; }
.is-console .page-head .title-icon, .is-console .page-head .title-icon .icon { color: var(--brand-text); }
.is-console .page-head p { color: var(--text-2); font-size: 0.92rem; margin-top: 4px; }
.is-console .content .section:not(.section .section) { border-radius: 14px; padding: 20px 22px; box-shadow: none; background: var(--surface); }
.is-console .content .section:not(.section .section) + .section:not(.section .section) { margin-top: 14px; }
.is-console .content .section > h2:first-child::before, .is-console .content .section > .section-head > h2:first-child::before { display: none; }
.is-console .content .section h2 { font-size: 1.02rem; font-weight: 700; }
.is-console .section-note { font-size: 0.86rem; }
.is-console .card, .is-console .editor, .is-console .plan, .is-console .cmd-item, .is-console .cat-list, .is-console .choice, .is-console .tile { box-shadow: none; }
.is-console .editor { background: var(--surface-2); border-radius: 12px; }
.is-console .notice { border-radius: 10px; }
.is-console .tab-pane { gap: 14px; }

/* ---------- кнопки, поля, переключатели ---------- */
.is-console .btn { border-radius: 10px; min-height: 38px; padding: 0 16px; font-weight: 600; }
.is-console .btn.small { min-height: 32px; padding: 0 12px; border-radius: 8px; }
.is-console .btn.lg { min-height: 46px; }
.is-console .btn.primary { background: var(--brand); box-shadow: none; border-color: transparent; }
.is-console .btn.primary:hover:not(:disabled) { background: var(--brand-600); filter: none; box-shadow: none; }
.is-console .btn.soft { background: var(--brand-50); color: var(--brand-text); }
.is-console .btn:not(.primary):not(.ghost):not(.soft):not(.danger) { background: var(--surface-2); backdrop-filter: none; border-color: var(--border); }
.is-console .btn:not(.primary):not(.ghost):not(.soft):not(.danger):hover { background: var(--surface-3); }
.is-console .theme-toggle { border-radius: 50%; }
.is-console input[type="text"], .is-console input[type="number"], .is-console input[type="password"], .is-console input[type="search"], .is-console input[type="url"],
.is-console input[type="datetime-local"], .is-console input[type="time"], .is-console input[type="date"], .is-console select, .is-console textarea { border-radius: 10px; background: var(--surface-2); }
.is-console .switch input:checked + span { background: var(--brand); box-shadow: none; }
.is-console .badge, .is-console .chip { border-radius: var(--r-pill); }

/* ---------- вкладки ---------- */
.is-console .segmented, .is-console .module-tabs { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px; }
.is-console .seg, .is-console .module-tabs .seg { border-radius: 8px; padding: 7px 14px; }
.is-console .seg[aria-selected="true"] { background: var(--surface-3); color: var(--text); box-shadow: none; }
.is-console .seg[aria-selected="true"] .seg-count { color: var(--brand-text); }

/* ---------- главная сервера ---------- */
.is-console .server-head { border-radius: 14px; padding: 20px 22px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: none; }
.is-console .server-head::after { display: none; }
.is-console .server-head .server-icon.lg { width: 60px; height: 60px; box-shadow: none; }
.is-console .server-head h1 { font-size: 1.5rem; }
.is-console .server-meta .live { background: color-mix(in srgb, var(--ok) 14%, transparent); }
.is-console .meter, .is-console .hbar-track { height: 8px; }
.is-console .meter span, .is-console .hbar-fill { background: var(--brand); box-shadow: none; }
.is-console .quick-row .btn { background: var(--surface-2); }
.is-console .tile { border-radius: 12px; background: var(--surface-2); border: 0; }
.is-console .tile:hover { transform: none; box-shadow: none; }
.is-console .tile-value { background: none; color: var(--text); -webkit-background-clip: initial; background-clip: initial; font-family: var(--font-head); font-weight: 800; }
.is-console .fr-icon, .is-console .todo-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-50); }
.is-console .todo-icon.warn { background: var(--warn-soft); }
.is-console .feature-list { border-radius: 14px; box-shadow: none; }
.is-console .catalog-group > h2 { font-family: var(--font); font-size: 0.82rem; font-weight: 600; letter-spacing: 0; text-transform: none; }
.is-console .feature-row:hover { background: var(--surface-2); }
.is-console .cmd-item, .is-console .cat-list { border-radius: 12px; }
.is-console .choice { border-radius: 12px; }
.is-console .choice:hover { transform: none; box-shadow: none; }
.is-console .modal { border-radius: 16px; }
.is-console .plan { border-radius: 14px; }
.is-console .plan.featured { background: var(--surface); border: 1px solid var(--brand); box-shadow: none; }
.is-console .plan.owned { box-shadow: 0 0 0 1px rgba(111, 123, 255, .8), 0 0 16px -5px rgba(111, 123, 255, .4); }

/* Колонка меню не должна распирать длинными названиями с тегом — всё обрезается по краю */
.is-console .side-nav, .is-console .side-foot { grid-template-columns: minmax(0, 1fr); }
.is-console .nav-item { min-width: 0; }

/* =================================================================
   Доступность (проверка по контрасту WCAG AA и размеру зон нажатия)
   ================================================================= */
/* Приглушённый текст и статусы были 3–3.9:1 — доводим до 4.5:1 и выше */
body.is-console { --ok: #0e7c52; --warn: #946200; --danger: #c42b45; --text-3: #6c6c79; --brand-grad: linear-gradient(135deg, #4955D4, #3f4abf); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.is-console { --brand: #4955D4; --text-3: #8c8c9a; --ok: #4fd6a0; --warn: #efc16a; --danger: #ff7c8f; }
}
:root[data-theme="dark"] body.is-console { --brand: #4955D4; --text-3: #8c8c9a; --ok: #4fd6a0; --warn: #efc16a; --danger: #ff7c8f; }
.is-console .badge.on { color: var(--ok); }

/* Зоны нажатия на сенсорных экранах — не меньше 44 px */
@media (pointer: coarse), (max-width: 960px) {
  .is-console .nav-item { min-height: 44px; }
  .is-console .btn { min-height: 44px; }
  .is-console .btn.small { min-height: 40px; padding: 0 14px; }
  .is-console .menu-toggle, .is-console .theme-toggle { min-width: 44px; min-height: 44px; }
  .is-console .seg { min-height: 40px; }
  .is-console .switch { width: 52px; height: 32px; }
  .is-console .switch span::after { width: 24px; height: 24px; }
  .is-console .switch input:checked + span::after { transform: translateX(20px); }
}
/* Заметный фокус с клавиатуры в меню и на карточках */
.is-console .nav-item:focus-visible, .is-console .switcher-btn:focus-visible, .is-console .btn:focus-visible { box-shadow: var(--focus); outline: none; }

/* =================================================================
   Палитра консоли = палитра главной («Aurora»): сиреневые чернила, фиолетовый акцент,
   розовое и голубое сияние. Спокойнее и контрастнее, чтобы глаз не уставал.
   Этот блок последний и перекрывает цвета выше.
   ================================================================= */
body.is-console {
  --brand: #4955D4;
  --brand-600: #6250e6;
  --brand-grad: linear-gradient(135deg, #4955D4 0%, #4955D4 45%, #3f49bd 100%);
  --aurora: linear-gradient(120deg, #4955D4 0%, #6f7bf0 50%, #4cc3f5 100%);
  --bg: #f7f4fd;
  --surface: #ffffff;
  --surface-2: #f5f2fc;
  --surface-3: #ece7f8;
  --border: #e9e4f5;
  --border-strong: #d6cfeb;
  --text: #1f1b38;
  --text-2: #5b5679;
  --text-3: #6f6a8c;
  --brand-50: #f1eeff;
  --brand-100: #e5e0ff;
  --brand-text: #5a49e0;
  --ok: #0e7c52;
  --warn: #946200;
  --danger: #c42b45;
  --side-bg: #ffffff;
  background:
    radial-gradient(900px 440px at 0% -6%, color-mix(in srgb, #4955D4 11%, transparent), transparent 70%),
    radial-gradient(760px 420px at 100% 0%, color-mix(in srgb, #4cc3f5 8%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.is-console {
    --bg: #100e1d;
    --surface: #17142b;
    --surface-2: #1e1a38;
    --surface-3: #28234a;
    --border: #2a2550;
    --border-strong: #3b3568;
    --text: #efecff;
    --text-2: #b9b4dc;
    --text-3: #8d88b5;
    --brand-50: #251f4d;
    --brand-100: #2f2760;
    --brand-text: #aab3ff;
    --ok: #4fd6a0;
    --warn: #efc16a;
    --danger: #ff8196;
    --side-bg: #141126;
    --shadow-hover: 0 8px 26px -12px rgba(73, 85, 212, 0.45);
  }
}
:root[data-theme="dark"] body.is-console {
  --bg: #100e1d;
  --surface: #17142b;
  --surface-2: #1e1a38;
  --surface-3: #28234a;
  --border: #2a2550;
  --border-strong: #3b3568;
  --text: #efecff;
  --text-2: #b9b4dc;
  --text-3: #8d88b5;
  --brand-50: #251f4d;
  --brand-100: #2f2760;
  --brand-text: #aab3ff;
  --ok: #4fd6a0;
  --warn: #efc16a;
  --danger: #ff8196;
  --side-bg: #141126;
  --shadow-hover: 0 8px 26px -12px rgba(73, 85, 212, 0.45);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.is-console { background:
    radial-gradient(900px 440px at 0% -6%, color-mix(in srgb, #4955D4 18%, transparent), transparent 70%),
    radial-gradient(760px 420px at 100% 0%, color-mix(in srgb, #4cc3f5 10%, transparent), transparent 70%),
    radial-gradient(900px 500px at 50% 120%, color-mix(in srgb, #5ad1ff 7%, transparent), transparent 70%), var(--bg); background-attachment: fixed; }
}
:root[data-theme="dark"] body.is-console { background:
  radial-gradient(900px 440px at 0% -6%, color-mix(in srgb, #4955D4 18%, transparent), transparent 70%),
  radial-gradient(760px 420px at 100% 0%, color-mix(in srgb, #4cc3f5 10%, transparent), transparent 70%),
  radial-gradient(900px 500px at 50% 120%, color-mix(in srgb, #5ad1ff 7%, transparent), transparent 70%), var(--bg); background-attachment: fixed; }

.is-console .side { background: var(--side-bg); }
.is-console .btn.primary { background: var(--brand-grad); }
.is-console .btn.primary:hover:not(:disabled) { background: var(--brand-grad); filter: brightness(1.08); }
.is-console .switch input:checked + span { background: var(--brand-grad); }
.is-console .meter span, .is-console .hbar-fill { background: var(--aurora); }
.nav-tag { background: var(--aurora); color: #1b1240; }
.is-console .nav-item[aria-current="page"] { background: color-mix(in srgb, var(--brand) 15%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 22%, transparent); }
.is-console .server-head { background:
  radial-gradient(420px 200px at 0% 0%, color-mix(in srgb, #4955D4 16%, transparent), transparent 70%),
  radial-gradient(360px 200px at 100% 100%, color-mix(in srgb, #4cc3f5 10%, transparent), transparent 70%), var(--surface); }
.is-console .server-head .server-icon.lg { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px color-mix(in srgb, var(--brand) 55%, transparent); }
.is-console .content .section:not(.section .section) { border-color: var(--border); }
.is-console .content .section > h2:first-child::before, .is-console .content .section > .section-head > h2:first-child::before { display: block; content: ""; width: 3px; height: 16px; border-radius: 3px; background: var(--aurora); flex: none; }
.is-console .tile-value { background: var(--aurora); -webkit-background-clip: text; background-clip: text; color: transparent; }
.is-console .seg[aria-selected="true"] { background: color-mix(in srgb, var(--brand) 18%, transparent); color: var(--brand-text); }
.is-console .wizard-steps li.current .n { background: var(--brand-grad); }
.topbar { background: color-mix(in srgb, var(--surface) 78%, transparent); }
