/* ERP design tokens — Al-Serehi palette (teal-green + gold, from alserehi.com)
   Light is the default; set data-theme="dark" on <html> for dark.
   Direction: set dir="rtl" and lang="ar" on <html>; components use logical properties. */

:root, [data-theme="light"] {
  /* Typography */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-arabic: "Cairo", "Segoe UI", Tahoma, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --fs-11: 11px;
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-16: 16px;
  --fs-18: 18px;
  --fs-20: 20px;
  --fs-24: 24px;
  --fs-30: 30px;
  --fs-36: 36px;
  --lh-tight: 1.25;
  --lh-base: 1.5;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  /* Spacing (8px grid) */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 48px;
  --space-9: 64px;
  /* Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-full: 999px;
  /* Sizing */
  --control-sm: 32px;
  --control-md: 40px;
  --control-lg: 48px;
  --row-h: 44px;
  --topbar-h: 56px;
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 64px;
  /* Motion */
  --ease: cubic-bezier(.2, 0, 0, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 320ms;
  /* Brand scales — "navy" holds the teal-green scale and "copper" the gold scale
     (names kept so existing var(--navy-*) / var(--copper-*) references keep working) */
  --navy-950: #041A1F;
  --navy-900: #07252B;
  --navy-800: #092D34;
  --navy-700: #12474F;
  --navy-600: #196066;
  --navy-300: #9CC3C6;
  --navy-100: #E3EFF0;
  --navy-50: #F2F8F8;
  --copper-800: #6E4F0C;
  --copper-700: #8F6810;
  --copper-600: #B8860B;
  --copper-500: #E8B130;
  --copper-300: #E8C87D;
  --copper-100: #FCF5E3;
  --slate-700: #4E4C54;
  --slate-600: #6B6973;
  --slate-500: #8A888F;
  --slate-300: #C4C3C8;
  --slate-100: #EEEEF0;
  /* Surfaces */
  --bg-page: #F4F6F6;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F8FAFA;
  --bg-sunken: #ECF1F1;
  --bg-hover: #EFF5F5;
  --bg-selected: #E3EFF0;
  --bg-overlay: rgba(4, 26, 31, .48);
  --border: #D3DCDD;
  --border-subtle: #E5EBEB;
  --border-strong: #A9B9BB;
  /* Text */
  --text-primary: #10211F;
  --text-secondary: #3A4B4C;
  --text-muted: #6B6973;
  --text-disabled: #A3A1A8;
  --text-on-brand: #FFFFFF;
  --text-link: #196066;
  /* Actions */
  --action-primary: #196066;
  --action-primary-hover: #12474F;
  --action-primary-active: #092D34;
  --action-primary-fg: #FFFFFF;
  --action-secondary-fg: #092D34;
  --action-secondary-border: #196066;
  --action-secondary-hover: #E3EFF0;
  --action-danger: #B42318;
  --action-danger-hover: #912018;
  --action-danger-fg: #FFFFFF;
  --brand: #092D34;
  --brand-subtle: #E3EFF0;
  --accent: #E8B130;
  --accent-subtle: #FCF5E3;
  --focus-ring: #2A8A91;
  /* Navigation */
  --nav-bg: #092D34;
  --nav-fg: #C9DCDD;
  --nav-fg-muted: #8FB0B3;
  --nav-hover: #0F3A42;
  --nav-active-bg: #145058;
  --nav-active-fg: #FFFFFF;
  --nav-icon-active: #E8B130;
  --nav-border: #134048;
  /* Status */
  --st-draft-bg: #EEF0F2;
  --st-draft-fg: #48515A;
  --st-pending-bg: #FDF1D6;
  --st-pending-fg: #8A5300;
  --st-approved-bg: #E3EFF0;
  --st-approved-fg: #092D34;
  --st-partial-bg: #EEEAFB;
  --st-partial-fg: #4F35A1;
  --st-invoiced-bg: #E1F2E8;
  --st-invoiced-fg: #1B6B41;
  --st-cancelled-bg: #FCE9E8;
  --st-cancelled-fg: #A3261B;
  /* Feedback */
  --success: #1B7A48;
  --success-subtle: #E1F2E8;
  --warning: #9A5800;
  --warning-subtle: #FDF1D6;
  --danger: #B42318;
  --danger-subtle: #FCE9E8;
  --info: #196066;
  --info-subtle: #E3EFF0;
  /* Charts */
  --chart-1: #196066;
  --chart-2: #E8B130;
  --chart-3: #6FB1B6;
  --chart-4: #8A888F;
  --chart-5: #5B7FA6;
  --chart-grid: #E7EAEE;
  --chart-axis: #6B6973;
  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(9, 45, 52, .06);
  --shadow-sm: 0 1px 3px rgba(9, 45, 52, .08), 0 1px 2px rgba(9, 45, 52, .04);
  --shadow-md: 0 8px 24px rgba(9, 45, 52, .12), 0 2px 6px rgba(9, 45, 52, .06);
  --shadow-lg: 0 20px 48px rgba(9, 45, 52, .18), 0 4px 12px rgba(9, 45, 52, .08);
  --focus-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 4px var(--focus-ring);
}

[data-theme="dark"] {
  color-scheme: dark;
  /* Surfaces */
  --bg-page: #0A1214;
  --bg-surface: #111D20;
  --bg-subtle: #142226;
  --bg-sunken: #070D0F;
  --bg-hover: #182A2E;
  --bg-selected: #163A40;
  --bg-overlay: rgba(0, 0, 0, .6);
  --border: #2A3D41;
  --border-subtle: #1D2E32;
  --border-strong: #41585C;
  /* Text */
  --text-primary: #EEF1EC;
  --text-secondary: #C3D0CF;
  --text-muted: #8FA3A5;
  --text-disabled: #566A6D;
  --text-on-brand: #FFFFFF;
  --text-link: #7CC4C9;
  /* Actions */
  --action-primary: #E8B130;
  --action-primary-hover: #EDC15A;
  --action-primary-active: #F1CF7D;
  --action-primary-fg: #0A1214;
  --action-secondary-fg: #9FD0D4;
  --action-secondary-border: #3F8A90;
  --action-secondary-hover: #182A2E;
  --action-danger: #EF6F63;
  --action-danger-hover: #F38A80;
  --action-danger-fg: #111A22;
  --brand: #7CC4C9;
  --brand-subtle: #163A40;
  --accent: #E8B130;
  --accent-subtle: #3A3018;
  --focus-ring: #4FB0B7;
  /* Navigation */
  --nav-bg: #070F11;
  --nav-fg: #B8C9CA;
  --nav-fg-muted: #7B9395;
  --nav-hover: #122427;
  --nav-active-bg: #163A40;
  --nav-active-fg: #FFFFFF;
  --nav-icon-active: #E8B130;
  --nav-border: #172629;
  /* Status */
  --st-draft-bg: #26343F;
  --st-draft-fg: #C3CDD6;
  --st-pending-bg: #3A2E14;
  --st-pending-fg: #F2C46B;
  --st-approved-bg: #163A40;
  --st-approved-fg: #9FD0D4;
  --st-partial-bg: #2D2750;
  --st-partial-fg: #BDB0F5;
  --st-invoiced-bg: #173A2A;
  --st-invoiced-fg: #7FD3A5;
  --st-cancelled-bg: #43201E;
  --st-cancelled-fg: #F4A29A;
  /* Feedback */
  --success: #5CC98F;
  --success-subtle: #173A2A;
  --warning: #F2B45A;
  --warning-subtle: #3A2E14;
  --danger: #F28B82;
  --danger-subtle: #43201E;
  --info: #7CC4C9;
  --info-subtle: #163A40;
  /* Charts */
  --chart-1: #7CC4C9;
  --chart-2: #E8B130;
  --chart-3: #3F8A90;
  --chart-4: #8FA3A5;
  --chart-5: #5B9BD5;
  --chart-grid: #1D2E32;
  --chart-axis: #8FA3A5;
  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .45);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, .55);
}
