/**
 * Denoma CRM ERP — design tokens (single source of truth)
 * Scope: web tryzubix (base.html). Do not redefine :root elsewhere.
 *
 * Brand teal: buttons / fills (#2b7a74).
 * Page chrome (menu cap + page headers): --color-shell (#0f172a).
 * Legacy --brutal-* aliases kept for brutal-design-clean.css.
 */

:root {
    /* ── Brand ── */
    --color-brand-light: #3d9e97;
    --color-brand: #2b7a74;
    --color-brand-dark: #205c57;
    --color-brand-soft: #e8f2f1;
    --color-brand-hover: #b7d4d1;
    --color-brand-rgb: 43, 122, 116;
    --color-on-brand: #ffffff;

    /* Shell chrome — same as left menu header */
    --color-shell: #0f172a;
    --color-shell-mid: #1a2332;

    /* Public landing accent. Cabinet buttons stay teal. */
    --color-land: #ff7a18;
    --color-land-hot: #ffb020;
    --color-land-rgb: 255, 122, 24;

    /* Fullxy mark (F / X) — landing + auth on dark */
    --color-mark-from: #4f7dff;
    --color-mark-to: #7c5cff;
    --color-mark-rgb: 79, 125, 255;

    /* Nova Poshta (page headers / NP flows) */
    --color-np: #e8352b;
    --color-np-dark: #c8102e;

    /* ── Surfaces ── */
    --bg-primary: #f8f9fa;
    --bg-secondary: #e9ecef;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --bg-white: #ffffff;
    --bg-subtle: #f1f5f9;

    /* ── Text ── */
    --text-primary: #212529;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    --text-ink: #2c3e50;
    --text-slate: #334155;

    /* ── Semantic accents ── */
    --accent-primary: var(--color-brand);
    --accent-primary-dark: var(--color-brand-dark);
    --accent-success: #28a745;
    --accent-success-strong: #16a34a;
    --accent-success-soft: #dcfce7;
    --accent-warning: #ffc107;
    --accent-danger: #dc3545;
    --accent-danger-strong: #dc2626;
    --accent-danger-soft: #fee2e2;
    --accent-danger-dark: #bb2d3b;
    --accent-info: #17a2b8;
    --color-info-soft: #e3f2fd;

    /* ── Borders / shadows ── */
    --border-color: #dee2e6;
    --border-input: #ced4da;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);

    /* ── Radii ── */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --badge-radius: var(--radius-md);

    /* ── Buttons (dn-buttons.css) ── */
    --btn-height: 36px;
    --btn-height-sm: 32px;
    --btn-pad-x: 1.1rem;
    --btn-pad-x-sm: 0.75rem;
    --btn-font: 0.82rem;
    --btn-font-sm: 0.78rem;
    --btn-weight: 700;
    --btn-radius: var(--radius-sm);
    --btn-focus-ring: 0 0 0 3px rgba(var(--color-brand-rgb), 0.22);

    /* ── Inputs (sidebars / forms) ── */
    --input-height: 32px;
    --input-pad-y: 0.25rem;
    --input-pad-x: 0.5rem;
    --input-font: 0.82rem;
    --input-radius: var(--radius-sm);

    /* ── Right sidebars: last opened must sit above (dn-sidebar-stack.js) ── */
    --dn-sidebar-z: 1060;
    --dn-sidebar-z-product: 12050;
    --dn-sidebar-z-stack: 12200;

    /* ── Shell layout ── */
    --page-header-height: 50px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* ── App shell sidebar (values that won over brutal in base.html) ── */
    --sidebar-width: 200px;
    --sidebar-collapsed-width: 50px;
    --sidebar-bg: #343a40;
    --sidebar-header-bg: var(--color-shell);
    --sidebar-text: #ffffff;
    --sidebar-hover: #495057;
    --sidebar-active: var(--color-brand);

    /* ── Legacy aliases (brutal-design-clean) ── */
    --brutal-bg: var(--bg-card);
    --brutal-darker: var(--bg-primary);
    --brutal-accent: var(--accent-primary);
    --brutal-success: var(--accent-success);
    --brutal-warning: var(--accent-warning);
    --brutal-danger: var(--accent-danger);
    --brutal-text: var(--text-primary);
    --brutal-text-muted: var(--text-muted);
    --brutal-border: var(--border-color);
    --brutal-card-bg: var(--bg-card);
    --brutal-shadow: var(--shadow-md);
    --brutal-radius: var(--radius-md);
    --brutal-border-width: 1px;

    /* ── Warehouse aliases (scoped roots re-export these) ── */
    --wc-teal: var(--color-brand);
    --wc-teal-dark: var(--color-brand-dark);
    --wc-teal-soft: var(--color-brand-soft);
    --wc-teal-hover: var(--color-brand-hover);
    --wc-text: var(--text-ink);
    --wc-muted: var(--text-muted);
    --wc-line: var(--bg-secondary);

    --wd-accent: var(--color-brand);
    --wd-accent-soft: var(--color-brand-soft);
    --wd-hover: var(--color-info-soft);
    --wd-text: var(--text-ink);
    --wd-muted: var(--text-muted);
    --wd-line: var(--bg-secondary);
    --wd-header-bg: var(--bg-secondary);

    /* ── Document sidebars (.ds-*) ── */
    --ds-panel-bg: var(--bg-white);
    --ds-soft: #f0fdf9;
    --ds-row-line: #f1f3f5;
    --ds-grid-line: #e5e7eb;
    --ds-muted: #6b7280;
    --ds-muted-2: #9ca3af;
    --ds-text: var(--text-primary);
    --ds-text-strong: #111827;
    --ds-text-mid: #374151;
    --ds-line-soft: #f3f4f6;
    --ds-menu-hover: #f3f4f6;
    --ds-rose: #e11d48;
    --ds-rose-soft: #fef2f2;
    --ds-rose-ring: #fda4af;
    --ds-save: var(--accent-success-strong);
    --ds-save-hover: #15803d;

    --status-ok-bg: #d1fae5;
    --status-ok-fg: #065f46;
    --status-draft-bg: #fef9c3;
    --status-draft-fg: #854d0e;
    --status-cancel-bg: var(--accent-danger-soft);
    --status-cancel-fg: #991b1b;
    --status-transfer-bg: #ede9fe;
    --status-transfer-fg: #5b21b6;

    /* Soft status badges (shared components.css) */
    --status-pending-bg: #fef3c7;
    --status-pending-fg: #92400e;
    --status-pending-border: #fcd34d;
    --status-processing-bg: #dbeafe;
    --status-processing-fg: #1e40af;
    --status-processing-border: #93c5fd;
    --status-completed-bg: #dcfce7;
    --status-completed-fg: #15803d;
    --status-completed-border: #86efac;
    --status-cancelled-bg: #fee2e2;
    --status-cancelled-fg: #b91c1c;
    --status-cancelled-border: #fca5a5;
    --status-hold-bg: #d5e0dc;
    --status-hold-fg: #3a524e;
    --status-hold-border: #9aafa9;
    --status-refunded-bg: #ede9fe;
    --status-refunded-fg: #6d28d9;
    --status-refunded-border: #c4b5fd;

    /* List tables */
    --bg-page-soft: #f1f5f4;
    --bg-table-head: #f1f5f4;
    --bg-table-hover: #f6faf9;
    --border-table: #dde3e2;
    --border-table-strong: #d0d9d8;
    --border-table-row: #eef1f0;
    --text-table-head: #5a7270;

    /* Doc-type header gradients */
    --ds-hdr-sale-from: #16a34a;
    --ds-hdr-sale-to: #15803d;
    --ds-hdr-return-from: #ea580c;
    --ds-hdr-return-to: #c2410c;
    --ds-hdr-income-from: #2563eb;
    --ds-hdr-income-to: #1d4ed8;
    --ds-hdr-writeoff-from: #dc2626;
    --ds-hdr-writeoff-to: #b91c1c;
    --ds-hdr-inventory-from: var(--color-brand);
    --ds-hdr-inventory-to: var(--color-brand-dark);
    --ds-hdr-transfer-from: #7c3aed;
    --ds-hdr-transfer-to: #6d28d9;
    --ds-hdr-shipment-from: #4f46e5;
    --ds-hdr-shipment-to: #3730a3;
    --ds-hdr-cash-from: #0f766e;
    --ds-hdr-cash-to: #0d9488;
}
