/* ═══════════════════════════════════════════════════════════════════
 * tokens.css — :root + темы (light/dark) + CSS-переменные + @import шрифтов
 * ═══════════════════════════════════════════════════════════════════
 * Сгенерировано: scripts/arch3_4_split_css.py
 * Источник: frontend/index.html (3 <style> блока)
 * ═══════════════════════════════════════════════════════════════════
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* ─── ФОНЫ (Молот v2) ─── */
  --bg0: #0a0a0c;
  --bg1: #141418;
  --bg2: #1c1c22;
  --bg3: #26262e;
  --bg4: #33333d;

  /* ─── АКЦЕНТ — warm orange ─── */
  --acc:        #ff6a2f;
  --acc-soft:   #ff6a2f1f;
  --acc-border: #ff6a2f55;
  --acc-dim:    #cc5424;

  /* ─── ТЕКСТ ─── */
  --fg0: #f5f5f7;
  --fg1: #a8a8b3;
  --fg2: #6e6e7a;
  --fg3: #48484f;

  /* ─── СТАТУСЫ ─── */
  --green:       #30d158;
  --green-soft:  #30d15820;
  --red:         #ff453a;
  --red-soft:    #ff453a20;
  --blue:        #0a84ff;
  --blue-soft:   #0a84ff20;
  --yellow:      #ffd60a;
  --yellow-soft: #ffd60a20;
  --purple:      #bf5af2;
  --purple-soft: #bf5af220;

  /* ─── ЯНТАРЬ (цены, числа) ─── */
  --amber:        #f59e0b;
  --amber-bg:     rgba(245,158,11,0.08);
  --amber-border: rgba(245,158,11,0.2);

  /* ─── ТИПОГРАФИКА ─── */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  /* ─── РАДИУСЫ (iOS scale) ─── */
  --r1: 6px;
  --r2: 10px;
  --r3: 14px;
  --r4: 18px;
  --r5: 24px;

  /* ─── ТЕНИ ─── */
  --shadow1: 0 1px 2px rgba(0,0,0,.4), 0 0 0 1px #ffffff08;
  --shadow2: 0 4px 16px rgba(0,0,0,.5), 0 0 0 1px #ffffff0a;
  --shadow3: 0 12px 40px rgba(0,0,0,.6), 0 0 0 1px #ffffff0d;
  --glow-acc: 0 0 0 1px #ff6a2f44, 0 8px 24px #ff6a2f22;

  /* ─── ОБРАТНАЯ СОВМЕСТИМОСТЬ ─── */
  --border:  var(--bg4);
  --border2: var(--bg3);

  /* ─── СТАТУСНЫЕ ФОНЫ/БОРДЕРЫ (явно для всех тем) ─── */
  --green-bg:     rgba(48,209,88,0.10);
  --green-border: rgba(48,209,88,0.30);
  --red-bg:       rgba(255,69,58,0.10);
  --red-border:   rgba(255,69,58,0.30);
  --yellow-bg:    rgba(255,214,10,0.10);
  --yellow-border:rgba(255,214,10,0.30);
  --blue-bg:      rgba(10,132,255,0.10);
  --blue-border:  rgba(10,132,255,0.30);
  --purple-bg:    rgba(191,90,242,0.10);
  --purple-border:rgba(191,90,242,0.30);
}

[data-theme="light"] {
  /* Фоны: от чисто-белого (страница) к светло-серому (бары/панели) */
  --bg0: #ffffff;     /* фон страницы */
  --bg1: #f7f7fa;     /* карточки, основные блоки */
  --bg2: #eeeef2;     /* бары, хедеры, panels-deep */
  --bg3: #e0e0e6;     /* hover, border-soft */
  --bg4: #d1d1d6;     /* основная граница */

  /* Акцент (оранжевый — тот же, чуть холоднее в soft варианте) */
  --acc:        #ff6a2f;
  --acc-soft:   rgba(255,106,47,0.10);
  --acc-border: rgba(255,106,47,0.45);
  --acc-dim:    #cc5424;

  /* Текст: тёмный → серый → светло-серый (инверсия) */
  --fg0: #1d1d1f;     /* основной текст */
  --fg1: #5a5a60;     /* вторичный */
  --fg2: #8a8a90;     /* приглушённый */
  --fg3: #c0c0c6;     /* еле видный */

  /* Статусы (чуть темнее для контраста на белом) */
  --green:        #28a745;
  --green-soft:   rgba(40,167,69,0.12);
  --green-bg:     rgba(40,167,69,0.10);
  --green-border: rgba(40,167,69,0.35);
  --red:          #d32f2f;
  --red-soft:     rgba(211,47,47,0.12);
  --red-bg:       rgba(211,47,47,0.10);
  --red-border:   rgba(211,47,47,0.30);
  --blue:         #0066cc;
  --blue-soft:    rgba(0,102,204,0.12);
  --blue-bg:      rgba(0,102,204,0.08);
  --blue-border:  rgba(0,102,204,0.30);
  --yellow:       #b8860b;
  --yellow-soft:  rgba(184,134,11,0.12);
  --yellow-bg:    rgba(184,134,11,0.10);
  --yellow-border:rgba(184,134,11,0.30);
  --purple:       #7b1fa2;
  --purple-soft:  rgba(123,31,162,0.12);
  --purple-bg:    rgba(123,31,162,0.08);
  --purple-border:rgba(123,31,162,0.30);

  --amber:        #d97706;
  --amber-bg:     rgba(217,119,6,0.08);
  --amber-border: rgba(217,119,6,0.30);

  /* Тени — мягче на светлом */
  --shadow1: 0 1px 2px rgba(0,0,0,.06), 0 0 0 1px rgba(0,0,0,.03);
  --shadow2: 0 4px 14px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.04);
  --shadow3: 0 12px 32px rgba(0,0,0,.12), 0 0 0 1px rgba(0,0,0,.05);
  --glow-acc: 0 0 0 1px rgba(255,106,47,0.30), 0 6px 20px rgba(255,106,47,0.15);

  --border:  var(--bg4);
  --border2: var(--bg3);
}

[data-theme="light"] ::-webkit-scrollbar { background: var(--bg2); }

[data-theme="light"] ::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 4px; }

[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: var(--fg2); }

[data-theme="light"] input,
[data-theme="light"] textarea,
[data-theme="light"] select { color-scheme: light; }

[data-theme="light"] .feed-row,
[data-theme="light"] .cal-cell,
[data-theme="light"] .cal-week-hline,
[data-theme="light"] .cal-week-time,
[data-theme="light"] .cal-side__sec,
[data-theme="light"] .cal-side__ev-sub,
[data-theme="light"] .lots-table td,
[data-theme="light"] .archive-table td,
[data-theme="light"] .ap-header,
[data-theme="light"] .ap-result {
  border-bottom-color: var(--border) !important;
}

[data-theme="light"] .ap-result {
  border-top-color: var(--border) !important;
}

[data-theme="light"] .lot-row:hover td {
  background: rgba(0,0,0,0.025) !important;
}

[data-theme="light"] .ev-chip,
[data-theme="light"] .cal-task-chip {
  background: rgba(0,0,0,0.04) !important;
}

[data-theme="light"] .ev-chip:hover,
[data-theme="light"] .cal-task-chip:hover {
  background: rgba(0,0,0,0.07) !important;
}

[data-theme="light"] .chip--active .chip__cnt {
  background: rgba(255,255,255,0.35) !important;
  color: #fff !important;
}

[data-theme="light"] .cal-seg-btn.active {
  background: var(--bg0) !important;
  color: var(--fg0) !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08), 0 0 0 1px var(--border) !important;
}

[data-theme="light"] .detail-profit-badge {
  background: rgba(0,0,0,0.04) !important;
}

[data-theme="light"] .copy-tooltip,
[data-theme="light"] .toast {
  background: var(--fg0) !important;
  color: var(--bg0) !important;
}

[data-theme="light"] .modal-content,
[data-theme="light"] .lot-detail-modal,
[data-theme="light"] .cal-preview-panel,
[data-theme="light"] .as-modal-content,
[data-theme="light"] [class*="modal__"] {
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 0 0 1px var(--border) !important;
}

[data-theme="light"] .photos-grid img,
[data-theme="light"] .lot-photo {
  box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important;
}

[data-theme="light"] .lightbox,
[data-theme="light"] .photo-lightbox {
  background: rgba(0,0,0,0.9) !important;
}

[data-theme="light"] .modal-bg,
[data-theme="light"] .modal-overlay {
  background: rgba(0,0,0,0.5) !important;
}

[data-theme="light"] .lot-card,
[data-theme="light"] .stat-card,
[data-theme="light"] .calc-block,
[data-theme="light"] .verdict-banner,
[data-theme="light"] .verdict-molot {
  border-color: var(--border) !important;
}

[data-theme="light"] .lots-table thead {
  background: var(--bg2) !important;
}

[data-theme="light"] .archive-table thead {
  background: var(--bg2) !important;
}

[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="time"],
[data-theme="light"] input[type="search"],
[data-theme="light"] input[type="email"],
[data-theme="light"] textarea,
[data-theme="light"] select {
  background: var(--bg0) !important;
  color: var(--fg0) !important;
  border-color: var(--border) !important;
}

[data-theme="light"] input:focus,
[data-theme="light"] textarea:focus,
[data-theme="light"] select:focus {
  border-color: var(--acc) !important;
  outline: none;
}

[data-theme="light"] ::placeholder { color: var(--fg2) !important; opacity: 1; }

[data-theme="light"] ::-webkit-scrollbar { background: transparent; width: 10px; height: 10px; }

[data-theme="light"] ::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 5px; border: 2px solid var(--bg0); }

[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: var(--fg2); }

[data-theme="light"] ::-webkit-scrollbar-corner { background: transparent; }

[data-theme="light"] .lots-table tbody td:not(:last-child),
[data-theme="light"] .lots-table thead th:not(:last-child) { border-right: 1px solid rgba(0,0,0,0.05); }
