/* ═══════════════════════════════════════════════════════════
   MAPA — base.css  |  reset · CSS vars · typography
   ═══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Theme tokens ─────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:    #07090f;
  --bg2:   #0b0f1a;
  --bg3:   #101422;
  --card:  #0d1120;
  --card2: #0f1627;
  --border:  rgba(255,255,255,0.065);
  --border2: rgba(255,255,255,0.13);
  --border3: rgba(255,255,255,0.22);
  --text:  #dde6f5;
  --text2: #8fa3c0;
  --text3: #4d6380;
  --sidebar-bg: linear-gradient(to bottom, #1976d1, #0d48a2);
  --th:   rgba(255,255,255,0.025);
  --row:  rgba(255,255,255,0.012);
  --shadow: rgba(0,0,0,0.45);
}

[data-theme="light"] {
  --bg:    #f0f4fa;
  --bg2:   #ffffff;
  --bg3:   #f5f8fc;
  --card:  #ffffff;
  --card2: #f5f8fc;
  --border:  rgba(0,0,0,0.07);
  --border2: rgba(0,0,0,0.14);
  --border3: rgba(0,0,0,0.22);
  --text:  #0f172a;
  --text2: #334155;
  --text3: #94a3b8;
  --sidebar-bg: linear-gradient(to bottom, #1976d1, #0d48a2);
  --th:   rgba(0,0,0,0.025);
  --row:  rgba(0,0,0,0.012);
  --shadow: rgba(0,0,0,0.15);
}

/* ── Brand palette (theme-independent) ───────────────────── */
:root {
  --blue:   #2563eb;  --blue2:   #3b82f6;
  --cyan:   #0891b2;  --cyan2:   #06b6d4;
  --green:  #059669;  --green2:  #10b981;
  --amber:  #d97706;  --amber2:  #f59e0b;
  --red:    #dc2626;  --red2:    #f87171;
  --purple: #7c3aed;  --purple2: #a78bfa;
  --teal:   #0d9488;  --teal2:   #2dd4bf;
  --orange: #ea580c;  --orange2: #fb923c;

  /* Layout */
  --sid-w:     228px;
  --sid-w-col: 56px;
  --top-h:     50px;
  --mob-nav-h: 56px;

  /* Animation */
  --ease: cubic-bezier(0.4,0,0.2,1);
  --dur:  0.15s;

  /* Radius scale — ONE rounding language app-wide.
     xs: bars/ticks · sm: inputs, chips, badges · md: cards, panels,
     buttons · lg: hero bands, modals · full: pills */
  --r-xs:   3px;
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-full: 999px;
}

/* Elevation scale — resting / raised / overlay. Theme-aware. */
[data-theme="dark"] {
  --sh-1: 0 1px 3px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.3);
  --sh-2: 0 4px 16px rgba(0,0,0,0.45);
  --sh-3: 0 24px 64px rgba(0,0,0,0.55);
}
[data-theme="light"] {
  --sh-1: 0 1px 3px rgba(15,23,42,0.07), 0 1px 2px rgba(15,23,42,0.04);
  --sh-2: 0 4px 16px rgba(15,23,42,0.12);
  --sh-3: 0 24px 64px rgba(15,23,42,0.18);
}

/* ── Global ───────────────────────────────────────────────── */
html { font-size: 14px; -webkit-tap-highlight-color: transparent; }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar (desktop) ─────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border3); }

/* ── Typography helpers ──────────────────────────────────── */
.text-muted  { color: var(--text3); }
.text-sub    { color: var(--text2); }
.mono        { font-family: "DM Mono", "Fira Mono", monospace; }
.weight-bold { font-weight: 700; }
.truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Utility ─────────────────────────────────────────────── */
.hidden   { display: none !important; }
.sr-only  { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.flex     { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-4    { gap: 4px; }
.gap-8    { gap: 8px; }
.gap-12   { gap: 12px; }
.gap-16   { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1   { flex: 1; }
.w-full   { width: 100%; }
.text-center { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.p-16  { padding: 16px; }

/* RTL support */
[lang="ar"] body, [dir="rtl"] { direction: rtl; }
