/* ============================================================
   المحاسبون الدوليون · HLB Saudi Arabia
   Design Tokens — sourced from the official HLB Saudi Arabia
   Design System (tokens/colors.css, spacing.css, typography.css).
   Brand anchors: petrol TEAL primary + warm AMBER CTA, cool
   blue-grey neutrals. Arabic-first typography layered on top.
   ============================================================ */

/* Webfonts — Arabic-first (Noto Kufi/Sans Arabic) + Hanken Grotesk
   (Latin, per HLB) + IBM Plex Mono (tabular figures/accounting data). */
@import url('https://fonts.googleapis.com/css2?family=Noto+Kufi+Arabic:wght@400;500;600;700;800&family=Noto+Sans+Arabic:wght@300;400;500;600;700&family=Hanken+Grotesk:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  /* ---- Brand: HLB Teal (primary / structural) — from official logo ---- */
  --hlb-teal-900: #00222C;
  --hlb-teal-800: #002E3B;
  --hlb-teal-700: #003E50;   /* pressed */
  --hlb-teal-600: #004F66;   /* hover */
  --hlb-teal-500: #005D77;   /* PRIMARY brand teal (logo) */
  --hlb-teal-400: #2C7E92;
  --hlb-teal-300: #5FA6B6;
  --hlb-teal-200: #A6CBD5;
  --hlb-teal-100: #D4E6EB;
  --hlb-teal-050: #E9F3F5;   /* tint surface */

  /* ---- Accent: HLB Amber (CTA / highlight) ---- */
  --hlb-amber-700: #B97D00;
  --hlb-amber-600: #DC9600;   /* hover */
  --hlb-amber-500: #F5A800;   /* PRIMARY cta amber */
  --hlb-amber-400: #FFC23D;
  --hlb-amber-200: #FBE2A6;
  --hlb-amber-100: #FDEFCB;
  --hlb-amber-050: #FFF8E8;

  /* ---- Ink / Neutrals (cool blue-grey) ---- */
  --ink-900: #14222A;
  --ink-800: #1F2E36;
  --ink-700: #364750;
  --ink-600: #4F5F68;
  --ink-500: #6B7A82;
  --ink-400: #94A2A9;
  --ink-300: #C2CDD2;
  --line-200: #DBE4E7;
  --line-100: #EAF0F2;
  --surface-100: #EDF3F4;
  --white: #FFFFFF;

  /* ---- Secondary accents (categories, charts) ---- */
  --accent-blue:    #1B75BC;
  --accent-green:   #4BA82E;
  --accent-purple:  #7A4D9F;
  --accent-magenta: #D6308B;
  --accent-gold:    #F5A800;
  --accent-sky:     #2E9BB5;

  /* ---- Semantic status ---- */
  --status-success: #2E9E5B;  --status-success-bg: #E7F5ED;
  --status-warning: #E09600;  --status-warning-bg: #FDF1DA;
  --status-danger:  #D64545;  --status-danger-bg:  #FBE9E9;
  --status-info:    #1B75BC;  --status-info-bg:    #E6F0F9;

  /* ---- Semantic aliases ---- */
  --color-brand:         var(--hlb-teal-500);
  --color-brand-hover:   var(--hlb-teal-600);
  --color-brand-pressed: var(--hlb-teal-700);
  --color-brand-tint:    var(--hlb-teal-050);
  --color-brand-on:      var(--white);

  --color-cta:         var(--hlb-amber-500);
  --color-cta-hover:   var(--hlb-amber-600);
  --color-cta-pressed: var(--hlb-amber-700);
  --color-cta-tint:    var(--hlb-amber-050);
  --color-cta-on:      var(--ink-900);

  --text-strong:   var(--ink-900);
  --text-body:     var(--ink-700);
  --text-muted:    var(--ink-500);
  --text-disabled: var(--ink-300);
  --text-on-brand: var(--white);
  --text-link:     var(--hlb-teal-600);

  --surface-page:    var(--surface-100);
  --surface-card:    var(--white);
  --surface-sunken:  var(--line-100);
  --surface-inverse: var(--hlb-teal-500);

  --border-default: var(--line-200);
  --border-strong:  var(--ink-300);
  --border-focus:   var(--hlb-teal-500);
  --focus-ring: 0 0 0 3px rgba(0, 93, 119, 0.30);

  /* ---- Typography — Arabic-first ---- */
  --font-display: "Noto Kufi Arabic", "Hanken Grotesk", "Segoe UI", Tahoma, sans-serif;
  --font-sans:    "Noto Sans Arabic", "Hanken Grotesk", "Segoe UI", Tahoma, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
  --font-heading: var(--font-display);
  --font-body:    var(--font-sans);

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

  --text-display: 44px; --text-h1: 34px; --text-h2: 26px; --text-h3: 21px;
  --text-h4: 18px; --text-lg: 17px; --text-base: 15px; --text-sm: 13.5px;
  --text-xs: 12.5px; --text-2xs: 11px;

  --leading-tight: 1.18; --leading-snug: 1.3; --leading-normal: 1.6; --leading-relaxed: 1.7;
  --tracking-tight: -0.01em; --tracking-wide: 0.06em;

  /* ---- Spacing (8px grid) ---- */
  --space-1: 2px; --space-2: 4px; --space-3: 8px; --space-4: 12px; --space-5: 16px;
  --space-6: 20px; --space-7: 24px; --space-8: 32px; --space-9: 40px; --space-10: 48px;
  --space-11: 64px; --space-12: 80px;

  /* ---- Radii ---- */
  --radius-xs: 3px; --radius-sm: 6px; --radius-md: 10px; --radius-lg: 16px;
  --radius-xl: 24px; --radius-pill: 999px;

  /* ---- Elevation ---- */
  --shadow-xs: 0 1px 2px rgba(28,31,42,0.06);
  --shadow-sm: 0 1px 3px rgba(28,31,42,0.08), 0 1px 2px rgba(28,31,42,0.04);
  --shadow-md: 0 4px 12px rgba(28,31,42,0.08), 0 2px 4px rgba(28,31,42,0.04);
  --shadow-lg: 0 12px 28px rgba(28,31,42,0.12), 0 4px 8px rgba(28,31,42,0.05);
  --shadow-xl: 0 24px 48px rgba(28,31,42,0.16);

  /* ---- Motion ---- */
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 120ms; --duration-base: 200ms; --duration-slow: 320ms;

  /* ---- Layout ---- */
  --sidebar-w: 268px;
  --topbar-h: 66px;
}

/* English / LTR mode → Latin-first families (Hanken Grotesk) */
html[dir="ltr"] {
  --font-display: "Hanken Grotesk", "Noto Kufi Arabic", "Segoe UI", sans-serif;
  --font-sans:    "Hanken Grotesk", "Noto Sans Arabic", "Segoe UI", sans-serif;
}

/* ---- Base reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-body);
  background: var(--surface-page);
  font-feature-settings: "tnum" 1;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-strong);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0;
}
p { margin: 0; }
a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
img { max-width: 100%; }
.figure, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
::selection { background: var(--hlb-teal-200); color: var(--ink-900); }

/* Accessibility: respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
