@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

/* ═══════════════════════════════════════════════════════════════════════════
   Workers724 — Professional Glassmorphism UI (Ocean Blue & Turquoise)
   Design: Glass · Blur · Depth · Smooth Motion · RTL Persian
═══════════════════════════════════════════════════════════════════════════ */

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

/* ─── Theme Tokens ────────────────────────────────────────────────────────── */
:root {
  /* Monochrome Black & Indigo Brand (مسیر ۱۵ قدمی style) */
  --primary: #6375f6;
  --primary-hover: #4f5de4;
  --primary-deep: #3248c6;
  --accent: #6375f6;
  --accent-hover: #4f5de4;
  --accent-glow: #aeb8ff;

  /* Semantic */
  --success: #087c62;
  --warning: #f59e0b;
  --danger: #b42318;
  --info: #6375f6;

  /* Light theme surfaces */
  --bg-1: #ffffff;
  --bg-2: #f7f7f5;
  --bg-3: #f3f3f0;
  --bg-mesh: #ffffff;

  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-bg-strong: rgba(255, 255, 255, 0.98);
  --glass-border: rgba(0, 0, 0, 0.09);
  --glass-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
  --glass-shadow-hover: 0 2px 8px rgba(0, 0, 0, 0.1), 0 8px 28px rgba(0, 0, 0, 0.07);
  --glass-shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.8);

  --text: #0d0d0d;
  --text-muted: #666666;
  --text-light: #737373;
  --border: rgba(0, 0, 0, 0.1);
  --input-bg: rgba(255, 255, 255, 0.95);
  --input-border: rgba(0, 0, 0, 0.15);

  /* Surfaces */
  --surface: #ffffff;
  --surface-2: #f7f7f5;
  --primary-light: #e9ecff;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-1: 180ms;
  --dur-2: 300ms;
  --dur-3: 500ms;

  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;

  --font: 'Vazirmatn', 'Segoe UI', system-ui, sans-serif;

  /* Ink: همیشه تیره */
  --ink: #0d0d0d;
  --ink-hover: #2a2a2a;
  --on-ink: #ffffff;
}

/* ─── Dark theme ──────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  background:
    linear-gradient(
      135deg,
      rgba(31, 38, 70, 0.98) 0%,
      rgba(35, 43, 82, 0.98) 55%,
      rgba(42, 51, 96, 0.98) 100%
    );
  --bg-mesh: #0d0d0d;

  --glass-bg: rgba(20, 20, 20, 0.85);
  --glass-bg-strong: rgba(18, 18, 18, 0.98);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 1px 4px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
  --glass-shadow-hover: 0 2px 8px rgba(0, 0, 0, 0.5), 0 8px 28px rgba(0, 0, 0, 0.4);
  --glass-shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.05);

  --text: #f0f0f0;
  --text-muted: #a3a3a3;
  --text-light: #737373;
  --border: rgba(255, 255, 255, 0.1);
  --input-bg: rgba(30, 30, 30, 0.9);
  --input-border: rgba(255, 255, 255, 0.15);

  --surface: #1a1a1a;
  --surface-2: #242424;
  --primary-light: rgba(99, 117, 246, 0.15);
  --on-ink: #ffffff;
}

/* ─── Base ────────────────────────────────────────────────────────────────── */
html { direction: rtl; font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-mesh);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: color var(--dur-2) var(--ease-out);
}

/* Ambient floating blobs (decorative) */
body::before, body::after {
  content: '';
  position: fixed; pointer-events: none; z-index: -1;
  width: 480px; height: 480px; border-radius: 50%;
  filter: blur(80px); opacity: .5;
  animation: floatBlob 22s ease-in-out infinite;
}
body::before {
  top: -180px; right: -120px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  opacity: .08;
}
body::after {
  bottom: -200px; left: -160px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  animation-delay: -11s;
  opacity: .05;
}
@keyframes floatBlob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(40px, -30px) scale(1.15); }
}

::selection { background: rgba(99, 117, 246, 0.2); color: var(--text); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-hover); background-clip: padding-box; }

/* ─── Typography ──────────────────────────────────────────────────────────── */
h1 { font-size: 1.85rem; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 1.4rem;  font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; font-weight: 600; }
p  { color: var(--text-muted); }

.gradient-text {
  background: none;
  -webkit-background-clip: unset; background-clip: unset;
  -webkit-text-fill-color: unset;
  color: var(--primary);
}

/* ─── Layout ──────────────────────────────────────────────────────────────── */
.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.page {
  padding: 32px 0 96px;
  /* فضای امن برای safe-area (notch/status bar) در PWA */
  padding-top: calc(32px + env(safe-area-inset-top, 0px));
  animation: pageIn var(--dur-3) var(--ease-out);
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hidden { display: none !important; }

/* ─── Navigation ──────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  /* safe-area: در PWA از status bar فاصله بگیر */
  top: calc(12px + env(safe-area-inset-top, 0px));
  z-index: 100;
  margin: calc(12px + env(safe-area-inset-top, 0px)) 16px 0;
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
          backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow), var(--glass-shadow-inset);
  animation: navIn 600ms var(--ease-out);
}
@keyframes navIn { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }

.nav-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 18px; max-width: 1140px; margin: 0 auto;
  min-height: 60px;
}
.nav-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.15rem;
  text-decoration: none;
  color: var(--text);
}
.nav-brand .brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--ink);
  display: grid; place-items: center;
  color: var(--on-ink);
  box-shadow: none;
}
.nav-brand .brand-name {
  color: var(--text);
}

.nav-links { display: flex; gap: 2px; align-items: center; flex-wrap: nowrap; }
.nav-link {
  position: relative;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 10px; border-radius: var(--radius-sm);
  font-size: 0.8rem; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  border: 1px solid transparent; background: transparent;
  font-family: var(--font);
  transition: all var(--dur-2) var(--ease-out);
  white-space: nowrap;
}
.nav-link .icon { width: 16px; height: 16px; flex-shrink: 0; }
.nav-link:hover {
  color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
}
.nav-link.active {
  color: var(--on-ink);
  background: var(--primary);
  box-shadow: 0 4px 14px rgba(99, 117, 246, 0.35);
}
.nav-link.danger:hover { color: var(--danger); background: rgba(239, 68, 68, 0.1); }

/* Nav notification dot/counter badge */
.nav-dot {
  display: none;          /* hidden by default — JS sets inline-flex when needed */
  align-items: center; justify-content: center;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--danger);
  color: #fff;
  font-size: .62rem; font-weight: 700; line-height: 1;
  margin-right: 2px;
  box-shadow: 0 2px 6px rgba(239,68,68,.45);
  animation: dotPop .3s cubic-bezier(0.34,1.56,0.64,1);
}
.nav-dot.visible { display: inline-flex; }
@keyframes dotPop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* Theme toggle */
.theme-toggle {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text); cursor: pointer;
  display: inline-grid; place-items: center;
  transition: all var(--dur-2) var(--ease-out);
}
.theme-toggle:hover {
  transform: rotate(15deg) scale(1.08);
  background: var(--primary);
  color: var(--on-ink);
  border-radius: 99px;
}
.theme-toggle .icon { width: 20px; height: 20px; transition: transform var(--dur-3) var(--ease-spring); }

/* Mobile burger */
.nav-toggle { display: none; }

/* ─── Floating Back Button ────────────────────────────────────────────────── */
.back-fab {
  position: fixed; top: 92px; right: 20px; z-index: 90;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
          backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--glass-border);
  color: var(--text);
  display: grid; place-items: center; cursor: pointer;
  box-shadow: var(--glass-shadow);
  transition: all var(--dur-2) var(--ease-out);
  opacity: 0; transform: scale(0.6) translateX(20px); pointer-events: none;
}
.back-fab.visible { opacity: 1; transform: scale(1) translateX(0); pointer-events: auto; }
.back-fab:hover {
  background: var(--primary);
  color: var(--on-ink);
  transform: scale(1.08) translateX(-3px);
  box-shadow: 0 6px 20px rgba(99,117,246,.35);
}
.back-fab .icon { width: 22px; height: 22px; }

/* ─── Cards / Glass Panels ────────────────────────────────────────────────── */
.card {
  position: relative;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
          backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--glass-shadow), var(--glass-shadow-inset);
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
  overflow: hidden;
}
.card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 40%);
  pointer-events: none;
}
.card:hover { box-shadow: var(--glass-shadow-hover), var(--glass-shadow-inset); }
.card + .card { margin-top: 16px; }
.card-title { font-weight: 700; margin-bottom: 10px; }

/* اضافه کن: */
.stats-row .card + .card { margin-top: 0; }
.stats-row-action .card + .card { margin-top: 0; }
.steps-grid .card + .card { margin-top: 0; }
/* Highlight card (gradient border) */
.card-accent {
  background:
    linear-gradient(var(--glass-bg), var(--glass-bg)) padding-box,
    linear-gradient(135deg, var(--primary), #aeb8ff) border-box;
  border: 1.5px solid transparent;
}

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-family: var(--font); font-size: 0.925rem; font-weight: 600;
  cursor: pointer; text-decoration: none; user-select: none;
  transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), background var(--dur-2), color var(--dur-2), filter var(--dur-2);
  position: relative; overflow: hidden;
  white-space: nowrap;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at var(--x,50%) var(--y,50%), rgba(255,255,255,.35), transparent 45%);
  opacity: 0; transition: opacity var(--dur-2);
  pointer-events: none;
}
.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 3px solid rgba(99,117,246,.3); outline-offset: 2px; }
.btn .icon { width: 16px; height: 16px; }

.btn-primary {
  color: var(--on-ink);
  background: var(--primary);
  box-shadow: 0 4px 14px rgba(99,117,246,.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  background: var(--primary-hover);
  box-shadow: 0 6px 20px rgba(99,117,246,.4);
  filter: none;
}

.btn-secondary {
  color: var(--text); background: var(--glass-bg-strong);
  border-color: var(--glass-border);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.btn-secondary:hover { transform: translateY(-1px); box-shadow: var(--glass-shadow); border-color: var(--text); color: var(--text); }

.btn-success { color:#fff; background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 8px 22px rgba(16,185,129,.35); }
.btn-success:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn-danger  { color:#fff; background: linear-gradient(135deg, #ef4444, #dc2626); box-shadow: 0 8px 22px rgba(239,68,68,.35); }
.btn-danger:hover  { transform: translateY(-2px); filter: brightness(1.05); }

.btn-sm { padding: 7px 14px; font-size: 0.82rem; border-radius: 10px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.btn-ghost {
  background: transparent; color: var(--text-muted);
  padding: 8px 12px; font-weight: 500;
}
.btn-ghost:hover { color: var(--primary); background: var(--primary-light); }

/* ─── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
label {
  display: flex; align-items: center; gap: 6px;
  font-weight: 500; margin-bottom: 8px; font-size: 0.9rem;
  color: var(--text);
}
input, textarea, select {
  width: 100%; padding: 12px 16px;
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.95rem;
  color: var(--text); background: var(--input-bg);
  transition: border-color var(--dur-2), box-shadow var(--dur-2), background var(--dur-2);
  direction: rtl;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
input::placeholder, textarea::placeholder { color: var(--text-light); }
input:hover, textarea:hover, select:hover { border-color: var(--primary); }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 117, 246, 0.18);
  background: var(--glass-bg-strong);
}
textarea { resize: vertical; min-height: 130px; line-height: 1.7; }

/* ─── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 600;
  border: 1px solid transparent;
}
.badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.badge-draft      { background: rgba(100,116,139,.15);  color: #64748b; border-color: rgba(100,116,139,.25); }
.badge-not_started{ background: rgba(100,116,139,.15);  color: #64748b; border-color: rgba(100,116,139,.25); }
.badge-submitted  { background: rgba(245,158,11,.15);   color: #d97706; border-color: rgba(245,158,11,.28); }
.badge-approved   { background: rgba(16,185,129,.15);   color: #059669; border-color: rgba(16,185,129,.28); }
.badge-rejected   { background: rgba(239,68,68,.15);    color: #dc2626; border-color: rgba(239,68,68,.28); }

/* ─── Steps Grid ──────────────────────────────────────────────────────────── */
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step-card {
  position: relative; overflow: hidden;
  padding: 24px 24px 20px 24px;
  cursor: pointer;
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
  animation: pageIn 500ms var(--ease-out) both;
}
.step-card:hover { transform: translateY(-4px); box-shadow: var(--glass-shadow-hover), var(--glass-shadow-inset); }
.step-card.locked { opacity: 0.55; pointer-events: none; filter: grayscale(0.3); }
.step-card.approved {
  background: linear-gradient(var(--glass-bg), var(--glass-bg)) padding-box,
    linear-gradient(135deg, var(--success), var(--accent)) border-box;
  border: 1px solid transparent;
}
.step-number {
  position: absolute; top: 16px; right: 16px;
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--primary);
  color: var(--on-ink);
  display: grid; place-items: center;
  font-weight: 800; font-size: 0.95rem;
  box-shadow: 0 4px 14px rgba(99, 117, 246, 0.3);
}
.step-number.done { background: var(--success); box-shadow: none; }
.step-card h3 { margin-bottom: 4px; }
.step-card-body { padding-right: 56px; }

/* ─── Stats Row ───────────────────────────────────────────────────────────── */
.stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-bottom: 28px;
}
.stat-card {
  text-align: center; padding: 22px 16px;
  position: relative; overflow: hidden;
  /* isolate so the glow pseudo-element doesn't bleed into siblings */
  isolation: isolate;
}
.stat-card::after {
  content: ''; position: absolute;
  inset: auto 0 -30px 0; height: 80px;
  background: radial-gradient(closest-side, rgba(99,117,246,.1), transparent);
  filter: blur(16px); pointer-events: none;
  /* clip strictly inside the card */
  border-radius: inherit;
}
.stat-num {
  font-size: 2.25rem; font-weight: 800; line-height: 1;
  background: none;
  -webkit-background-clip: unset; background-clip: unset;
  -webkit-text-fill-color: unset;
  color: var(--text);
}
.stat-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; font-weight: 500; }
.stat-icon {
  width: 40px; height: 40px; margin: 0 auto 10px;
  border-radius: 12px;
  background: var(--primary-light);
  display: grid; place-items: center; color: var(--primary);
}
.stat-icon .icon { width: 22px; height: 22px; }

/* ─── Podcast Player Bar ──────────────────────────────────────────────────── */
.player-bar {
  position: fixed; bottom: 16px; right: 16px; left: 16px;
  max-width: 780px; margin: 0 auto;
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
          backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: 0 -2px 12px rgba(0,0,0,.08), var(--glass-shadow-inset);
  z-index: 200;
  animation: playerIn 400ms var(--ease-spring);
}
@keyframes playerIn { from { transform: translateY(120%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.player-bar audio { flex: 1; direction: ltr; min-width: 0; }
.player-hidden { display: none; }
#player-title { font-weight: 600; min-width: 120px; color: var(--text); font-size: 0.9rem; }

/* ─── Tables ──────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: var(--glass-shadow);
}
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th {
  background: var(--surface-2);
  padding: 14px 16px; font-weight: 700; text-align: right;
  color: var(--text); font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { padding: 13px 16px; border-top: 1px solid var(--border); color: var(--text); }
tr { transition: background var(--dur-1); }
tbody tr:hover td { background: rgba(99, 117, 246, 0.05); }

/* ─── Alerts / Toast ──────────────────────────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px; border-radius: var(--radius-sm);
  font-size: 0.9rem; margin-bottom: 16px;
  border: 1px solid transparent;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  animation: pageIn 300ms var(--ease-out);
}
.alert .icon { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: rgba(16,185,129,.12); color: #065f46; border-color: rgba(16,185,129,.3); }
.alert-error   { background: rgba(239,68,68,.12);  color: #991b1b; border-color: rgba(239,68,68,.3); }
.alert-info    { background: rgba(99,117,246,.12); color: #3248c6; border-color: rgba(99,117,246,.25); }
.alert-warning { background: rgba(245,158,11,.12); color: #92400e; border-color: rgba(245,158,11,.3); }

[data-theme="dark"] .alert-success { color: #6ee7b7; }
[data-theme="dark"] .alert-error   { color: #fca5a5; }
[data-theme="dark"] .alert-info    { color: #aeb8ff; }
[data-theme="dark"] .alert-warning { color: #fcd34d; }

/* Toast container (top-right) */
#toast-container {
  position: fixed; top: 90px; right: 20px; z-index: 500;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  min-width: 260px; max-width: 400px;
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
          backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: var(--glass-shadow);
  display: flex; align-items: center; gap: 10px;
  color: var(--text); font-size: 0.9rem;
  animation: toastIn 400ms var(--ease-spring);
  pointer-events: auto;
  border-right: 4px solid var(--primary);
}
.toast.toast-success { border-right-color: var(--success); }
.toast.toast-error   { border-right-color: var(--danger); }
.toast.toast-warning { border-right-color: var(--warning); }
.toast.toast-info    { border-right-color: var(--info); }
.toast .icon { width: 20px; height: 20px; flex-shrink: 0; }
.toast.hide { animation: toastOut 300ms var(--ease-out) forwards; }
@keyframes toastIn  { from { transform: translateX(-120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { to { transform: translateX(-120%); opacity: 0; } }

/* ─── Loader / Spinner ────────────────────────────────────────────────────── */
.spinner-wrap { display: grid; place-items: center; padding: 80px 0; }
.spinner {
  width: 44px; height: 44px;
  border: 3px solid transparent;
  border-top-color: var(--primary);
  border-right-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 60px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, rgba(148,163,184,.15) 0%, rgba(148,163,184,.28) 50%, rgba(148,163,184,.15) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}
.skeleton-line { height: 14px; margin: 8px 0; }
.skeleton-line.lg { height: 22px; }
.skeleton-card { height: 120px; border-radius: var(--radius); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ─── Auth Page ───────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  /* safe-area برای PWA — جلوگیری از رفتن زیر notch */
  padding-top: calc(24px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}
.auth-card {
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
          backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 44px 36px;
  width: 100%; max-width: 420px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08), 0 16px 48px rgba(0,0,0,.06), var(--glass-shadow-inset);
  animation: authIn 700ms var(--ease-out);
}
@keyframes authIn { from { opacity: 0; transform: translateY(20px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

.auth-logo-wrap {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-bottom: 12px;
}
.auth-logo-mark {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--ink);
  display: grid; place-items: center;
  color: var(--on-ink);
  box-shadow: none;
  animation: pulse 3s ease-in-out infinite;
}
.auth-logo-mark .icon { width: 30px; height: 30px; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99,117,246,.0); }
  50%      { box-shadow: 0 0 0 6px rgba(99,117,246,.12); }
}
.auth-logo {
  font-size: 2rem; font-weight: 800;
  background: none;
  -webkit-background-clip: unset; background-clip: unset;
  -webkit-text-fill-color: unset;
  color: var(--text);
}
.auth-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 30px; font-size: 0.95rem; }

/* OTP input */
.otp-input {
  letter-spacing: 12px !important; font-size: 1.6rem !important;
  text-align: center; font-weight: 700;
  padding: 16px !important;
}

/* ─── Empty state ─────────────────────────────────────────────────────────── */
.empty {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-icon {
  width: 72px; height: 72px; margin: 0 auto 16px;
  border-radius: 22px;
  background: var(--primary-light);
  display: grid; place-items: center; color: var(--primary);
}
.empty-icon .icon { width: 36px; height: 36px; }
.empty h3 { color: var(--text); margin-bottom: 6px; }

/* ─── Chips / Filter buttons ──────────────────────────────────────────────── */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  padding: 7px 14px; border-radius: 999px;
  font-size: 0.82rem; font-weight: 500;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  color: var(--text-muted); cursor: pointer;
  transition: all var(--dur-2) var(--ease-out);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-family: var(--font);
}
.chip:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-1px); }
.chip.active {
  color: var(--on-ink);
  background: var(--primary);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(99,117,246,.3);
}

/* ─── Media Session helper ────────────────────────────────────────────────── */
.play-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--primary);
  color: var(--on-ink);
  border: none;
  cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(99,117,246,.35);
  transition: transform var(--dur-2) var(--ease-out);
}
.play-btn:hover { transform: scale(1.08); }
.play-btn .icon { width: 20px; height: 20px; }

/* ─── Grid Utilities ──────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-full { grid-column: 1 / -1; }

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  h1 { font-size: 1.5rem; }
  .nav { margin: 8px 10px 0; }
  .nav-inner { padding: 8px 12px; flex-wrap: wrap; }
  .nav-toggle {
    display: grid; place-items: center;
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    color: var(--text); cursor: pointer;
  }
  .nav-toggle .icon { width: 22px; height: 22px; }
  .nav-links {
    display: none; width: 100%; flex-direction: column; gap: 4px;
    margin-top: 8px; padding-top: 12px;
    border-top: 1px solid var(--border);
  }
  .nav-links.open { display: flex; animation: pageIn 300ms var(--ease-out); }
  .nav-link { justify-content: flex-start; width: 100%; }
  .back-fab { top: auto; bottom: 90px; right: 16px; width: 44px; height: 44px; }
  .grid-2 { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-card { padding: 32px 22px; }
  .container { padding: 0 14px; }
}

@media (max-width: 420px) {
  .stats-row { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
}

/* ─── Reduced Motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  body::before, body::after { display: none; }
}

/* ── Global icon size fix ───────────────────────────── */
svg.icon {
  display: inline-block;
  flex-shrink: 0;
  width: var(--icon-size, 20px);
  height: var(--icon-size, 20px);
  max-width: var(--icon-size, 20px);
  max-height: var(--icon-size, 20px);
  overflow: hidden;
}

h1 svg.icon { --icon-size: 26px; }
h2 svg.icon { --icon-size: 22px; }
h3 svg.icon { --icon-size: 18px; }
.stat-icon svg.icon { --icon-size: 22px; }
.empty-icon svg.icon { --icon-size: 40px; }
.auth-logo-mark svg.icon { --icon-size: 30px; }
.play-btn svg.icon { --icon-size: 20px; }
.nav-link svg.icon { --icon-size: 18px; }
.btn svg.icon { --icon-size: 16px; }
.toast svg.icon { --icon-size: 20px; }
.alert svg.icon { --icon-size: 20px; }
.form-group label svg.icon { --icon-size: 16px; }

/* profile info rows */
.card > div > svg.icon { --icon-size: 20px; }


/* ── Action stat cards (queue / tickets) ── */
.stats-row-action {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
  align-items: stretch;
}
.stats-row-action .card {
  height: 100%;
  box-sizing: border-box;
}
.stat-card-action {
  text-align: center;
  padding: 26px 16px;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  cursor: pointer;
  border: 1.5px solid rgba(22,163,74,.35);
  transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out);
}
.stat-card-action::after {
  content: '';
  position: absolute;
  inset: auto 0 -30px 0;
  height: 80px;
  background: radial-gradient(closest-side, rgba(22,163,74,.15), transparent);
  filter: blur(16px);
  pointer-events: none;
  border-radius: inherit;
}
.stat-card-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(22,163,74,.18);
  border-color: rgba(22,163,74,.65);
}
.stat-card-action .stat-icon {
  background: rgba(22,163,74,.12);
  color: #16a34a;
}
.stat-card-action .stat-num {
  color: #16a34a;
}
.stat-card-action .stat-label {
  color: #16a34a;
  opacity: .8;
}

@media (max-width: 768px) {
  .stats-row-action { grid-template-columns: 1fr 1fr; }
}

/* ─── Dashboard fixes ────────────────────────────────────────────────────────── */

/* Continue Card */
.continue-card-new {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(24px, 4vw, 40px);
  background: linear-gradient(135deg, #dfe4ff 0%, #c8d1ff 100%);
  color: var(--text);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}

.continue-card-new::after {
  content: "";
  position: absolute;
  width: 280px; height: 280px;
  bottom: -160px; left: -60px;
  border: 45px solid rgba(255,255,255,0.08);
  border-radius: 50%;
  pointer-events: none;
}

.eyebrow-label {
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
}

/* Progress Ring */
.progress-ring-wrap {
  --ring-value: 0deg;
  width: 150px; height: 150px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(rgba(255,255,255,0.9) var(--ring-value), rgba(255,255,255,0.15) 0);
}

.progress-ring-wrap::before {
  content: "";
  width: 114px; height: 114px;
  grid-area: 1/1;
  background: var(--primary);
  border-radius: 50%;
}

.progress-ring-inner {
  z-index: 1;
  grid-area: 1/1;
  text-align: center;
}

.progress-ring-inner strong {
  display: block;
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.progress-ring-inner small {
  display: block;
  color: rgba(255,255,255,0.7);
  font-size: 11px;
  margin-top: 4px;
}

/* Phase List */
.phase-list-new { display: grid; gap: 0; }

.phase-item-new {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  min-height: 70px;
  position: relative;
}

.phase-item-new:not(:last-child)::after {
  content: "";
  position: absolute;
  width: 2px; height: 34px;
  top: 34px; right: 16px;
  background: var(--border);
}

.phase-icon-new {
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  background: rgba(99,117,246,.1);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  flex-shrink: 0;
}

.phase-item-new.done .phase-icon-new { background: var(--success); color: #fff; }
.phase-item-new.current .phase-icon-new { background: rgba(99,117,246,.15); color: var(--primary); }
.phase-item-new strong, .phase-item-new small { display: block; }
.phase-item-new small { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

/* Step Tiles */
.step-tiles {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.step-tile-new {
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
  background: rgba(99,117,246,.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  text-align: right;
  transition: transform 150ms ease, border-color 150ms ease;
}

.step-tile-new:hover { transform: translateY(-2px); border-color: var(--primary); }
.step-tile-new.done { border-color: var(--success); background: rgba(22,163,74,.08); }
.step-tile-new.current { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }

.step-tile-top-new { display: flex; align-items: center; justify-content: space-between; }
.step-num-new { font-size: 11px; font-weight: 700; color: var(--text-muted); }

.step-status-dot {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  background: rgba(99,117,246,.1);
  border-radius: 50%;
  font-size: 10px;
  color: var(--text-muted);
}

.step-tile-new.done .step-status-dot { background: var(--success); color: #fff; }
.step-tile-new.current .step-status-dot { background: var(--primary); color: #fff; }
.step-tile-title-new { font-size: 12px; font-weight: 700; line-height: 1.5; margin-top: 8px; }

/* Locked Cards */
.locked-card-new {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 16px; padding: 20px 24px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  opacity: 0.65;
}

.locked-card-new.unlocked { border-style: solid; border-color: var(--primary); background: rgba(99,117,246,.05); opacity: 1; }
.lock-badge {
  min-width: 36px; height: 36px;
  display: grid; place-items: center;
  background: rgba(99,117,246,.1);
  border-radius: 10px;
  font-size: 11px; font-weight: 800;
  color: var(--text-muted); flex-shrink: 0;
}

/* Responsive */
@media (max-width: 900px) {
  .continue-card-new { flex-direction: column; align-items: flex-start; }
  .progress-ring-wrap { width: 120px; height: 120px; }
  .progress-ring-wrap::before { width: 92px; height: 92px; }
}

@media (max-width: 768px) {
  .step-tiles { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
  .step-tiles { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Onboarding 3-Step ─────────────────────────────────────────────────────── */
.ob-progress-wrap {
  max-width: 640px;
  margin: 0 auto 24px;
}

.ob-steps-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  gap: 0;
}

.ob-step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.ob-step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  transition: all .25s;
}

.ob-step-item.ob-active .ob-step-circle {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(14,165,233,.18);
}

.ob-step-item.ob-done .ob-step-circle {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}

.ob-step-label {
  font-size: .75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.ob-step-item.ob-active .ob-step-label { color: var(--primary); font-weight: 600; }
.ob-step-item.ob-done .ob-step-label   { color: var(--success); }

.ob-step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 6px;
  margin-bottom: 22px;
  transition: background .25s;
  min-width: 32px;
}
.ob-step-line.ob-done { background: var(--success); }

.ob-progress-bar-bg {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 4px;
}

.ob-progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
}

.ob-card {
  max-width: 640px;
  margin: 0 auto;
  animation: obCardIn .3s ease;
}

@keyframes obCardIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ob-step-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.ob-step-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ob-step-icon-wrap svg { width: 24px; height: 24px; }

.ob-step-header h2 { margin: 0 0 4px; font-size: 1.1rem; }
.ob-step-header p  { margin: 0; font-size: .875rem; color: var(--text-muted); }

.ob-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ─── Phase Map ──────────────────────────────────────────────────────────────── */
.phase-map-card { overflow: hidden; }

.phase-map-track {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.phase-map-item {
  display: grid;
  grid-template-columns: 56px 4px 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "node  line body"
    "node  line .   ";
  gap: 0 16px;
  padding-bottom: 8px;
}

.phase-map-item:last-child { padding-bottom: 0; }

/* Node (circle icon) */
.pm-node {
  grid-area: node;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 2px;
}

.pm-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  transition: all .3s;
  border: 2px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
}

.pm-icon svg { width: 22px; height: 22px; }

.pm-active .pm-icon {
  background: var(--primary);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(99,117,246,.3);
}

.pm-done .pm-icon {
  background: var(--success);
  border-color: transparent;
  color: #fff;
  box-shadow: none;
}

/* Badge under icon */
.pm-badge {
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}
.pm-badge-active { background: var(--primary-light); color: var(--primary); }
.pm-badge-done   { background: rgba(16,185,129,.12); color: var(--success); }

/* Connector line */
.pm-connector-top,
.pm-connector-bottom {
  grid-area: line;
  width: 2px;
  background: var(--border);
  margin: 0 auto;
  min-height: 16px;
}

.pm-connector-top  { grid-row: 1; align-self: stretch; }
.pm-connector-bottom { grid-row: 2; align-self: stretch; }

.phase-map-item:first-child .pm-connector-top { visibility: hidden; }
.phase-map-item:last-child  .pm-connector-bottom { visibility: hidden; }

.pm-line-done   { background: var(--success); }
.pm-line-active { background: var(--primary); }

/* Body */
.pm-body {
  grid-area: body;
  padding: 0 0 24px;
}

.pm-title {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 6px;
}

.pm-title span {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.pm-title strong { font-size: 1rem; }

.pm-locked .pm-title strong { color: var(--text-muted); }

.pm-desc {
  font-size: .85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Mini progress bar inside phase 1 */
.pm-progress-mini {
  height: 5px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 10px;
}
.pm-progress-mini-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}

/* Locked state */
.pm-locked .pm-body button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* Responsive — mobile stack */
@media (max-width: 600px) {
  .phase-map-item {
    grid-template-columns: 44px 3px 1fr;
    gap: 0 12px;
  }
  .pm-icon { width: 40px; height: 40px; border-radius: 12px; }
}

/* ─── Choice Cards ───────────────────────────────────────────────────────────── */
.choice-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.choice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
  transition: all .2s;
  text-align: center;
  font-family: var(--font);
}

.choice-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(99,117,246,.12);
}

.choice-selected {
  border-color: var(--primary) !important;
  background: var(--primary-light) !important;
  box-shadow: 0 0 0 3px rgba(99,117,246,.18);
}

.choice-icon { font-size: 1.8rem; line-height: 1; }
.choice-title { font-size: .9rem; font-weight: 700; color: var(--text); }
.choice-desc { font-size: .75rem; color: var(--text-muted); line-height: 1.4; }

.choice-selected .choice-title { color: var(--primary); }

@media (max-width: 480px) {
  .choice-cards-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Step Tiles ─────────────────────────────────────────────────────────────── */
.step-tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }

.step-tile {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px; border-radius: 14px; border: 1.5px solid var(--border);
  background: var(--surface); cursor: pointer; text-align: right;
  font-family: var(--font); transition: all .2s;
}
.step-tile:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.step-tile:disabled { opacity: .5; cursor: not-allowed; }

.st-header { display: flex; justify-content: space-between; align-items: center; }
.st-num { font-size: .72rem; font-weight: 700; color: var(--text-muted); }
.st-badge { font-size: .68rem; font-weight: 600; padding: 2px 7px; border-radius: 99px; }
.st-title { font-size: .875rem; font-weight: 600; color: var(--text); line-height: 1.4; flex: 1; }

.st-progress-bar { height: 3px; background: var(--border); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.st-progress-fill { height: 100%; border-radius: 99px; transition: width .4s ease; }

/* وضعیت‌ها */
.st-done   { border-color: rgba(16,185,129,.3); background: rgba(16,185,129,.04); }
.st-done   .st-badge { background: rgba(16,185,129,.12); color: var(--success); }
.st-done   .st-progress-fill { background: var(--success); }

.st-submitted { border-color: rgba(245,158,11,.3); background: rgba(245,158,11,.04); }
.st-submitted .st-badge { background: rgba(245,158,11,.12); color: var(--warning); }
.st-submitted .st-progress-fill { background: var(--warning); }

.st-rejected  { border-color: rgba(239,68,68,.3); background: rgba(239,68,68,.04); }
.st-rejected  .st-badge { background: rgba(239,68,68,.12); color: var(--danger); }
.st-rejected  .st-progress-fill { background: var(--danger); }

.st-current   { border-color: rgba(99,117,246,.35); background: rgba(99,117,246,.04); }
.st-current   .st-badge { background: rgba(99,117,246,.12); color: var(--primary); }
.st-current   .st-progress-fill { background: var(--primary); }

.st-locked    { border-color: var(--border); }
.st-locked    .st-badge { background: var(--surface-2); color: var(--text-muted); }
.st-locked    .st-progress-fill { background: var(--border); }

/* ─── Notification Banner ────────────────────────────────────────────────────── */
.notif-banner {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px; padding: 14px 18px;
  background: var(--primary-light);
  border: 1px solid rgba(99,117,246,.3); border-radius: 16px;
  cursor: pointer; transition: all .2s;
  position: relative; overflow: hidden;
}
.notif-banner::before {
  content: ''; position: absolute; right: 0; top: 0; bottom: 0;
  width: 3px; background: var(--primary);
  border-radius: 0 16px 16px 0;
}
.notif-banner:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(99,117,246,.15); border-color: rgba(99,117,246,.5); }

.notif-banner-icon { font-size: 1.5rem; flex-shrink: 0; }

.notif-banner-body { flex: 1; min-width: 0; }
.notif-banner-title { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.notif-banner-title strong { font-size: .9rem; }

.notif-count-badge {
  font-size: .7rem; font-weight: 700; padding: 1px 7px;
  background: var(--primary); color: #fff; border-radius: 99px;
}

.notif-banner-text {
  margin: 0; font-size: .82rem; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.notif-banner-arrow {
  font-size: 1.1rem; color: var(--primary); flex-shrink: 0;
  transition: transform .2s;
}
.notif-banner:hover .notif-banner-arrow { transform: translateX(-3px); }

/* ═══════════════════════════════════════════════════════════════════
   Dashboard v2 — New Layout (matching screenshot)
═══════════════════════════════════════════════════════════════════ */

/* ── Layout wrapper ── */
.db-layout { display: flex; flex-direction: column; gap: 20px; }

/* ── Header ── */
.db-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 4px;
}
.db-header-text { flex: 1; min-width: 0; }
.db-greeting {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -.03em;
  margin: 6px 0 8px;
  color: var(--text);
}
.db-subtext { font-size: .88rem; color: var(--text-muted); margin: 0; max-width: 460px; line-height: 1.7; }

.db-resume-btn {
  flex-shrink: 0;
  margin-top: 6px;
  border: 1.5px solid var(--border);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  font-size: .88rem;
}

/* ── Mid row: Next step (right→first col) + Phase map (left→second col) ── */
/* در RTL: اول در DOM = سمت راست صفحه */
.db-mid-row {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;   /* next-card راست، phasemap چپ */
  gap: 14px;
  align-items: start;
}

/* Next step card — راست (اول در DOM) */
.db-next-card {
  padding: 22px 24px 20px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.db-next-title {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0 0 6px;
  line-height: 1.35;
}
.db-next-desc {
  font-size: .82rem;
  color: var(--text-muted);
  margin: 0 0 14px;
  line-height: 1.65;
}

/* Progress ring — کوچک‌تر */
.db-ring-wrap {
  display: flex;
  justify-content: center;
  margin: 6px 0 16px;
}
.db-ring {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) 0deg, var(--primary) var(--ring-value), rgba(0,0,0,.08) var(--ring-value));
  display: grid; place-items: center;
  box-shadow: 0 4px 18px rgba(99,117,246,.15);
}
.db-ring-inner {
  width: 66px; height: 66px;
  background: var(--glass-bg-strong);
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
}
.db-ring-inner strong { font-size: .95rem; font-weight: 800; color: var(--text); }
.db-ring-inner small  { font-size: .62rem; color: var(--text-muted); }

.db-next-btn { width: 100%; justify-content: center; font-size: .85rem; padding: 10px 16px; }

/* Phase map card — چپ (دوم در DOM) */
.db-phasemap-card { padding: 18px 20px; }
.db-phasemap-title { font-size: .88rem; font-weight: 700; margin: 0 0 14px; }

.db-phase-list { display: flex; flex-direction: column; gap: 0; }

.db-phase-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0 10px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.db-phase-item:last-child { border-bottom: none; padding-bottom: 0; }
.db-phase-item:first-child { padding-top: 0; }

/* Number circle — کوچک‌تر */
.dpi-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: .78rem; font-weight: 700;
  flex-shrink: 0;
  border: 2px solid var(--border);
  color: var(--text-muted);
  background: var(--glass-bg);
  margin-top: 1px;
}
.dpi-active .dpi-num {
  background: var(--primary);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 10px rgba(99,117,246,.3);
}
.dpi-done .dpi-num {
  background: var(--success);
  border-color: transparent;
  color: #fff;
  box-shadow: none;
}
.dpi-locked .dpi-num { opacity: .4; }

/* Body text */
.dpi-body { display: flex; flex-direction: column; gap: 1px; padding-top: 3px; }
.dpi-body strong { font-size: .82rem; font-weight: 700; color: var(--text); }
.dpi-locked .dpi-body strong { color: var(--text-muted); }
.dpi-body small { font-size: .7rem; color: var(--text-muted); }

/* Progress bar inside phase item */
.dpi-progress-wrap { grid-column: 2; margin-top: 6px; }
.dpi-progress-bar { height: 3px; background: var(--border); border-radius: 99px; overflow: hidden; }
.dpi-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  transition: width .6s ease;
}

/* ── Step tiles (updated) ── */
.step-tiles {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.step-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 12px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--glass-bg);
  cursor: pointer;
  text-align: right;
  font-family: var(--font);
  transition: all .2s;
}
.step-tile:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.08); border-color: var(--primary); }
.step-tile:disabled { opacity: .45; cursor: not-allowed; }

.st-header { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.st-num    { font-size: 1rem; }
.st-label  { font-size: .68rem; font-weight: 700; color: var(--text-muted); }
.st-title  { font-size: .8rem; font-weight: 600; color: var(--text); line-height: 1.4; flex: 1; }
.st-arrow  { font-size: .75rem; color: var(--text-muted); margin-top: auto; }

.st-done      { border-color: rgba(16,185,129,.35); background: rgba(16,185,129,.04); }
.st-done .st-num { color: var(--success); }
.st-submitted { border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.04); }
.st-submitted .st-num { color: var(--warning); }
.st-rejected  { border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.04); }
.st-rejected  .st-num { color: var(--danger); }
.st-current   { border-color: rgba(99,117,246,.45); background: rgba(99,117,246,.05); box-shadow: 0 4px 14px rgba(99,117,246,.12); }
.st-current .st-num { color: var(--primary); }
.st-locked    { opacity: .5; }

/* ── Steps section card ── */
.db-steps-card { padding: 24px; }
.db-steps-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; flex-wrap: wrap;
  gap: 8px; margin-bottom: 18px;
}
.db-steps-title { margin: 4px 0 0; font-size: 1.1rem; }

/* ── Locked cards row ── */
.db-locked-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.db-locked-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  opacity: .7;
}
.db-locked-card.dlc-unlocked { opacity: 1; }

.dlc-body { display: flex; flex-direction: column; gap: 3px; }
.dlc-body strong { font-size: .9rem; font-weight: 700; }
.dlc-body small  { font-size: .78rem; color: var(--text-muted); }

.dlc-lock {
  flex-shrink: 0;
  font-size: .78rem; font-weight: 700;
  padding: 5px 14px;
  border-radius: 99px;
  background: var(--border);
  color: var(--text-muted);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .db-mid-row { grid-template-columns: 1fr; }
  .step-tiles { grid-template-columns: repeat(3, 1fr); }
  .db-locked-row { grid-template-columns: 1fr; }
  .db-next-card { padding: 20px; }
}
@media (max-width: 480px) {
  .step-tiles { grid-template-columns: repeat(2, 1fr); }
  .db-greeting { font-size: 1.5rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Dashboard Fix — این بلوک رو به انتهای style.css اضافه کن
   (override می‌کنه همه چیزی که قبلاً نوشتیم)
═══════════════════════════════════════════════════════════════════════════ */

/* ── eyebrow — تعریف نشده بود ── */
.eyebrow {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 6px;
}

/* ── wrapper داشبورد ── */
.dashboard-wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 28px 20px 48px;
  /* safe-area برای PWA/notch */
  padding-top: calc(28px + env(safe-area-inset-top, 0px));
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Header ── */
.dashboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.dashboard-head h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -.03em;
  margin: 4px 0 6px;
  color: var(--text);
}
.dashboard-head .db-subtext {
  font-size: .85rem;
  color: var(--text-muted);
  max-width: 440px;
  line-height: 1.7;
  margin: 0;
}
.dashboard-resume-btn {
  flex-shrink: 0;
  margin-top: 4px;
  font-size: .85rem;
}

/* ── Notification banner ── */
.notification-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--glass-bg);
  border: 1.5px solid rgba(22,163,74,.4);
  backdrop-filter: blur(12px);
  cursor: pointer;
  text-align: right;
  font-family: var(--font);
  transition: all var(--dur-1) var(--ease-out);
}
.notification-banner:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99,117,246,.12);
  border-color: rgba(22,163,74,.7);
}
.notification-banner-mark {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: transparent;
  color: #16a34a;
  border: 2.5px solid #16a34a;
  font-size: .82rem; font-weight: 800;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.notification-banner-text { flex: 1; min-width: 0; }
.notification-banner-text strong { display: block; font-size: .88rem; font-weight: 700; color: var(--text);}
.notification-banner-text small  { font-size: .78rem; color: var(--text-muted); }
.notification-banner-arrow {
  font-size: 1.1rem; color: #16a34a;
  flex-shrink: 0;
  transition: transform var(--dur-1);
}
.notification-banner:hover .notification-banner-arrow { transform: translateX(-3px); }

/* ── Main grid ── */
/* در RTL: col 1 = سمت چپ DOM، ولی چون dir=rtl → col 1 = راست بصری */
/* continue-card باید سمت راست (= col 1 در RTL) باشه */
/* phase-card باید سمت چپ (= col 2 در RTL) باشه */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
}

/* continue-card: col 1 = راست بصری در RTL */
.continue-card {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 28px;
}
.continue-card-text { flex: 1; min-width: 0; }
.continue-card h2 {
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0 0 8px;
  line-height: 1.35;
  color: var(--text);
}
.continue-card p {
  font-size: .82rem;
  color: var(--text-muted);
  margin: 0 0 16px;
  line-height: 1.65;
}

/* phase-card: col 2 = چپ بصری در RTL */
.phase-card {
  grid-column: 2;
  grid-row: 1;
  padding: 22px;
}
.phase-card h3 {
  font-size: .88rem;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--text);
}
.phase-list { display: flex; flex-direction: column; }
.phase-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.phase-item:first-child { padding-top: 0; }
.phase-item:last-child  { border-bottom: none; padding-bottom: 0; }
.phase-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: .78rem; font-weight: 700;
  flex-shrink: 0;
  border: 2px solid var(--border);
  color: var(--text-muted);
  background: var(--glass-bg);
  margin-top: 1px;
  /* override step-number که position:absolute داره */
  position: static !important;
  top: auto !important; right: auto !important;
  box-shadow: none;
}
.phase-item.current .phase-icon {
  background: var(--primary);
  border-color: transparent; color: #fff;
  box-shadow: 0 3px 10px rgba(99,117,246,.3);
}
.phase-item.done .phase-icon {
  background: var(--success);
  border-color: transparent; color: #fff;
}
.phase-item strong { display: block; font-size: .82rem; font-weight: 700; color: var(--text); }
.phase-item small  { font-size: .7rem; color: var(--text-muted); margin-top: 2px; display: block; }

/* progress ring */
.progress-ring {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: conic-gradient(
    var(--primary) 0deg,
    var(--primary) var(--value),
    rgba(99,117,246,.16) var(--value)
  );
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 18px rgba(99,117,246,.12);
}
[data-theme="dark"] .progress-ring {
  background: conic-gradient(
    var(--primary) 0deg,
    var(--primary) var(--value),
    rgba(255,255,255,.14) var(--value)
  );

  box-shadow: 0 4px 20px rgba(99,117,246,.18);
}

.progress-ring-content {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);

  /* Light */
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.45);
}
[data-theme="dark"] .progress-ring-content {
  /* متناسب با سطح Dark کارت */
  background: rgba(32, 35, 43, 0.88);
  border-color: rgba(255, 255, 255, 0.08);
}
.progress-ring-content strong { font-size: 1.15rem; font-weight: 800; color: var(--text); }
.progress-ring-content small  { font-size: .7rem; color: var(--text-muted); }

/* roadmap-card: full width, row 2 */
.roadmap-card {
  grid-column: 1 / -1;
  grid-row: 2;
  padding: 24px;
}
.roadmap-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.roadmap-head h2 { margin: 4px 0 0; font-size: 1.05rem; font-weight: 700; color: var(--text); }
.roadmap-head .db-subtext { font-size: .8rem; color: var(--text-muted); margin: 0; align-self: flex-end; }

/* ── Step grid داخل roadmap ── */
.step-grid {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 10px !important;
  /* override step-tiles */
}

/* ── Step tile — override کامل ── */
.step-grid .step-tile {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  padding: 12px 10px !important;
  border-radius: 12px !important;
  border: 1.5px solid rgba(0, 0, 0, 0.07) !important;
  background: #f8f8f8 !important;
  cursor: pointer;
  text-align: right;
  font-family: var(--font);
  transition: all .2s;
  min-height: unset !important;
  height: auto !important;
  position: relative !important;
}
.step-grid .step-tile:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.08);
  border-color: var(--primary) !important;
}
.step-grid .step-tile:disabled { opacity: .45; cursor: not-allowed; }

/* وضعیت‌ها */
.step-grid .step-tile.done     { border-color: rgba(16,185,129,.35) !important; background: rgba(16,185,129,.05) !important; }
.step-grid .step-tile.submitted { border-color: rgba(245,158,11,.35) !important; background: rgba(245,158,11,.04) !important; }
.step-grid .step-tile.rejected  { border-color: rgba(239,68,68,.35) !important;  background: rgba(239,68,68,.04) !important; }
.step-grid .step-tile.current   { border-color: rgba(99,117,246,.45) !important;  background: rgba(99,117,246,.05) !important; box-shadow: 0 4px 14px rgba(99,117,246,.12); }

/* محتوای داخل tile */
.step-tile-top {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 4px;
}
/* override .step-number که position:absolute داره */
.step-grid .step-tile .tile-step-num {
  font-size: .68rem;
  font-weight: 700;
  color: var(--text-muted);
  /* نه position:absolute */
  position: static !important;
  width: auto !important;
  height: auto !important;
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  display: inline !important;
}
.step-grid .step-tile.done     .tile-step-num { color: var(--success); }
.step-grid .step-tile.current  .tile-step-num { color: var(--primary); }
.step-grid .step-tile.submitted .tile-step-num { color: var(--warning); }
.step-grid .step-tile.rejected  .tile-step-num { color: var(--danger); }

.tile-status-mark {
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  background: var(--border);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.step-grid .step-tile.done     .tile-status-mark { background: rgba(16,185,129,.15); color: var(--success); }
.step-grid .step-tile.submitted .tile-status-mark { background: rgba(245,158,11,.15); color: var(--warning); }
.step-grid .step-tile.rejected  .tile-status-mark { background: rgba(239,68,68,.15);  color: var(--danger); }
.step-grid .step-tile.current   .tile-status-mark { background: rgba(99,117,246,.12); color: var(--primary); }

.tile-title {
  font-size: .78rem !important;
  font-weight: 600 !important;
  color: var(--text) !important;
  line-height: 1.4 !important;
  /* override هر چیزی */
  position: static !important;
  display: block !important;
}
.step-grid .step-tile:disabled .tile-title { color: var(--text-muted) !important; }

/* locked-row: full width, row 3 */
.locked-row {
  grid-column: 1 / -1;
  grid-row: 3;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.locked-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--glass-bg);
  opacity: .7;
}
.locked-card.unlocked {
  opacity: 1;
  border-color: var(--primary);
  background: rgba(99,117,246,.04);
}
.locked-card h3 { font-size: .9rem; font-weight: 700; margin: 0 0 4px; color: var(--text); }
.locked-card p  { font-size: .78rem; color: var(--text-muted); margin: 0; }
.lock-symbol {
  flex-shrink: 0;
  font-size: .75rem; font-weight: 700;
  padding: 5px 14px;
  border-radius: 99px;
  background: rgba(148,163,184,.2);
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .continue-card {
    grid-column: 1;
    flex-direction: row !important;
    align-items: center;
    gap: 16px;
  }
  .progress-ring { width: 90px; height: 90px; flex-shrink: 0; }
  .progress-ring-content { width: 68px; height: 68px; }
  .phase-card     { grid-column: 1; grid-row: 2; }
  .roadmap-card   { grid-row: 3; }
  .locked-row     { grid-row: 4; grid-template-columns: 1fr; }
  .step-grid      { grid-template-columns: repeat(3, 1fr) !important; }
  .progress-ring  { width: 100px; height: 100px; }
  .progress-ring-content { width: 76px; height: 76px; }
  .dashboard-wrap { padding: 20px 14px 40px; }
}
@media (max-width: 480px) {
  .step-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .dashboard-head h1 { font-size: 1.4rem; }
}

/* ── Dashboard grid card fixes ── */
.dashboard-grid .card + .card { margin-top: 0; }
.dashboard-grid .card { height: 100%; box-sizing: border-box; }
.phase-card { display: flex; flex-direction: column; }

/* ── Nav: لوگو چسبیده به لینک‌ها، theme/خروج سمت چپ ── */
.nav-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  max-width: 1140px;
  margin: 0 auto;
  min-height: 60px;
}
.nav-brand { flex-shrink: 0; margin-left: 0; }
.nav-inner > .nav-links { flex: 1; margin-right: 8px; }
.nav-inner > .nav-links .theme-toggle,
.nav-inner > .nav-links .nav-link.danger { margin-right: auto; }


/* ── Gradient: باکس قدم بعدی ── */

.continue-card {
  background:
    radial-gradient(
      circle at 8% 5%,
      rgba(255, 255, 255, 0.42) 0%,
      transparent 26%
    ),
    linear-gradient(
      135deg,
      #e3e8ff 0%,
      #d5dcff 48%,
      #c4ceff 100%
    );

  border-color: rgba(99, 117, 246, 0.12);
}

/* Dark Mode */
[data-theme="dark"] .continue-card {
  background:
    radial-gradient(
      circle at 8% 5%,
      rgba(255, 255, 255, 0.07) 0%,
      transparent 26%
    ),
    linear-gradient(
      135deg,
      #202744 0%,
      #252e52 48%,
      #2c3763 100%
    );

  border-color: rgba(255, 255, 255, 0.08);
}

/* ═════════════════════════════════════════════════════
   Dashboard Surfaces — subtle gray separation
   ═════════════════════════════════════════════════════ */

/* ── سه فاز + باکس قدم‌ها ── */
.phase-card,
.roadmap-card {
  background: #f2f3f5 !important;
  border-color: #e1e3e7 !important;
}

/* حذف لایه سفید glass که سطح را دوباره سفید می‌کند */
.phase-card::before,
.roadmap-card::before {
  background: none !important;
}

/* ── هر قدم ── */
.step-grid .step-tile {
  background: #e9ebee !important;
  border-color: #dfe2e6 !important;
}

/* ── Dark Mode ── */
[data-theme="dark"] .phase-card,
[data-theme="dark"] .roadmap-card {
  background: #17191f !important;
  border-color: rgba(255,255,255,.09) !important;
}

[data-theme="dark"] .phase-card::before,
[data-theme="dark"] .roadmap-card::before {
  background: none !important;
}

[data-theme="dark"] .step-grid .step-tile {
  background: #20232b !important;
  border-color: rgba(255,255,255,.08) !important;
}

/* ═══════════════════════════════════════════════
   MOBILE-FIRST OVERHAUL — PWA optimized
   Target: iOS Safari, Android Chrome, PWA standalone
   ═══════════════════════════════════════════════ */

/* Safe area support برای notch و home bar */
:root {
  --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 (max-width: 768px) {

  /* ── Base ── */
  html {
    font-size: 15px;
    /* جلوگیری از zoom روی focus در iOS */
    -webkit-text-size-adjust: 100%;
  }

  body {
    /* حذف blob animation در موبایل — باعث lag میشه */
    overscroll-behavior-y: none;
  }
  body::before, body::after { display: none; }

  /* ── Nav: تبدیل به bottom tab bar در موبایل ── */
  .nav {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
    padding-bottom: var(--safe-bottom);
    z-index: 200;
    /* حذف top sticky که در موبایل جا میگیره */
    animation: navInMobile 400ms var(--ease-out);
  }
  @keyframes navInMobile {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
  }

  .nav-inner {
    padding: 6px 8px calc(6px + var(--safe-bottom));
    min-height: 56px;
    justify-content: space-around;
    gap: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav-inner::-webkit-scrollbar { display: none; }

  /* برند رو در موبایل مخفی کن — فضا کمه */
  .nav-brand { display: none; }

  /* hamburger دیگه نداریم — همه لینک‌ها در bottom bar */
  .nav-toggle { display: none !important; }

  .nav-links {
    display: flex !important;   /* همیشه نمایش */
    flex-direction: row !important;
    gap: 0;
    width: 100%;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    justify-content: space-around;
    align-items: center;
    background: none;
    animation: none;
  }

  .nav-link {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px;
    font-size: 0.62rem;
    border-radius: 12px;
    min-width: 48px;
    min-height: 48px;   /* حداقل touch target */
    border: none;
    flex: 1;
  }
  .nav-link .icon {
    width: 20px;
    height: 20px;
  }
  .nav-link span:not(.nav-dot) {
    font-size: 0.6rem;
    white-space: nowrap;
  }
  .nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    box-shadow: none;
  }

  /* theme toggle در bottom bar — آخر بذارش */
  .theme-toggle {
    min-width: 44px;
    min-height: 44px;
    border-radius: 12px;
    flex-shrink: 0;
  }

  /* ── Page padding — جا برای bottom nav بده ── */
  .page {
    padding-top: 16px;
    padding-bottom: calc(80px + var(--safe-bottom));
  }

  /* ── Container ── */
  .container { padding: 0 12px; }

  /* ── Auth ── */
  /* ── Auth — centered on mobile ── */
  .auth-page {
    min-height: 100dvh;
    align-items: center;
    justify-content: center;

    padding:
      calc(var(--safe-top) + 20px)
      16px
      calc(var(--safe-bottom) + 20px);

    overflow-y: auto;
  }

  .auth-card {
    width: 100%;
    max-width: 420px;

    border-radius: 24px;
    padding: 32px 20px;

    margin: auto;
  }
  /* ── Back FAB — بالاتر از bottom nav ── */
  .back-fab {
    bottom: calc(72px + var(--safe-bottom));
    right: 16px;
    top: auto;
    width: 44px;
    height: 44px;
  }

  /* ── Toast — بالای صفحه با safe area ── */
  #toast-container {
    top: calc(var(--safe-top) + 28px);
    left: 12px;
    right: 12px;
    align-items: stretch;
  }
  .toast {
    min-width: unset;
    max-width: unset;
    width: 100%;
    font-size: 0.85rem;
  }

  /* ── Cards ── */
  .card { padding: 16px; border-radius: 14px; }
  .card + .card { margin-top: 12px; }

  /* ── Buttons — بزرگتر برای لمس ── */
  .btn {
    padding: 13px 18px;
    font-size: 0.9rem;
    min-height: 48px;
  }
  .btn-sm {
    padding: 9px 14px;
    min-height: 40px;
  }

  /* ── Forms — جلوگیری از zoom در iOS ── */
  input, textarea, select {
    font-size: 16px !important;  /* iOS zoom اگه کمتر از 16px باشه */
    padding: 13px 14px;
    border-radius: 10px;
  }

  /* ── Podcast player bar ── */
  .player-bar {
    bottom: calc(72px + var(--safe-bottom));
    left: 8px;
    right: 8px;
    padding: 10px 12px;
    gap: 10px;
    border-radius: 14px;
  }
  #player-title { font-size: 0.8rem; min-width: 80px; }

  /* ── Stats ── */
  .stats-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
  }
  .stat-card { padding: 14px 8px; }
  .stat-num { font-size: 1.6rem; }
  .stat-label { font-size: 0.72rem; }
  .stat-icon { width: 32px; height: 32px; border-radius: 10px; margin-bottom: 8px; }

  /* ── Step tiles ── */
  .step-tiles { grid-template-columns: repeat(4, 1fr); gap: 6px; }

  /* ── Onboarding ── */
  .ob-card { padding: 16px; }
  .ob-progress-wrap { padding: 0 4px; }
  .choice-cards-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .choice-card { padding: 12px 8px; }

  /* ── Typography ── */
  h1 { font-size: 1.35rem; }
  h2 { font-size: 1.15rem; }

  /* ── Table — scroll horizontal ── */
  .table-wrap { border-radius: 10px; }
  td, th { padding: 10px 12px; font-size: 0.82rem; }

  /* ── Grid 2 ── */
  .grid-2 { grid-template-columns: 1fr; gap: 12px; }

  /* ── Scrollbar مخفی در موبایل ── */
  ::-webkit-scrollbar { display: none; }
  * { scrollbar-width: none; }
}

/* ── extra small ── */
@media (max-width: 380px) {
  .nav-link span:not(.nav-dot) { display: none; }  /* فقط آیکون */
  .nav-link { min-width: 40px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .step-tiles { grid-template-columns: repeat(3, 1fr); }
}

/* ── PWA standalone mode ── */
@media (display-mode: standalone) {
  .nav {
    /* در PWA حتماً bottom bar باشه با safe area */
    padding-bottom: var(--safe-bottom);
  }
  /* page top padding — جایی که status bar هست */
  .page { padding-top: calc(var(--safe-top) + 8px); }
  .auth-page {
    min-height: 100dvh;
    padding:
      calc(var(--safe-top) + 20px)
      16px
      calc(var(--safe-bottom) + 20px);
  }
}

/* ── Tap highlight حذف ── */
* { -webkit-tap-highlight-color: transparent; }
button, a, [role="button"] { touch-action: manipulation; }

/* ═══════════════════════════════════════════════
   MOBILE / PWA — FINAL SAFE AREA FIX
   ═══════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* ── Welcome / Toast ── */
  #toast-container {
    position: fixed;

    /* فاصله واقعی از بالای صفحه + status bar */
    top: calc(env(safe-area-inset-top, 0px) + 32px);

    left: 12px;
    right: 12px;

    width: auto;
    max-width: none;

    z-index: 9999;

    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;

    pointer-events: none;
  }

  .toast {
    position: relative;
    width: 100%;
    max-width: none;
    min-width: 0;

    margin: 0;
    box-sizing: border-box;
  }

  /* ── Auth ── */
  .auth-page {
    min-height: 100dvh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding:
      calc(env(safe-area-inset-top, 0px) + 20px)
      16px
      calc(env(safe-area-inset-bottom, 0px) + 20px);
  }

  .auth-card {
    width: 100%;
    max-width: 420px;
    margin: auto;
    border-radius: 24px;
  }
}


/* ── PWA Standalone ── */
@media (display-mode: standalone) {

  #toast-container {
    top: calc(env(safe-area-inset-top, 0px) + 32px);
  }

  .auth-page {
    min-height: 100dvh;

    padding:
      calc(env(safe-area-inset-top, 0px) + 20px)
      16px
      calc(env(safe-area-inset-bottom, 0px) + 20px);
  }
}

/* ═══════════════════════════════════════════════
   MOBILE BROWSER — BOTTOM BAR ABOVE BROWSER UI
   ═══════════════════════════════════════════════ */

@media (max-width: 768px) and (display-mode: browser) {

  .nav {
    bottom: 12px;
    left: 10px;
    right: 10px;

    border-radius: 20px;

    /*
     * مرورگر موبایل خودش bottom UI دارد.
     * safe-area برای نوار مرورگر کافی نیست،
     * پس کمی فاصلهٔ واقعی از پایین می‌دهیم.
     */
    padding-bottom: 0;
  }

  .nav-inner {
    padding:
      6px
      8px;

    min-height: 56px;
  }

  /* محتوای صفحه هم زیر bottom bar نرود */
  .page {
    padding-bottom: 100px;
  }

  /* اگر پلیر فعال شد، بالاتر از bottom nav قرار بگیرد */
  .player-bar {
    bottom: 88px;
  }

  .back-fab {
    bottom: 92px;
  }
}


/* ═══════════════════════════════════════════════
   PWA — KEEP SAFE AREA BEHAVIOR
   ═══════════════════════════════════════════════ */

@media (max-width: 768px) and (display-mode: standalone) {

  .nav {
    bottom: 0;
    left: 0;
    right: 0;

    border-radius: 20px 20px 0 0;

    padding-bottom: var(--safe-bottom);
  }

  .nav-inner {
    padding:
      6px
      8px
      calc(6px + var(--safe-bottom));
  }

  .page {
    padding-bottom: calc(90px + var(--safe-bottom));
  }

  .player-bar {
    bottom: calc(72px + var(--safe-bottom));
  }

  .back-fab {
    bottom: calc(72px + var(--safe-bottom));
  }
}

/* ── Onboarding page — بدون nav، وسط‌چین مثل auth ── */
.ob-page-wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) 16px
           calc(env(safe-area-inset-bottom, 0px) + 24px);
}

.ob-page-wrap .container {
  width: 100%;
  max-width: 600px;
  margin: 0;
  padding: 0;
}

/* ═══════════════════════════════════════════════════════
   Workers724 — Onboarding جدید (سه‌بخشی)
   این استایل‌ها را به فایل CSS اصلی اضافه کن
   ═══════════════════════════════════════════════════════ */

/* ─── wrapper ─────────────────────────────────────────── */
.ob-new-wrap {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px 60px;
  background: var(--bg);
}

.ob-new-inner {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ─── هدر ─────────────────────────────────────────────── */
.ob-new-header {
  text-align: center;
  padding: 8px 0 4px;
}

.ob-new-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 6px;
}

.ob-new-header p {
  color: var(--text-muted);
  margin: 0;
}

/* ─── section ─────────────────────────────────────────── */
.ob-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ob-section-label {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ob-section-label h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.ob-section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ─── ویدیو ───────────────────────────────────────────── */
.ob-video-wrap {
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0,0,0,.04);
}

.ob-video-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  background: linear-gradient(135deg, rgba(14,165,233,.06), rgba(20,184,166,.06));
  border-radius: 14px;
  border: 1.5px dashed var(--border);
  cursor: pointer;
  transition: background .2s;
}

.ob-video-placeholder:hover {
  background: linear-gradient(135deg, rgba(14,165,233,.12), rgba(20,184,166,.12));
}

.ob-video-play-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.ob-video-play-btn p {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent);
}

.ob-video-play-btn small {
  color: var(--text-muted);
  font-size: .82rem;
}

.ob-video-rewatch {
  display: none;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: .85rem;
  color: var(--text-muted);
  cursor: pointer;
  align-self: flex-end;
  transition: border-color .2s, color .2s;
}

.ob-video-rewatch:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── FAQ ─────────────────────────────────────────────── */
.ob-faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ob-faq-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.ob-faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card-bg);
  border: none;
  cursor: pointer;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  text-align: right;
  transition: background .15s;
}

.ob-faq-q:hover {
  background: rgba(14,165,233,.06);
}

.ob-faq-arrow {
  flex-shrink: 0;
  font-size: .75rem;
  color: var(--accent);
  transition: transform .22s ease;
}

.ob-faq-a {
  padding: 0 16px 14px;
  background: var(--card-bg);
}

.ob-faq-a p {
  margin: 0;
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.75;
}

/* ─── Memory / باکس حافظه ──────────────────────────────── */
.ob-memory-hint {
  margin: -4px 0 0;
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* فید پیام‌ها */
.ob-memory-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 72px;
  max-height: 260px;
  overflow-y: auto;
  padding: 4px 2px;
}

.ob-memory-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: .88rem;
  opacity: .7;
}

.ob-memory-empty p { margin: 0; }

/* حباب پیام ارسال شده */
.ob-memory-msg {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  animation: ob-msg-in .25s ease;
}

@keyframes ob-msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ob-memory-msg-bubble {
  background: linear-gradient(135deg, var(--accent), rgba(20,184,166,.9));
  color: #fff;
  padding: 10px 14px;
  border-radius: 14px 14px 4px 14px;
  font-size: .9rem;
  line-height: 1.6;
  max-width: 90%;
  white-space: pre-wrap;
  word-break: break-word;
}

.ob-memory-msg-time {
  font-size: .75rem;
  color: var(--text-muted);
  padding-left: 4px;
}

/* ورودی پیام */
.ob-memory-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 4px;
}

.ob-memory-textarea {
  width: 100%;
  min-height: 80px;
  resize: vertical;
  font-family: inherit;
  font-size: .93rem;
  line-height: 1.6;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--input-bg, var(--bg));
  color: var(--text);
  transition: border-color .2s;
  box-sizing: border-box;
}

.ob-memory-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.ob-memory-send-btn {
  align-self: flex-end;
  min-width: 110px;
}

/* ─── دکمه ورود به پلتفرم ────────────────────────────── */
.ob-enter-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 8px;
}

.ob-enter-btn {
  font-size: 1.05rem;
  padding: 14px;
  border-radius: 14px;
}

.ob-enter-hint {
  text-align: center;
  font-size: .82rem;
  color: var(--text-muted);
  margin: 0;
}

/* ─── موبایل ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .ob-new-wrap { padding: 20px 12px 48px; }
  .ob-section  { padding: 18px 16px 16px; }
  .ob-new-header h1 { font-size: 1.3rem; }
  .ob-video-placeholder { min-height: 180px; }
}