/* ============================================================
   main.css — Design tokens, base styles, typography (RTL Arabic)
   ============================================================ */

:root {
  /* Brand colors */
  --primary: #6FAED9;
  --primary-dark: #3E7FAE;
  --primary-darker: #2F658C;
  --primary-light: #EAF5FC;

  --background: #FFFFFF;
  --surface: #F8FBFD;
  --surface-hover: #F1F7FB;

  --text-primary: #1F2933;
  --text-secondary: #667085;
  --text-muted: #98A2B3;

  --border: #D9E6EF;
  --border-strong: #C3D8E6;

  --success: #4F9D69;
  --success-bg: #EDF7F0;
  --danger: #C75C5C;
  --danger-bg: #FBEFEF;
  --warning: #C89B4B;
  --warning-bg: #FBF5EA;
  --info-bg: var(--primary-light);

  /* Typography */
  --font-family: "Segoe UI", "Tahoma", "Noto Kufi Arabic", "Arial", sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.8125rem;
  --font-size-base: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.375rem;
  --font-size-2xl: 1.75rem;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;

  /* Radius & shadow (subtle) */
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 2px rgba(31, 41, 51, 0.06);
  --shadow-md: 0 2px 8px rgba(31, 41, 51, 0.08);
  --shadow-lg: 0 8px 24px rgba(31, 41, 51, 0.12);

  /* Layout */
  --sidebar-width: 248px;
  --sidebar-collapsed-width: 64px;
  --topbar-height: 60px;

  --transition: 150ms ease;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--surface);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
}

p { margin: 0; }
a { color: var(--primary-dark); text-decoration: none; }
a:hover { color: var(--primary-darker); }

ul, ol { margin: 0; padding: 0; list-style: none; }

img { max-width: 100%; display: block; }

/* Numbers always LTR even inside RTL */
.num, .amount, .currency, td.num, .mono {
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
}

.amount--negative { color: var(--danger); }
.amount--positive { color: var(--success); }

/* ---------- Focus / Accessibility ---------- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Utilities ---------- */
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-center { text-align: center; }
.fw-semibold { font-weight: 600; }
.fw-bold { font-weight: 700; }
.fs-sm { font-size: var(--font-size-sm); }
.fs-lg { font-size: var(--font-size-lg); }

.d-flex { display: flex; }
.d-grid { display: grid; }
.d-none { display: none !important; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.w-100 { width: 100%; }
