/* ==========================================================================
   AlleProfit Design System — CSS Custom Properties
   ========================================================================== */

:root {
  /* ---- Colors: Light Theme ---- */
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-hover: #f1f5f9;
  /* Subtle inset fill for badges/pills/info dots. Referenced with hardcoded
     light fallbacks (#eef2ff) across several JS modules — defining it here
     makes those theme-aware in dark mode (audit ALPR-58). */
  --color-bg-subtle: #eef2f8;
  --color-border: #e2e8f0;
  --color-text: #0f172a;
  --color-text-secondary: #64748b;
  /* AA bump (audit 2026-07-01): #94a3b8 was 2.56:1 on white (th, hints,
     empty-state copy). #64748b = 4.76:1. */
  --color-text-muted: #64748b;

  --color-primary: #ff5a00;
  --color-primary-hover: #e85100;
  --color-primary-light: #fff4eb;
  /* Near-black on brand orange (Allegro-style). White was 3.13:1 on #ff5a00
     (AA fail on every primary button); #1f1000 is ~9:1 in both themes. */
  --color-primary-text: #ffffff;

  --color-gold: #d4a017;
  --color-gold-hover: #b8890f;
  --color-gold-light: #fdf6e3;
  --color-gold-text: #92400e;

  --color-success: #10b981;
  --color-success-hover: #059669;
  --color-success-light: #d1fae5;
  --color-success-text: #065f46;

  --color-danger: #ef4444;
  --color-danger-hover: #dc2626;
  --color-danger-light: #fee2e2;
  --color-danger-text: #991b1b;

  --color-warning: #f59e0b;
  --color-warning-hover: #d97706;
  --color-warning-light: #fef3c7;
  --color-warning-text: #92400e;

  --color-info: #3b82f6;
  --color-info-light: #dbeafe;

  /* ---- Shadows ---- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.1);

  /* ---- Spacing ---- */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-5xl: 8rem;

  /* ---- Border Radii ---- */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;

  /* ---- Typography ---- */
  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;

  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;

  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-extrabold: 800;

  /* ---- Transitions ---- */
  --transition: 0.2s ease;
  --transition-slow: 0.3s ease;
  --transition-fast: 0.15s ease;

  /* ---- Z-Index Scale ---- */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  /* Toast must sit above blocking modals like the subscription-gate
     (zIndex 11000 inline) — otherwise post-payment toasts ("Płatność
     zaakceptowana") render under the gate and the user sees nothing. */
  --z-toast: 13000;

  /* ---- Layout ---- */
  --sidebar-width: 260px;
  --sidebar-collapsed: 64px;
  --topbar-height: 64px;
  --container-max: 1280px;
}

/* ==========================================================================
   Dark Theme
   ========================================================================== */

[data-theme='dark'] {
  --color-bg: #0b1121;
  --color-surface: #1a2332;
  --color-surface-hover: #243044;
  --color-bg-subtle: #243044;
  --color-border: #2d3b4e;
  --color-text: #f1f5f9;
  --color-text-secondary: #94a3b8;
  /* AA bump (audit 2026-07-01): #64748b was 2.79:1 on #243044 (all table
     headers) and 3.32:1 on surface. #8b9cb3 ≈ 4.6:1 on surface. */
  --color-text-muted: #8b9cb3;

  --color-primary: #ff8533;
  --color-primary-hover: #ff5a00;
  --color-primary-light: #2d1800;
  --color-primary-text: #ffffff;

  --color-gold: #e8b830;
  --color-gold-hover: #d4a017;
  --color-gold-light: #2d2200;
  --color-gold-text: #fde68a;

  --color-success-light: #064e3b;
  --color-success-text: #a7f3d0;

  /* #ef4444 in dark too - owner's call 2026-07-04 (the lighter AA-clearing
     #f87171 read washed-out on buttons/amounts). 4.19:1 on surface accepted. */
  --color-danger: #ef4444;
  --color-danger-light: #7f1d1d;
  --color-danger-text: #fecaca;

  --color-warning-light: #78350f;
  --color-warning-text: #fde68a;

  --color-info-light: #1e3a5f;

  /* Deeper shadows for dark mode */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.35);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.45);
}
