/* ── Delvin PDA — Base ────────────────────────────────────────────────────
   Design system: دو حالت روشن/تاریک با یک پالت واحد
   Accent: بنفش-آبی (#6c5ce7)، secondary: فیروزه‌ای (#00b894)
   Typography: Vazirmatn + system-ui، یک خانواده، سه وزن
   ────────────────────────────────────────────────────────────────────── */

/* ── Font ─────────────────────────────────────────────────────────────── */
:root {
  --ff: Vazirmatn, "Noto Sans Arabic UI", "Segoe UI", system-ui, sans-serif;

  /* ── Type scale ────────────────────────────────────────────────────── */
  --text-xs:   .75rem;
  --text-sm:   .875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.375rem;
  --text-2xl:  1.75rem;
  --text-3xl:  2.25rem;

  /* ── Radius ────────────────────────────────────────────────────────── */
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   18px;
  --r-xl:   24px;
  --r-full: 999px;

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

  /* ── Motion ────────────────────────────────────────────────────────── */
  --ease-out: cubic-bezier(.2,.8,.2,1);
  --ease-in:  cubic-bezier(.5,.1,.8,.5);
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 350ms;
}

/* ── Light theme ──────────────────────────────────────────────────────── */
:root,
[data-theme="light"] {
  --bg:          #f4f3f8;
  --bg-2:        #eceaf4;
  --surface:     #ffffff;
  --surface-2:   #f8f7fc;
  --surface-raised: #ffffff;
  --border:      rgba(0,0,0,.08);
  --border-2:    rgba(0,0,0,.13);
  --text-primary:   #1a1830;
  --text-secondary: #5f5c7a;
  --text-muted:     #9896b0;
  --accent:         #6c5ce7;
  --accent-dim:     rgba(108,92,231,.12);
  --accent-2:       #00b894;
  --accent-2-dim:   rgba(0,184,148,.12);
  --danger:         #d63031;
  --danger-dim:     rgba(214,48,49,.1);
  --warning:        #e17055;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg: 0 8px 28px rgba(0,0,0,.1), 0 3px 8px rgba(0,0,0,.06);
  --overlay:   rgba(0,0,0,.35);

  /* Workspace colors */
  --ws-personal:  #6c5ce7;
  --ws-business:  #00b894;

  color-scheme: light;
}

/* ── Dark theme ───────────────────────────────────────────────────────── */
[data-theme="dark"],
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #0f0e1a;
    --bg-2:        #17152a;
    --surface:     #1e1b32;
    --surface-2:   #252240;
    --surface-raised: #2a2645;
    --border:      rgba(255,255,255,.07);
    --border-2:    rgba(255,255,255,.12);
    --text-primary:   #f0eefa;
    --text-secondary: #9896b8;
    --text-muted:     #5e5c78;
    --accent:         #a29bfe;
    --accent-dim:     rgba(162,155,254,.14);
    --accent-2:       #55efc4;
    --accent-2-dim:   rgba(85,239,196,.12);
    --danger:         #ff7675;
    --danger-dim:     rgba(255,118,117,.13);
    --warning:        #fd9644;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
    --shadow-md: 0 4px 14px rgba(0,0,0,.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,.5);
    --overlay:   rgba(0,0,0,.6);
    color-scheme: dark;
  }
}

[data-theme="dark"] {
  --bg:          #0f0e1a;
  --bg-2:        #17152a;
  --surface:     #1e1b32;
  --surface-2:   #252240;
  --surface-raised: #2a2645;
  --border:      rgba(255,255,255,.07);
  --border-2:    rgba(255,255,255,.12);
  --text-primary:   #f0eefa;
  --text-secondary: #9896b8;
  --text-muted:     #5e5c78;
  --accent:         #a29bfe;
  --accent-dim:     rgba(162,155,254,.14);
  --accent-2:       #55efc4;
  --accent-2-dim:   rgba(85,239,196,.12);
  --danger:         #ff7675;
  --danger-dim:     rgba(255,118,117,.13);
  --warning:        #fd9644;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow-md: 0 4px 14px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.5);
  --overlay:   rgba(0,0,0,.6);
  color-scheme: dark;
}

/* ── Reset ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font: 400 var(--text-base)/1.75 var(--ff);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font: inherit; }
input, select, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── Typography utilities ─────────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { margin: 0 0 .5em; font-weight: 700; line-height: 1.3; }
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
p  { margin: 0 0 .75em; }
.text-xs  { font-size: var(--text-xs); }
.text-sm  { font-size: var(--text-sm); }
.text-lg  { font-size: var(--text-lg); }
.text-muted    { color: var(--text-muted); }
.text-secondary{ color: var(--text-secondary); }
.text-accent   { color: var(--accent); }
.text-danger   { color: var(--danger); }
.text-success  { color: var(--accent-2); }
.ltr { direction: ltr; text-align: left; }
.rtl { direction: rtl; text-align: right; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }

/* ── Scrollbar ────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: var(--r-full); }
