/* ============================================================================
   Atlas Ad Monitor — Design Tokens & Components
   Style E Final · v2.1 · 2026-04-28

   Single source of truth for visual style.
   Aesthetic: hi-tech SaaS spy-tool with Apple liquid glass topbar,
   pastel gray-blue background, Apple-blue accent, generous radii,
   light shadows, Geist typography.

   Linked styleguide: /preview/styleguide (v4.1 — 52 sections)

   How to use:
     <link rel="stylesheet" href="/tokens.css?v=4.1">
     <button class="btn btn--primary">Primary</button>

   Changelog:
     v2.1 (2026-04-28) — added: --radius-hero, .checkbox, .radio, .toggle-switch,
                         .pagination, .tt-wrap, .drawer, .toast, .empty-state,
                         .skeleton, .field, .dd, .prog-wrap, .sec-hdr2, .spark,
                         backdrop-filter @supports fallback.
     v2.0 (2026-04-27) — initial Style E Final release.
============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ─────────────────────────────────────────────────────────────────────────
   1. TOKENS
   ───────────────────────────────────────────────────────────────────────── */
:root {
  /* ── Foreground (text) ───────────────────────────────────────────────── */
  --foreground:        #0e1017;   /* primary */
  --foreground-muted:  #4b5462;   /* secondary */
  --foreground-subtle: #8a93a3;   /* tertiary */
  --foreground-faint:  #c0c6d2;   /* placeholder, disabled */

  /* ── Surfaces ────────────────────────────────────────────────────────── */
  --surface:    #ffffff;
  --surface-2:  #f4f5f8;
  --border:     #ebedf2;
  --border-2:   #dde1e8;

  /* ── Accent (Apple-blue) ─────────────────────────────────────────────── */
  --accent:             #0a84ff;
  --accent-2:           #4ea7ff;
  --accent-soft:        #e6f2ff;
  --accent-foreground:  #0050a3;

  /* ── Semantic colors ─────────────────────────────────────────────────── */
  --success:             #16a34a;
  --success-soft:        #dcfce7;
  --success-foreground:  #15803d;
  --warning:             #f59e0b;
  --warning-soft:        #fef3c7;
  --warning-foreground:  #b45309;
  --danger:              #ef4444;
  --danger-soft:         #fee2e2;
  --pink:                #ec4899;
  --pink-soft:           #fce7f3;

  /* ── Avatar palette (для рандомных user/item аватаров k1..k5) ────────── */
  --av-k1-from:  #a78bfa;  --av-k1-to:  #7c3aed;  /* purple */
  --av-k2-from:  #34d399;  --av-k2-to:  #059669;  /* green */
  --av-k3-from:  #fbbf24;  --av-k3-to:  #d97706;  /* yellow */
  --av-k4-from:  #fb7185;  --av-k4-to:  #e11d48;  /* pink */
  --av-k5-from:  #60a5fa;  --av-k5-to:  #2563eb;  /* blue */

  /* ── Typography ──────────────────────────────────────────────────────── */
  --font-sans:  'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:  'JetBrains Mono', 'SF Mono', Menlo, monospace;

  --text-xs:    11px;
  --text-sm:    12px;
  --text-base:  13px;
  --text-md:    14px;
  --text-lg:    16px;
  --text-xl:    20px;
  --text-2xl:   28px;
  --text-3xl:   44px;   /* page hero title — Style E signature */

  --leading-tight:  1.05;
  --leading-snug:   1.25;
  --leading-normal: 1.5;

  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;
  --weight-black:    800;

  --tracking-tight:  -0.04em;   /* big titles */
  --tracking-snug:   -0.025em;
  --tracking-normal: -0.011em;  /* default */
  --tracking-wide:    0.04em;
  --tracking-wider:   0.06em;   /* uppercase labels */

  /* ── Spacing (4px scale) ─────────────────────────────────────────────── */
  --sp-1:   4px;
  --sp-2:   8px;
  --sp-3:   12px;
  --sp-4:   16px;
  --sp-5:   20px;
  --sp-6:   24px;
  --sp-8:   32px;
  --sp-10:  40px;
  --sp-12:  48px;
  --sp-16:  64px;

  /* ── Radius ──────────────────────────────────────────────────────────── */
  --radius-xs:    4px;
  --radius-sm:    8px;
  --radius-md:    12px;
  --radius-hero:  14px;   /* exception: 54x54 hero icons only */
  --radius-lg:    18px;   /* default for cards (Style E pick) */
  --radius-xl:    22px;   /* large panels */
  --radius-2xl:   28px;
  --radius-pill:  999px;

  /* ── Shadow (light, Style E pick) ────────────────────────────────────── */
  --accent-glow:    rgba(10,132,255,0.35);   /* color для CTA box-shadow glow */
  --shadow-card:    0 1px 2px rgba(15,17,21,0.04);
  --shadow-card-lg: 0 4px 16px rgba(15,17,21,0.05), 0 1px 2px rgba(15,17,21,0.03);
  --shadow-button:  0 4px 14px rgba(10,132,255,0.35), inset 0 1px 0 rgba(255,255,255,0.25);
  --shadow-focus:   0 0 0 3px rgba(10,132,255,0.18);
  --shadow-glass:
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -1px 0 rgba(15,17,21,0.04),
    0 0 0 0.5px rgba(15,17,21,0.05),
    0 8px 32px rgba(15,17,21,0.05),
    0 2px 6px rgba(15,17,21,0.04);

  /* ── Apple liquid glass ──────────────────────────────────────────────── */
  --glass-bg:     linear-gradient(180deg, rgba(255,255,255,0.32) 0%, rgba(255,255,255,0.18) 100%);
  --glass-border: rgba(255,255,255,0.6);
  --glass-blur:   blur(40px) saturate(180%);

  /* ── Motion ──────────────────────────────────────────────────────────── */
  --duration-fast:  150ms;
  --duration-base:  200ms;
  --duration-slow:  280ms;
  --ease-out:       cubic-bezier(0.16, 1, 0.30, 1);
  --ease-in-out:    cubic-bezier(0.4, 0, 0.2, 1);

  /* ── Z-index ─────────────────────────────────────────────────────────── */
  --z-dropdown: 50;
  --z-sticky:   100;
  --z-overlay:  500;
  --z-modal:    1000;
  --z-toast:    2000;

  /* ── Layout ──────────────────────────────────────────────────────────── */
  --page-width:  1480px;
  --rail-width:  380px;
}

/* ─────────────────────────────────────────────────────────────────────────
   2. RESET / DEFAULTS
   ───────────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  letter-spacing: var(--tracking-normal);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  /* E5 background — gray-blue with subtle radial */
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(15,17,21,0.04) 0%, transparent 70%),
    linear-gradient(180deg, #f7f8fa 0%, #eef0f4 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

::selection { background: var(--accent-soft); color: var(--accent-foreground); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(15,17,21,0.15); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: rgba(15,17,21,0.25); }

code, kbd, pre, samp { font-family: var(--font-mono); font-size: 0.92em; }

/* ─────────────────────────────────────────────────────────────────────────
   3. TYPOGRAPHY
   ───────────────────────────────────────────────────────────────────────── */
.t-display  { font-size: var(--text-3xl); font-weight: var(--weight-bold); letter-spacing: var(--tracking-tight); line-height: var(--leading-tight); }
.t-h1       { font-size: var(--text-2xl); font-weight: var(--weight-bold); letter-spacing: var(--tracking-snug); line-height: var(--leading-snug); }
.t-h2       { font-size: var(--text-xl);  font-weight: var(--weight-semibold); letter-spacing: var(--tracking-snug); line-height: var(--leading-snug); }
.t-h3       { font-size: var(--text-lg);  font-weight: var(--weight-semibold); }
.t-body     { font-size: var(--text-base); }
.t-small    { font-size: var(--text-sm);  color: var(--foreground-muted); }
.t-label    {
  font-size: var(--text-xs); font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wider); text-transform: uppercase;
  color: var(--foreground-subtle);
}
.t-mono     { font-family: var(--font-mono); font-size: var(--text-sm); }
.t-muted    { color: var(--foreground-muted); }
.t-subtle   { color: var(--foreground-subtle); }
.t-num      { font-variant-numeric: tabular-nums; }

/* Hero title with gradient accent on <em> word */
.title-hero {
  font-size: var(--text-3xl); font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight); line-height: var(--leading-tight);
  margin: 0;
}
.title-hero em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text;
  color: transparent; font-weight: var(--weight-black);
}

/* ─────────────────────────────────────────────────────────────────────────
   4. APPLE LIQUID GLASS TOPBAR
   ───────────────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 16px; z-index: var(--z-sticky);
  margin: 16px 24px 0;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--sp-8);
  padding: 8px 14px 8px 18px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 0.5px solid var(--glass-border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-glass);
}
.topbar::before {
  content: ''; position: absolute; top: 0; left: 12%; right: 12%; height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.85) 50%, transparent 100%);
  border-radius: var(--radius-pill); pointer-events: none;
}

.topbar .brand { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--text-lg); font-weight: var(--weight-bold); letter-spacing: var(--tracking-snug); }
.topbar .brand-mark {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: var(--weight-bold); font-size: var(--text-md); letter-spacing: -0.04em;
  box-shadow: 0 2px 8px rgba(10,132,255,0.4), inset 0 1px 0 rgba(255,255,255,0.4);
}

.topbar nav { display: flex; align-items: center; justify-content: center; gap: var(--sp-1); }
.topbar nav a {
  padding: 8px 18px; font-size: var(--text-md); font-weight: var(--weight-medium);
  color: var(--foreground-muted); border-radius: var(--radius-pill);
  cursor: pointer; transition: all var(--duration-fast) var(--ease-out);
  text-decoration: none; display: inline-flex; align-items: center; gap: var(--sp-1);
}
.topbar nav a:hover { color: var(--foreground); background: rgba(15,17,21,0.04); }
.topbar nav a.is-active {
  background: var(--accent); color: #fff; font-weight: var(--weight-semibold);
  box-shadow: 0 2px 8px rgba(10,132,255,0.35), inset 0 1px 0 rgba(255,255,255,0.25);
}

.topbar .right-tools { display: flex; align-items: center; gap: var(--sp-2); }
.topbar .search-box {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 7px 14px 7px 12px;
  background: rgba(255,255,255,0.5); border: 0.5px solid var(--glass-border);
  border-radius: var(--radius-pill);
  font-size: var(--text-base); color: var(--foreground-subtle); min-width: 160px;
  cursor: text; box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
}
.topbar .icon-btn {
  width: 38px; height: 38px;
  border: 0.5px solid var(--glass-border); background: rgba(255,255,255,0.5);
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--foreground-muted); position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
}
.topbar .icon-btn:hover { background: rgba(255,255,255,0.85); color: var(--foreground); }
.topbar .av-circle {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: var(--weight-bold); font-size: var(--text-base); cursor: pointer;
  border: 2px solid rgba(255,255,255,0.85);
  box-shadow: 0 2px 8px rgba(10,132,255,0.35);
}

/* ─────────────────────────────────────────────────────────────────────────
   5. BUTTON
   ───────────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 10px 18px; font-family: var(--font-sans);
  font-size: var(--text-base); font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-snug); line-height: 1;
  border: 1px solid var(--border); background: var(--surface); color: var(--foreground);
  border-radius: var(--radius-pill); cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  user-select: none; white-space: nowrap;
}
.btn:hover { border-color: var(--foreground-muted); }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.btn--primary {
  padding: 10px 20px;
  background: var(--accent); color: #fff; border-color: var(--accent);
  box-shadow: var(--shadow-button);
}
.btn--primary:hover { background: var(--accent-2); border-color: var(--accent-2); }

.btn--dark {
  background: var(--foreground); color: #fff; border-color: var(--foreground);
  box-shadow: 0 4px 14px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn--ghost { background: transparent; border-color: transparent; color: var(--foreground-muted); }
.btn--ghost:hover { background: var(--surface-2); color: var(--foreground); border-color: transparent; }

.btn--danger {
  background: var(--danger); color: #fff; border-color: var(--danger);
}

.btn--sm { padding: 6px 12px; font-size: var(--text-sm); }
.btn--lg { padding: 12px 24px; font-size: var(--text-md); }
.btn--icon { width: 38px; height: 38px; padding: 0; }
.btn--icon.btn--sm { width: 30px; height: 30px; }
.btn--icon.btn--lg { width: 44px; height: 44px; }

.btn.is-flash { background: var(--success) !important; color: #fff !important; border-color: var(--success) !important; }

/* Date pill */
.date-pill {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 9px 16px 9px 12px;
  background: rgba(255,255,255,0.7); border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--foreground);
  cursor: pointer; backdrop-filter: blur(10px);
}
.date-pill .cal-ic {
  width: 26px; height: 26px;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
}

/* ─────────────────────────────────────────────────────────────────────────
   6. INPUT
   ───────────────────────────────────────────────────────────────────────── */
.input, .input-wrap {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  height: 38px; padding: 0 var(--sp-3);
  font-family: var(--font-sans); font-size: var(--text-base);
  letter-spacing: var(--tracking-snug); color: var(--foreground);
  background: var(--surface-2); border: 1px solid transparent;
  border-radius: var(--radius-sm); outline: none;
  transition: all var(--duration-fast) var(--ease-out);
  width: 100%;
}
.input::placeholder { color: var(--foreground-faint); }
.input:focus, .input-wrap:focus-within {
  background: var(--surface); border-color: var(--accent);
  box-shadow: none;
}
.input-wrap > input {
  flex: 1; min-width: 0;
  border: none; outline: none; background: transparent;
  font-family: inherit; font-size: inherit; color: inherit;
}
.input-wrap > input::placeholder { color: var(--foreground-faint); }
.input-wrap .ic { color: var(--foreground-faint); }
.input-wrap .clear { cursor: pointer; color: var(--foreground-faint); padding: 0 var(--sp-1); visibility: hidden; }
.input-wrap:has(input:not(:placeholder-shown)) .clear { visibility: visible; }
.input-wrap .clear:hover { color: var(--foreground); }

.select {
  appearance: none;
  height: 38px; padding: 0 var(--sp-8) 0 var(--sp-3);
  font-family: var(--font-sans); font-size: var(--text-base); color: var(--foreground);
  background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%238a93a3' stroke-width='3'><polyline points='6 9 12 15 18 9'/></svg>") no-repeat right var(--sp-3) center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  outline: none; cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.select:focus { border-color: var(--accent); box-shadow: none; }

/* ─────────────────────────────────────────────────────────────────────────
   7. CARD
   ───────────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);   /* 18px */
  box-shadow: var(--shadow-card);
}
.card--lg { border-radius: var(--radius-xl); box-shadow: var(--shadow-card-lg); }
.card--padded { padding: var(--sp-6); }
.card--glass {
  background: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(230,242,255,0.5));
  border: 1px solid rgba(255,255,255,0.7);
  backdrop-filter: blur(20px);
}

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
  min-height: 52px;
}
.card-head h3 {
  margin: 0; font-size: var(--text-lg); font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-snug);
}
.card-body { padding: var(--sp-5); }

/* ─────────────────────────────────────────────────────────────────────────
   8. STAT TILE (sparkline + outlined icon)
   ───────────────────────────────────────────────────────────────────────── */
.stat {
  position: relative;
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.stat .ic-circle {
  position: absolute; top: var(--sp-4); right: var(--sp-4);
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1.5px solid var(--accent); color: var(--accent);
}
.stat.stat--success .ic-circle { border-color: var(--success); color: var(--success); }
.stat.stat--warning .ic-circle { border-color: var(--warning); color: var(--warning); }
.stat.stat--pink    .ic-circle { border-color: var(--pink);    color: var(--pink); }
.stat .lbl-top { font-size: var(--text-sm); color: var(--foreground-subtle); font-weight: var(--weight-medium); margin-bottom: var(--sp-3); }
.stat .val { font-size: 38px; font-weight: var(--weight-bold); letter-spacing: var(--tracking-tight); line-height: 1; font-variant-numeric: tabular-nums; margin-bottom: var(--sp-1); }
.stat .val .pct { font-size: 22px; color: var(--foreground-subtle); font-weight: var(--weight-medium); }
.stat .row-bot { display: flex; justify-content: space-between; align-items: flex-end; margin-top: var(--sp-2); }
.stat .delta { font-size: var(--text-sm); font-weight: var(--weight-semibold); padding: 2px 9px; border-radius: var(--radius-pill); font-variant-numeric: tabular-nums; }
.stat .delta--up   { color: var(--success-foreground); background: var(--success-soft); }
.stat .delta--flat { color: var(--foreground-subtle);  background: var(--surface-2); }
.stat .delta--warn { color: var(--warning-foreground); background: var(--warning-soft); }
.stat .spark { width: 70px; height: 26px; }

/* ─────────────────────────────────────────────────────────────────────────
   9. BADGE & PILL
   ───────────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  padding: 2px var(--sp-2); font-size: var(--text-xs); font-weight: var(--weight-bold);
  border-radius: var(--radius-xs);
  background: var(--surface-2); color: var(--foreground-subtle);
  font-variant-numeric: tabular-nums;
}
.badge--accent  { background: var(--accent-soft);  color: var(--accent-foreground); }
.badge--success { background: var(--success-soft); color: var(--success-foreground); }
.badge--warning { background: var(--warning-soft); color: var(--warning-foreground); }

.pill {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  padding: 3px var(--sp-3); font-size: var(--text-xs); font-weight: var(--weight-medium);
  border-radius: var(--radius-pill);
  background: var(--surface); color: var(--foreground-muted); border: 1px solid var(--border);
}
.pill--accent  { background: var(--accent-soft);  color: var(--accent-foreground); border-color: transparent; cursor: pointer; }
.pill--accent:hover { background: var(--accent); color: #fff; }
.pill--success { background: var(--success-soft); color: var(--success-foreground); border-color: transparent; }
.pill--warning { background: var(--warning-soft); color: var(--warning-foreground); border-color: transparent; }

/* Status pill (used in task lists) */
.status-pill {
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
}
.status-pill--running { background: var(--warning-soft); color: var(--warning-foreground); }
.status-pill--done    { background: var(--success-soft); color: var(--success-foreground); }
.status-pill--queued  { background: var(--surface-2);    color: var(--foreground-subtle); }

/* Live indicator */
.live-btn {
  padding: 6px 14px; background: var(--danger); color: #fff;
  border: none; border-radius: var(--radius-pill);
  font-size: var(--text-sm); font-weight: var(--weight-semibold);
  cursor: pointer; font-family: inherit;
}
.live-btn::before {
  content: ""; display: inline-block;
  width: 6px; height: 6px; background: #fff; border-radius: 50%;
  margin-right: var(--sp-1); animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ─────────────────────────────────────────────────────────────────────────
   10. PILL TABS (sub-navigation)
   ───────────────────────────────────────────────────────────────────────── */
.tabs {
  display: inline-flex; gap: var(--sp-1);
  padding: 3px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
}
.tab {
  padding: 6px var(--sp-3); font-size: var(--text-sm); font-weight: var(--weight-medium);
  color: var(--foreground-muted); cursor: pointer; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; gap: var(--sp-1);
}
.tab:hover { color: var(--foreground); }
.tab.is-active {
  background: var(--accent); color: #fff; font-weight: var(--weight-semibold);
}
.tab .cnt {
  padding: 1px 6px; background: var(--accent); color: #fff;
  border-radius: 8px; font-size: 10px; font-weight: var(--weight-bold);
}
.tab.is-active .cnt { background: rgba(255,255,255,0.25); }

/* ─────────────────────────────────────────────────────────────────────────
   11. ROW (list item)
   ───────────────────────────────────────────────────────────────────────── */
.row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4); font-size: var(--text-base);
  border-bottom: 1px solid var(--border);
  transition: background var(--duration-fast) var(--ease-out);
}
.row:last-child { border-bottom: none; }
.row:hover { background: var(--accent-soft); }
.row.is-checked { background: var(--accent-soft); }
.row.is-active { background: rgba(10,132,255,0.10); font-weight: var(--weight-semibold); }
.row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .num { color: var(--success); font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }
.row .meta { font-size: var(--text-xs); color: var(--foreground-faint); margin-top: 2px; }

.check {
  width: 16px; height: 16px;
  border: 1.5px solid var(--border-2); border-radius: var(--radius-xs);
  background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.check svg { width: 10px; height: 10px; color: #fff; display: none; }
.row.is-checked .check { background: var(--accent); border-color: var(--accent); }
.row.is-checked .check svg { display: block; }

/* ─────────────────────────────────────────────────────────────────────────
   12. AVATAR GROUP (overlapping)
   ───────────────────────────────────────────────────────────────────────── */
.av-group { display: flex; }
.av-group .av {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--surface-2); margin-left: -7px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: var(--weight-bold); color: #fff;
}
.av-group .av:first-child { margin-left: 0; }
.av-group .av:nth-child(1) { background: linear-gradient(135deg, #ff7e5f, #feb47b); }
.av-group .av:nth-child(2) { background: linear-gradient(135deg, var(--success), #34d399); }
.av-group .av:nth-child(3) { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.av-group .av.more { background: var(--surface); color: var(--foreground-muted); border-color: var(--surface-2); }

/* ─────────────────────────────────────────────────────────────────────────
   12.5. NATIVE CONTROL UNIFICATION — checkbox / radio / number / textarea
   ───────────────────────────────────────────────────────────────────────── */
/* Global accent-color for native checkboxes & radios */
input[type="checkbox"], input[type="radio"] {
  accent-color: var(--accent);
}

/* Number inputs — Style E look + hide ugly spin arrows */
.num-input, input[type="number"]:not(.fi):not(.h-input) {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--foreground);
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  -moz-appearance: textfield;
}
.num-input:focus, input[type="number"]:not(.fi):not(.h-input):focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: none;
}
/* Hide spin arrows */
.num-input::-webkit-outer-spin-button,
.num-input::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}

/* ── Flatpickr — Style E theme override ── */
.flatpickr-calendar {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 14px !important;
  box-shadow: 0 12px 32px rgba(15,17,21,0.12), 0 4px 8px rgba(15,17,21,0.06) !important;
  font-family: var(--font-sans) !important;
  padding: 12px !important;
  width: 320px !important;
}
.flatpickr-calendar.arrowTop:before, .flatpickr-calendar.arrowTop:after { border-bottom-color: var(--border) !important; }
.flatpickr-months {
  padding: 4px 0 12px !important;
  display: flex !important; align-items: center !important;
  position: relative;
}
.flatpickr-month {
  background: transparent !important;
  color: var(--foreground) !important;
  border-radius: 8px;
  height: 36px !important;
  overflow: visible !important;
  flex: 1;
}
.flatpickr-current-month {
  font-size: 14px !important; font-weight: 600 !important;
  letter-spacing: -0.015em; padding: 0 !important;
  height: 36px !important;
  display: inline-flex !important; align-items: center !important; justify-content: center !important; gap: 6px;
  position: absolute !important;
  left: 40px !important; right: 40px !important;
  top: 0 !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
  font-family: var(--font-sans) !important; font-weight: 600 !important;
  color: var(--foreground) !important; font-size: 14px !important;
  padding: 4px 8px !important;
  border-radius: 6px !important;
  background: transparent !important;
  height: auto !important;
}
.flatpickr-current-month input.cur-year {
  width: 60px !important; min-width: 60px !important;
  text-align: center;
  border: 1px solid transparent !important;
}
.flatpickr-current-month input.cur-year:hover,
.flatpickr-current-month input.cur-year:focus {
  background: var(--surface-2) !important; border-color: var(--border) !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months {
  appearance: none !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months:hover {
  background: var(--surface-2) !important;
}
.numInputWrapper:hover { background: transparent !important; }
.numInputWrapper span { display: none !important; }
.flatpickr-prev-month, .flatpickr-next-month {
  fill: var(--foreground-subtle) !important;
  color: var(--foreground-subtle) !important;
  border-radius: 8px !important;
  transition: background 0.15s !important;
  padding: 0 !important;
  height: 36px !important; width: 36px !important;
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
  position: absolute !important; top: 0 !important;
  z-index: 3;
}
.flatpickr-prev-month { left: 0 !important; }
.flatpickr-next-month { right: 0 !important; }
.flatpickr-prev-month svg, .flatpickr-next-month svg { width: 14px !important; height: 14px !important; }
.flatpickr-prev-month:hover, .flatpickr-next-month:hover {
  background: var(--surface-2) !important;
  fill: var(--foreground) !important;
}
.flatpickr-weekdays { background: transparent !important; padding: 4px 0 8px !important; height: auto !important; }
.flatpickr-weekdaycontainer { display: flex; justify-content: space-around; }
span.flatpickr-weekday {
  color: var(--foreground-faint) !important; background: transparent !important;
  font-weight: 600 !important; font-size: 11px !important;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.dayContainer { padding: 0 !important; min-width: 296px !important; width: 296px !important; }
.flatpickr-days { width: 296px !important; }
.flatpickr-day {
  font-family: var(--font-sans) !important;
  font-size: 13px !important; font-weight: 500 !important;
  color: var(--foreground) !important;
  border-radius: 8px !important; border: none !important;
  height: 36px !important; line-height: 36px !important;
  max-width: 14.2857% !important;
  margin: 1px 0;
  transition: background 0.12s, color 0.12s;
}
.flatpickr-day:hover, .flatpickr-day.prevMonthDay:hover, .flatpickr-day.nextMonthDay:hover {
  background: var(--surface-2) !important;
  color: var(--foreground) !important;
}
.flatpickr-day.today {
  border: 1.5px solid var(--accent) !important;
  color: var(--accent-foreground) !important; font-weight: 600 !important;
}
.flatpickr-day.selected, .flatpickr-day.selected:hover,
.flatpickr-day.startRange, .flatpickr-day.endRange {
  background: var(--accent) !important;
  color: #fff !important; font-weight: 600 !important;
  box-shadow: 0 2px 8px rgba(10,132,255,0.35) !important;
}
.flatpickr-day.inRange {
  background: var(--accent-soft) !important; color: var(--accent-foreground) !important;
  border-radius: 0 !important;
}
.flatpickr-day.flatpickr-disabled, .flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay {
  color: var(--foreground-faint) !important;
}
.flatpickr-day.flatpickr-disabled { opacity: 0.5; }
/* Time picker (если используется) */
.flatpickr-time input { color: var(--foreground) !important; font-family: var(--font-mono) !important; }
.flatpickr-time .flatpickr-time-separator { color: var(--foreground-subtle) !important; }

/* Textarea — Style E look */
textarea {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  letter-spacing: -0.011em;
  color: var(--foreground);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  resize: vertical;
}
textarea:focus {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: none;
}
textarea::placeholder { color: var(--foreground-faint); }

/* ─────────────────────────────────────────────────────────────────────────
   13. ANIMATIONS — entrance fadeUp (auto-applied to page sections)
   ───────────────────────────────────────────────────────────────────────── */
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { to { opacity: 1; } }

:root { --spring: cubic-bezier(0.32, 0.72, 0, 1); }

/* Auto-stagger: direct children of any `.page.on` (SPA) or `.fade-page` block */
.page.on > *, .fade-page > * {
  opacity: 0;
  transform: translateY(14px);
  animation: fadeUp 0.7s var(--spring) forwards;
}
.page.on > *:nth-child(1), .fade-page > *:nth-child(1) { animation-delay: 0.04s; }
.page.on > *:nth-child(2), .fade-page > *:nth-child(2) { animation-delay: 0.10s; }
.page.on > *:nth-child(3), .fade-page > *:nth-child(3) { animation-delay: 0.16s; }
.page.on > *:nth-child(4), .fade-page > *:nth-child(4) { animation-delay: 0.22s; }
.page.on > *:nth-child(5), .fade-page > *:nth-child(5) { animation-delay: 0.28s; }
.page.on > *:nth-child(6), .fade-page > *:nth-child(6) { animation-delay: 0.34s; }
.page.on > *:nth-child(n+7), .fade-page > *:nth-child(n+7) { animation-delay: 0.40s; }

/* Manual class for one-off elements */
.fade-up {
  opacity: 0;
  transform: translateY(14px);
  animation: fadeUp 0.7s var(--spring) forwards;
}
.fade-up--delay-1 { animation-delay: 0.05s; }
.fade-up--delay-2 { animation-delay: 0.10s; }
.fade-up--delay-3 { animation-delay: 0.18s; }
.fade-up--delay-4 { animation-delay: 0.26s; }
.fade-up--delay-5 { animation-delay: 0.34s; }

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .page.on > *, .fade-page > *, .fade-up {
    opacity: 1; transform: none; animation: none;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   14. UTILITY
   ───────────────────────────────────────────────────────────────────────── */
.stack    { display: flex; flex-direction: column; gap: var(--sp-3); }
.cluster  { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.row-flex { display: flex; align-items: center; gap: var(--sp-3); }
.spacer   { flex: 1; }

.divider  { height: 1px; background: var(--border); margin: var(--sp-4) 0; }

.kbd {
  display: inline-flex; align-items: center; padding: 1px 6px;
  background: var(--surface-2); border-radius: var(--radius-xs);
  font-family: var(--font-mono); font-size: 11px; color: var(--foreground-muted);
}

/* ─────────────────────────────────────────────────────────────────────────
   15. SECTION HEADER (// LABEL mono uppercase)
   ───────────────────────────────────────────────────────────────────────── */
.sec-hdr2 {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 var(--sp-3);
}
.sec-lbl {
  font-size: var(--text-xs); font-weight: var(--weight-bold);
  color: var(--foreground-faint);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.sec-lbl::before { content: "// "; color: var(--accent); }
.sec-cnt {
  font-size: var(--text-sm); color: var(--foreground-faint);
  font-variant-numeric: tabular-nums;
}

/* ─────────────────────────────────────────────────────────────────────────
   16. CHECKBOX · RADIO · TOGGLE (custom visual over native input)
   ───────────────────────────────────────────────────────────────────────── */
.checkbox, .radio, .toggle-switch {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  cursor: pointer; user-select: none; font-size: var(--text-base);
}
.checkbox input, .radio input, .toggle-switch input {
  position: absolute; opacity: 0; pointer-events: none;
}
.checkbox.is-disabled, .radio.is-disabled, .toggle-switch.is-disabled {
  opacity: 0.45; cursor: not-allowed;
}

/* Checkbox */
.checkbox .ck-box {
  width: 18px; height: 18px; border: 1.5px solid var(--border-2);
  border-radius: var(--radius-xs); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all var(--duration-fast) var(--ease-out);
}
.checkbox .ck-box svg {
  width: 12px; height: 12px; color: #fff; opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
}
.checkbox input:checked + .ck-box { background: var(--accent); border-color: var(--accent); }
.checkbox input:checked + .ck-box svg { opacity: 1; }
.checkbox input:focus-visible + .ck-box { box-shadow: var(--shadow-focus); }
.checkbox:hover .ck-box { border-color: var(--accent); }
.checkbox.is-indeterminate .ck-box { background: var(--accent); border-color: var(--accent); }
.checkbox.is-indeterminate .ck-box::after {
  content: ""; width: 10px; height: 2px; background: #fff; border-radius: 1px;
}
.checkbox.is-indeterminate .ck-box svg { display: none; }

/* Radio */
.radio .rd-box {
  width: 18px; height: 18px; border: 1.5px solid var(--border-2);
  border-radius: 50%; background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all var(--duration-fast) var(--ease-out);
}
.radio .rd-box::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff;
  transform: scale(0); transition: transform var(--duration-fast) var(--ease-out);
}
.radio input:checked + .rd-box { background: var(--accent); border-color: var(--accent); }
.radio input:checked + .rd-box::after { transform: scale(1); }
.radio input:focus-visible + .rd-box { box-shadow: var(--shadow-focus); }
.radio:hover .rd-box { border-color: var(--accent); }

/* Toggle Switch */
.toggle-switch { gap: var(--sp-3); }
.toggle-switch .ts-track {
  width: 36px; height: 20px; background: var(--border-2);
  border-radius: var(--radius-pill); position: relative;
  transition: background var(--duration-fast) var(--ease-out); flex-shrink: 0;
}
.toggle-switch .ts-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; background: #fff; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform var(--duration-base) var(--ease-out);
}
.toggle-switch input:checked ~ .ts-track { background: var(--accent); }
.toggle-switch input:checked ~ .ts-track .ts-thumb { transform: translateX(16px); }
.toggle-switch input:focus-visible ~ .ts-track { box-shadow: var(--shadow-focus); }

/* ─────────────────────────────────────────────────────────────────────────
   17. PAGINATION
   ───────────────────────────────────────────────────────────────────────── */
.pagination { display: inline-flex; align-items: center; gap: var(--sp-1); }
.pagination .pg-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 var(--sp-3);
  font-size: var(--text-sm); font-weight: var(--weight-semibold);
  font-family: var(--font-sans); color: var(--foreground-muted);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  font-variant-numeric: tabular-nums;
}
.pagination .pg-btn:hover:not(:disabled):not(.is-active) {
  border-color: var(--accent); color: var(--accent);
}
.pagination .pg-btn.is-active {
  background: var(--accent); color: #fff; border-color: var(--accent); cursor: default;
}
.pagination .pg-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination .pg-btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.pagination .pg-ellipsis {
  color: var(--foreground-faint); padding: 0 var(--sp-1);
  font-family: var(--font-mono);
}
.pagination .pg-info {
  margin-left: var(--sp-3); font-size: var(--text-xs);
  color: var(--foreground-subtle); font-family: var(--font-mono);
}

/* ─────────────────────────────────────────────────────────────────────────
   18. DROPDOWN MENU
   ───────────────────────────────────────────────────────────────────────── */
.dd {
  display: inline-block; min-width: 220px; padding: 6px 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15,17,21,0.12), 0 4px 8px rgba(15,17,21,0.06);
  z-index: var(--z-dropdown);
}
.dd-lbl {
  padding: var(--sp-2) var(--sp-4) var(--sp-1);
  font-size: 10px; font-weight: var(--weight-bold);
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--foreground-faint);
}
.dd-item {
  padding: var(--sp-2) var(--sp-4); font-size: var(--text-base);
  cursor: pointer; display: flex; align-items: center; gap: var(--sp-2);
}
.dd-item:hover { background: var(--surface-2); }
.dd-item.is-active { color: var(--accent-foreground); font-weight: var(--weight-semibold); }
.dd-item.is-focus { background: var(--accent-soft); }
.dd-item .check { width: 14px; height: 14px; color: var(--accent); }
.dd-sep { height: 1px; background: var(--border); margin: var(--sp-2) 0; }

/* ─────────────────────────────────────────────────────────────────────────
   19. TOOLTIP (4 positions: default top / bottom / right / left)
   ───────────────────────────────────────────────────────────────────────── */
.tt-wrap { position: relative; display: inline-flex; }
.tt-wrap .tt {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  padding: 5px 10px; background: var(--foreground); color: #fff;
  font-size: 11.5px; font-weight: var(--weight-medium);
  border-radius: var(--radius-sm); white-space: nowrap;
  pointer-events: none; opacity: 0;
  transition: opacity var(--duration-fast) 60ms;
  z-index: var(--z-dropdown);
}
.tt-wrap .tt::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 4px solid transparent; border-top-color: var(--foreground);
}
.tt-wrap:hover .tt, .tt-wrap:focus-within .tt { opacity: 1; }

.tt-wrap .tt.tt-bottom { bottom: auto; top: calc(100% + 6px); }
.tt-wrap .tt.tt-bottom::after {
  top: auto; bottom: 100%;
  border-top-color: transparent; border-bottom-color: var(--foreground);
}
.tt-wrap .tt.tt-right {
  bottom: 50%; left: calc(100% + 6px); transform: translateY(50%);
}
.tt-wrap .tt.tt-right::after {
  top: 50%; left: 0; transform: translate(-100%, -50%);
  border-top-color: transparent; border-right-color: var(--foreground);
}
.tt-wrap .tt.tt-left {
  bottom: 50%; right: calc(100% + 6px); left: auto; transform: translateY(50%);
}
.tt-wrap .tt.tt-left::after {
  top: 50%; left: auto; right: 0; transform: translate(100%, -50%);
  border-top-color: transparent; border-left-color: var(--foreground);
}

/* ─────────────────────────────────────────────────────────────────────────
   20. DRAWER · MOBILE MENU
   ───────────────────────────────────────────────────────────────────────── */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: var(--z-modal); opacity: 0; pointer-events: none;
  transition: opacity var(--duration-slow) var(--ease-out);
}
.drawer-overlay.is-open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 280px; background: var(--surface);
  padding: var(--sp-5) var(--sp-4); z-index: calc(var(--z-modal) + 1);
  box-shadow: 4px 0 24px rgba(0,0,0,0.12);
  display: flex; flex-direction: column; gap: var(--sp-1);
  transform: translateX(-100%); transition: transform var(--duration-slow) var(--ease-out);
}
.drawer.is-open { transform: translateX(0); }
@media (min-width: 480px) { .drawer { width: 320px; } }

.drawer .d-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-4); padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}
.drawer .d-brand {
  display: flex; align-items: center; gap: var(--sp-2);
  font-weight: var(--weight-bold); font-size: var(--text-lg);
}
.drawer .d-brand .mark {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: var(--weight-bold); font-size: 13px;
}
.drawer .d-link {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 9px var(--sp-3); font-size: 13.5px;
  color: var(--foreground-muted); border-radius: var(--radius-sm);
  cursor: pointer; text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}
.drawer .d-link:hover { background: var(--surface-2); color: var(--foreground); }
.drawer .d-link.is-active {
  background: var(--accent); color: #fff; font-weight: var(--weight-semibold);
}
.drawer .d-link svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Hamburger (trigger в topbar) */
.hamburger {
  width: 32px; height: 32px;
  display: inline-flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  cursor: pointer; background: transparent; border: none;
}
.hamburger span {
  display: block; width: 16px; height: 2px;
  background: var(--foreground); border-radius: 2px;
}

/* ─────────────────────────────────────────────────────────────────────────
   21. PROGRESS BAR
   ───────────────────────────────────────────────────────────────────────── */
.prog-wrap {
  padding: var(--sp-3) var(--sp-4); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md);
}
.prog-row {
  display: flex; justify-content: space-between; margin-bottom: var(--sp-2);
}
.prog-title {
  font-size: var(--text-sm); font-weight: var(--weight-semibold);
  color: var(--foreground);
}
.prog-status {
  font-family: var(--font-mono); font-size: var(--text-xs);
  color: var(--foreground-subtle); font-variant-numeric: tabular-nums;
}
.prog-bg {
  height: 6px; background: var(--surface-2);
  border-radius: var(--radius-pill); overflow: hidden;
}
.prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  border-radius: var(--radius-pill);
  transition: width var(--duration-slow) var(--ease-out);
}
.prog-fill.is-indeterminate {
  width: 40% !important;
  animation: prog-slide 1.4s ease-in-out infinite;
}
@keyframes prog-slide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

/* ─────────────────────────────────────────────────────────────────────────
   22. TOAST (notification)
   ───────────────────────────────────────────────────────────────────────── */
.toast-stack {
  position: fixed; bottom: var(--sp-4); right: var(--sp-4);
  display: flex; flex-direction: column-reverse; gap: var(--sp-2);
  z-index: var(--z-toast); pointer-events: none;
}
.toast {
  display: inline-flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4) var(--sp-3) 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(15,17,21,0.12);
  font-size: var(--text-base); min-width: 280px; max-width: 420px;
  pointer-events: auto;
  animation: toast-in var(--duration-slow) var(--ease-out);
}
@keyframes toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.toast.is-leaving {
  animation: toast-out var(--duration-slow) var(--ease-out) forwards;
}
@keyframes toast-out {
  to { transform: translateX(100%); opacity: 0; }
}
.toast .ic {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.toast--success .ic { background: var(--success); }
.toast--error   .ic { background: var(--danger); }
.toast--warning .ic { background: var(--warning); }
.toast--info    .ic { background: var(--accent); }
.toast .body { flex: 1; }
.toast .title { font-weight: var(--weight-semibold); margin-bottom: 2px; }
.toast .desc { color: var(--foreground-muted); font-size: var(--text-sm); }
.toast .x {
  color: var(--foreground-faint); cursor: pointer; padding: 0 var(--sp-1);
  background: transparent; border: none; font-size: 14px;
}
.toast .x:hover { color: var(--foreground); }

/* ─────────────────────────────────────────────────────────────────────────
   23. EMPTY STATE
   ───────────────────────────────────────────────────────────────────────── */
.empty-state { padding: 48px var(--sp-6); text-align: center; }
.empty-state .ic {
  width: 56px; height: 56px; margin: 0 auto var(--sp-4);
  border-radius: 50%; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--foreground-faint);
}
.empty-state .ic svg { width: 28px; height: 28px; }
.empty-state .ttl {
  font-size: var(--text-lg); font-weight: var(--weight-semibold); margin: 0 0 6px;
}
.empty-state .desc {
  font-size: var(--text-base); color: var(--foreground-muted);
  margin: 0 auto var(--sp-5); max-width: 360px; line-height: var(--leading-normal);
}
.empty-state--minimal { padding: 32px var(--sp-6); }
.empty-state--minimal .ic { width: 40px; height: 40px; margin-bottom: var(--sp-3); }
.empty-state--minimal .ic svg { width: 20px; height: 20px; }

/* ─────────────────────────────────────────────────────────────────────────
   24. SKELETON LOADER
   ───────────────────────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 0%, #ecedf2 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: skel 1.4s linear infinite;
  border-radius: var(--radius-xs);
}
@keyframes skel {
  0%   { background-position:  200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton.line     { height: 12px; }
.skeleton.line-sm  { height: 10px; }
.skeleton.line-lg  { height: 16px; }
.skeleton.box      { height: 80px; border-radius: var(--radius-md); }
.skeleton.circle   { width: 38px; height: 38px; border-radius: 50%; }

/* ─────────────────────────────────────────────────────────────────────────
   25. FORM FIELD (label + input + helper/error)
   ───────────────────────────────────────────────────────────────────────── */
.field {
  display: flex; flex-direction: column; gap: 6px; max-width: 420px;
}
.field-label {
  font-size: var(--text-xs); font-weight: var(--weight-bold);
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--foreground-subtle);
  display: flex; align-items: center; gap: 6px;
}
.field-label .req { color: var(--danger); }
.field-help    { font-size: 11.5px; color: var(--foreground-subtle); }
.field-error   { font-size: 11.5px; color: var(--danger);             display: flex; align-items: center; gap: 6px; }
.field-success { font-size: 11.5px; color: var(--success-foreground); display: flex; align-items: center; gap: 6px; }
.field.is-error    .input,
.field.is-error    .input-wrap,
.field.is-error    .select,
.field.is-error    textarea     { border-color: var(--danger); background: var(--danger-soft); }
.field.is-success  .input,
.field.is-success  .input-wrap  { border-color: var(--success); }

/* Inline form (search + submit + ...) */
.form-inline {
  display: flex; gap: var(--sp-2); align-items: center; max-width: 520px;
}
.form-inline > .input-wrap, .form-inline > .input { flex: 1; }

/* ─────────────────────────────────────────────────────────────────────────
   26. SPARKLINE (utility — only sets size; SVG inline в разметке)
   ───────────────────────────────────────────────────────────────────────── */
.spark { width: 72px; height: 28px; }
.spark--lg { width: 96px; height: 36px; }
.spark--sm { width: 56px; height: 20px; }
/* Используется так:
   <svg class="spark" viewBox="0 0 72 28">
     <polyline points="0,22 12,18 24,20 36,12 48,14 60,8 72,4"
               fill="none" stroke="var(--accent)" stroke-width="2"/>
   </svg>
*/

/* ─────────────────────────────────────────────────────────────────────────
   27. BACKDROP-FILTER FALLBACK
   For Safari < 9, Firefox < 103, и других браузеров без backdrop-filter —
   glass-эффект пропадает, поверхности становятся плотными.
   ───────────────────────────────────────────────────────────────────────── */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar {
    background: rgba(255,255,255,0.92);
  }
  /* glass-card pattern в SPA — fallback решается inline-стилями страницы;
     общее правило тут не задаём (атрибутов класса .glass-card в проекте нет) */
}
