/* ============================================================
   Tendero · app.css
   Единый дизайн-фундамент. BEM-разметка, переменные сверху,
   все состояния — модификаторы. Готово к копипасте в app.css прода.

   Структура файла:
     1. Tokens (variables)
     2. Reset & base
     3. Layout: shell, sidebar, topbar, tabs, drawer
     4. Primitives: btn, input, card, section-label, kbd, divider
     5. Status surfaces: stage-badge, badge, chip, dot
     6. Domain components: wf-ribbon, list-row, kpi, task, event
     7. Forms & tables
     8. Tender card (heaviest)
     9. Empty states (cross-cutting)
    10. Auth (login)
    11. Utilities
   ============================================================ */


/* ============================================================
   1. TOKENS
   Имена выбраны под лёгкий поиск-замену (--accent-*, --stage-*,
   --bg-*, --text-*). См. tokens-map.md.
   ============================================================ */

:root {
  /* — Surfaces (тёплый нейтрал) — */
  --bg-canvas:        #faf7f2;     /* фон страницы */
  --bg-surface:       #ffffff;     /* карточки, drawer */
  --bg-sunken:        #f3efe7;     /* подложки, KPI, плашки */
  --bg-hover:         #f6f2ea;
  --bg-inverse:       #1a1a1a;

  /* — Borders — */
  --border-1:         #ece7dd;     /* subtle */
  --border-2:         #e0d9cc;     /* default */
  --border-3:         #c9c0af;     /* strong */
  --border-focus:     #ed6a5a;

  /* — Text — */
  --text-1:           #1a1a1a;     /* primary */
  --text-2:           #5a5750;     /* secondary */
  --text-3:           #8f8a7f;     /* muted */
  --text-4:           #b6b1a4;     /* disabled */
  --text-inverse:     #ffffff;

  /* — Accent: brand coral — */
  --accent-50:        #fdf1ef;
  --accent-100:       #fbe2dd;
  --accent-200:       #f7c4ba;
  --accent-300:       #f3a193;
  --accent-400:       #ef806f;
  --accent-500:       #ed6a5a;     /* primary */
  --accent-600:       #d85648;
  --accent-700:       #b8473b;

  /* — Stage ЕИС: синяя ось, ОТДЕЛЬНАЯ от наших статусов — */
  --stage-bg:         #eef4fc;
  --stage-border:     #cfdef3;
  --stage-dot:        #4a8ee0;
  --stage-fg:         #2c6ec0;

  /* Семантические вариации стадии (для разной фазы ЕИС) */
  --stage-submit:     #4a8ee0;     /* приём заявок */
  --stage-await:      #2c6ec0;     /* подведение итогов */
  --stage-completed:  #5a8c66;     /* определение завершено */
  --stage-exec:       #2e9d57;     /* исполнение */
  --stage-canceled:   #8f8a7f;     /* отменён */

  /* — Semantic — наши статусы (не путать со стадией) — */
  --success-50:       #e9f6ee;
  --success-500:      #2e9d57;
  --success-700:      #1f7a42;

  --warn-50:          #fdf3e1;
  --warn-500:         #d99323;
  --warn-700:         #a16e15;

  --danger-50:        #fbeaea;
  --danger-500:       #c44545;
  --danger-700:       #9a2f2f;

  --info-50:          #ece9f7;
  --info-500:         #6357c4;

  /* — Phase tints — для ribbon-workflow — */
  --phase-pre-bg:     var(--bg-sunken);
  --phase-pre-fg:     var(--text-3);
  --phase-done-bg:    var(--success-50);
  --phase-done-fg:    var(--success-700);
  --phase-active-bg:  var(--accent-500);
  --phase-active-fg:  #fff;
  --phase-term-bg:    var(--danger-50);
  --phase-term-fg:    var(--danger-700);

  /* — Type — */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --fs-11: 11px;  --lh-11: 14px;
  --fs-12: 12px;  --lh-12: 16px;
  --fs-13: 13px;  --lh-13: 18px;
  --fs-14: 14px;  --lh-14: 20px;
  --fs-15: 15px;  --lh-15: 22px;
  --fs-17: 16px;  --lh-17: 24px;
  --fs-20: 19px;  --lh-20: 28px;
  --fs-24: 22px;  --lh-24: 30px;
  --fs-32: 28px;  --lh-32: 36px;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* — Radius — */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 999px;

  /* — Shadow — мягкие, тёплые — */
  --shadow-1: 0 1px 2px rgba(40, 30, 20, .04);
  --shadow-2: 0 4px 14px rgba(40, 30, 20, .06);
  --shadow-3: 0 12px 28px rgba(40, 30, 20, .10);
  --shadow-inset: inset 0 0 0 1px var(--border-1);

  /* — Spacing — 4px grid — */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 28px; --sp-8: 32px;
  --sp-10: 40px; --sp-12: 48px; --sp-14: 56px; --sp-16: 64px;

  /* — Layout dimensions — */
  --sidebar-w: 232px;
  --sidebar-w-collapsed: 60px;
  --topbar-h: 60px;
  --topbar-h-thin: 52px;
  --drawer-w: 380px;
  --content-max: 1240px;

  /* — Motion — */
  --t-quick: 120ms cubic-bezier(.2,.7,.2,1);
  --t-base:  180ms cubic-bezier(.2,.7,.2,1);
}


/* ============================================================
   2. RESET & BASE
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-14);
  line-height: var(--lh-14);
  color: var(--text-1);
  background: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'cv11';
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: var(--fw-semibold); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-3); }
::-webkit-scrollbar-track { background: transparent; }

/* Lucide-иконка как inline-svg внутри тега <i data-lucide="..."> */
[data-lucide] { width: 16px; height: 16px; stroke-width: 1.6; vertical-align: middle; flex-shrink: 0; }
.icon-sm [data-lucide], [data-lucide].icon-sm { width: 14px; height: 14px; }
.icon-md [data-lucide], [data-lucide].icon-md { width: 18px; height: 18px; }
.icon-lg [data-lucide], [data-lucide].icon-lg { width: 22px; height: 22px; }


/* ============================================================
   3. LAYOUT — shell, sidebar, topbar, tabs, drawer
   ============================================================ */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  background: var(--bg-canvas);
}
.shell--with-drawer .shell__main { grid-template-columns: 1fr var(--drawer-w); }
.shell__main {
  display: grid;
  grid-template-columns: 1fr;
  min-width: 0;
}
.shell__main-col {
  display: flex; flex-direction: column;
  min-width: 0;
}

/* === Sidebar === */
.sidebar {
  background: var(--bg-canvas);
  border-right: 1px solid var(--border-1);
  padding: 14px 12px;
  display: flex; flex-direction: column;
  position: sticky; top: 0;
  height: 100vh;
}
.sidebar__logo {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px 14px;
  font-size: var(--fs-17); font-weight: var(--fw-bold);
  letter-spacing: -.01em;
}
.sidebar__logo-mark {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
}
.sidebar__logo-mark svg { width: 22px; height: 22px; }
.sidebar__logo-text-accent { color: var(--accent-500); }

.sidebar__group {
  padding: 14px 12px 4px;
  font-size: var(--fs-11); color: var(--text-3);
  text-transform: uppercase; letter-spacing: .08em;
  font-weight: var(--fw-medium);
}
.sidebar__group:first-of-type { padding-top: 4px; }

.sidebar__item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; margin-bottom: 2px;
  border-radius: var(--r-md);
  font-size: var(--fs-14); color: var(--text-1);
  cursor: pointer;
  transition: background var(--t-quick);
}
.sidebar__item:hover { background: var(--bg-hover); }
.sidebar__item--active {
  background: var(--accent-50);
  color: var(--accent-700);
  font-weight: var(--fw-medium);
}
.sidebar__item--active:hover { background: var(--accent-50); }
.sidebar__item-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__item-count {
  font-family: var(--font-mono); font-size: var(--fs-12);
  color: var(--text-3); font-variant-numeric: tabular-nums;
}
.sidebar__item-count--accent { color: var(--accent-600); font-weight: var(--fw-medium); }

.sidebar__spacer { flex: 1; }

.sidebar__user {
  margin-top: 12px; padding: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  display: flex; align-items: center; gap: 10px;
}
.sidebar__user-avatar {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-200); color: var(--accent-700);
  font-size: 12px; font-weight: var(--fw-semibold);
  display: inline-flex; align-items: center; justify-content: center;
}
.sidebar__user-info { flex: 1; min-width: 0; }
.sidebar__user-name {
  font-size: var(--fs-13); font-weight: var(--fw-medium);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar__user-tenant {
  font-size: var(--fs-11); color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar__user-btn {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-3); border-radius: var(--r-sm);
}
.sidebar__user-btn:hover { background: var(--bg-hover); color: var(--text-1); }


/* === Topbar — единый каркас, 2 варианта === */

.topbar {
  display: flex; align-items: center;
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-1);
  padding: 0 var(--sp-7);
  gap: var(--sp-4);
}
.topbar__icon {
  width: 36px; height: 36px; flex-shrink: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2);
}
.topbar__title-block { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.topbar__title { font-size: var(--fs-20); line-height: 1.2; font-weight: var(--fw-bold); letter-spacing: -.01em; color: var(--text-1); }
.topbar__subtitle { margin-top: 2px; font-size: var(--fs-13); color: var(--text-3); }
.topbar__actions { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Variant: classic — высокий, заголовок крупно */
.shell--classic .topbar { padding-top: var(--sp-5); padding-bottom: var(--sp-4); align-items: flex-start; }
.shell--classic .topbar__title { font-size: var(--fs-24); line-height: var(--lh-24); }
.shell--classic .topbar__actions { padding-top: 6px; }

/* Variant: condensed — тонкая полоса, inline */
.shell--condensed .topbar {
  height: var(--topbar-h-thin);
  background: var(--bg-surface);
}
.shell--condensed .topbar__icon {
  width: 28px; height: 28px; border: 0; background: transparent;
}
.shell--condensed .topbar__title { font-size: var(--fs-17); }
.shell--condensed .topbar__subtitle {
  margin: 0 0 0 8px;
  display: inline; font-size: var(--fs-13);
}
.shell--condensed .topbar__subtitle::before { content: "· "; color: var(--text-4); }
.shell--condensed .topbar__title-block { flex-direction: row; align-items: baseline; }

/* === Tabs (под топбаром) === */
.tabs {
  display: flex; gap: 4px;
  padding: 0 var(--sp-6);
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-1);
}
.shell--condensed .tabs { background: var(--bg-surface); }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  font-size: var(--fs-14); font-weight: var(--fw-medium);
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color var(--t-quick), border-color var(--t-quick);
}
.tab:hover { color: var(--text-1); }
.tab--active {
  color: var(--text-1);
  font-weight: var(--fw-semibold);
  border-bottom-color: var(--accent-500);
}
.tab__count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 18px; padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--bg-sunken); color: var(--text-2);
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: var(--fs-11); font-weight: var(--fw-medium);
}
.tab__count--accent { background: var(--accent-50); color: var(--accent-700); }
.tab__count--success { background: var(--success-50); color: var(--success-700); }
.tab--active .tab__count { background: var(--bg-sunken); }

/* === Content area === */
.content {
  padding: var(--sp-6) var(--sp-7) var(--sp-10);
  min-width: 0;
}
.content--narrow { max-width: 1080px; }
.content--tight { padding-top: var(--sp-5); }

/* === Drawer (правый) === */
.drawer {
  border-left: 1px solid var(--border-1);
  background: var(--bg-surface);
  padding: 0;
  overflow: auto;
  height: 100vh;
  position: sticky; top: 0;
  display: flex; flex-direction: column;
}
.drawer__head {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border-1);
  flex-shrink: 0;
}
.drawer__tabs {
  display: flex; gap: 2px;
  padding: 0 12px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-1);
  flex-shrink: 0;
  overflow-x: auto;
}
.drawer__tab {
  padding: 10px 12px;
  font-size: var(--fs-13); font-weight: var(--fw-medium);
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.drawer__tab:hover { color: var(--text-1); }
.drawer__tab--active {
  color: var(--accent-700);
  border-bottom-color: var(--accent-500);
  font-weight: var(--fw-semibold);
}
.drawer__tab--disabled { color: var(--text-4); cursor: not-allowed; }
.drawer__tab-count {
  font-family: var(--font-mono); font-size: var(--fs-11);
  background: var(--bg-sunken); color: var(--text-2);
  padding: 1px 6px; border-radius: var(--r-pill);
}
.drawer__body { padding: 16px 20px; flex: 1; overflow: auto; }
.drawer__footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-1);
  background: var(--bg-canvas);
  flex-shrink: 0;
  display: flex; gap: 8px;
}

/* Compact drawer section: иконка + лейбл + значение, плотно */
.drawer__section {
  margin-bottom: 18px;
}
.drawer__section:last-child { margin-bottom: 0; }
.drawer__section-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .06em; font-weight: var(--fw-medium);
  margin-bottom: 8px;
}
.drawer__section-title-link {
  color: var(--accent-600); font-size: 11px;
  text-transform: none; letter-spacing: 0; font-weight: var(--fw-medium);
}
.drawer__dates {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 12px;
  font-size: var(--fs-13);
}
.drawer__dates dt { color: var(--text-3); }
.drawer__dates dd { margin: 0; font-family: var(--font-mono); color: var(--text-1); text-align: right; }


/* ============================================================
   4. PRIMITIVES
   ============================================================ */

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  height: 36px; padding: 0 14px;
  border-radius: var(--r-md);
  font-size: var(--fs-14); font-weight: var(--fw-medium);
  background: var(--bg-surface);
  color: var(--text-1);
  border: 1px solid var(--border-2);
  cursor: pointer;
  transition: background var(--t-quick), border-color var(--t-quick), transform var(--t-quick);
  white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--accent-500);
  color: #fff;
  border-color: var(--accent-500);
}
.btn--primary:hover { background: var(--accent-600); border-color: var(--accent-600); }

.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--bg-hover); }

.btn--link {
  background: transparent; border: 0; padding: 0; height: auto;
  color: var(--accent-600); font-weight: var(--fw-medium);
}
.btn--link:hover { color: var(--accent-700); text-decoration: underline; }

.btn--danger { color: var(--danger-700); border-color: var(--border-2); background: var(--bg-surface); }
.btn--danger:hover { background: var(--danger-50); border-color: var(--danger-500); color: var(--danger-700); }

.btn--sm { height: 30px; padding: 0 10px; font-size: var(--fs-13); }
.btn--lg { height: 42px; padding: 0 18px; font-size: var(--fs-15); }
.btn--icon { width: 36px; padding: 0; }
.btn--icon.btn--sm { width: 30px; }
.btn--block { width: 100%; }

/* === Inputs === */
.input {
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  transition: border-color var(--t-quick), box-shadow var(--t-quick);
}
.input:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-50);
}
.input__icon { color: var(--text-3); display: inline-flex; }
.input__field {
  flex: 1; min-width: 0;
  border: 0; outline: none; background: transparent;
  font-size: var(--fs-14); color: var(--text-1);
}
.input__field::placeholder { color: var(--text-3); }
.input__suffix { color: var(--text-3); font-size: var(--fs-12); }
.input--lg { height: 44px; }
.input--search { width: 100%; }

.checkbox {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: var(--fs-14);
}
.checkbox__box {
  width: 16px; height: 16px;
  border: 1.5px solid var(--border-3);
  border-radius: var(--r-xs);
  background: var(--bg-surface);
  display: inline-flex; align-items: center; justify-content: center;
  color: transparent;
}
.checkbox--on .checkbox__box {
  background: var(--accent-500); border-color: var(--accent-500); color: #fff;
}

/* === Search bar (полноразмерная панель в листингах) === */
.search-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
}
.search-bar__input {
  flex: 1; display: flex; align-items: center; gap: 10px;
  height: 28px; padding: 0;
}
.search-bar__input input {
  flex: 1; border: 0; outline: none; background: transparent;
  font-size: var(--fs-15); color: var(--text-1);
}
.search-bar__input input::placeholder { color: var(--text-3); }
.search-bar__sep { width: 1px; height: 22px; background: var(--border-1); }
.search-bar__action {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: var(--r-md);
  font-size: var(--fs-13); color: var(--text-2);
  cursor: pointer;
}
.search-bar__action:hover { background: var(--bg-hover); color: var(--text-1); }
.search-bar__meta {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px 10px;
  font-size: var(--fs-12); color: var(--text-3);
}

/* === Card === */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
}
.card--lg { padding: var(--sp-5); }
.card--xl { padding: var(--sp-6); }
.card--sunken { background: var(--bg-sunken); border-color: transparent; }
.card--accent {
  background: linear-gradient(180deg, #fff 0%, var(--accent-50) 100%);
  border-color: var(--accent-200);
}
.card--success {
  background: var(--success-50); border-color: rgba(46,157,87,.2);
}

/* === Section label (eyebrow над секцией) === */
.section-label {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  margin-bottom: var(--sp-3);
}
.section-label__title {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text-3);
  font-size: var(--fs-12);
  text-transform: uppercase; letter-spacing: .06em;
  font-weight: var(--fw-medium);
}
.section-label__title--accent { color: var(--accent-700); }
.section-label__right { display: inline-flex; align-items: center; gap: 8px; }

/* === Divider === */
.divider {
  height: 1px; background: var(--border-1);
  margin: var(--sp-4) 0;
}
.divider-v { width: 1px; background: var(--border-1); align-self: stretch; }

/* === Kbd === */
.kbd {
  display: inline-flex; align-items: center;
  padding: 2px 6px; border-radius: var(--r-xs);
  border: 1px solid var(--border-2); background: var(--bg-sunken);
  font-family: var(--font-mono); font-size: var(--fs-11); color: var(--text-2);
}


/* ============================================================
   5. STATUS SURFACES — stage-badge, badge, chip, dot
   ============================================================ */

/* Бейдж стадии ЕИС — СИНЯЯ ось, отдельная от наших статусов */
.stage-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--stage-bg);
  color: var(--stage-fg);
  font-size: var(--fs-13);
  font-weight: var(--fw-medium);
  line-height: 1.4;
  white-space: nowrap;
}
.stage-badge__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--stage-dot);
  flex-shrink: 0;
}
.stage-badge__countdown {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  opacity: .8; font-size: var(--fs-12);
}
.stage-badge--sm { padding: 1px 8px; font-size: var(--fs-12); }

.stage-badge--submission .stage-badge__dot { background: var(--stage-submit); }
.stage-badge--awaiting   .stage-badge__dot { background: var(--stage-await); }
.stage-badge--completed  { background: var(--success-50); color: var(--success-700); }
.stage-badge--completed  .stage-badge__dot { background: var(--stage-completed); }
.stage-badge--execution  { background: var(--success-50); color: var(--success-700); }
.stage-badge--execution  .stage-badge__dot { background: var(--stage-exec); }
.stage-badge--canceled   { background: var(--bg-sunken); color: var(--text-3); }
.stage-badge--canceled   .stage-badge__dot { background: var(--stage-canceled); }

/* Наш статус — semantic */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  background: var(--bg-sunken); color: var(--text-2);
  font-size: var(--fs-13); font-weight: var(--fw-medium);
  line-height: 1.4;
  white-space: nowrap;
}
.badge--success { background: var(--success-50); color: var(--success-700); }
.badge--warn    { background: var(--warn-50);    color: var(--warn-700); }
.badge--danger  { background: var(--danger-50);  color: var(--danger-700); }
.badge--info    { background: var(--info-50);    color: var(--info-500); }
.badge--accent  { background: var(--accent-50);  color: var(--accent-700); }
.badge--sm      { padding: 1px 8px; font-size: var(--fs-12); }

/* Chip — фильтры, флаги */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-1);
  border: 1px solid var(--border-2);
  font-size: var(--fs-13); font-weight: var(--fw-medium);
  white-space: nowrap;
  cursor: default;
}
.chip:hover { background: var(--bg-hover); }
.chip--active { background: var(--bg-sunken); border-color: var(--border-3); }
.chip--fire   { background: #fff1ec; color: #b8473b; border-color: #fbd7c6; }
.chip--soon   { background: #fff7e6; color: #a16e15; border-color: #fbe6b8; }
.chip--accent { background: var(--accent-50); color: var(--accent-700); border-color: var(--accent-200); }
.chip--ghost  { background: transparent; border-style: dashed; color: var(--text-3); }
.chip__close {
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 2px; opacity: .6; cursor: pointer;
}
.chip__close:hover { opacity: 1; }

/* Dot — маркер вне бейджа */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot--accent { background: var(--accent-500); }
.dot--success { background: var(--success-500); }
.dot--warn { background: var(--warn-500); }
.dot--danger { background: var(--danger-500); }
.dot--muted { background: var(--text-3); }
.dot--stage { background: var(--stage-dot); }


/* ============================================================
   6. DOMAIN COMPONENTS
   ============================================================ */

/* === Ribbon workflow — тонкие сегменты, 3 состояния === */
.wf-ribbon {
  display: flex; gap: 4px;
  width: 100%;
}
.wf-step {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: var(--phase-pre-bg);
  color: var(--phase-pre-fg);
  border-radius: var(--r-sm);
  font-size: var(--fs-13); font-weight: var(--fw-medium);
  overflow: hidden;
}
.wf-step__num {
  font-family: var(--font-mono); font-size: 11px;
  opacity: .6; flex-shrink: 0;
}
.wf-step__label {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wf-step--done   { background: var(--phase-done-bg);   color: var(--phase-done-fg); }
.wf-step--active { background: var(--phase-active-bg); color: var(--phase-active-fg); font-weight: var(--fw-semibold); }
.wf-step--term   { background: var(--phase-term-bg);   color: var(--phase-term-fg); }
.wf-ribbon--compact .wf-step { padding: 6px 10px; font-size: var(--fs-12); }


/* === Unified list row — поиск, архив, аукционы, контракты === */
.list { display: flex; flex-direction: column; gap: 8px; }

.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px 140px;
  gap: 16px; align-items: start;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--t-quick), border-color var(--t-quick), box-shadow var(--t-quick);
}
.list-row:hover {
  background: var(--bg-hover);
  border-color: var(--border-2);
}
.list-row--taken { background: linear-gradient(90deg, var(--accent-50) 0, var(--accent-50) 4px, var(--bg-surface) 4px); }
.list-row--taken:hover { background: linear-gradient(90deg, var(--accent-500) 0, var(--accent-500) 4px, var(--bg-hover) 4px); }
.list-row--compact { padding: 10px 14px; }
.list-row--compact .list-row__title { font-size: var(--fs-14); }
.list-row--spacious { padding: 18px 20px; }

.list-row__main { min-width: 0; }
.list-row__meta {
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px;
  color: var(--text-3); font-size: var(--fs-12);
}
.list-row__meta .mono { color: var(--text-2); }
.list-row__sep { color: var(--text-4); }
.list-row__title {
  font-size: var(--fs-15); font-weight: var(--fw-medium); color: var(--text-1);
  line-height: 1.4; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.list-row__customer {
  color: var(--text-3); font-size: var(--fs-13);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.list-row__chips {
  display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap;
}
.list-row__side {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
}
.list-row__deadline {
  color: var(--text-2); font-size: var(--fs-13);
  display: inline-flex; align-items: center; gap: 6px;
}
.list-row__deadline-date { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.list-row__amount {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: var(--fs-17); font-weight: var(--fw-semibold);
  color: var(--text-1);
  text-align: right;
}
.list-row__amount-hint { font-size: var(--fs-11); color: var(--text-3); font-weight: var(--fw-regular); }
.list-row__taken-flag {
  color: var(--accent-700); font-weight: var(--fw-medium);
}
.list-row__responsible {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-2); font-size: var(--fs-13);
}
.avatar-xs {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent-100); color: var(--accent-700);
  font-size: 10px; font-weight: var(--fw-semibold);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}


/* === KPI tile === */
.kpi-row { display: grid; gap: 12px; }
.kpi-row--4 { grid-template-columns: repeat(4, 1fr); }
.kpi-row--3 { grid-template-columns: repeat(3, 1fr); }
.kpi-row--2 { grid-template-columns: repeat(2, 1fr); }

.kpi {
  position: relative; overflow: hidden;
  padding: 16px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
}
.kpi__bar {
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: transparent;
}
.kpi--accent .kpi__bar { background: var(--accent-500); }
.kpi--success .kpi__bar { background: var(--success-500); }
.kpi--warn .kpi__bar { background: var(--warn-500); }
.kpi__label {
  color: var(--text-3); font-size: 11px;
  text-transform: uppercase; letter-spacing: .08em;
  font-weight: var(--fw-medium); margin-bottom: 8px;
}
.kpi__value {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: var(--fs-32); line-height: 1; font-weight: var(--fw-bold);
  letter-spacing: -.01em; color: var(--text-1);
}
.kpi__hint { margin-top: 6px; font-size: var(--fs-13); color: var(--text-3); }
.kpi__hint--accent { color: var(--accent-700); }
.kpi__hint--success { color: var(--success-700); }


/* === Task row === */
.task {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  transition: background var(--t-quick);
}
.task:hover { background: var(--bg-hover); }
.task__priority {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--text-3);
}
.task--now  .task__priority { background: var(--danger-500); }
.task--soon .task__priority { background: var(--warn-500); }
.task--done .task__priority { background: var(--success-500); }

/* Compact one-line variant — приоритет + шаг + тендер (truncated) + срок */
.task--compact {
  grid-template-columns: auto auto 1fr auto;
  padding: 8px 12px;
  gap: 10px;
}
.task--compact .task__main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.task--compact .task__step {
  margin: 0; font-size: var(--fs-13); font-weight: var(--fw-semibold);
  white-space: nowrap;
}
.task--compact .task__tender {
  font-size: var(--fs-13); color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0;
}
.task--compact .task__customer { display: none; }
.task--compact .task__role { display: none; }
.task--compact .task__deadline { font-size: var(--fs-12); }
.task--compact .task__priority-label { display: none; }
.task--compact .task__step-meta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-11); color: var(--text-3); font-weight: var(--fw-regular);
}
.task__main { min-width: 0; }
.task__step {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-14); font-weight: var(--fw-semibold);
  margin-bottom: 2px;
}
.task__role { font-size: 11px; color: var(--text-3); font-weight: var(--fw-regular); }
.task__tender, .task__customer {
  font-size: var(--fs-13); color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.task__customer { color: var(--text-3); font-size: 11px; margin-top: 2px; }
.task__deadline {
  text-align: right;
  font-family: var(--font-mono);
  font-size: var(--fs-13);
  color: var(--text-2);
  font-weight: var(--fw-medium);
}
.task--now .task__deadline { color: var(--danger-700); }
.task__priority-label { font-size: 11px; color: var(--text-3); }


/* === Mini-tender row (для рабочего стола) === */
.my-tender {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: 14px; align-items: center;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
}
.my-tender:hover { background: var(--bg-hover); }
.my-tender__head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
  font-family: var(--font-mono); font-size: 11px; color: var(--text-3);
}
.my-tender__title {
  font-size: var(--fs-14); font-weight: var(--fw-medium);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.my-tender__side {
  text-align: right; font-size: 11px; color: var(--text-3);
}
.my-tender__phase {
  color: var(--accent-700); font-weight: var(--fw-medium);
  margin-bottom: 2px;
}
.my-tender__date { font-family: var(--font-mono); }
.my-tender__amount {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: var(--fs-14); font-weight: var(--fw-semibold);
  text-align: right; min-width: 100px;
}


/* === Event row (лента событий) === */
.event {
  display: grid; grid-template-columns: 32px 1fr auto; gap: 14px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-left-width: 3px;
  border-radius: var(--r-md);
}
.event--new    { border-left-color: var(--success-500); }
.event--alert  { border-left-color: var(--danger-500); }
.event--info   { border-left-color: var(--info-500); }
.event--neutral{ border-left-color: var(--text-4); }

.event__icon {
  width: 32px; height: 32px; border-radius: var(--r-md);
  background: var(--bg-sunken);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2);
}
.event--new .event__icon   { background: var(--success-50); color: var(--success-700); }
.event--alert .event__icon { background: var(--danger-50);  color: var(--danger-700); }
.event--info .event__icon  { background: var(--info-50);    color: var(--info-500); }

.event__body { min-width: 0; }
.event__title { font-size: var(--fs-14); font-weight: var(--fw-semibold); margin-bottom: 4px; }
.event__meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: var(--fs-12); color: var(--text-3);
  margin-bottom: 4px;
}
.event__meta .mono { color: var(--accent-700); }
.event__subject {
  font-size: var(--fs-13); color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.event__when {
  text-align: right; font-family: var(--font-mono);
  font-size: var(--fs-12); color: var(--text-3); white-space: nowrap;
}


/* ============================================================
   7. FORMS & TABLES
   ============================================================ */

.field {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: var(--sp-3);
}
.field__label {
  font-size: var(--fs-12); color: var(--text-3);
  text-transform: uppercase; letter-spacing: .06em; font-weight: var(--fw-medium);
}
.field__hint { font-size: var(--fs-12); color: var(--text-3); }
.field__error { font-size: var(--fs-12); color: var(--danger-700); }

/* — Таблица — основной паттерн листинга, когда колоночные данные важнее карточки — */
.table {
  width: 100%; border-collapse: collapse;
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.table th, .table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-1);
  vertical-align: top;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table th {
  font-size: var(--fs-11); text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); font-weight: var(--fw-medium);
  background: var(--bg-canvas);
}
.table td { font-size: var(--fs-14); color: var(--text-1); }
.table tbody tr:hover { background: var(--bg-hover); cursor: pointer; }
.table tbody tr.is-selected { background: var(--accent-50); }
.table tbody tr.is-selected td { border-bottom-color: var(--accent-200); }
.table tbody tr.is-selected:hover { background: var(--accent-50); }
.table .num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .nowrap { white-space: nowrap; }


/* ============================================================
   8. TENDER CARD — карточка тендера (самый сложный экран)
   Информационная иерархия: hero → выше-первого-экрана → табы → секции
   ============================================================ */

/* === Tender header (sticky hero) === */
.tcard-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg-canvas);
  padding: var(--sp-4) var(--sp-7);
  border-bottom: 1px solid var(--border-1);
}
.tcard-header__crumbs {
  display: flex; align-items: center; gap: 10px;
  font-size: var(--fs-13); color: var(--text-3);
  margin-bottom: 10px;
}
.tcard-header__crumbs .mono { color: var(--text-2); }
.tcard-header__title {
  display: flex; align-items: flex-start; gap: 16px;
  margin-bottom: var(--sp-3);
}
.tcard-header__title h1 {
  font-size: var(--fs-24); line-height: var(--lh-24); font-weight: var(--fw-bold);
  letter-spacing: -.01em; margin: 0; flex: 1;
}
.tcard-header__actions { display: inline-flex; gap: 8px; flex-shrink: 0; }

.tcard-hero {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: var(--sp-6);
  align-items: center;
  padding: var(--sp-4) var(--sp-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
}
.tcard-hero__price {
  border-right: 1px solid var(--border-1);
  padding-right: var(--sp-5);
}
.tcard-hero__price-label {
  font-size: 11px; color: var(--text-3); text-transform: uppercase;
  letter-spacing: .06em; font-weight: var(--fw-medium); margin-bottom: 4px;
}
.tcard-hero__price-value {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: var(--fs-32); line-height: 1; font-weight: var(--fw-bold);
  letter-spacing: -.01em;
}
.tcard-hero__price-hint { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.tcard-hero__deadline {
  display: flex; flex-direction: column; gap: 4px;
}
.tcard-hero__deadline-label {
  font-size: 11px; color: var(--text-3); text-transform: uppercase;
  letter-spacing: .06em; font-weight: var(--fw-medium);
}
.tcard-hero__deadline-value {
  font-family: var(--font-mono); font-size: var(--fs-20);
  font-weight: var(--fw-semibold);
}
.tcard-hero__deadline-countdown {
  font-size: var(--fs-13); color: var(--danger-700);
  font-weight: var(--fw-medium);
}

/* Workflow в шапке — главный жест на странице */
.tcard-workflow {
  margin-top: var(--sp-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
}
.tcard-workflow__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-3);
}
.tcard-workflow__current {
  font-size: var(--fs-13); color: var(--text-3);
}
.tcard-workflow__current strong { color: var(--text-1); font-weight: var(--fw-semibold); }

/* — Tabs в карточке (закреплённые) — */
.tcard-tabs {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 6px;
  padding: 10px 0 0;
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-1);
  margin-bottom: var(--sp-5);
  overflow-x: auto;
}
.tcard-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  font-size: var(--fs-13); color: var(--text-2); font-weight: var(--fw-medium);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  cursor: pointer;
}
.tcard-tab:hover { color: var(--text-1); }
.tcard-tab--active {
  color: var(--accent-700);
  border-bottom-color: var(--accent-500);
  font-weight: var(--fw-semibold);
}
.tcard-tab__count {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-3);
}

/* — Секции внутри карточки — */
.tcard-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-4);
  overflow: hidden;
}
.tcard-section__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-1);
}
.tcard-section__title {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--fs-13); color: var(--text-2); font-weight: var(--fw-semibold);
  text-transform: uppercase; letter-spacing: .04em;
}
.tcard-section__body { padding: var(--sp-4); }
.tcard-section__body--p0 { padding: 0; }

/* — Name/value layout (Продукты, Сроки, Финансы) — */
.kv { display: grid; grid-template-columns: 220px 1fr; gap: 12px 24px; }
.kv__name { color: var(--text-3); font-size: var(--fs-13); }
.kv__value { color: var(--text-1); font-size: var(--fs-14); }
.kv__value--mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }


/* ============================================================
   AI ANALYSIS CARD — отдельный визуальный код (info-фиолетовый),
   чтобы отличать «AI/автомат» от ручных данных
   ============================================================ */

.ai-card {
  background: linear-gradient(135deg, var(--info-50) 0%, var(--bg-surface) 60%);
  border: 1px solid #d8d3ec;
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-4);
  overflow: hidden;
  position: relative;
}
.ai-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--info-500), #9489d8, var(--accent-500));
}
.ai-card__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid #e6e1f5;
}
.ai-card__title {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--fs-13); color: var(--info-500); font-weight: var(--fw-semibold);
  text-transform: uppercase; letter-spacing: .06em;
}
.ai-card__title-icon {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--info-500); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.ai-card__updated { font-size: 11px; color: var(--text-3); }
.ai-card__body { padding: var(--sp-4); }

.ai-verdict {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-3);
}
.ai-verdict__score {
  flex-shrink: 0;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--success-50); color: var(--success-700);
  border: 2px solid var(--success-500);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 18px; font-weight: var(--fw-bold);
}
.ai-verdict--warn .ai-verdict__score { background: var(--warn-50); color: var(--warn-700); border-color: var(--warn-500); }
.ai-verdict--danger .ai-verdict__score { background: var(--danger-50); color: var(--danger-700); border-color: var(--danger-500); }
.ai-verdict__label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; font-weight: var(--fw-medium); margin-bottom: 4px; }
.ai-verdict__recommend { font-size: var(--fs-17); font-weight: var(--fw-bold); }
.ai-verdict__reason { font-size: var(--fs-13); color: var(--text-2); margin-top: 4px; line-height: 1.45; }

.ai-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: var(--sp-3); }
.ai-list:last-child { margin-bottom: 0; }
.ai-list__head {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: var(--fw-semibold);
  margin-bottom: 4px;
}
.ai-list__head--good { color: var(--success-700); }
.ai-list__head--risk { color: var(--warn-700); }
.ai-list__head--note { color: var(--info-500); }

.ai-item {
  display: grid; grid-template-columns: 20px 1fr; gap: 10px;
  font-size: var(--fs-13); line-height: 1.5;
}
.ai-item__icon {
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ai-item__icon--good { background: var(--success-50); color: var(--success-700); }
.ai-item__icon--risk { background: var(--warn-50); color: var(--warn-700); }
.ai-item__icon--note { background: var(--info-50); color: var(--info-500); }
.ai-item__icon [data-lucide] { width: 11px; height: 11px; }

.ai-card__footer {
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-canvas);
  border-top: 1px solid var(--border-1);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  font-size: var(--fs-12); color: var(--text-3);
}


/* ============================================================
   9. EMPTY STATES — сквозной слой
   ============================================================ */

.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: var(--sp-10) var(--sp-6);
  gap: var(--sp-3);
}
.empty--inline {
  padding: var(--sp-7) var(--sp-4);
  background: var(--bg-surface);
  border: 1px dashed var(--border-2);
  border-radius: var(--r-lg);
}
.empty__illu {
  width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--bg-sunken);
  color: var(--text-3);
  margin-bottom: var(--sp-2);
}
.empty__illu--accent { background: var(--accent-50); color: var(--accent-600); }
.empty__illu--success { background: var(--success-50); color: var(--success-700); }
.empty__illu [data-lucide] { width: 30px; height: 30px; }
.empty__title {
  font-size: var(--fs-17); font-weight: var(--fw-semibold); color: var(--text-1);
}
.empty__hint {
  font-size: var(--fs-14); color: var(--text-3);
  max-width: 420px; text-wrap: pretty;
}
.empty__cta { margin-top: var(--sp-2); display: inline-flex; gap: 8px; }
.empty__tip {
  margin-top: var(--sp-3);
  padding: 10px 14px;
  background: var(--bg-sunken);
  border-radius: var(--r-md);
  font-size: var(--fs-12); color: var(--text-2);
  max-width: 480px;
}


/* ============================================================
   10. AUTH — login
   ============================================================ */

.auth {
  min-height: 100vh; padding: var(--sp-8);
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 20% 30%, var(--accent-50) 0, transparent 40%),
    radial-gradient(circle at 80% 70%, #f5efe5 0, transparent 50%),
    var(--bg-canvas);
}
.auth__card {
  width: 100%; max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: var(--r-xl);
  padding: var(--sp-7);
  box-shadow: var(--shadow-2);
}
.auth__logo { display: flex; align-items: center; gap: 8px; margin-bottom: var(--sp-5);
  font-size: var(--fs-17); font-weight: var(--fw-bold);
}
.auth__title { font-size: var(--fs-24); line-height: var(--lh-24); font-weight: var(--fw-bold); }
.auth__subtitle { margin-top: 6px; font-size: var(--fs-14); color: var(--text-3); margin-bottom: var(--sp-5); }
.auth__footer {
  margin-top: var(--sp-5); padding-top: var(--sp-4);
  border-top: 1px solid var(--border-1);
  font-size: var(--fs-13); color: var(--text-3);
}
.auth__footer .mono { color: var(--text-1); background: var(--bg-sunken); padding: 1px 6px; border-radius: var(--r-xs); }


/* ============================================================
   11. UTILITIES
   ============================================================ */

.mono { font-family: var(--font-mono); font-feature-settings: 'tnum','zero'; font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.secondary { color: var(--text-2); }
.text-1 { color: var(--text-1); }
.text-accent { color: var(--accent-700); }
.text-success { color: var(--success-700); }
.text-warn { color: var(--warn-700); }
.text-danger { color: var(--danger-700); }

.eyebrow {
  font-size: var(--fs-11); color: var(--text-3);
  text-transform: uppercase; letter-spacing: .08em; font-weight: var(--fw-medium);
}

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-baseline { align-items: baseline; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-5 { gap: 20px; } .gap-6 { gap: 24px; }
.flex-1 { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.nowrap { white-space: nowrap; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-5 { margin-top: 20px; } .mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 20px; } .mb-6 { margin-bottom: 24px; }

.text-sm { font-size: var(--fs-13); }
.text-xs { font-size: var(--fs-12); }
.text-xxs { font-size: var(--fs-11); }
.fw-medium { font-weight: var(--fw-medium); }
.fw-semibold { font-weight: var(--fw-semibold); }
.fw-bold { font-weight: var(--fw-bold); }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
