/* ==========================================================================
   Silver Star Inventory — Design Tokens
   ========================================================================== */

:root {
  /* Brand colors */
  --color-primary: #383710;
  --color-primary-light: #4a4918;
  --color-primary-dark: #232205;
  --color-primary-bg: #f0f0e8;
  /* Secondary is used selectively (highlights, active states, key actions,
     links) — the base hue is for accents/badges/outlines on light surfaces,
     not solid buttons: white text on --color-secondary measures ~2.6:1
     contrast, below WCAG AA (4.5:1) for normal text. --color-secondary-dark
     (~4.9:1) is what solid buttons/fills use instead; see .btn-secondary in
     components.css. */
  --color-secondary: #c69a6d;
  --color-secondary-light: #d1ae8a;
  --color-secondary-dark: #8b6c4c;
  --color-secondary-bg: #f9f5f0;
  --color-command-panel: #34360f;
  --color-command-panel-border: rgba(198, 154, 109, 0.36);
  --color-control-bg: #f4f4f4;

  /* Surfaces */
  --color-bg: #f6f7f5;
  --color-sidebar: #24230f;
  --color-sidebar-hover: #35331a;
  --color-sidebar-active: #423f1f;
  --color-sidebar-text: #cfceb8;
  --color-sidebar-text-muted: #8f8d72;
  --color-card: #ffffff;
  --color-border: #e3e5e1;
  --color-border-strong: #cfd2cc;
  --color-table-head: #eeeeee;

  /* Text */
  --color-text: #252621;
  --color-text-muted: #6b6f66;
  --color-text-faint: #9d9c8a;
  --color-text-on-primary: #f8f8f6;

  /* Status */
  --color-success: #15803d;
  --color-success-bg: #e3f0e8;
  --color-warning: #d97706;
  --color-warning-bg: #faefe1;
  --color-danger: #dc2626;
  --color-danger-bg: #fbe5e5;
  --color-info: #2563eb;
  --color-info-bg: #e5ecfd;

  /* Typography */
  --font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-xxl: 1.875rem;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* Spacing (8px base system) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 40px;
  --space-7: 48px;
  --space-8: 64px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 8px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(25, 28, 20, 0.08);
  --shadow-md: 0 8px 20px rgba(25, 28, 20, 0.1);
  --shadow-lg: 0 20px 48px rgba(25, 28, 20, 0.14);
  --shadow-focus: 0 0 0 3px rgba(198, 154, 109, 0.4);

  --page-wash: var(--color-bg);

  /* Motion */
  --transition-fast: 0.15s ease;
  --transition: 0.3s ease;
  --transition-slow: 0.45s ease;

  /* Layout */
  --sidebar-width: 264px;
  --sidebar-width-collapsed: 76px;
  --topbar-height: 68px;
  --z-topbar: 100;
  --z-sidebar: 90;
  --z-dropdown: 200;
  --z-modal-backdrop: 300;
  --z-modal: 310;
  --z-toast: 400;
  --z-tooltip: 500;
}

/* ---- Dark theme overrides ---- */
:root[data-theme="dark"] {
  --color-bg: #17160a;
  --color-sidebar: #17160a;
  --color-sidebar-hover: #26240f;
  --color-sidebar-active: #322f17;
  --color-card: #201f10;
  --color-border: #322f1c;
  --color-border-strong: #423e22;
  --color-command-panel: #27280d;
  --color-command-panel-border: rgba(198, 154, 109, 0.24);
  --color-control-bg: #292717;
  --color-table-head: #292717;

  --color-text: #f1f0e6;
  --color-text-muted: #b8b6a0;
  --color-text-faint: #837f65;
  --color-text-on-primary: #f8f8f6;

  --color-primary-bg: rgba(241, 240, 230, 0.12);
  --color-success-bg: rgba(21, 128, 61, 0.18);
  --color-warning-bg: rgba(217, 119, 6, 0.18);
  --color-danger-bg: rgba(220, 38, 38, 0.18);
  --color-info-bg: rgba(37, 99, 235, 0.18);
  --color-secondary-bg: rgba(198, 154, 109, 0.16);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);

  --page-wash: var(--color-bg);
}
