/*
 * Design tokens. Every colour, spacing step, radius and type size used by the
 * admin panel and the public pages comes from here.
 */
:root {
  /* Typography (phase 8.1: the whole scale moved one step down - IRANSans reads large) */
  --font-sans: 'IRANSans', system-ui, -apple-system, 'Segoe UI', Tahoma, Arial, sans-serif;
  --font-fa-num: 'IRANSansFaNum', var(--font-sans);
  --fs-xs: 0.6875rem; /* 11px */
  --fs-sm: 0.75rem;   /* 12px */
  --fs-base: 0.875rem; /* 14px */
  --fs-md: 0.9375rem; /* 15px */
  --fs-lg: 1rem;      /* 16px */
  --fs-xl: 1.125rem;  /* 18px */
  --fs-2xl: 1.375rem; /* 22px */
  --fs-input: 16px;   /* text controls: 16px on touch screens so iOS Safari does not zoom on focus */
  --lh-tight: 1.35;
  --lh-normal: 1.7;

  /* Brand: forest and sea greens for the northern coast */
  --c-primary-50: #f0fdfa;
  --c-primary-100: #ccfbf1;
  --c-primary-200: #99f6e4;
  --c-primary-500: #14b8a6;
  --c-primary-600: #0d9488;
  --c-primary-700: #0f766e;
  --c-primary-800: #115e59;
  --c-primary-900: #134e4a;
  --c-primary: var(--c-primary-700);
  --c-primary-hover: var(--c-primary-800);
  --c-on-primary: #ffffff;

  /* Neutrals */
  --c-bg: #f3f6f5;
  --c-surface: #ffffff;
  --c-surface-2: #f8faf9;
  --c-border: #dfe6e3;
  --c-border-strong: #c5cfca;
  --c-text: #17211e;
  --c-text-2: #4b5a55;
  --c-text-muted: #75847f;
  --c-sidebar-bg: #0f2f2b;
  --c-sidebar-text: #cfe3df;
  --c-sidebar-active: rgba(255, 255, 255, 0.1);

  /* Status */
  --c-success: #15803d;
  --c-success-bg: #ecfdf3;
  --c-success-border: #bbf7d0;
  --c-danger: #b91c1c;
  --c-danger-bg: #fef2f2;
  --c-danger-border: #fecaca;
  --c-warning: #a16207;
  --c-warning-bg: #fefce8;
  --c-warning-border: #fde68a;
  --c-info: #1d4ed8;
  --c-info-bg: #eff6ff;
  --c-info-border: #bfdbfe;
  /* One step stronger than the *-bg tints: icon chips that must stay visible on a tinted surface */
  --c-success-100: #dcfce7;
  --c-danger-100: #fee2e2;
  --c-warning-100: #fef3c7;
  --c-info-100: #dbeafe;
  /* Gender marks in people lists (mars / venus icons) */
  --c-male: #1d4ed8;
  --c-female: #be185d;

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;

  /* Radii, shadows, motion */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 999px;
  --sh-sm: 0 1px 2px rgba(23, 33, 30, 0.06);
  --sh-md: 0 4px 16px rgba(23, 33, 30, 0.08);
  --sh-lg: 0 12px 32px rgba(23, 33, 30, 0.14);
  --ease: 180ms ease;

  /* Layout */
  --topbar-h: 52px;
  --sidebar-w: 248px;
  --tabbar-h: 54px;
  --touch: 44px;
  --gutter: var(--sp-4);
  --content-max: 1120px;

  /* Device safe areas (notch / home indicator) for the installed PWA; 0 in a normal browser tab. */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

@media (min-width: 768px) {
  :root {
    --gutter: var(--sp-6);
    --topbar-h: 56px;
  }
}

/* Mouse / trackpad devices: no finger to hit, so controls drop to the usual 40px and text
   controls follow the body size (the 16px rule only matters for touch-screen Safari). */
@media (hover: hover) and (pointer: fine) {
  :root {
    --touch: 40px;
    --fs-input: var(--fs-base);
  }
}
