/* ============================================================================
 * smsfx.css — ظاهرِ «سامانهٔ پیامک» داخلِ پنل مدیریت (a1.94.0).
 * از پوستهٔ پنلِ پیامکِ رسالت آمده ولی **روی توکن‌های همین برنامه**: رنگِ اصلی،
 * کارت‌ها، دکمه‌ها و سربرگِ کشویی همان شکلِ بقیهٔ پنل‌اند (مثلِ سربرگِ «ایمیل»).
 * همه‌چیز زیرِ .smfx است تا بیرون از این سربرگ هیچ چیزی عوض نشود؛ فقط پنجره‌ها
 * و پیام‌های شناور (sp-modal / sp-toast) که به body می‌چسبند جدا آمده‌اند.
 * ========================================================================== */
.smfx, .sp-modal {
  --card: var(--background);
  --c-light: var(--muted-foreground);
  --c-blue: var(--primary);
  --c-teal: 172 58% 38%; --c-amber: 36 88% 50%; --c-rose: 348 70% 54%; --c-violet: 262 45% 60%; --c-green: 152 55% 38%;
  --btn-a: var(--primary); --btn-b: var(--primary);
  --shadow: 0 1px 2px rgba(0,0,0,.04);
  --ease: cubic-bezier(.22,.8,.24,1);
}
.dark .smfx, .dark .sp-modal { --c-teal: 170 55% 50%; --c-amber: 40 90% 58%; --c-rose: 350 80% 66%; --c-violet: 262 55% 72%; --c-green: 152 50% 52%; }

.smfx .sp-wrap { max-width: 980px; margin: 0 auto; padding: 0; display: flex; flex-direction: column; gap: 12px; }
/* سرآمد: همان «آیکون + عنوان» بقیهٔ بخش‌های پنل، نه بنرِ رنگی */
.smfx .sp-hero { display: flex; align-items: center; gap: 10px; padding: 4px 2px 0; color: hsl(var(--foreground)); }
.smfx .sp-hero .sp-hico { width: 36px; height: 36px; flex-shrink: 0; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.smfx .sp-hero .t { font-size: calc(15px*var(--font-scale,1)); font-weight: 600; line-height: 1.4; }
.smfx .sp-hero .s { font-size: calc(12px*var(--font-scale,1)); color: hsl(var(--muted-foreground)); margin-top: 1px; }
.smfx .sp-hero .sp-chip { flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; padding: 5px 10px;
  border-radius: 999px; border: 1px solid hsl(var(--border)); background: hsl(var(--background)); color: hsl(var(--muted-foreground)); }
.smfx .sp-demo { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 12px; border: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / .5); }
.smfx .sp-demo-i { width: 28px; height: 28px; flex-shrink: 0; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: hsl(var(--background)); color: hsl(var(--muted-foreground)); border: 1px solid hsl(var(--border)); }
/* سربرگ‌های داخلی: کنترلِ کشوییِ همان سربرگِ «ایمیل» */
.smfx .sp-tabs { position: relative; display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: hsl(var(--muted)); overflow-x: auto; scrollbar-width: none; }
.smfx .sp-tabs::-webkit-scrollbar { display: none; }
.smfx .sp-tab { position: relative; z-index: 1; flex: 1 0 auto; padding: 7px 12px; border-radius: 9px; font-size: calc(13px*var(--font-scale,1)); font-weight: 500;
  color: hsl(var(--muted-foreground)); white-space: nowrap; transition: color .25s var(--ease); background: none; border: 0; cursor: pointer; }
.smfx .sp-tab:hover { color: hsl(var(--foreground)); }
.smfx .sp-tab.sp-on { color: hsl(var(--foreground)); }
.smfx .sp-tab .sp-line { display: none; }
.smfx .sp-pill { position: absolute; top: 4px; bottom: 4px; left: 0; border-radius: 9px; background: hsl(var(--background));
  box-shadow: 0 1px 2px rgba(0,0,0,.08); transition: transform .32s var(--ease), width .32s var(--ease); z-index: 0; pointer-events: none; }
/* کارت، دکمه، فیلد — همان قطعه‌های UI-KIT */
.smfx .sp-card, .sp-modal .sp-card { background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 12px !important; box-shadow: none; }
.smfx .sp-btn, .sp-modal .sp-btn { background: hsl(var(--primary)) !important; color: hsl(var(--primary-foreground)) !important; border-radius: 10px !important; font-weight: 500;
  transition: opacity .15s; }
.smfx .sp-btn:hover, .sp-modal .sp-btn:hover { opacity: .92; }
.smfx .sp-btn[disabled], .sp-modal .sp-btn[disabled] { opacity: .6; }
.smfx .sp-btn2, .sp-modal .sp-btn2 { background: hsl(var(--muted)) !important; border: 1px solid hsl(var(--border)); border-radius: 10px !important; color: hsl(var(--foreground)); }
.smfx .sp-btn2:hover, .sp-modal .sp-btn2:hover { background: hsl(var(--muted-foreground) / .12) !important; }
.smfx .sp-input, .sp-modal .sp-input { background: hsl(var(--background)) !important; border-radius: 10px !important; border: 1px solid hsl(var(--border)) !important; color: hsl(var(--foreground)); }
.smfx .sp-input:focus, .sp-modal .sp-input:focus { border-color: hsl(var(--primary) / .45) !important; box-shadow: none; }
/* داشبورد */
.smfx .sp-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.smfx .sp-kpis { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); }
.smfx .sp-kpi { position: relative; overflow: hidden; padding: 14px; display: flex; flex-direction: column; gap: 4px; animation: spUp .5s both; }
.smfx .sp-kpi .ic { width: 30px; height: 30px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: color-mix(in oklab, var(--k) 14%, transparent); color: var(--k); }
.smfx .sp-kpi .v { font-size: calc(22px*var(--font-scale,1)); font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
.smfx .sp-kpi .l { font-size: calc(12px*var(--font-scale,1)); color: hsl(var(--muted-foreground)); }
.smfx .sp-kpi .sub { font-size: calc(11px*var(--font-scale,1)); color: hsl(var(--muted-foreground)); }
.smfx .sp-kpi svg.sp-spark { position: absolute; inset-inline-end: 12px; top: 16px; width: 70px; height: 26px; opacity: .9; }
.smfx .sp-sec { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.smfx .sp-sec .h { font-size: calc(13px*var(--font-scale,1)); font-weight: 600; flex: 1; }
.smfx .sp-sec .d { font-size: calc(11px*var(--font-scale,1)); color: hsl(var(--muted-foreground)); }
.smfx .sp-tip { position: absolute; pointer-events: none; background: hsl(var(--foreground)); color: hsl(var(--background)); font-size: 11px; padding: 4px 8px;
  border-radius: 8px; transform: translate(-50%, -120%); white-space: nowrap; opacity: 0; transition: opacity .1s; z-index: 5; }
.smfx .sp-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: hsl(var(--muted-foreground)); }
.smfx .sp-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
.smfx .sp-hbar { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.smfx .sp-hbar .n { width: 74px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smfx .sp-hbar .tr { flex: 1; height: 10px; border-radius: 99px; background: hsl(var(--muted)); overflow: hidden; }
.smfx .sp-hbar .tr b { display: block; height: 100%; border-radius: 99px; width: 0; transition: width .9s cubic-bezier(.2,.8,.2,1); }
.smfx .sp-hbar .c { width: 38px; text-align: left; color: hsl(var(--muted-foreground)); }
.smfx .sp-ring circle.v { transition: stroke-dashoffset 1.1s cubic-bezier(.2,.8,.2,1); }
.smfx .sp-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 8px; text-align: center; color: hsl(var(--muted-foreground)); font-size: 12px; }
.smfx .sp-funnel .st { display: flex; align-items: center; gap: 10px; margin: 7px 0; }
.smfx .sp-funnel .bar { height: 32px; border-radius: 9px; display: flex; align-items: center; padding: 0 12px; color: #fff; font-size: 13px; font-weight: 600;
  min-width: 64px; transition: width 1s cubic-bezier(.2,.8,.2,1); margin-inline: auto; }
.smfx .sp-funnel .lb { width: 84px; font-size: 12px; color: hsl(var(--muted-foreground)); flex-shrink: 0; }
.smfx .sp-funnel .pc { width: 44px; font-size: 11px; color: hsl(var(--muted-foreground)); text-align: left; flex-shrink: 0; }
.smfx .sp-funnel .col { flex: 1; display: flex; }
@keyframes spUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 520px) { .smfx .sp-kpi .v { font-size: 20px; } .smfx .sp-hero .s { display: none; } .smfx .sp-funnel .lb { width: 66px; } }
/* حرکت */
@keyframes spIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.smfx .sp-enter > * { animation: spIn .38s var(--ease) both; }
.smfx .sp-enter > *:nth-child(2) { animation-delay: .04s; } .smfx .sp-enter > *:nth-child(3) { animation-delay: .08s; }
.smfx .sp-enter > *:nth-child(4) { animation-delay: .12s; } .smfx .sp-enter > *:nth-child(n+5) { animation-delay: .16s; }
/* پنجره‌ها و پیام‌های شناور (به body می‌چسبند) */
@keyframes spFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spSlide { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sp-modal { animation: spFade .22s cubic-bezier(.22,.8,.24,1) both; }
.sp-modal .sp-modal-box { animation: spSlide .32s cubic-bezier(.22,.8,.24,1) both; }
.sp-modal.sp-out { opacity: 0; transition: opacity .2s ease; }
.sp-modal.sp-out .sp-modal-box { transform: translateY(36px); opacity: 0; transition: transform .22s ease, opacity .2s ease; animation: none; }
@keyframes spToast { from { opacity: 0; transform: translate(-50%, 14px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
.sp-toast { animation: spToast .32s cubic-bezier(.22,.8,.24,1) both; }
.sp-toast.sp-out { opacity: 0; transform: translate(-50%, 10px) !important; transition: opacity .22s, transform .22s; animation: none; }
@media (min-width: 760px) { .smfx .sp-narrow { max-width: 680px; width: 100%; margin-left: auto; margin-right: auto; } }
@media (min-width: 640px) { .sp-modal { align-items: center !important; } .sp-modal-box { border-radius: 20px !important; max-height: 86vh !important; } }
@media (prefers-reduced-motion: reduce) { .smfx *, .sp-modal, .sp-modal *, .sp-toast { animation: none !important; transition: none !important; } }
