/* ============================================================================
   career-lens.sa — Operations OS · Design System
   "عدسة في الليل" — dark-elegant, mobile-first, RTL Arabic
   Premium references: Linear · Things 3 · Arc
   Single-file design system: reset · tokens · components · motion · RTL
   ============================================================================ */

/* ----------------------------------------------------------------------------
   0. FONTS
   IBM Plex Sans Arabic (Arabic UI) + Inter (numbers / latin)
   Add to <head>:
   <link rel="preconnect" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
   <link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
---------------------------------------------------------------------------- */

/* ============================================================================
   1. DESIGN TOKENS
   ============================================================================ */
:root {
  /* --- Color · raw palette ------------------------------------------------ */
  --ink-900: #07090F;   /* deepest — behind everything */
  --ink-800: #0B0D14;   /* app background (the night) */
  --ink-700: #0F1219;   /* sunken / scroll track */
  --surface: #12151F;   /* card surface */
  --surface-2: #161A26; /* nested surface */
  --elevated: #1A1E2D;  /* raised card / sheet / modal */
  --elevated-2: #20253629; /* hover wash */
  --hairline: #262B3B;  /* borders / dividers */
  --hairline-soft: #1E2330;

  /* --- Brand -------------------------------------------------------------- */
  --primary: #6E7BFF;          /* lens violet-blue — identity */
  --primary-strong: #5563F0;
  --primary-soft: #6E7BFF1F;   /* 12% tint */
  --primary-glow: #6E7BFF40;

  --accent: #22D3EE;           /* cyan light — CTA / energy / Turki */
  --accent-strong: #0EB6D6;
  --accent-soft: #22D3EE1A;
  --accent-glow: #22D3EE40;

  --gold: #E6B980;             /* warm — achievement / Hanadi */
  --gold-soft: #E6B98017;

  /* --- Semantic states ---------------------------------------------------- */
  --success: #34D399;   /* منشور / published */
  --success-soft: #34D39917;
  --pending: #FBBF24;   /* بالانتظار / pending */
  --pending-soft: #FBBF2417;
  --rejected: #FB7185;  /* مرفوض / rejected */
  --rejected-soft: #FB718517;
  --info: #60A5FA;
  --info-soft: #60A5FA17;

  /* --- Text --------------------------------------------------------------- */
  --text: #EDEFF7;         /* primary — warm white, not harsh */
  --text-secondary: #A8AEC2;
  --text-muted: #6B7287;
  --text-faint: #474D60;
  --text-on-accent: #051018;
  --text-on-primary: #0A0B14;

  /* --- Gradients ---------------------------------------------------------- */
  --grad-brand: linear-gradient(135deg, #6E7BFF 0%, #22D3EE 100%);
  --grad-brand-soft: linear-gradient(135deg, #6E7BFF1A 0%, #22D3EE12 100%);
  --grad-gold: linear-gradient(135deg, #E6B980 0%, #C98D5A 100%);
  --grad-surface: linear-gradient(180deg, #161A26 0%, #12151F 100%);
  --grad-sheen: linear-gradient(180deg, #FFFFFF0A 0%, #FFFFFF00 100%);
  --grad-app: radial-gradient(120% 80% at 50% -10%, #161B2E 0%, #0B0D14 55%);

  /* --- Glass -------------------------------------------------------------- */
  --glass-bg: #12151FCC;
  --glass-bg-strong: #0F1219E6;
  --glass-border: #FFFFFF0F;
  --glass-blur: 18px;

  /* --- Spacing scale (4px base) ------------------------------------------ */
  --sp-0: 0;
  --sp-1: 0.25rem;   /* 4 */
  --sp-2: 0.5rem;    /* 8 */
  --sp-3: 0.75rem;   /* 12 */
  --sp-4: 1rem;      /* 16 */
  --sp-5: 1.25rem;   /* 20 */
  --sp-6: 1.5rem;    /* 24 */
  --sp-8: 2rem;      /* 32 */
  --sp-10: 2.5rem;   /* 40 */
  --sp-12: 3rem;     /* 48 */
  --sp-16: 4rem;     /* 64 */

  /* --- Radii -------------------------------------------------------------- */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-2xl: 30px;
  --r-full: 999px;

  /* --- Shadows · soft, layered ------------------------------------------- */
  --sh-xs: 0 1px 2px #00000040;
  --sh-sm: 0 2px 8px #00000047, 0 1px 2px #0000003d;
  --sh-md: 0 8px 24px #0000005c, 0 2px 6px #00000040;
  --sh-lg: 0 18px 48px #00000070, 0 6px 16px #0000004d;
  --sh-xl: 0 28px 70px #0000008c, 0 10px 28px #00000059;
  --sh-glow-primary: 0 8px 30px -6px var(--primary-glow);
  --sh-glow-accent: 0 8px 30px -6px var(--accent-glow);
  --sh-inset-top: inset 0 1px 0 #FFFFFF0F;

  /* --- Typography --------------------------------------------------------- */
  --font-ar: "IBM Plex Sans Arabic", system-ui, -apple-system, sans-serif;
  --font-num: "Inter", "IBM Plex Sans Arabic", system-ui, sans-serif;

  --fs-2xs: 0.6875rem; /* 11 */
  --fs-xs: 0.75rem;    /* 12 */
  --fs-sm: 0.8125rem;  /* 13 */
  --fs-base: 0.9375rem;/* 15 */
  --fs-md: 1rem;       /* 16 */
  --fs-lg: 1.125rem;   /* 18 */
  --fs-xl: 1.375rem;   /* 22 */
  --fs-2xl: 1.75rem;   /* 28 */
  --fs-3xl: 2.25rem;   /* 36 */

  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  --lh-tight: 1.2;
  --lh-snug: 1.4;
  --lh-normal: 1.6;

  /* --- Z-index ------------------------------------------------------------ */
  --z-base: 1;
  --z-sticky: 100;
  --z-header: 200;
  --z-nav: 300;
  --z-fab: 350;
  --z-sheet: 400;
  --z-modal: 500;
  --z-toast: 600;
  --z-max: 999;

  /* --- Motion ------------------------------------------------------------- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);       /* snappy settle */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1); /* gentle overshoot */
  --t-fast: 120ms;
  --t-base: 200ms;
  --t-slow: 320ms;
  --t-slower: 480ms;

  /* --- Layout ------------------------------------------------------------- */
  --maxw: 480px;            /* mobile-first canvas */
  --header-h: 56px;
  --nav-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  color-scheme: dark;
}

/* ============================================================================
   2. RESET
   ============================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-ar);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--text);
  background: var(--ink-800);
  background-image: var(--grad-app);
  background-attachment: fixed;
  min-height: 100dvh;
  overflow-x: hidden;
  direction: rtl;
  text-align: start;
}

h1, h2, h3, h4, h5, h6 { font-weight: var(--fw-semibold); line-height: var(--lh-tight); letter-spacing: -0.01em; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; font-size: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
img, svg, video { display: block; max-width: 100%; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }

/* Numbers always tabular + Inter — Turki loves numbers */
.num, [data-num] { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

::selection { background: var(--primary-soft); color: var(--text); }

/* ============================================================================
   3. APP SHELL & LAYOUT
   ============================================================================ */
.app {
  max-width: var(--maxw);
  margin-inline: auto;
  min-height: 100dvh;
  position: relative;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  padding: var(--sp-4) var(--sp-4) calc(var(--nav-h) + var(--safe-bottom) + var(--sp-6));
  animation: screen-in var(--t-slow) var(--ease-out);
}

.section { margin-bottom: var(--sp-6); }
.section-title {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  color: var(--text-secondary); letter-spacing: 0.02em;
  margin-bottom: var(--sp-3);
}
.section-title .count {
  font-family: var(--font-num); font-size: var(--fs-2xs);
  color: var(--text-muted); background: var(--surface-2);
  padding: 1px var(--sp-2); border-radius: var(--r-full);
}

.stack { display: flex; flex-direction: column; gap: var(--sp-3); }
.row { display: flex; align-items: center; gap: var(--sp-3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
.spacer { flex: 1; }

/* ============================================================================
   4. APP HEADER  (glass, sticky)
   ============================================================================ */
.app-header {
  position: sticky; top: 0; z-index: var(--z-header);
  display: flex; align-items: center; gap: var(--sp-3);
  height: calc(var(--header-h) + var(--safe-top));
  padding: var(--safe-top) var(--sp-4) 0;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border-bottom: 1px solid var(--glass-border);
}
.app-header__title {
  display: flex; flex-direction: column; gap: 1px; min-width: 0;
}
.app-header__title h1 { font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.app-header__title .sub {
  font-size: var(--fs-2xs); color: var(--text-muted); font-weight: var(--fw-medium);
}
.app-header__brand {
  width: 34px; height: 34px; border-radius: var(--r-md);
  background: var(--grad-brand); display: grid; place-items: center;
  box-shadow: var(--sh-glow-primary), var(--sh-inset-top);
  flex-shrink: 0; font-weight: var(--fw-bold); color: var(--text-on-primary);
}
.app-header__actions { display: flex; gap: var(--sp-1); margin-inline-start: auto; }

/* ============================================================================
   5. CARD
   ============================================================================ */
.card {
  position: relative;
  background: var(--grad-surface);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  box-shadow: var(--sh-sm), var(--sh-inset-top);
  transition: transform var(--t-base) var(--ease-out),
              border-color var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out);
}
.card--interactive { cursor: pointer; -webkit-user-select: none; user-select: none; }
.card--interactive:active { transform: scale(0.985); }
.card--interactive:hover { border-color: var(--hairline); box-shadow: var(--sh-md), var(--sh-inset-top); }

/* glowing top edge accent (premium hero cards) */
.card--glow::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  padding: 1px; pointer-events: none;
  background: var(--grad-brand);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0.5;
}
.card--feature {
  background: var(--grad-brand-soft), var(--grad-surface);
  border-color: var(--primary-soft);
}
.card__header { display: flex; align-items: flex-start; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.card__title { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.card__meta { font-size: var(--fs-xs); color: var(--text-muted); }
.card__body { font-size: var(--fs-sm); color: var(--text-secondary); line-height: var(--lh-normal); }
.card__footer { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-4); padding-top: var(--sp-3); border-top: 1px solid var(--hairline-soft); }

/* ============================================================================
   6. BUTTONS
   ============================================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2); position: relative;
  height: 44px; padding-inline: var(--sp-5);
  border-radius: var(--r-md);
  font-size: var(--fs-base); font-weight: var(--fw-semibold);
  letter-spacing: -0.01em; white-space: nowrap;
  transition: transform var(--t-fast) var(--ease-out),
              background var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out),
              opacity var(--t-base);
  -webkit-user-select: none; user-select: none;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn svg { width: 18px; height: 18px; }

.btn--primary {
  background: var(--grad-brand); color: var(--text-on-primary);
  box-shadow: var(--sh-glow-primary), var(--sh-inset-top);
}
.btn--primary:hover { box-shadow: 0 10px 36px -6px var(--primary-glow), var(--sh-inset-top); }

.btn--accent {
  background: var(--accent); color: var(--text-on-accent);
  box-shadow: var(--sh-glow-accent), var(--sh-inset-top);
}

.btn--secondary {
  background: var(--elevated); color: var(--text);
  border: 1px solid var(--hairline);
  box-shadow: var(--sh-xs), var(--sh-inset-top);
}
.btn--secondary:hover { background: var(--surface-2); border-color: var(--text-faint); }

.btn--ghost { background: transparent; color: var(--text-secondary); }
.btn--ghost:hover { background: var(--elevated-2); color: var(--text); }

.btn--danger { background: var(--rejected-soft); color: var(--rejected); border: 1px solid #FB718533; }
.btn--danger:hover { background: #FB718524; }

.btn--block { display: flex; width: 100%; }
.btn--sm { height: 36px; padding-inline: var(--sp-4); font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn--lg { height: 52px; padding-inline: var(--sp-6); font-size: var(--fs-md); border-radius: var(--r-lg); }

/* icon button */
.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: var(--r-md);
  color: var(--text-secondary);
  transition: background var(--t-base) var(--ease-out),
              color var(--t-base) var(--ease-out),
              transform var(--t-fast) var(--ease-out);
}
.icon-btn:hover { background: var(--elevated-2); color: var(--text); }
.icon-btn:active { transform: scale(0.9); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn--badge { position: relative; }
.icon-btn--badge::after {
  content: ""; position: absolute; top: 8px; inset-inline-end: 8px;
  width: 7px; height: 7px; border-radius: var(--r-full);
  background: var(--accent); box-shadow: 0 0 0 2px var(--surface);
}

/* ============================================================================
   7. BADGE / STATUS PILL  (content-guide statuses)
   ============================================================================ */
.badge {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  height: 22px; padding-inline: var(--sp-2);
  border-radius: var(--r-full);
  font-size: var(--fs-2xs); font-weight: var(--fw-semibold);
  letter-spacing: 0.01em; white-space: nowrap;
  border: 1px solid transparent;
}
.badge .dot { width: 6px; height: 6px; border-radius: var(--r-full); background: currentColor; }

.badge--published { color: var(--success); background: var(--success-soft); border-color: #34D39933; }
.badge--pending   { color: var(--pending); background: var(--pending-soft); border-color: #FBBF2433; }
.badge--rejected  { color: var(--rejected); background: var(--rejected-soft); border-color: #FB718533; }
.badge--neutral   { color: var(--text-secondary); background: var(--surface-2); border-color: var(--hairline); }
.badge--primary   { color: var(--primary); background: var(--primary-soft); border-color: #6E7BFF33; }
.badge--accent    { color: var(--accent); background: var(--accent-soft); border-color: #22D3EE33; }
.badge--gold      { color: var(--gold); background: var(--gold-soft); border-color: #E6B98033; }

/* platform chip (per-platform content) */
.chip {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  height: 26px; padding-inline: var(--sp-3);
  border-radius: var(--r-full); font-size: var(--fs-xs); font-weight: var(--fw-medium);
  background: var(--surface-2); color: var(--text-secondary);
  border: 1px solid var(--hairline-soft);
  transition: all var(--t-base) var(--ease-out);
}
.chip--active { background: var(--primary-soft); color: var(--primary); border-color: #6E7BFF40; }

/* ============================================================================
   8. LIST ITEM
   ============================================================================ */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-1);
  border-bottom: 1px solid var(--hairline-soft);
  transition: background var(--t-base) var(--ease-out);
}
.list-item:last-child { border-bottom: none; }
.list-item--interactive { cursor: pointer; border-radius: var(--r-sm); padding-inline: var(--sp-3); }
.list-item--interactive:active { background: var(--elevated-2); }
.list-item__icon {
  width: 38px; height: 38px; border-radius: var(--r-sm); flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-secondary);
}
.list-item__icon--accent { background: var(--accent-soft); color: var(--accent); }
.list-item__main { min-width: 0; flex: 1; }
.list-item__title { font-size: var(--fs-base); font-weight: var(--fw-medium); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item__sub { font-size: var(--fs-xs); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item__trail { margin-inline-start: auto; display: flex; align-items: center; gap: var(--sp-2); flex-shrink: 0; }
.list-item__chevron { color: var(--text-faint); width: 18px; height: 18px; }

/* checkable (tasks) */
.check {
  width: 24px; height: 24px; border-radius: var(--r-full); flex-shrink: 0;
  border: 2px solid var(--text-faint);
  display: grid; place-items: center;
  transition: all var(--t-base) var(--ease-spring);
  cursor: pointer;
}
.check svg { width: 14px; height: 14px; opacity: 0; transform: scale(0.5); transition: all var(--t-base) var(--ease-spring); color: var(--text-on-accent); }
.check--done { background: var(--success); border-color: var(--success); }
.check--done svg { opacity: 1; transform: scale(1); }
.list-item--done .list-item__title { color: var(--text-muted); text-decoration: line-through; text-decoration-color: var(--text-faint); }

/* ============================================================================
   9. STAT TILE  (dashboard — Turki's numbers)
   ============================================================================ */
.stat {
  position: relative; overflow: hidden;
  background: var(--grad-surface);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  box-shadow: var(--sh-sm), var(--sh-inset-top);
}
.stat::after {
  content: ""; position: absolute; inset-block-start: -40%; inset-inline-end: -20%;
  width: 120px; height: 120px; border-radius: var(--r-full);
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  opacity: 0.6; pointer-events: none;
}
.stat--accent::after { background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%); }
.stat--gold::after { background: radial-gradient(circle, #E6B98040 0%, transparent 70%); }
.stat__label { font-size: var(--fs-xs); color: var(--text-muted); font-weight: var(--fw-medium); display: flex; align-items: center; gap: var(--sp-1); }
.stat__value { font-family: var(--font-num); font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: -0.02em; margin-top: var(--sp-1); font-variant-numeric: tabular-nums; }
.stat__delta { font-family: var(--font-num); font-size: var(--fs-xs); font-weight: var(--fw-semibold); display: inline-flex; align-items: center; gap: 2px; margin-top: var(--sp-1); }
.stat__delta--up { color: var(--success); }
.stat__delta--down { color: var(--rejected); }

/* progress bar */
.progress { height: 8px; border-radius: var(--r-full); background: var(--ink-700); overflow: hidden; box-shadow: inset 0 1px 2px #00000059; }
.progress__fill { height: 100%; border-radius: var(--r-full); background: var(--grad-brand); box-shadow: 0 0 12px -2px var(--accent-glow); transition: width var(--t-slower) var(--ease-out); }

/* ============================================================================
   10. AVATAR
   ============================================================================ */
.avatar {
  width: 36px; height: 36px; border-radius: var(--r-full);
  display: grid; place-items: center; flex-shrink: 0;
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  background: var(--surface-2); color: var(--text); overflow: hidden;
  border: 1px solid var(--hairline);
}
.avatar--sm { width: 28px; height: 28px; font-size: var(--fs-xs); }
.avatar--lg { width: 52px; height: 52px; font-size: var(--fs-lg); }
.avatar--turki { background: var(--grad-brand); color: var(--text-on-primary); border: none; }
.avatar--hanadi { background: var(--grad-gold); color: #2A1B0E; border: none; }
.avatar-group { display: flex; }
.avatar-group .avatar { margin-inline-start: -10px; border: 2px solid var(--ink-800); }
.avatar-group .avatar:first-child { margin-inline-start: 0; }

/* ============================================================================
   11. TABS / SEGMENTED CONTROL
   ============================================================================ */
.segmented {
  display: flex; gap: 2px; padding: 3px;
  background: var(--ink-700); border-radius: var(--r-md);
  border: 1px solid var(--hairline-soft);
}
.segmented__item {
  flex: 1; height: 36px; border-radius: var(--r-sm);
  font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-muted);
  display: grid; place-items: center;
  transition: all var(--t-base) var(--ease-out); position: relative;
}
.segmented__item--active {
  background: var(--elevated); color: var(--text);
  box-shadow: var(--sh-xs), var(--sh-inset-top);
}
.segmented__item .count { font-family: var(--font-num); font-size: var(--fs-2xs); opacity: 0.7; margin-inline-start: 4px; }

/* underline tabs */
.tabs { display: flex; gap: var(--sp-4); border-bottom: 1px solid var(--hairline-soft); overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: var(--sp-3) var(--sp-1); font-size: var(--fs-sm); font-weight: var(--fw-medium);
  color: var(--text-muted); white-space: nowrap; position: relative;
  transition: color var(--t-base) var(--ease-out);
}
.tab--active { color: var(--text); }
.tab--active::after {
  content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 2px;
  background: var(--grad-brand); border-radius: var(--r-full);
}

/* ============================================================================
   12. BOTTOM NAVIGATION  (4 primary + More)
   ============================================================================ */
.nav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: var(--z-nav);
  max-width: var(--maxw); margin-inline: auto;
  padding: var(--sp-2) var(--sp-2) calc(var(--sp-2) + var(--safe-bottom));
  display: flex; align-items: stretch;
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border-top: 1px solid var(--glass-border);
}
.nav__item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: var(--sp-1); border-radius: var(--r-md);
  color: var(--text-muted); position: relative;
  transition: color var(--t-base) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.nav__item:active { transform: scale(0.9); }
.nav__item svg { width: 23px; height: 23px; transition: transform var(--t-base) var(--ease-spring); }
.nav__item span { font-size: var(--fs-2xs); font-weight: var(--fw-medium); }
.nav__item--active { color: var(--text); }
.nav__item--active svg { transform: translateY(-1px); }
.nav__item--active::before {
  content: ""; position: absolute; top: -1px; inset-inline: 28%; height: 3px;
  background: var(--grad-brand); border-radius: var(--r-full);
  box-shadow: 0 0 10px -1px var(--accent-glow);
}
.nav__item--active .nav__glyph { color: var(--accent); }

/* ============================================================================
   13. FAB
   ============================================================================ */
.fab {
  position: fixed; z-index: var(--z-fab);
  inset-inline-end: max(var(--sp-4), calc(50% - var(--maxw)/2 + var(--sp-4)));
  bottom: calc(var(--nav-h) + var(--safe-bottom) + var(--sp-4));
  width: 56px; height: 56px; border-radius: var(--r-xl);
  background: var(--grad-brand); color: var(--text-on-primary);
  display: grid; place-items: center;
  box-shadow: var(--sh-lg), var(--sh-glow-primary), var(--sh-inset-top);
  transition: transform var(--t-base) var(--ease-spring), box-shadow var(--t-base);
}
.fab:active { transform: scale(0.9) rotate(90deg); }
.fab svg { width: 26px; height: 26px; }

/* ============================================================================
   14. BOTTOM SHEET  ("More" + detail panels)
   ============================================================================ */
.scrim {
  position: fixed; inset: 0; z-index: var(--z-sheet);
  background: #05070C99;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity var(--t-base) var(--ease-out);
}
.scrim--open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; inset-inline: 0; bottom: 0; z-index: var(--z-sheet);
  max-width: var(--maxw); margin-inline: auto;
  background: var(--elevated);
  background-image: var(--grad-sheen);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  border-top: 1px solid var(--glass-border);
  box-shadow: var(--sh-xl);
  padding: var(--sp-3) var(--sp-4) calc(var(--sp-6) + var(--safe-bottom));
  max-height: 88dvh; overflow-y: auto;
  transform: translateY(100%);
  transition: transform var(--t-slow) var(--ease-out);
}
.sheet--open { transform: translateY(0); }
.sheet__handle { width: 40px; height: 4px; border-radius: var(--r-full); background: var(--hairline); margin: var(--sp-1) auto var(--sp-4); }
.sheet__title { font-size: var(--fs-lg); font-weight: var(--fw-bold); margin-bottom: var(--sp-4); }

/* "More" grid inside sheet */
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
.more-item {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-2); border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--hairline-soft);
  transition: all var(--t-base) var(--ease-out);
}
.more-item:active { transform: scale(0.95); background: var(--surface-2); }
.more-item__icon { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--grad-brand-soft); color: var(--primary); }
.more-item span { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-secondary); text-align: center; }
.more-item--locked .more-item__icon { background: var(--gold-soft); color: var(--gold); }

/* ============================================================================
   15. MODAL  (centered — confirmations, secure content)
   ============================================================================ */
.modal {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: grid; place-items: center; padding: var(--sp-5);
  background: #05070CB3;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity var(--t-base) var(--ease-out);
}
.modal--open { opacity: 1; pointer-events: auto; }
.modal__card {
  width: 100%; max-width: 360px;
  background: var(--elevated); background-image: var(--grad-sheen);
  border: 1px solid var(--glass-border); border-radius: var(--r-xl);
  padding: var(--sp-6); box-shadow: var(--sh-xl);
  transform: scale(0.92) translateY(8px); opacity: 0;
  transition: transform var(--t-slow) var(--ease-spring), opacity var(--t-base);
}
.modal--open .modal__card { transform: scale(1) translateY(0); opacity: 1; }
.modal__icon { width: 48px; height: 48px; border-radius: var(--r-md); display: grid; place-items: center; margin-bottom: var(--sp-4); background: var(--primary-soft); color: var(--primary); }
.modal__title { font-size: var(--fs-xl); font-weight: var(--fw-bold); margin-bottom: var(--sp-2); }
.modal__body { font-size: var(--fs-sm); color: var(--text-secondary); margin-bottom: var(--sp-5); }
.modal__actions { display: flex; gap: var(--sp-2); }
.modal__actions .btn { flex: 1; }

/* ============================================================================
   16. INPUTS  (auth + forms)
   ============================================================================ */
.field { display: flex; flex-direction: column; gap: var(--sp-2); }
.label { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-secondary); }
.input {
  height: 48px; padding-inline: var(--sp-4);
  background: var(--ink-700); color: var(--text);
  border: 1px solid var(--hairline); border-radius: var(--r-md);
  font-size: var(--fs-base); width: 100%;
  transition: border-color var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out), background var(--t-base);
}
.input::placeholder { color: var(--text-faint); }
.input:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px var(--primary-soft); }
.input--lg { height: 54px; border-radius: var(--r-lg); }
textarea.input { height: auto; min-height: 96px; padding-block: var(--sp-3); resize: vertical; line-height: var(--lh-normal); }

.input-group { position: relative; }
.input-group .input { padding-inline-start: var(--sp-10); }
.input-group__icon { position: absolute; inset-inline-start: var(--sp-3); top: 50%; transform: translateY(-50%); color: var(--text-muted); width: 20px; height: 20px; pointer-events: none; }

/* ============================================================================
   17. EMPTY STATE
   ============================================================================ */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: var(--sp-12) var(--sp-6); gap: var(--sp-3);
}
.empty__icon {
  width: 72px; height: 72px; border-radius: var(--r-2xl);
  display: grid; place-items: center; margin-bottom: var(--sp-2);
  background: var(--grad-brand-soft); color: var(--primary);
  border: 1px solid var(--primary-soft);
}
.empty__icon svg { width: 32px; height: 32px; }
.empty__title { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.empty__text { font-size: var(--fs-sm); color: var(--text-muted); max-width: 28ch; }

/* ============================================================================
   18. TOAST
   ============================================================================ */
.toast-wrap {
  position: fixed; inset-inline: 0; z-index: var(--z-toast);
  bottom: calc(var(--nav-h) + var(--safe-bottom) + var(--sp-3));
  max-width: var(--maxw); margin-inline: auto; padding-inline: var(--sp-4);
  display: flex; flex-direction: column; gap: var(--sp-2); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md);
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border); box-shadow: var(--sh-lg);
  font-size: var(--fs-sm); color: var(--text); pointer-events: auto;
  animation: toast-in var(--t-slow) var(--ease-spring);
}
.toast__icon { width: 22px; height: 22px; flex-shrink: 0; display: grid; place-items: center; }
.toast--success .toast__icon { color: var(--success); }
.toast--error .toast__icon { color: var(--rejected); }
.toast--info .toast__icon { color: var(--accent); }
.toast__bar { position: absolute; bottom: 0; inset-inline-start: 0; height: 2px; background: var(--accent); border-radius: var(--r-full); animation: toast-bar 3.2s linear forwards; }

/* ============================================================================
   19. DIVIDER / MISC
   ============================================================================ */
.divider { height: 1px; background: var(--hairline-soft); margin-block: var(--sp-4); border: none; }
.divider--label { display: flex; align-items: center; gap: var(--sp-3); margin-block: var(--sp-4); color: var(--text-muted); font-size: var(--fs-xs); }
.divider--label::before, .divider--label::after { content: ""; flex: 1; height: 1px; background: var(--hairline-soft); }

.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; border-radius: var(--r-sm); animation: shimmer 1.4s ease-in-out infinite; }

/* persona accent helpers (الشخصنة) */
.persona-turki { --persona: var(--accent); }
.persona-hanadi { --persona: var(--gold); }
.persona-ribbon { border-inline-start: 3px solid var(--persona, var(--primary)); padding-inline-start: var(--sp-3); }

/* lock marker for sensitive sections (اتفاقية · عملاء) */
.locked-tag { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-2xs); color: var(--gold); font-weight: var(--fw-medium); }
.locked-tag svg { width: 13px; height: 13px; }

/* ============================================================================
   20. UTILITIES
   ============================================================================ */
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-gradient { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.text-center { text-align: center; }
.fw-bold { font-weight: var(--fw-bold); }
.fs-sm { font-size: var(--fs-sm); }
.fs-xs { font-size: var(--fs-xs); }
.mt-2 { margin-top: var(--sp-2); } .mt-4 { margin-top: var(--sp-4); } .mt-6 { margin-top: var(--sp-6); }
.mb-2 { margin-bottom: var(--sp-2); } .mb-4 { margin-bottom: var(--sp-4); }
.full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.glass { background: var(--glass-bg); -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur)); border: 1px solid var(--glass-border); }
.hidden { display: none !important; }

/* ============================================================================
   21. MOTION · keyframes & micro-interactions
   ============================================================================ */
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-bar { from { width: 100%; } to { width: 0; } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes pulse-glow { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

/* staggered list entrance — set --i on each item */
.stagger > * { animation: screen-in var(--t-slow) var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 45ms); }

/* page transition wrapper (for SPA route swaps) */
.page-enter { animation: screen-in var(--t-slow) var(--ease-out); }
.page-exit { animation: screen-in var(--t-base) var(--ease-in-out) reverse; }

/* live dot (marketing monitor / sync) */
.live-dot { width: 8px; height: 8px; border-radius: var(--r-full); background: var(--success); box-shadow: 0 0 0 0 var(--success); animation: live 2s var(--ease-out) infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 #34D39966; } 70% { box-shadow: 0 0 0 8px #34D39900; } 100% { box-shadow: 0 0 0 0 #34D39900; } }

/* ============================================================================
   22. RTL / LTR  — content-aware
   logical properties used throughout, so most of RTL is automatic.
   These handle directional glyphs & latin runs.
   ============================================================================ */
[dir="rtl"] .chevron-back { transform: scaleX(-1); }       /* arrows flip */
[dir="rtl"] .list-item__chevron { transform: scaleX(-1); }
[lang="en"], .ltr, .num, [data-num] { direction: ltr; unicode-bidi: isolate; }
.ltr-inline { direction: ltr; unicode-bidi: isolate; display: inline-block; }
/* keep numbers/latin readable inside Arabic lines without breaking flow */
.bidi-iso { unicode-bidi: isolate; }

/* ============================================================================
   23. RESPONSIVE  — graceful scale-up past mobile (tablet / desktop preview)
   ============================================================================ */
@media (min-width: 640px) {
  :root { --maxw: 520px; }
  .screen { padding-inline: var(--sp-5); }
}
@media (min-width: 900px) {
  :root { --maxw: 560px; }
  body { background-image: radial-gradient(80% 60% at 50% -5%, #161B2E 0%, #0B0D14 50%); }
  .app { border-inline: 1px solid var(--hairline-soft); box-shadow: var(--sh-xl); }
}

/* ============================================================================
   24. ACCESSIBILITY
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
@media (prefers-contrast: more) {
  :root { --text-secondary: #C7CCDC; --text-muted: #9097AC; --hairline: #3A4156; }
}

/* ============================================================================
   25. CONTENT GUIDE  (دليل المحتوى — بطاقات النشرات)
   ============================================================================ */
.chip-row {
  display: flex; gap: var(--sp-2); overflow-x: auto; flex-wrap: nowrap;
  -ms-overflow-style: none; scrollbar-width: none; padding-block: var(--sp-1);
  margin-block: var(--sp-3);
}
.chip-row::-webkit-scrollbar { display: none; }
.chip-row .chip { flex-shrink: 0; }

.post-card { display: flex; gap: var(--sp-3); align-items: flex-start; }
.post-card__main { min-width: 0; flex: 1; }
.post-card__text {
  font-size: var(--fs-sm); color: var(--text-secondary); line-height: var(--lh-snug);
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card__meta { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-2); font-size: var(--fs-2xs); color: var(--text-muted); flex-wrap: wrap; }
.post-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-2); }

.post-thumb {
  width: 64px; height: 64px; border-radius: var(--r-md); flex-shrink: 0;
  object-fit: cover; background: var(--surface-2); border: 1px solid var(--hairline-soft);
}
.post-thumb--empty { display: grid; place-items: center; color: var(--text-faint); }
.post-thumb--empty svg { width: 26px; height: 26px; }

.media-strip { display: flex; gap: var(--sp-2); overflow-x: auto; scrollbar-width: none; padding-block: var(--sp-1); }
.media-strip::-webkit-scrollbar { display: none; }
.media-strip img { width: 72px; height: 72px; border-radius: var(--r-sm); object-fit: cover; flex-shrink: 0; border: 1px solid var(--hairline-soft); }

.post-detail { display: flex; flex-direction: column; gap: var(--sp-4); }
.post-detail__preview { white-space: pre-wrap; line-height: var(--lh-normal); font-size: var(--fs-base); }
