/* Дизайн-система кабинета Ledgeum. Всё берётся из токенов; своих шрифтов и скриптов достаточно. */

@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* Фирменная надпись — шрифты прототипа приложения, только нужные буквы. */
@font-face {
  font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 800; font-display: block;
  src: url("fonts/jakarta-wordmark-800.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/plex-mono-latin-500.woff2") format("woff2");
}

/* ── Токены: общие ── */
:root {
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --text-xs: 12px; --text-sm: 13px; --text-md: 14px; --text-lg: 16px; --text-xl: 22px; --text-2xl: 26px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-full: 999px;
  --sidebar: 232px; --sidebar-rail: 64px; --topbar: 56px;
  --ease: 140ms ease;
}

/* ── Токены: светлая тема ── */
:root {
  color-scheme: light;
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f1f3f6; --surface-3: #e8ebf0;
  --line: #e2e5ea; --line-strong: #cdd2da;
  --text: #111827; --text-2: #4b5563; --text-3: #5f6875;
  --accent: #0a7f6a; --accent-hover: #086b59; --on-accent: #ffffff; --accent-soft: #e3f4f0; --accent-text: #08705d;
  --success: #12714a; --success-soft: #e2f4ea;
  --warning: #8a5a00; --warning-soft: #fbf0d9;
  --danger: #bb2336; --danger-hover: #a01d2e; --on-danger: #ffffff; --danger-soft: #fce8ea;
  --info: #2455c3; --info-soft: #e6edfb;
  --focus: #2f6bff; --scrim: rgba(15, 23, 42, .45);
  --chart: #0b8f76;
  --field-border: #8b93a0;
  --brand-gradient: linear-gradient(90deg, #00d4aa, #1a56f0);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-md: 0 6px 20px rgba(16, 24, 40, .12);
  --shadow-lg: 0 18px 48px rgba(16, 24, 40, .2);
}

/* ── Токены: тёмная тема (система или явный выбор) ── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0f17; --surface: #121824; --surface-2: #1a2130; --surface-3: #232c3e;
    --line: #252f42; --line-strong: #36425a;
    --text: #eef2f8; --text-2: #b4bdcc; --text-3: #98a2b5;
    --accent: #2ee8c2; --accent-hover: #5ceed0; --on-accent: #04221b; --accent-soft: rgba(46, 232, 194, .12); --accent-text: #2ee8c2;
    --success: #3fd693; --success-soft: rgba(63, 214, 147, .14);
    --warning: #f5b544; --warning-soft: rgba(245, 181, 68, .14);
    --danger: #ff6b7d; --danger-hover: #ff8896; --on-danger: #2a0509; --danger-soft: rgba(255, 107, 125, .14);
    --info: #7da6ff; --info-soft: rgba(125, 166, 255, .14);
    --focus: #7da6ff; --scrim: rgba(0, 0, 0, .6);
    --chart: #17a98b;
  --field-border: #5f6c86;
  --brand-gradient: linear-gradient(90deg, #00d4aa, #1a56f0);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, .45);
    --shadow-lg: 0 20px 56px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0f17; --surface: #121824; --surface-2: #1a2130; --surface-3: #232c3e;
  --line: #252f42; --line-strong: #36425a;
  --text: #eef2f8; --text-2: #b4bdcc; --text-3: #98a2b5;
  --accent: #2ee8c2; --accent-hover: #5ceed0; --on-accent: #04221b; --accent-soft: rgba(46, 232, 194, .12); --accent-text: #2ee8c2;
  --success: #3fd693; --success-soft: rgba(63, 214, 147, .14);
  --warning: #f5b544; --warning-soft: rgba(245, 181, 68, .14);
  --danger: #ff6b7d; --danger-hover: #ff8896; --on-danger: #2a0509; --danger-soft: rgba(255, 107, 125, .14);
  --info: #7da6ff; --info-soft: rgba(125, 166, 255, .14);
  --focus: #7da6ff; --scrim: rgba(0, 0, 0, .6);
    --chart: #17a98b;
  --field-border: #5f6c86;
  --brand-gradient: linear-gradient(90deg, #00d4aa, #1a56f0);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .45);
  --shadow-lg: 0 20px 56px rgba(0, 0, 0, .6);
}

/* ── Основа ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
b, strong { font-weight: 600; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 var(--text-md)/1.5 var(--font); font-feature-settings: "cv11", "tnum" 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
[hidden] { display: none !important; }
h1 { font-size: var(--text-xl); font-weight: 600; letter-spacing: -.01em; margin: 0; overflow-wrap: anywhere; }
h2 { font-size: var(--text-lg); font-weight: 600; margin: var(--s-8) 0 var(--s-3); }
p { margin: 0 0 var(--s-3); }
.icon { width: 18px; height: 18px; flex: none; stroke-width: 1.75; }
.mono { font-family: var(--mono); font-size: var(--text-sm); overflow-wrap: anywhere; }
.muted { color: var(--text-3); }
.skip { position: absolute; left: var(--s-3); top: -60px; z-index: 60; background: var(--surface); padding: var(--s-2) var(--s-3); border-radius: var(--r-md); box-shadow: var(--shadow-md); }
.skip:focus { top: var(--s-3); }

/* ── Каркас ── */
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar); display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); transition: width var(--ease), transform var(--ease); }
.brand { height: var(--topbar); display: flex; align-items: center; gap: 10px; padding: 0 var(--s-4); color: var(--text); border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.brand:hover { text-decoration: none; }
/* Знак — квадрат со скруглением: углы исходного файла срезаются. */
/* Как шапка прототипа: «Ledge» + «um» с переходом бирюзовый → синий, подпись моноширинным. */
.brand .logo { width: 34px; height: 34px; flex: none; border-radius: 24%; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font: 800 19px/1.05 "Plus Jakarta Sans", var(--font); letter-spacing: -.03em; }
.brand-name b { font-weight: 800; background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.brand-line { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.brand small { font: 500 9.5px/1 "IBM Plex Mono", var(--mono); letter-spacing: .24em; text-transform: uppercase; color: var(--text-3); }
.brand .brand-sub { margin-top: 3px; font: 500 9px/1 "IBM Plex Mono", var(--mono); letter-spacing: .02em; color: var(--text-3); opacity: .85; }
.nav { flex: 1; overflow-y: auto; padding: var(--s-3) var(--s-2); }
.nav-group + .nav-group { margin-top: var(--s-4); }
.nav-title { padding: 0 var(--s-3) var(--s-1); font-size: var(--text-xs); font-weight: 600; color: var(--text-3); white-space: nowrap; }
.nav-item { display: flex; align-items: center; gap: var(--s-3); height: 36px; padding: 0 var(--s-3); border-radius: var(--r-md); color: var(--text-2); font-weight: 500; white-space: nowrap; overflow: hidden; }
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.nav-foot { padding: var(--s-2); border-top: 1px solid var(--line); }
.nav-foot button { width: 100%; justify-content: flex-start; gap: var(--s-3); padding: 0 var(--s-3); white-space: nowrap; overflow: hidden; }
.scrim { display: none; position: fixed; inset: 0; z-index: 25; background: var(--scrim); }
.page { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left var(--ease); }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar); display: flex; align-items: center; gap: var(--s-3); padding: 0 var(--s-6); background: var(--surface); border-bottom: 1px solid var(--line); }
.btn.topbar-menu { display: none; }
.crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s-1); font-size: var(--text-sm); color: var(--text-3); white-space: nowrap; overflow: hidden; }
.crumbs a { color: var(--text-3); }
.crumbs span[aria-current] { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.crumbs .icon { width: 14px; height: 14px; }
.content { flex: 1; width: 100%; max-width: 1320px; padding: var(--s-6); }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-5); }

:root[data-sidebar="collapsed"] .sidebar { width: var(--sidebar-rail); }
:root[data-sidebar="collapsed"] .page { margin-left: var(--sidebar-rail); }
:root[data-sidebar="collapsed"] .brand .brand-text,
:root[data-sidebar="collapsed"] .nav-item span,
:root[data-sidebar="collapsed"] .nav-foot span { display: none; }
:root[data-sidebar="collapsed"] .nav-title { visibility: hidden; height: var(--s-2); padding: 0; }
:root[data-sidebar="collapsed"] .nav-item,
:root[data-sidebar="collapsed"] .nav-foot button { justify-content: center; padding: 0; }
:root[data-sidebar="collapsed"] .brand { justify-content: center; padding: 0; }

@media (max-width: 899px) {
  .sidebar, :root[data-sidebar="collapsed"] .sidebar { width: var(--sidebar); transform: translateX(-100%); }
  :root[data-drawer-nav="open"] .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  :root[data-drawer-nav="open"] .scrim { display: block; }
  .page, :root[data-sidebar="collapsed"] .page { margin-left: 0; }
  .nav-foot { display: none; }
  :root[data-sidebar="collapsed"] .brand .brand-text,
  :root[data-sidebar="collapsed"] .nav-item span { display: inline; }
  :root[data-sidebar="collapsed"] .brand .brand-text { display: flex; }
  :root[data-sidebar="collapsed"] .nav-title { visibility: visible; height: auto; padding: 0 var(--s-3) var(--s-1); }
  :root[data-sidebar="collapsed"] .nav-item { justify-content: flex-start; padding: 0 var(--s-3); }
  :root[data-sidebar="collapsed"] .brand { justify-content: flex-start; padding: 0 var(--s-4); }
  .btn.topbar-menu { display: inline-flex; }
  .topbar { padding: 0 var(--s-4); }
  .content { padding: var(--s-4); }
}

/* Вход, второй фактор и страницы ошибок без меню */
.solo { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--s-6) var(--s-4); }
.solo-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-md); padding: var(--s-6); }
.solo-card .brand { border: 0; height: auto; padding: 0 0 var(--s-5); }
.solo-card .brand .logo { width: 44px; height: 44px; }
.solo-card .brand-name { font-size: 24px; }
.solo-card .brand small { font-size: 10.5px; }
.solo-card .brand .brand-sub { font-size: 10px; }
.solo-card h1 { margin-bottom: var(--s-4); }
.solo-card form.stack { background: none; border: 0; box-shadow: none; padding: 0; }

/* ── Кнопки ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); height: 36px; padding: 0 var(--s-4); border: 1px solid transparent; border-radius: var(--r-md); background: none; color: var(--text); font: 500 var(--text-sm)/1 var(--font); cursor: pointer; white-space: nowrap; transition: background var(--ease), border-color var(--ease), color var(--ease); }
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); border-color: var(--field-border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: var(--on-danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }
.btn-danger-outline { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn-danger-outline:hover:not(:disabled) { background: var(--danger-soft); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-icon { width: 36px; padding: 0; }
.btn-sm { height: 30px; padding: 0 var(--s-3); }
.btn[aria-busy="true"] { cursor: progress; }

/* ── Поля ── */
label { display: flex; flex-direction: column; gap: var(--s-1); font-size: var(--text-sm); font-weight: 500; color: var(--text-2); }
label.check { flex-direction: row; align-items: center; gap: var(--s-2); }
input, select, textarea { min-height: 36px; padding: 0 var(--s-3); background: var(--surface); color: var(--text); border: 1px solid var(--field-border); border-radius: var(--r-md); font: 400 var(--text-md)/1.4 var(--font); max-width: 100%; }
textarea { padding: var(--s-2) var(--s-3); min-height: 90px; resize: vertical; }
textarea.mono { font-family: var(--mono); font-size: var(--text-sm); }
input[type="checkbox"], input[type="radio"] { min-height: 0; width: 16px; height: 16px; accent-color: var(--accent); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--text-3); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); border-radius: var(--r-md); }

form.stack { display: flex; flex-direction: column; align-items: stretch; gap: var(--s-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: var(--s-4); }
form.stack .btn { align-self: flex-start; }
form.inline { display: inline-flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; margin: 0; }
.filters { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: flex-end; margin-bottom: var(--s-4); }
.actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--s-4); align-items: start; }
.grid2 > div > h2:first-child { margin-top: 0; }
.tariff-form { margin-bottom: var(--s-4); }

/* ── Карточки ── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s-3); margin-bottom: var(--s-5); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: var(--s-4); }
.stat-label { display: block; font-size: var(--text-sm); font-weight: 500; color: var(--text-2); }
.stat-value { display: block; margin-top: var(--s-1); font-size: var(--text-2xl); font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-note { display: block; margin-top: var(--s-1); font-size: var(--text-xs); color: var(--text-3); }

/* ── Таблицы ── */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.table-wrap:focus-visible { border-radius: var(--r-lg); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px var(--s-3); border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--surface-2); color: var(--text-2); font-size: var(--text-xs); font-weight: 600; white-space: nowrap; }
td { font-size: var(--text-sm); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
td.nowrap { white-space: nowrap; }

/* ── Бейджи ── */
.badge { display: inline-flex; align-items: center; gap: var(--s-1); padding: 2px var(--s-2); border-radius: var(--r-full); font-size: var(--text-xs); font-weight: 600; line-height: 1.4; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }

/* ── Уведомления на странице ── */
.notice { display: flex; align-items: flex-start; gap: var(--s-2); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); margin-bottom: var(--s-3); font-size: var(--text-sm); border: 1px solid transparent; }
.notice.ok { background: var(--success-soft); color: var(--success); }
.notice.bad { background: var(--danger-soft); color: var(--danger); }
.notice.warn { background: var(--warning-soft); color: var(--warning); }
.notice.info { background: var(--info-soft); color: var(--info); }

/* ── Выпадающее меню ── */
.menu { position: relative; }
.menu-panel { position: absolute; right: 0; top: calc(100% + var(--s-1)); z-index: 40; min-width: 240px; padding: var(--s-1); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-md); }
.menu-head { padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--line); margin-bottom: var(--s-1); }
.menu-head b { display: block; font-size: var(--text-sm); font-weight: 600; overflow-wrap: anywhere; }
.menu-head span { font-size: var(--text-xs); color: var(--text-3); }
.menu-item { display: flex; align-items: center; gap: var(--s-2); width: 100%; height: 34px; padding: 0 var(--s-3); border: 0; border-radius: var(--r-md); background: none; color: var(--text); font: 400 var(--text-sm)/1 var(--font); cursor: pointer; }
.menu-item:hover { background: var(--surface-2); text-decoration: none; }
.menu-item.danger { color: var(--danger); }
.menu-sep { height: 1px; margin: var(--s-1) 0; background: var(--line); }
.menu form { margin: 0; }
.profile-button { display: inline-flex; align-items: center; gap: var(--s-2); height: 36px; padding: 0 var(--s-2); border: 0; border-radius: var(--r-md); background: none; color: var(--text); font: 500 var(--text-sm)/1 var(--font); cursor: pointer; }
.profile-button:hover { background: var(--surface-2); }
.avatar { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-full); background: var(--accent-soft); color: var(--accent-text); font-weight: 600; font-size: var(--text-xs); text-transform: uppercase; }
.theme-switch { display: flex; gap: 2px; padding: var(--s-1) var(--s-2); }
.theme-switch .label { flex: 1; align-self: center; font-size: var(--text-xs); color: var(--text-3); }
.theme-switch button { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--r-sm); background: none; color: var(--text-2); cursor: pointer; }
.theme-switch button:hover { background: var(--surface-2); }
.theme-switch button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); }
.theme-switch .icon { width: 16px; height: 16px; }

/* ── Модальное окно и боковая панель ── */
dialog { color: var(--text); border: 0; padding: 0; background: none; }
dialog::backdrop { background: var(--scrim); }
html:has(dialog[open]) { overflow: hidden; }
.modal { width: min(460px, calc(100vw - 32px)); margin: auto; }
.modal-box { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: var(--s-5); }
.modal-box h2 { margin: 0 0 var(--s-2); }
.modal-box p { color: var(--text-2); }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--s-2); margin-top: var(--s-5); }
.drawer { width: min(480px, 100vw); max-width: none; height: 100dvh; max-height: none; margin: 0 0 0 auto; }
.drawer-box { height: 100%; display: flex; flex-direction: column; background: var(--surface); box-shadow: var(--shadow-lg); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: var(--s-5); }

/* ── Вкладки ── */
.tab-list { display: flex; gap: var(--s-1); box-shadow: inset 0 -1px 0 var(--line); margin-bottom: var(--s-4); overflow: auto hidden; }
.tab { height: 38px; padding: 0 var(--s-3); border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-2); font: 500 var(--text-sm)/1 var(--font); cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--accent-text); border-bottom-color: var(--accent); font-weight: 600; }

/* ── Всплывающие сообщения и индикатор ── */
.toasts { position: fixed; right: var(--s-4); bottom: var(--s-4); z-index: 70; display: flex; flex-direction: column; gap: var(--s-2); width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-4); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-left: 3px solid var(--success); border-radius: var(--r-md); box-shadow: var(--shadow-md); font-size: var(--text-sm); }
.toast-bad { border-left-color: var(--danger); }
.toast-close { border: 0; background: none; color: var(--text-3); font-size: 18px; line-height: 1; cursor: pointer; padding: 0; }
.progress { position: fixed; inset: 0 0 auto; z-index: 80; height: 2px; overflow: hidden; visibility: hidden; }
.progress.on { visibility: visible; }
.progress::before { content: ""; display: block; height: 100%; width: 40%; background: var(--accent); animation: progress 1.1s ease-in-out infinite; }
@keyframes progress { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .progress::before { animation: none; width: 100%; }
}

/* ── Прочее ── */
.qr { background: #fff; padding: var(--s-3); border-radius: var(--r-lg); width: 220px; margin-bottom: var(--s-3); }
.qr svg { width: 100%; height: auto; display: block; }
.empty { text-align: center; padding: var(--s-10) var(--s-4); color: var(--text-3); }
.empty .icon { width: 28px; height: 28px; margin-bottom: var(--s-2); }
.empty b { display: block; color: var(--text); font-weight: 600; margin-bottom: var(--s-1); }
.tech { font-size: var(--text-xs); color: var(--text-3); }
.tech summary { cursor: pointer; white-space: nowrap; }
.tech-row { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-1); max-width: 420px; }
.tech-row .mono { flex: 1; min-width: 0; font-size: var(--text-xs); color: var(--text-2); }
.tech-row .btn-icon { width: 26px; height: 26px; }
.tech-row .icon { width: 14px; height: 14px; }
.cards + .tech { margin: calc(var(--s-2) * -1) 0 var(--s-4); }
.client-status { margin-bottom: var(--s-3); }
.key-card { display: flex; align-items: center; gap: var(--s-3); }
.key-card .mono { flex: 1; min-width: 0; }
.filters input[type="search"] { width: 280px; }
.filters-end { margin-left: auto; }
.sort { color: inherit; display: inline-flex; gap: var(--s-1); }
.sort-mark { color: var(--accent-text); }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); margin-top: var(--s-3); font-size: var(--text-sm); }
.pager .actions { align-items: center; }
.pager-at { padding: 0 var(--s-2); }
.btn.is-disabled { opacity: .5; cursor: not-allowed; }
tr[data-row-link] { cursor: pointer; }
.facts { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: var(--s-2) var(--s-3); margin: 0 0 var(--s-4); font-size: var(--text-sm); }
.facts dt { color: var(--text-3); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.panel-actions { border-top: 1px solid var(--line); margin-top: var(--s-4); padding-top: var(--s-4); }
.panel-actions h3 { font-size: var(--text-md); font-weight: 600; margin: 0 0 var(--s-2); }
.panel-actions form.stack, .modal-box form.stack { background: none; border: 0; box-shadow: none; padding: 0; }
.modal-box form.stack .btn { align-self: auto; }
.skeleton { display: flex; flex-direction: column; gap: var(--s-3); }
.skeleton i { display: block; height: 14px; border-radius: var(--r-sm); background: var(--surface-3); animation: pulse 1.2s ease-in-out infinite; }
.skeleton i:nth-child(odd) { width: 70%; }
@keyframes pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .skeleton i { animation: none; } }
.summary-line { font-size: var(--text-sm); color: var(--text-2); margin-bottom: var(--s-3); }
.note-form { max-width: 640px; }
.segmented { display: inline-flex; gap: 2px; padding: 2px; background: var(--surface-3); border-radius: var(--r-md); max-width: 100%; overflow-x: auto; }
.segment { padding: 6px var(--s-3); border-radius: var(--r-sm); color: var(--text-2); font-size: var(--text-sm); font-weight: 500; white-space: nowrap; }
.segment:hover { color: var(--text); text-decoration: none; }
.segment[aria-current="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.period-row { margin-bottom: var(--s-3); }
.delta { font-weight: 600; }
.delta-success { color: var(--success); }
.delta-danger { color: var(--danger); }
.chart-grid-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: var(--s-3); margin-bottom: var(--s-5); }
.chart h3 { margin: 0; font-size: var(--text-sm); font-weight: 500; color: var(--text-2); }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }
.chart-total { font-size: var(--text-lg); font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-empty { display: flex; align-items: center; justify-content: center; min-height: 150px; color: var(--text-3); font-size: var(--text-sm); text-align: center; }
.chart-svg { display: block; width: 100%; height: auto; }
.chart-svg:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-axis { fill: var(--text-3); font: 400 11px var(--font); }
.chart-bar { fill: var(--chart); }
.chart-hit { fill: transparent; }
.chart-point.on .chart-hit { fill: var(--surface-3); opacity: .55; }
.chart-tip { position: fixed; z-index: 50; display: flex; flex-direction: column; padding: 6px var(--s-2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-md); font-size: var(--text-xs); pointer-events: none; }
.chart-tip b { font-size: var(--text-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-tip span { color: var(--text-3); }
.chart-table { margin-top: var(--s-2); }
.chart-table .table-wrap { margin-top: var(--s-2); box-shadow: none; }
.hbars { display: flex; flex-direction: column; gap: var(--s-3); }
.hbar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; align-items: center; gap: var(--s-2); font-size: var(--text-sm); }
.hbar-label { color: var(--text-2); }
.hbar-track { min-width: 0; }
.hbar-fill { height: 12px; background: var(--chart); border-radius: 0 4px 4px 0; }
.hbar-value { font-variant-numeric: tabular-nums; font-weight: 500; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); }
.section-head h2 { margin-bottom: var(--s-3); }
.top-search { position: relative; display: flex; align-items: center; margin: 0; }
.top-search .icon { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--text-3); pointer-events: none; }
.top-search input { width: 220px; min-height: 34px; padding-left: 32px; background: var(--surface-2); border-color: transparent; font-size: var(--text-sm); }
@media (max-width: 899px) { .top-search input { width: 150px; } }
.setting-list { padding: 0; }
.setting-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-6); padding: var(--s-4); border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-text { flex: 1 1 320px; min-width: 0; }
.setting-text b { font-weight: 600; }
.setting-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-top: var(--s-2); font-size: var(--text-xs); }
.setting-form { display: flex; flex: none; align-items: center; gap: var(--s-2); margin: 0; }
.setting-form input[type="text"], .setting-form input[type="number"] { width: 200px; }
.panel-form { background: none; border: 0; box-shadow: none; padding: 0; }
.after-table { margin-top: var(--s-3); }
#account-panel-0 .facts { max-width: 640px; }
.backup-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--s-2) var(--s-4); max-width: 640px; }
.swatches { display: flex; flex-wrap: wrap; gap: var(--s-2); }
