/* ══════════════════════════════════════════════════════════
   DESIGN TOKENS — semantic colour & sizing system
   ══════════════════════════════════════════════════════════
   Single source of truth for visual primitives. Module-level
   CSS files (estimates.css, catalog_sidebar.css, base.css)
   reference these tokens via var(--token-name).

   Theme overrides: a body[data-theme="X"] selector can later
   re-bind these vars to switch themes without touching the
   modules that consume them.
   ══════════════════════════════════════════════════════════ */
:root {
    /* === SURFACES (фоны) === */
    --bg-page: #f8fafc;            /* основной фон страницы */
    --bg-card: #ffffff;            /* фон карточек, таблиц, панелей */
    --bg-subtle: #f1f5f9;          /* лёгкий tint (hover, sub-headers) */
    --bg-elevated: #ffffff;        /* всплывающие блоки (popups, dropdowns) */
    --bg-tinted-blue: #eff6ff;     /* акцентный фон (selected category, info) */
    --bg-tinted-warning: #fef3c7;  /* hover на editable, warning highlights */
    --bg-tinted-success: #dcfce7;  /* success-tinted backgrounds */
    --bg-tinted-danger: #fef2f2;   /* danger-tinted backgrounds */

    /* === BORDERS === */
    --border-strong: #cbd5e1;      /* акцентные/hover границы */
    --border-default: #e2e8f0;     /* обычные границы */
    --border-subtle: #f1f5f9;      /* очень лёгкие разделители */

    /* === TEXT === */
    --text-primary: #334155;       /* основной текст */
    --text-secondary: #64748b;     /* ослабленный (muted) */
    --text-tertiary: #94a3b8;      /* третичный (light) */
    --text-inverse: #ffffff;       /* на тёмном фоне */
    --text-link: #2563eb;          /* ссылки */

    /* === ACCENT (primary brand) === */
    --accent-primary: #2563eb;
    --accent-primary-hover: #1d4ed8;
    --accent-primary-soft: #eff6ff;        /* blue-50, very light tint */
    --accent-primary-soft-strong: #dbeafe; /* blue-100, stronger tint */
    --accent-primary-border: #93c5fd;      /* blue-300, for tinted borders */
    --accent-primary-text: #ffffff;

    /* === STATUS === */
    --status-success: #22c55e;
    --status-success-soft: #dcfce7;
    --status-success-text: #166534;
    --status-warning: #eab308;
    --status-warning-soft: #fef9c3;
    --status-warning-text: #d97706;
    --status-danger: #ef4444;
    --status-danger-soft: #fef2f2;
    --status-danger-text: #dc2626;
    --status-info: #0ea5e9;
    --status-info-soft: #f0f9ff;
    --status-info-text: #0284c7;

    /* === ROLES (бейджи групп оборудования) === */
    --role-sound: #2563eb;         /* звук */
    --role-light: #eab308;         /* свет */
    --role-video: #7c3aed;         /* видео */
    --role-stage: #f97316;         /* сцена */
    --role-rigging: #475569;       /* такелаж */
    --role-logistics: #0ea5e9;     /* логистика */
    --role-consumables: #94a3b8;   /* расходники */
    --role-subrent: #d97706;       /* субаренда */

    /* === SHAPE === */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-pill: 999px;

    /* === MOTION === */
    --transition-fast: 0.15s ease;
    --transition-default: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* === GANTT panel (availability bottom sheet — intentionally dark for contrast) === */
    --gantt-panel-bg:          #0f172a;  /* slate-900 — panel background */
    --gantt-panel-bg-elev:     #1e293b;  /* slate-800 — tooltips, sub-elevations */
    --gantt-panel-text:        #e2e8f0;  /* slate-200 — primary text */
    --gantt-panel-text-bright: #f8fafc;  /* slate-50  — emphasized text */
    --gantt-panel-text-muted:  #94a3b8;  /* slate-400 — secondary text */
    --gantt-panel-text-dim:    #64748b;  /* slate-500 — tertiary text */
    --gantt-panel-text-faint:  #475569;  /* slate-600 — quaternary (date col) */
    --gantt-panel-text-accent: #cbd5e1;  /* slate-300 — names, accents */
    --gantt-panel-border:      rgba(255, 255, 255, 0.06);
    --gantt-panel-border-soft: rgba(255, 255, 255, 0.04);
    --gantt-panel-hover-bg:    rgba(255, 255, 255, 0.08);
    --gantt-panel-track-bg:    rgba(255, 255, 255, 0.06);
    --gantt-panel-grid-bg:     rgba(255, 255, 255, 0.03);

    /* === GANTT bar colours (booking bars colour-coded by relation to current estimate) === */
    --gantt-current:           #3b82f6;  /* current estimate's bookings */
    --gantt-current-conflict:  #ef4444;  /* current estimate when over capacity */
    --gantt-same-proj:         #8b5cf6;  /* other estimates of same project */
    --gantt-other:             #475569;  /* other projects (non-conflicting) */
    --gantt-other-conflict:    #f97316;  /* other projects when conflicting */
    --gantt-balance-full-bg:   rgba(34, 197, 94, 0.2);
    --gantt-balance-full-fg:   #4ade80;
    --gantt-balance-partial-bg:rgba(234, 179, 8, 0.25);
    --gantt-balance-partial-fg:#fbbf24;
    --gantt-balance-deficit:   #dc2626;
    --gantt-now-line:          rgba(59, 130, 246, 0.4);
    --gantt-day-today-bg:      rgba(59, 130, 246, 0.05);
    --gantt-day-weekend:       #334155;

    /* === SIDEBAR (left navigation, dark by default) === */
    --sidebar-bg-start: #1e293b;
    --sidebar-bg-end: #0f172a;
    --sidebar-text: #ffffff;
    --sidebar-text-muted: #94a3b8;
    --sidebar-item-hover: rgba(255, 255, 255, 0.08);
    --sidebar-item-active: var(--accent-primary);
    --sidebar-border: rgba(255, 255, 255, 0.1);

    /* === TOPBAR (Linear-style dark top nav, only in themes that use it) === */
    --topbar-bg: var(--bg-card);
    --topbar-text: var(--text-primary);
    --topbar-active: var(--accent-primary);
}
