/* ═══════════════════════════════════════════════════════════════════════════
   یادآور — استایلِ اصلی
   بر پایهٔ UI Kit (توکن‌ها، گردی‌ها، اکسنتِ متحرک، پس‌زمینهٔ نفس‌کش، الگوی کامپوننت‌ها)
   + تمِ تیرهٔ پیش‌فرض و نوار ناوبریِ شناور به سبکِ اسکرین‌شات‌های مدیارو.
   همهٔ رنگ‌ها توکن‌اند تا هر دو تم از یک مجموعه قانون استفاده کنند.
   ═══════════════════════════════════════════════════════════════════════════ */
@import url('/assets/fonts/fonts.css');

@property --accent       { syntax: '<color>'; inherits: true; initial-value: #14b8a6; }
@property --accent-light { syntax: '<color>'; inherits: true; initial-value: #2dd4bf; }

@keyframes accentShift {
  0%   { --accent:#14b8a6; --accent-light:#2dd4bf; }
  14%  { --accent:#06b6d4; --accent-light:#22d3ee; }
  28%  { --accent:#6366f1; --accent-light:#a5b4fc; }
  42%  { --accent:#ec4899; --accent-light:#f9a8d4; }
  57%  { --accent:#f97316; --accent-light:#fdba74; }
  71%  { --accent:#10b981; --accent-light:#34d399; }
  85%  { --accent:#8b5cf6; --accent-light:#c4b5fd; }
  100% { --accent:#14b8a6; --accent-light:#2dd4bf; }
}

/* ─── توکن‌ها: تمِ روشن (از کیت) ───────────────────────────────────────── */
:root {
  --accent: #14b8a6;
  --accent-light: #2dd4bf;
  --accent-bg: color-mix(in srgb, var(--accent) 10%, transparent);
  --accent-glow: color-mix(in srgb, var(--accent) 20%, transparent);
  --accent-ink: color-mix(in srgb, var(--accent) 70%, #0f172a);

  --bg: #f4fbfa;
  --bg-grad: radial-gradient(ellipse 70% 50% at 15% 0%, rgba(20,184,166,.13), transparent),
             radial-gradient(ellipse 50% 40% at 95% 100%, rgba(99,102,241,.07), transparent),
             linear-gradient(180deg, #f4fbfa 0%, #edf6f5 60%, #f0f9ff 100%);
  --surface: rgba(255,255,255,.94);
  --surface-solid: #ffffff;
  --surface-2: #f8fafc;
  --surface-soft: #f1f5f9;
  --fg: #0f172a;
  --fg2: #334155;
  --muted: #64748b;
  --muted2: #94a3b8;
  --border: #e2e8f0;
  --border2: #cbd5e1;
  --glass: rgba(255,255,255,.78);
  --glass-border: rgba(15,23,42,.08);
  --input-bg: #ffffff;
  --hero: linear-gradient(135deg, #d9f5f0 0%, #e4e9fb 55%, #efe6fb 100%);
  --hero-glow: rgba(255,255,255,.85);
  --bubble: rgba(255,255,255,.88);
  --sidebar: linear-gradient(180deg, #0c1a2e 0%, #111827 100%);

  --danger: #ef4444;   --danger-bg: rgba(239,68,68,.08);  --danger-border: rgba(239,68,68,.22); --danger-ink: #dc2626;
  --success: #22c55e;  --success-bg: rgba(34,197,94,.08); --success-border: rgba(34,197,94,.22); --success-ink: #15803d;
  --warning: #f59e0b;  --warning-bg: rgba(245,158,11,.09); --warning-border: rgba(245,158,11,.24); --warning-ink: #b45309;
  --info: #6366f1;     --info-bg: rgba(99,102,241,.08);   --info-border: rgba(99,102,241,.2);   --info-ink: #4f46e5;

  --shadow-xs: 0 2px 8px rgba(15,23,42,.05);
  --shadow: 0 8px 32px rgba(15,23,42,.08);
  --shadow-md: 0 16px 48px rgba(15,23,42,.10);
  --shadow-lg: 0 24px 64px rgba(15,23,42,.13);
  --shadow-accent: 0 12px 32px color-mix(in srgb, var(--accent) 30%, transparent);

  --sw: 260px;
  --hh: 60px;
  --nav-h: 70px;
  --r: 24px;
  --rsm: 14px;
  --rlg: 32px;
  --ease: cubic-bezier(.22,1,.36,1);
  --spring: cubic-bezier(.34,1.56,.64,1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

/* ─── تمِ تیره (پیش‌فرض) — هم‌خانواده با کیت، با حسِ مدیارو ─────────────── */
:root[data-theme="dark"] {
  --accent-ink: var(--accent-light);
  --bg: #0b0f19;
  --bg-grad: radial-gradient(ellipse 80% 50% at 85% -10%, rgba(20,184,166,.10), transparent 60%),
             radial-gradient(ellipse 60% 50% at 0% 100%, rgba(139,92,246,.08), transparent 60%),
             linear-gradient(180deg, #0b0f19 0%, #0d1220 100%);
  --surface: rgba(22,28,42,.92);
  --surface-solid: #161c2a;
  --surface-2: #1a2132;
  --surface-soft: #1d2537;
  --fg: #e9edf5;
  --fg2: #c3cad8;
  --muted: #8b94a9;
  --muted2: #5d6780;
  --border: rgba(255,255,255,.075);
  --border2: rgba(255,255,255,.13);
  --glass: rgba(20,26,40,.78);
  --glass-border: rgba(255,255,255,.08);
  --input-bg: #121827;
  --hero: radial-gradient(ellipse 60% 70% at 25% 20%, rgba(170,190,200,.20), transparent 60%),
          linear-gradient(135deg, #1b3b44 0%, #1d2a42 50%, #2a2445 100%);
  --hero-glow: rgba(160,200,210,.22);
  --bubble: rgba(14,19,31,.82);
  --sidebar: linear-gradient(180deg, #0e1424 0%, #0a0e19 100%);
  --danger-bg: rgba(239,68,68,.12);  --danger-border: rgba(239,68,68,.28); --danger-ink: #fca5a5;
  --success-bg: rgba(34,197,94,.12); --success-border: rgba(34,197,94,.28); --success-ink: #86efac;
  --warning-bg: rgba(245,158,11,.13); --warning-border: rgba(245,158,11,.3); --warning-ink: #fcd34d;
  --info-bg: rgba(129,140,248,.13);  --info-border: rgba(129,140,248,.3);  --info-ink: #a5b4fc;
  --shadow-xs: 0 2px 8px rgba(0,0,0,.25);
  --shadow: 0 10px 30px rgba(0,0,0,.30);
  --shadow-md: 0 16px 44px rgba(0,0,0,.38);
  --shadow-lg: 0 24px 70px rgba(0,0,0,.5);
  color-scheme: dark;
}

/* اکسنتِ متحرک — با تنظیم «انیمیشن رنگ» خاموش می‌شود */
:root.accent-anim { animation: accentShift 18s ease-in-out infinite; }

/* ─── Reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  direction: rtl; height: 100%;
  overflow-x: hidden;                         /* تلهٔ ۱۱ کیت */
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  background: var(--bg);
}
body {
  font-family: 'Vazirmatn', Tahoma, system-ui, sans-serif;
  font-size: 14px; line-height: 1.65;
  color: var(--fg);
  min-height: 100vh; min-height: 100dvh;
  overflow-x: hidden; max-width: 100vw;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: var(--bg-grad);
  background-attachment: fixed;
  overscroll-behavior-y: none;
}
@keyframes bgPulse {
  0%,100% { filter: hue-rotate(0deg)   brightness(1);   }
  25%     { filter: hue-rotate(40deg)  brightness(1.02);}
  50%     { filter: hue-rotate(180deg) brightness(1.01);}
  75%     { filter: hue-rotate(300deg) brightness(1.02);}
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 10% -10%, rgba(20,184,166,.16), transparent 55%),
    radial-gradient(ellipse 60% 50% at 90% 110%, rgba(99,102,241,.11), transparent 55%),
    radial-gradient(ellipse 40% 40% at 50% 50%, rgba(236,72,153,.04), transparent 60%);
}
:root[data-theme="dark"] body::before { opacity: .55; }
:root.accent-anim body::before { animation: bgPulse 18s ease-in-out infinite; }

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; cursor: pointer; border: none; background: none; }
img, svg { max-width: 100%; }
::selection { background: var(--accent-glow); }
[hidden] { display: none !important; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.num { font-feature-settings: "tnum"; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ─── Keyframes (کیت + اضافه) ──────────────────────────────────────── */
@keyframes fadeUp   { from{opacity:0;transform:translateY(14px)} to{opacity:1;transform:none} }
@keyframes fadeIn   { from{opacity:0} to{opacity:1} }
@keyframes spin     { to{transform:rotate(360deg)} }
@keyframes pulse    { 0%,100%{opacity:1} 50%{opacity:.4} }
@keyframes shimmer  { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
@keyframes countUp  { from{opacity:0;transform:translateY(8px) scale(.88)} to{opacity:1;transform:none} }
@keyframes slideUp  { from{transform:translateY(100%)} to{transform:none} }
@keyframes slideDown{ from{transform:none} to{transform:translateY(100%)} }
@keyframes popIn    { 0%{opacity:0;transform:scale(.85)} 70%{transform:scale(1.03)} 100%{opacity:1;transform:none} }
@keyframes toastIn  { from{opacity:0;transform:translateY(20px) scale(.96)} to{opacity:1;transform:none} }
@keyframes toastOut { to{opacity:0;transform:translateY(16px) scale(.96)} }
@keyframes dotPulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.35);opacity:.7} }

/* ═══ Layout ══════════════════════════════════════════════════════════ */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.view {
  flex: 1; width: 100%; max-width: 760px; margin: 0 auto;
  padding: 14px 16px calc(var(--nav-h) + 40px + var(--safe-b));
}
.view.wide { max-width: 1100px; }
.view > * { animation: fadeUp .38s var(--ease) both; }
.view > *:nth-child(2) { animation-delay: .04s; }
.view > *:nth-child(3) { animation-delay: .08s; }
.view > *:nth-child(4) { animation-delay: .12s; }
.view > *:nth-child(5) { animation-delay: .16s; }
.view > *:nth-child(n+6) { animation-delay: .2s; }

/* ─── هدر ──────────────────────────────────────────────────────────── */
.app-header {
  position: sticky; top: 0; z-index: 40;
  padding: var(--safe-t) 16px 0;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--border);
}
.app-header-in {
  height: var(--hh); display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 760px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.brand-icon {
  width: 40px; height: 40px; border-radius: 13px; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(145deg, #8fe3d8, #a8b8f5 60%, #c4a8f0);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent), inset 0 1px 0 rgba(255,255,255,.5);
  display: grid; place-items: center;
}
.brand-icon yado-mascot { margin-top: 6px; }
.clock { text-align: left; line-height: 1.25; direction: rtl; }
.clock-j { font-size: 13px; font-weight: 700; color: var(--fg); white-space: nowrap; }
.clock-g { font-size: 11px; color: var(--muted); direction: ltr; text-align: left; white-space: nowrap; font-weight: 500; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--fg2);
  transition: transform .15s, background .15s;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 20px; height: 20px; }

/* ─── نوار پایینِ شناور ───────────────────────────────────────────── */
.tabbar {
  position: fixed; z-index: 45;
  left: 12px; right: 12px; bottom: calc(10px + var(--safe-b));
  height: var(--nav-h);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  padding: 0 6px;
  background: var(--glass);
  backdrop-filter: saturate(170%) blur(22px);
  -webkit-backdrop-filter: saturate(170%) blur(22px);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  box-shadow: 0 14px 40px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.05);
  max-width: 560px; margin: 0 auto;
}
.tab {
  position: relative; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 11.5px; font-weight: 600;
  transition: color .2s;
}
.tab-ic {
  width: 52px; height: 32px; border-radius: 16px; display: grid; place-items: center;
  transition: background .25s var(--ease), transform .2s var(--spring);
}
.tab-ic svg { width: 22px; height: 22px; stroke-width: 1.9; }
.tab.active { color: var(--fg); }
.tab.active .tab-ic { background: var(--accent-bg); color: var(--accent-ink); }
.tab:active .tab-ic { transform: scale(.88); }
.tab-center { position: relative; }
.tab-fab {
  position: absolute; top: -30px; left: 50%; transform: translateX(-50%);
  width: 70px; height: 70px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--surface-solid) 85%, var(--accent)), var(--surface-solid) 70%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--bg) 70%, transparent), 0 10px 26px rgba(0,0,0,.35),
              0 0 22px color-mix(in srgb, var(--accent) 25%, transparent);
  transition: transform .2s var(--spring), box-shadow .3s;
  touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.tab-fab:active { transform: translateX(-50%) scale(.92); }
.tab-center.active .tab-fab { box-shadow: 0 0 0 5px color-mix(in srgb, var(--bg) 70%, transparent), 0 0 0 7px var(--accent-glow), 0 10px 26px rgba(0,0,0,.35); }
.tab-center .tab-label { margin-top: 34px; }
.tab-badge {
  position: absolute; top: 6px; right: 8px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--surface-solid);
  animation: dotPulse 1.6s ease-in-out infinite;
}

/* ─── سایدبارِ دسکتاپ (از کیت، سمت راست) ──────────────────────────── */
.sidebar { display: none; }
@media (min-width: 900px) {
  .sidebar {
    display: flex; flex-direction: column;
    position: fixed; top: 0; right: 0; bottom: 0; width: var(--sw); z-index: 50;
    background: var(--sidebar); color: #fff;
    border-left: 1px solid rgba(255,255,255,.07);
    box-shadow: -16px 0 40px rgba(0,0,0,.18);
  }
  .main { margin-right: var(--sw); }
  .tabbar { display: none; }
  .view { padding-bottom: 48px; padding-top: 24px; }
  .app-header { padding-right: 24px; padding-left: 24px; }
  .app-header .brand { visibility: hidden; }
  .app-header-in, .view { max-width: 980px; }
  .view.narrow { max-width: 760px; }
}
@media (min-width: 1400px) { :root { --sw: 280px; } }
.sidebar-logo { display: flex; align-items: center; gap: 12px; padding: 22px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.07); }
.sidebar-logo .lt { font-weight: 800; font-size: 17px; }
.sidebar-logo .ld { display: block; color: rgba(255,255,255,.45); font-size: 11.5px; font-weight: 500; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 11px 14px; margin: 2px 10px;
  border-radius: 12px; color: rgba(255,255,255,.72); font-size: 13.5px; font-weight: 500;
  transition: all .16s ease; position: relative; width: calc(100% - 20px); text-align: right;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; color: rgba(255,255,255,.4); transition: color .16s; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; transform: translateX(-3px); }
.nav-item:hover svg { color: var(--accent-light); }
.nav-item.active { background: color-mix(in srgb, var(--accent) 22%, transparent); color: #fff; font-weight: 700; }
.nav-item.active svg { color: var(--accent-light); }
.nav-item.active::after { content: ''; position: absolute; right: -10px; top: 50%; transform: translateY(-50%); width: 3px; height: 22px; background: var(--accent-light); border-radius: 2px 0 0 2px; }
.nav-item .nav-badge { margin-right: auto; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; }
.sidebar-section { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; color: rgba(148,163,184,.55); padding: 14px 24px 4px; }
.sidebar-mascot { margin: 10px; padding: 14px; border-radius: 18px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); display: flex; align-items: center; gap: 10px; cursor: pointer; }
.sidebar-mascot .sm-text { font-size: 12px; color: rgba(255,255,255,.7); line-height: 1.6; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.07); padding: 10px 0 16px; }

/* ═══ کامپوننت‌ها ═════════════════════════════════════════════════════ */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.page-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.back-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; font-size: 13.5px; padding: 8px 0; min-height: 44px; }
.back-btn svg { width: 18px; height: 18px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--shadow); position: relative;
}
.card-pad { padding: 18px; }
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; justify-content: space-between; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 24px 2px 12px; gap: 10px; }
.section-title h2 { font-size: 16.5px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.section-title .count {
  min-width: 30px; height: 30px; padding: 0 8px; border-radius: 15px; display: inline-grid; place-items: center;
  background: var(--surface-soft); color: var(--fg2); font-size: 13px; font-weight: 700;
}
.section-title a, .link { color: var(--accent-ink); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.section-label {
  font-size: 11.5px; font-weight: 800; letter-spacing: .04em; color: var(--muted);
  margin: 18px 4px 8px; display: flex; align-items: center; gap: 8px;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ─── کارت هیرو ────────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--rlg); padding: 22px 20px 20px;
  background: var(--hero);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  isolation: isolate;
}
.hero::before {
  content: ''; position: absolute; width: 260px; height: 260px; top: -90px; right: -60px; z-index: -1;
  background: radial-gradient(circle, var(--hero-glow), transparent 65%);
  filter: blur(10px);
}
.hero-title { font-size: 25px; font-weight: 800; letter-spacing: -.03em; line-height: 1.35; }
.hero-sub { color: var(--fg2); opacity: .8; font-size: 13.5px; margin-top: 4px; line-height: 1.8; }
.hero-row { display: flex; align-items: flex-end; gap: 10px; margin-top: 12px; }
.hero-row .bubble { flex: 1; }
.hero-mascot { flex-shrink: 0; position: relative; display: grid; place-items: center; cursor: pointer; }
.hero-mascot::before {
  content: ''; position: absolute; inset: -14px; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 68%);
}

.bubble {
  position: relative; background: var(--bubble);
  border: 1px solid var(--glass-border);
  border-radius: 22px; padding: 14px 16px;
  font-size: 13.5px; line-height: 1.9; color: var(--fg);
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  min-height: 52px;
}
.bubble::after {   /* دمِ حباب به سمتِ کاراکتر (چپ) */
  content: ''; position: absolute; left: -7px; bottom: 18px; width: 14px; height: 14px;
  background: inherit; border-left: 1px solid var(--glass-border); border-bottom: 1px solid var(--glass-border);
  transform: rotate(45deg); border-radius: 0 0 0 4px;
}
.bubble.up::after { left: 50%; top: -7px; bottom: auto; transform: translateX(-50%) rotate(135deg); }
.bubble-text { transition: opacity .25s; }
.bubble.typing .bubble-text { opacity: 0; }

/* ─── آمار (stat-card کیت با نوار رنگی) ───────────────────────────── */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 700px) { .stat-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
  padding: 14px 14px 16px; position: relative; overflow: hidden; box-shadow: var(--shadow-xs);
}
.stat-card::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--sc, var(--accent)), var(--sc2, var(--accent-light)));
}
.stat-card-blue   { --sc:#6366f1; --sc2:#a5b4fc; }
.stat-card-green  { --sc:#22c55e; --sc2:#4ade80; }
.stat-card-orange { --sc:#f59e0b; --sc2:#fbbf24; }
.stat-card-red    { --sc:#ef4444; --sc2:#f87171; }
.stat-card-teal   { --sc:var(--accent); --sc2:var(--accent-light); }
.stat-label { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 21px; font-weight: 800; letter-spacing: -.03em; animation: countUp .6s ease both; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-unit { font-size: 11.5px; font-weight: 600; color: var(--muted); margin-right: 3px; }
.stat-foot { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ─── پرداخت بعدی ──────────────────────────────────────────────────── */
.next-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.next-card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(ellipse 60% 80% at 100% 0%, var(--accent-bg), transparent 70%);
}
.next-top { display: flex; align-items: center; gap: 12px; }
.next-title { font-weight: 800; font-size: 16px; }
.next-sub { color: var(--muted); font-size: 12.5px; }
.countdown { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.countdown b { font-size: 26px; font-weight: 800; letter-spacing: -.03em; color: var(--accent-ink); }
.countdown span { color: var(--muted); font-size: 13px; }
.next-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.next-amount { font-weight: 800; font-size: 17px; }

/* ─── دکمه‌ها ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; min-height: 44px; border-radius: var(--rsm);
  font-size: 14px; font-weight: 700; line-height: 1; white-space: nowrap;
  background: var(--surface-soft); color: var(--fg); border: 1px solid var(--border);
  transition: transform .15s var(--ease), box-shadow .2s, background .2s, filter .2s;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn:active:not(:disabled) { transform: scale(.95); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-light)); color: #fff; border: none;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 30%, transparent);
  text-shadow: 0 1px 1px rgba(0,0,0,.12);
}
.btn-primary:hover:not(:disabled) { box-shadow: var(--shadow-accent); filter: brightness(1.05); }
.btn-ghost { background: transparent; border: 1.5px solid var(--border2); }
.btn-danger { background: var(--danger-bg); color: var(--danger-ink); border-color: var(--danger-border); }
.btn-success { background: var(--success-bg); color: var(--success-ink); border-color: var(--success-border); }
.btn-warning { background: var(--warning-bg); color: var(--warning-ink); border-color: var(--warning-border); }
.btn-sm { padding: 7px 12px; min-height: 36px; font-size: 12.5px; border-radius: 11px; gap: 5px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { padding: 14px 24px; min-height: 52px; font-size: 15.5px; border-radius: 18px; }
.btn-full { width: 100%; }
.btn .sp { width: 16px; height: 16px; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn:not(.btn-primary) .sp { border-color: var(--accent-glow); border-top-color: var(--accent); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }

/* ─── بج و چیپ ─────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 10px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
  background: var(--accent-bg); color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}
.badge-success { background: var(--success-bg); color: var(--success-ink); border-color: var(--success-border); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger-ink);  border-color: var(--danger-border); }
.badge-warning { background: var(--warning-bg); color: var(--warning-ink); border-color: var(--warning-border); }
.badge-info    { background: var(--info-bg); color: var(--info-ink); border-color: var(--info-border); }
.badge-gray    { background: var(--surface-soft); color: var(--muted); border-color: var(--border); }
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 14px;
  border-radius: 999px; border: 1.5px solid var(--border2); background: var(--surface);
  font-size: 13px; font-weight: 600; color: var(--fg2); transition: all .18s var(--ease);
  user-select: none; -webkit-user-select: none;
}
.chip:active { transform: scale(.95); }
.chip.on { background: var(--accent-bg); border-color: var(--accent); color: var(--accent-ink); }
.chip-scroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 16px 6px; margin: 0 -16px; scroll-snap-type: x proximity; }
.chip-scroll::-webkit-scrollbar { display: none; }
.chip-scroll > * { flex-shrink: 0; scroll-snap-align: start; }

/* ─── سگمنت (iOS) ─────────────────────────────────────────────────── */
.segmented {
  display: flex; padding: 4px; gap: 4px; border-radius: 16px; background: var(--surface-soft);
  border: 1px solid var(--border); position: relative;
}
.segmented button {
  flex: 1; min-height: 38px; border-radius: 12px; font-size: 13px; font-weight: 700; color: var(--muted);
  transition: background .2s, color .2s, box-shadow .2s;
}
.segmented button.on { background: var(--surface-solid); color: var(--fg); box-shadow: var(--shadow-xs); }

/* ─── فرم (از کیت، با توکن) ───────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
label, .label { display: block; font-size: 13px; font-weight: 700; color: var(--fg2); margin-bottom: 7px; }
.lhint { color: var(--muted); font-weight: 400; font-size: 12px; }
.required { color: var(--danger); }
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([type=range]):not([type=color]),
textarea, select {
  width: 100%; background: var(--input-bg); border: 1.5px solid var(--border2); border-radius: var(--rsm);
  color: var(--fg); padding: 11px 14px; font-size: 14px; outline: none; min-height: 46px;
  transition: border-color .18s, box-shadow .18s; appearance: none; -webkit-appearance: none;
  text-align: right; direction: rtl;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 4px var(--accent-glow); }
input::placeholder, textarea::placeholder { color: var(--muted2); }
textarea { resize: vertical; min-height: 84px; line-height: 1.8; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b94a9' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 14px center; padding-left: 36px;
}
input[dir="ltr"], textarea[dir="ltr"] { direction: ltr !important; text-align: left !important; }
input[dir="ltr"]::placeholder, textarea[dir="ltr"]::placeholder { direction: rtl; text-align: right; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.helper { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.input-suffix { position: relative; }
.input-suffix input { padding-left: 64px !important; }
.input-suffix .sfx { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 12.5px; color: var(--muted); font-weight: 600; pointer-events: none; }
.input-btn { position: relative; }
.input-btn input { padding-left: 50px !important; }
.input-btn > button { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); width: 42px; height: 38px; border-radius: 10px; color: var(--muted); display: grid; place-items: center; }
.input-btn > button svg { width: 19px; height: 19px; }
.search-wrap { position: relative; }
.search-wrap input { padding-right: 42px !important; border-radius: 16px; }
.search-wrap .search-icon { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; pointer-events: none; }
.field-btn {
  width: 100%; min-height: 46px; border-radius: var(--rsm); border: 1.5px solid var(--border2); background: var(--input-bg);
  padding: 8px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: right;
}
.field-btn .fb-main { font-weight: 700; font-size: 14px; }
.field-btn .fb-sub { color: var(--muted); font-size: 12px; direction: ltr; }
.field-btn svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }

/* ─── توگل (کیت) ──────────────────────────────────────────────────── */
.toggle { position: relative; display: inline-block; width: 50px; height: 30px; flex-shrink: 0; cursor: pointer; margin: 0; }
.toggle input { display: none; }
.toggle-slider { position: absolute; inset: 0; background: var(--border2); border-radius: 999px; transition: background .22s; }
.toggle-slider::before {
  content: ''; position: absolute; width: 24px; height: 24px; right: 3px; top: 3px; background: #fff; border-radius: 50%;
  transition: transform .25s var(--spring); box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.toggle input:checked + .toggle-slider { background: linear-gradient(135deg, var(--accent), var(--accent-light)); }
.toggle input:checked + .toggle-slider::before { transform: translateX(-20px); }

/* ─── ردیف تنظیمات (الگوی کیت) ────────────────────────────────────── */
.settings-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; margin-bottom: 16px; box-shadow: var(--shadow-xs); }
.settings-section-head { padding: 14px 18px; background: linear-gradient(135deg, var(--accent-bg), transparent 70%); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.settings-section-icon { font-size: 18px; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-soft); }
.settings-section-title { font-weight: 800; font-size: 14.5px; flex: 1; }
.settings-section-body { padding: 4px 0; }
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; border-bottom: 1px solid var(--border); gap: 12px; min-height: 58px; }
.setting-row:last-child { border-bottom: none; }
.setting-row.stack { flex-direction: column; align-items: stretch; }
.setting-info { flex: 1; min-width: 0; }
.setting-label { font-weight: 700; font-size: 13.5px; color: var(--fg); }
.setting-desc { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.6; }
.setting-control { flex-shrink: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.setting-control input, .setting-control select { width: 180px; }
.setting-row.link-row { cursor: pointer; }
.setting-row.link-row:active { background: var(--surface-soft); }
@media (max-width: 640px) {
  .setting-row.wrap { flex-direction: column; align-items: stretch; gap: 10px; }
  .setting-row.wrap .setting-control input, .setting-row.wrap .setting-control select { width: 100%; }
  .setting-row.wrap .setting-control { width: 100%; }
}

/* ─── جعبه‌های اطلاع ──────────────────────────────────────────────── */
.info-box, .warn-box, .success-box, .danger-box { border-radius: var(--rsm); padding: 12px 16px; font-size: 13px; line-height: 1.8; border: 1px solid; }
.info-box { background: var(--accent-bg); border-color: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--fg2); }
.warn-box { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning-ink); }
.success-box { background: var(--success-bg); border-color: var(--success-border); color: var(--success-ink); }
.danger-box { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-ink); }
code, .mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 12.5px; direction: ltr; unicode-bidi: isolate; }
code { background: var(--surface-soft); border: 1px solid var(--border); border-radius: 7px; padding: 1px 6px; }

/* ═══ لیستِ نوبت‌ها ══════════════════════════════════════════════════ */
.group-label { font-size: 12.5px; font-weight: 800; color: var(--muted); margin: 16px 6px 8px; display: flex; gap: 6px; align-items: center; }
.group-label .gl-sum { margin-right: auto; font-weight: 600; font-size: 12px; }
.occ-list { display: flex; flex-direction: column; gap: 10px; }
.swipe { position: relative; border-radius: 22px; overflow: hidden; touch-action: pan-y; }
.swipe-bg {
  position: absolute; inset: 0; border-radius: inherit; display: flex; align-items: center; justify-content: flex-end;
  padding-left: 22px; background: linear-gradient(270deg, transparent 10%, var(--success) 100%); color: #fff; font-weight: 800; font-size: 14px; gap: 8px;
  opacity: 0; transition: opacity .15s;
}
.swipe-bg svg { width: 24px; height: 24px; }
.swipe.armed .swipe-bg { background: var(--success); }
.occ {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: 22px;
  transition: transform .3s var(--ease), background .2s, opacity .3s;
  will-change: transform; cursor: pointer;
}
.occ:active { background: var(--surface-2); }
.occ.overdue { background: color-mix(in srgb, var(--danger) 7%, var(--surface-solid)); border-color: var(--danger-border); }
.occ.due_today { border-color: var(--warning-border); }
.occ.paid, .occ.skipped { opacity: .62; }
.occ-ic {
  width: 46px; height: 46px; border-radius: 15px; flex-shrink: 0; display: grid; place-items: center; font-size: 22px;
  background: color-mix(in srgb, var(--c, var(--accent)) 16%, var(--surface-soft));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c, var(--accent)) 22%, transparent);
}
.occ-body { flex: 1; min-width: 0; }
.occ-title { font-weight: 800; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.occ-title .prov { color: var(--muted); font-weight: 500; font-size: 12.5px; margin-right: 4px; }
.occ-dates { font-size: 12px; color: var(--muted); margin-top: 1px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.occ-dates .g { direction: ltr; unicode-bidi: isolate; opacity: .85; }
.occ-side { text-align: left; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.occ-amount { font-weight: 800; font-size: 14px; white-space: nowrap; }
.occ-toman { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.occ-check {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--border2); flex-shrink: 0; display: grid; place-items: center;
  transition: all .25s var(--spring); color: transparent; background: var(--surface-solid);
}
.occ-check svg { width: 18px; height: 18px; stroke-width: 3; }
.occ.paid .occ-check, .occ-check.on { background: var(--success); border-color: var(--success); color: #fff; transform: scale(1.04); }
.occ.skipped .occ-check { background: var(--muted2); border-color: var(--muted2); color: #fff; }
.days-chip { font-size: 11.5px; padding: 3px 9px; }

/* ═══ کارتِ هزینه (لیست) ═════════════════════════════════════════════ */
.exp-grid { display: grid; gap: 10px; }
@media (min-width: 900px) { .exp-grid { grid-template-columns: 1fr 1fr; } }
.exp-card { display: flex; gap: 12px; padding: 14px; align-items: flex-start; cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s; border-radius: 22px; }
.exp-card:active { transform: scale(.985); }
.exp-card.paused, .exp-card.archived { opacity: .6; }
.exp-main { flex: 1; min-width: 0; }
.exp-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.exp-title { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp-prov { color: var(--muted); font-size: 12.5px; }
.exp-amount { font-weight: 800; white-space: nowrap; font-size: 14.5px; text-align: left; }
.exp-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.exp-next { font-size: 12px; color: var(--muted); margin-top: 6px; }
.exp-next .g { direction: ltr; unicode-bidi: isolate; }

.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.toolbar .search-wrap { flex: 1; }
.filter-btn { position: relative; }
.filter-btn .dot { position: absolute; top: 8px; left: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ═══ جزئیات ═════════════════════════════════════════════════════════ */
.detail-hero { padding: 20px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.detail-hero::before { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; background: radial-gradient(ellipse 70% 90% at 100% 0%, color-mix(in srgb, var(--c, var(--accent)) 20%, transparent), transparent 70%); }
.detail-top { display: flex; gap: 14px; align-items: center; }
.detail-top .occ-ic { width: 60px; height: 60px; font-size: 30px; border-radius: 19px; }
.detail-title { font-size: 20px; font-weight: 800; line-height: 1.4; }
.detail-amount { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.kv { display: flex; flex-direction: column; }
.kv-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); min-height: 52px; }
.kv-row:last-child { border-bottom: none; }
.kv-k { color: var(--muted); font-size: 13px; flex-shrink: 0; }
.kv-v { font-weight: 600; font-size: 13.5px; text-align: left; min-width: 0; overflow-wrap: anywhere; display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.copy-btn { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); background: var(--surface-soft); flex-shrink: 0; }
.copy-btn svg { width: 16px; height: 16px; }
.timeline { padding: 6px 18px 12px; }
.tl-item { display: flex; gap: 14px; position: relative; padding: 10px 0; }
.tl-item::before { content: ''; position: absolute; right: 13px; top: 38px; bottom: -10px; width: 2px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-size: 13px; background: var(--surface-soft); border: 2px solid var(--border2); z-index: 1; }
.tl-dot.paid { background: var(--success); border-color: var(--success); color: #fff; }
.tl-dot.skipped { background: var(--muted2); border-color: var(--muted2); color: #fff; }
.tl-dot.overdue { background: var(--danger-bg); border-color: var(--danger); color: var(--danger-ink); }
.tl-dot.due_today, .tl-dot.due_soon { border-color: var(--warning); }
.tl-body { flex: 1; min-width: 0; }
.tl-title { font-weight: 700; font-size: 13.5px; }
.tl-sub { color: var(--muted); font-size: 12px; }
.action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.action-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border); font-size: 12px; font-weight: 700; color: var(--fg2);
  transition: transform .15s; min-height: 72px; justify-content: center;
}
.action-tile:active { transform: scale(.94); }
.action-tile svg { width: 22px; height: 22px; color: var(--accent-ink); }
.action-tile.danger svg, .action-tile.danger { color: var(--danger-ink); }

/* ═══ شیت / مودال (موبایل = bottom-sheet) ═══════════════════════════ */
.overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(5,8,15,.55); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  animation: fadeIn .2s ease;
}
.overlay.closing { animation: fadeIn .2s ease reverse forwards; }
.sheet {
  width: 100%; max-width: 540px; max-height: calc(100dvh - 32px); overflow: hidden;
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--rlg);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  animation: popIn .3s var(--ease);
}
.sheet-grip { display: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 20px 10px; flex-shrink: 0; }
.sheet-title { font-size: 17px; font-weight: 800; }
.sheet-close { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); background: var(--surface-soft); }
.sheet-close svg { width: 18px; height: 18px; }
.sheet-body { padding: 6px 20px 16px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; flex: 1; }
.sheet-foot { display: flex; gap: 8px; padding: 12px 20px calc(14px + var(--safe-b)); border-top: 1px solid var(--border); flex-shrink: 0; background: var(--surface-solid); }
.sheet-foot .btn { flex: 1; }
@media (max-width: 768px) {
  .overlay { align-items: flex-end; padding: 0; }
  .sheet {
    max-width: 100%; border-radius: 28px 28px 0 0; max-height: 92dvh; border-bottom: none;
    animation: slideUp .38s var(--ease);
  }
  .overlay.closing .sheet { animation: slideDown .25s ease forwards; }
  .sheet-grip { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--border2); margin: 8px auto 0; flex-shrink: 0; }
  .sheet-head { padding-top: 10px; }
  .form-row { grid-template-columns: 1fr 1fr; }
  .form-row.r-1 { grid-template-columns: 1fr; }
  /* iOS: فونتِ ورودی ≥۱۶px تا زوم نکند (تلهٔ ۵ کیت) */
  input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([type=range]):not([type=color]),
  textarea, select { font-size: 16px !important; }
}
.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-item { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--border); text-align: right; font-weight: 700; min-height: 60px; transition: transform .15s; }
.menu-item:active { transform: scale(.97); }
.menu-item .mi-ic { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-size: 21px; background: var(--accent-bg); }
.menu-item .mi-sub { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }

/* ─── toast ─────────────────────────────────────────────────────────── */
.toast-wrap {
  position: fixed; left: 12px; right: 12px; z-index: 300; display: flex; flex-direction: column; gap: 8px; pointer-events: none;
  bottom: calc(var(--nav-h) + 22px + var(--safe-b)); max-width: 440px; margin: 0 auto;
}
@media (min-width: 900px) { .toast-wrap { bottom: 24px; left: 24px; right: auto; width: 380px; margin: 0; } }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; pointer-events: auto;
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: 18px; box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  animation: toastIn .3s var(--ease); font-size: 13px;
}
.toast.exit { animation: toastOut .22s ease forwards; }
.toast-icon { font-size: 18px; flex-shrink: 0; display: grid; place-items: center; }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-weight: 800; font-size: 13px; }
.toast-msg { color: var(--fg2); font-size: 12.5px; line-height: 1.6; word-break: break-word; }
.toast-action { font-weight: 800; color: var(--accent-ink); padding: 8px 10px; border-radius: 10px; flex-shrink: 0; min-height: 38px; }
.toast-close { color: var(--muted); font-size: 18px; width: 30px; height: 30px; flex-shrink: 0; }
.toast.success { border-right: 3px solid var(--success); }
.toast.error   { border-right: 3px solid var(--danger); }
.toast.warning { border-right: 3px solid var(--warning); }
.toast.info    { border-right: 3px solid var(--accent); }

/* ─── اسکلتون / خالی / خطا ────────────────────────────────────────── */
.skeleton { border-radius: 22px; background: linear-gradient(90deg, var(--surface-2), var(--surface-soft), var(--surface-2)); background-size: 220% 100%; animation: shimmer 1.3s ease-in-out infinite; border: 1px solid var(--border); }
.sk-row { height: 74px; margin-bottom: 10px; }
.sk-hero { height: 210px; border-radius: var(--rlg); margin-bottom: 14px; }
.sk-stat { height: 86px; }
.empty { text-align: center; padding: 28px 20px 34px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty p { font-size: 14px; line-height: 1.9; max-width: 300px; }
.empty .empty-title { color: var(--fg); font-weight: 800; font-size: 16px; }
.error-state .empty-title { color: var(--danger-ink); }

/* ─── آفلاین / به‌روزرسانی ───────────────────────────────────────── */
.top-banner {
  position: fixed; top: calc(var(--safe-t) + 8px); left: 50%; transform: translateX(-50%); z-index: 200;
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: 999px; padding: 8px 8px 8px 16px;
  display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); animation: fadeUp .3s var(--ease); white-space: nowrap; max-width: calc(100vw - 24px);
}
.top-banner.offline { padding: 8px 16px; color: var(--warning-ink); }

/* ─── date picker ──────────────────────────────────────────────────── */
.dp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.dp-title { font-weight: 800; font-size: 16px; text-align: center; flex: 1; }
.dp-title small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; direction: ltr; }
.dp-nav { width: 42px; height: 42px; border-radius: 13px; background: var(--surface-soft); display: grid; place-items: center; }
.dp-nav svg { width: 18px; height: 18px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dp-wd { text-align: center; font-size: 11.5px; color: var(--muted); font-weight: 700; padding: 4px 0; }
.dp-day {
  aspect-ratio: 1; min-height: 40px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14.5px; transition: background .15s, transform .15s; position: relative;
}
.dp-day small { font-size: 9.5px; color: var(--muted); font-weight: 500; line-height: 1; margin-top: 1px; }
.dp-day:active { transform: scale(.9); }
.dp-day.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.dp-day.sel { background: linear-gradient(135deg, var(--accent), var(--accent-light)); color: #fff; }
.dp-day.sel small { color: rgba(255,255,255,.8); }
.dp-day.fri { color: var(--danger-ink); }
.dp-day.sel.fri { color: #fff; }
.dp-day.empty-cell { visibility: hidden; }
.dp-preview { text-align: center; margin-top: 12px; padding: 10px; border-radius: 14px; background: var(--surface-soft); font-weight: 700; font-size: 13.5px; }
.dp-preview .g { color: var(--muted); font-weight: 500; direction: ltr; unicode-bidi: isolate; }

/* ─── فرم هزینه ────────────────────────────────────────────────────── */
.tpl-scroll .tpl {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 132px; padding: 10px 12px;
  border-radius: 16px; background: var(--surface-2); border: 1.5px solid var(--border); text-align: right; transition: all .18s;
}
.tpl-scroll .tpl:active { transform: scale(.96); }
.tpl-scroll .tpl.on { border-color: var(--accent); background: var(--accent-bg); }
.tpl .tpl-emo { font-size: 20px; }
.tpl .tpl-name { font-weight: 800; font-size: 12.5px; }
.tpl .tpl-sub { font-size: 11px; color: var(--muted); }
.form-section { padding: 14px 0 4px; border-top: 1px dashed var(--border2); margin-top: 6px; }
.form-section:first-of-type { border-top: none; }
.form-section-title { font-weight: 800; font-size: 13.5px; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; color: var(--fg); }
.live-preview { border-radius: 16px; padding: 12px 14px; background: var(--accent-bg); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); font-size: 13px; line-height: 1.9; }
.live-preview b { color: var(--fg); }
.emoji-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-pick button { width: 42px; height: 42px; border-radius: 12px; font-size: 21px; background: var(--surface-2); border: 1.5px solid var(--border); }
.emoji-pick button.on { border-color: var(--accent); background: var(--accent-bg); }
.color-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.color-pick button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; box-shadow: 0 0 0 1px var(--border2); }
.color-pick button.on { border-color: var(--surface-solid); box-shadow: 0 0 0 2px var(--fg); }
.details-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 12px 0; font-weight: 800; font-size: 13.5px; color: var(--accent-ink); min-height: 44px; }
.details-toggle svg { width: 18px; height: 18px; transition: transform .25s; }
.details-toggle.open svg { transform: rotate(180deg); }
.ac-list { position: absolute; top: calc(100% + 4px); right: 0; left: 0; z-index: 5; background: var(--surface-solid); border: 1px solid var(--border2); border-radius: 14px; box-shadow: var(--shadow-md); overflow: hidden; }
.ac-list button { display: block; width: 100%; text-align: right; padding: 11px 14px; font-size: 14px; border-bottom: 1px solid var(--border); }
.ac-list button:last-child { border-bottom: none; }
.ac-list button:hover, .ac-list button:focus { background: var(--surface-soft); }

/* ─── ریسپانسیو کوچک ───────────────────────────────────────────────── */
@media (max-width: 380px) {
  :root { --r: 20px; --rlg: 26px; }
  .view { padding-left: 12px; padding-right: 12px; }
  .hero-title { font-size: 22px; }
  .stat-value { font-size: 18px; }
  .clock-j { font-size: 12px; }
  .tab { font-size: 10.5px; }
  .tab-ic { width: 44px; }
}

/* ─── حرکتِ کمتر ───────────────────────────────────────────────────── */
:root.no-motion *, :root.no-motion *::before, :root.no-motion *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ─── View Transitions (جهتِ اسلاید مطابق RTL) ─────────────────────── */
@keyframes vtOutFwd { to { opacity: 0; transform: translateX(28px); } }
@keyframes vtInFwd  { from { opacity: 0; transform: translateX(-28px); } }
@keyframes vtOutBack{ to { opacity: 0; transform: translateX(-28px); } }
@keyframes vtInBack { from { opacity: 0; transform: translateX(28px); } }
::view-transition-old(page) { animation: vtOutFwd .2s ease both; }
::view-transition-new(page) { animation: vtInFwd .3s var(--ease) both; }
:root.vt-back::view-transition-old(page) { animation-name: vtOutBack; }
:root.vt-back::view-transition-new(page) { animation-name: vtInBack; }
:root.vt-fade::view-transition-old(page) { animation: fadeIn .15s ease reverse both; }
:root.vt-fade::view-transition-new(page) { animation: fadeIn .2s ease both; }
.view-host { view-transition-name: page; }
::view-transition-group(root) { animation: none; }

/* ردیفِ چک/توگل با برچسب (فرم‌ها) */
.remember { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13.5px; cursor: pointer; color: var(--fg2); margin: 0; }

/* گالریِ حالت‌ها (مثلِ اسکرین‌شاتِ مدیارو) */
.gal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
@media (min-width: 700px) { .gal-grid { grid-template-columns: repeat(4, 1fr); } }
.gal-cell { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px 14px; border-radius: var(--r);
  background: var(--surface); border: 1.5px solid var(--border); font-weight: 700; font-size: 14px; color: var(--fg2); transition: all .2s var(--ease); }
.gal-cell:active { transform: scale(.96); }
.gal-cell.on { border-color: color-mix(in srgb, var(--accent) 70%, #6366f1); box-shadow: 0 0 0 3px var(--accent-glow); color: var(--accent-ink); }

/* ═══ نمودارها — پالتِ دسته‌ایِ اعتبارسنجی‌شده (dataviz reference)، ترتیبِ ثابت ═══ */
:root {
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #6250d6; --series-7: #008300; --series-8: #e34948;
  --series-other: #a3a3a0; --grid: rgba(15,23,42,.07); --axis-text: #64748b;
}
:root[data-theme="dark"] {
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #9085e9; --series-7: #008300; --series-8: #e66767;
  --series-other: #6b6b68; --grid: rgba(255,255,255,.06); --axis-text: #8b94a9;
}
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .ax { font: 500 10.5px Vazirmatn, sans-serif; fill: var(--axis-text); }
.chart .gl { stroke: var(--grid); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .bar { transition: opacity .15s; }
.chart.hovering .bar:not(.on) { opacity: .45; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 120px; max-width: 220px;
  background: var(--surface-solid); border: 1px solid var(--border2); border-radius: 12px; box-shadow: var(--shadow-md);
  padding: 8px 11px; font-size: 12px; line-height: 1.7; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
}
.chart-tip.show { opacity: 1; transform: none; }
.chart-tip b { font-weight: 800; }
.chart-tip .k { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 6px; vertical-align: -1px; }
.legend { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.legend-row { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--border); font-size: 13px; }
.legend-row:last-child { border-bottom: none; }
.legend-row .sw { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.legend-row .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.legend-row .val { font-weight: 700; white-space: nowrap; }
.legend-row .pct { color: var(--muted); font-size: 12px; width: 42px; text-align: left; }
.legend-inline { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--fg2); margin: 4px 0 8px; }
.legend-inline span { display: inline-flex; align-items: center; gap: 6px; }
.legend-inline i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.donut-wrap { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; }
@media (max-width: 420px) { .donut-wrap { grid-template-columns: 1fr; justify-items: center; } .donut-wrap .legend { width: 100%; } }
.donut-center-v { font: 800 15px Vazirmatn, sans-serif; fill: var(--fg); }
.donut-center-l { font: 500 10.5px Vazirmatn, sans-serif; fill: var(--muted); }
.chart-card { padding: 16px 16px 12px; }
.chart-card h3 { font-size: 14.5px; font-weight: 800; margin-bottom: 2px; }
.chart-card .sub { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.table-toggle { font-size: 12px; color: var(--accent-ink); font-weight: 700; margin-top: 6px; padding: 6px 0; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 6px; }
.mini-table td, .mini-table th { padding: 6px 4px; border-bottom: 1px solid var(--border); text-align: right; }
.mini-table th { color: var(--muted); font-weight: 700; font-size: 11.5px; }
.mini-table td.n { text-align: left; font-feature-settings: "tnum"; }

/* ═══ تقویم ═══ */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-title { flex: 1; text-align: center; }
.cal-title b { display: block; font-size: 18px; font-weight: 800; }
.cal-title small { color: var(--muted); font-size: 12px; direction: ltr; display: block; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; touch-action: pan-y; }
.cal-wd { text-align: center; font-size: 11.5px; font-weight: 800; color: var(--muted); padding: 2px 0 6px; }
.cal-day {
  min-height: 64px; border-radius: 14px; padding: 5px 3px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--surface); border: 1px solid var(--border); position: relative; transition: transform .15s, background .15s; min-width: 0;
}
.cal-day:active { transform: scale(.94); }
.cal-day.other { opacity: .35; }
.cal-day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-day.today .cd-n { color: var(--accent-ink); }
.cal-day.has { background: var(--surface-2); }
.cal-day.fri .cd-n { color: var(--danger-ink); }
.cd-n { font-weight: 800; font-size: 14.5px; line-height: 1.2; }
.cd-s { font-size: 9.5px; color: var(--muted); line-height: 1; }
.cd-dots { display: flex; gap: 2px; margin-top: 2px; flex-wrap: wrap; justify-content: center; }
.cd-dots i { width: 6px; height: 6px; border-radius: 50%; display: block; }
.cd-sum { font-size: 9.5px; font-weight: 700; color: var(--fg2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 12px 0 4px; font-size: 11.5px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend i { width: 8px; height: 8px; border-radius: 50%; }
@media (min-width: 700px) { .cal-day { min-height: 84px; } .cd-sum { font-size: 11px; } }
.progress { height: 12px; border-radius: 999px; background: var(--surface-soft); overflow: hidden; border: 1px solid var(--border); }
.progress > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-light)); transition: width .6s var(--ease); }
.check-head { display: flex; align-items: center; gap: 14px; padding: 16px; }
.check-head .ch-txt { flex: 1; }
.check-head .ch-big { font-size: 20px; font-weight: 800; }
.occ-list.big .occ-check { width: 42px; height: 42px; }
.occ-list.big .occ-check svg { width: 22px; height: 22px; }
.rep-grid { display: grid; gap: 14px; margin-top: 14px; }
@media (min-width: 900px) { .rep-grid { grid-template-columns: 1fr 1fr; } }
.norm-list { display: flex; flex-direction: column; }
.norm-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 2px; border-bottom: 1px solid var(--border); font-size: 13px; }
.norm-row:last-child { border-bottom: none; }
.nr-t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nr-v { font-weight: 700; }
.nr-bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--surface-soft); overflow: hidden; }
.nr-bar i { display: block; height: 100%; border-radius: 3px; background: var(--series-1); }

/* ═══ دستیار ═══ */
.assistant-hero { text-align: center; padding: 26px 16px 18px; display: flex; flex-direction: column; align-items: center; }
.as-mascot { position: relative; }
.as-mascot::before { content: ''; position: absolute; inset: -20px; border-radius: 50%; z-index: -1; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 25%, transparent), transparent 66%); }
.as-bubble { margin-top: 14px; max-width: 360px; text-align: center; }
.as-name { margin-top: 10px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.action-grid.quick { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 700px) { .action-grid.quick { grid-template-columns: repeat(6, 1fr); } }
.ins-list { display: flex; flex-direction: column; gap: 10px; }
.ins-card { display: flex; gap: 12px; align-items: flex-start; border-radius: 18px; padding: 14px; }
.ins-card[data-act] { cursor: pointer; }
.ins-card[data-act]:active { transform: scale(.98); }
.ins-ic { font-size: 24px; line-height: 1.2; flex-shrink: 0; }
.ins-body { flex: 1; min-width: 0; }
.ins-title { font-weight: 800; font-size: 14px; color: var(--fg); }
.ins-text { font-size: 13px; line-height: 1.85; color: var(--fg2); margin-top: 2px; }
.ins-go { color: var(--muted); align-self: center; }
.ins-go svg { width: 18px; height: 18px; }
.cat-list { padding: 6px 12px; }
.cat-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 14px; background: var(--surface-solid); margin: 6px 0; border: 1px solid var(--border); transition: box-shadow .2s; touch-action: auto; }
.cat-row.dragging { box-shadow: var(--shadow-lg); z-index: 3; position: relative; transition: none; border-color: var(--accent); }
.cat-grip { width: 40px; height: 40px; display: grid; place-items: center; color: var(--muted); cursor: grab; touch-action: none; border-radius: 10px; }
.cat-grip svg { width: 18px; height: 18px; }
.cat-emo { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; background: color-mix(in srgb, var(--c) 18%, var(--surface-soft)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent); }
.cat-name { flex: 1; font-weight: 700; font-size: 14px; min-width: 0; }
.ios-steps { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 8px; counter-reset: s; }
.ios-steps li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; line-height: 1.7; counter-increment: s; }
.ios-steps li::before { content: counter(s, persian); font-weight: 800; color: var(--accent-ink); width: 16px; }
.ios-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-solid); border: 1px solid var(--border); flex-shrink: 0; color: #0a84ff; font-size: 18px; }

/* رفتارِ اپ‌گونه: بدونِ انتخابِ متن/منوی لمسِ طولانی روی کنترل‌ها */
.tab, .tabbar, .btn, .chip, .segmented, .action-tile, .menu-item, .icon-btn, .cal-day, .dp-day, .gal-cell, .occ-check {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.occ, .exp-card, .card[role="link"] { -webkit-touch-callout: none; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
button:focus:not(:focus-visible) { outline: none; }
