/* ===== نرم‌افزار مدیریت مدرسه — پوسته مدرن ===== */
@font-face {
  font-family: Vazirmatn;
  src: url("/assets/fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Vazirmatn;
  src: url("/assets/fonts/Vazirmatn-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: Vazirmatn;
  src: url("/assets/fonts/Vazirmatn-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: Vazirmatn;
  src: url("/assets/fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: Vazirmatn;
  src: url("/assets/fonts/Vazirmatn-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}
/* فونت نمایشی «لاله‌زار» — فقط برای عنوان صفحه، برند و اسپلش؛ بدنه وزیرمتن می‌ماند */
@font-face {
  font-family: Lalezar;
  src: url("/assets/fonts/Lalezar-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #f2f5f3;
  --paper: #ffffff;
  --ink: #17252d;
  --muted: #5c6f68;
  --line: #dce5e0;
  --side: #0d3b34;
  --side-2: #14584c;
  --accent: #d97706;
  --accent-2: #047857;
  --good: #047857;
  --warn: #b45309;
  --bad: #b91c1c;
  --info: #2563eb;
  --gold: #f59e0b;
  --ring: rgba(4, 120, 87, .18);
  --shadow: 0 1px 2px rgba(23, 37, 45, .05), 0 8px 24px rgba(23, 37, 45, .07);
  --shadow-lg: 0 24px 60px rgba(13, 59, 52, .22);

  /* --- دیزاین توکن‌ها: شعاع، فاصله و آیکون — یک منبع واحد برای همه‌جا --- */
  --radius-xs: 8px;   /* چیپ‌ها و دکمه‌های ریز */
  --radius-sm: 11px;  /* ورودی‌ها و دکمه‌های sm */
  --radius-md: 13px;  /* آیتم‌های منو و پیل‌ها */
  --radius-lg: 16px;  /* کارت‌ها و جعبه‌های مسیر */
  --radius-xl: 20px;  /* مودال و کارد بزرگ */
  --radius-full: 999px;
  --gap: 12px;        /* فاصله استاندارد داخل ردیف‌ها */
  --gap-lg: 16px;     /* فاصله بین کارت‌ها */
  --pad-card: 20px;   /* پدینگ کارت */
  --dur: .18s;        /* مدت استاندارد ترنزیشن */

  /* --- پکیج ۲.۴: مقیاس تایپوگرافی، سایه، z-index و حرکت --- */
  --fs-3xs: 9px;      /* ریزترین متون (تاریخ میلادی/قمری تقویم) */
  --fs-2xs: 10.5px;   /* برچسب‌های کوچک */
  --fs-xs: 12px;      /* برچسب فیلد، badge */
  --fs-sm: 13px;      /* متن ثانویه، دکمه sm */
  --fs-md: 14px;      /* متن اصلی فرم */
  --fs-base: 15px;    /* بدنه */
  --fs-lg: 16px;      /* تیتر کارت */
  --fs-xl: 20px;      /* تیتر بزرگ */
  --fs-2xl: 28px;     /* عدد بزرگ */
  --fs-3xl: 36px;     /* نمایشی */
  --fs-title: 23px;   /* عنوان صفحه */
  --fs-stat: 32px;    /* عدد کارت آمار */
  --fs-hero: 42px;    /* اسپلش */
  --fs-wm: 78px;      /* واترمارک چاپی */
  --dur-slow: .3s;    /* ترنزیشن‌های کُندتر */
  --ease: cubic-bezier(.32, .72, 0, 1); /* حرکت یکدست «سنگین و نرم» */

  /* --- توکن‌های موشن (فاز ۱) — فقط برای قواعد جدید؛ قواعد موجود دست‌نخورده --- */
  --dur-fast: .15s;    /* میکرو-اینترکشن: هاور، فوکوس، ردیف */
  --dur-base: .24s;    /* حرکت استاندارد رویدادی */
  --dur-big: .42s;     /* حرکت‌های بزرگ: ripple، ورود صفحات */
  --ease-out: cubic-bezier(.22, 1, .36, 1);        /* شتاب‌گیریِ نرمِ کم‌کنش */
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);  /* فنر با کمی overshoot */
  --stagger: 35ms;     /* گام پله‌ای ورود آیتم‌ها */
  --stagger-c: 15ms;   /* گام ریز موج تقویم (۳۸ سلول → کپ کوتاه) */
  --grad-brand: linear-gradient(135deg, #116a5a, var(--side));
  --grad-gold: linear-gradient(135deg, #f59e0b, #d97706);
  --grad-danger: linear-gradient(135deg, #dc2626, #b91c1c);
  --grad-good: linear-gradient(135deg, #03855b, #047857);
  --surface-2: #f8fafc;          /* سطح دوم (هدر جدول، چیپ، هاور) */
  --shadow-xs: 0 1px 2px rgba(13, 59, 52, .07);
  --shadow-md: 0 14px 34px rgba(13, 59, 52, .14);
  --z-base: 2;        /* جریان عادی */
  --z-tool: 6;        /* ابزار داخل کارت (فولد، خروجی چارت، سرستون چسبان) */
  --z-dropdown: 20;   /* لیست پیشنهاد */
  --z-high: 50;       /* لایه‌های شناور محتوا */
  --z-modal: 90;
  --z-pop: 110;       /* انتخابگر تاریخ/ساعت */
  --z-toast: 120;
  --z-login: 150;
  --z-bell: 300;      /* اعلان زنگ */
  --z-tip: 500;
  --z-flash: 990;     /* کانفتی */
  --z-splash: 999;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  display: flex;
  /* هاله‌های نور برند (Aurora): سبز + طلایی + بنفش — با شدت قابل‌دیدن */
  background:
    radial-gradient(1200px 560px at 85% -10%, rgba(5, 150, 105, .16), transparent 62%),
    radial-gradient(1000px 560px at -10% 110%, rgba(217, 119, 6, .12), transparent 62%),
    radial-gradient(920px 540px at 52% 118%, rgba(139, 92, 246, .1), transparent 64%),
    var(--bg);
  color: var(--ink);
  font-family: Vazirmatn, Tahoma, sans-serif;
  font-size:var(--fs-base);
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c9d4ce; border-radius: var(--radius-xs); border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #a9bab1; }

/* نوار اسکرول صفحهٔ اصلی (ریشه) پنهان است.
   کروم نوار عمودی را حتی در RTL در لبهٔ راست پنجره می‌کشد؛ آن نوار روی لبهٔ
   سایدبار می‌افتاد و به شکل یک نوار روشن/آبی دیده می‌شد که با اسکرول پایین‌تر
   پررنگ‌تر می‌شد. اسکرول با چرخ ماوس/تاچ/کیبورد کاملاً کار می‌کند. */
html { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar { width: 0; height: 0; display: none; }

button, input, select, textarea { font-family: inherit; }
a { color: inherit; }

/* ===== سایدبار ۳.۰ — ستون برند (سمت راست، تمام‌قد و ثابت) =====
   هم‌خانواده با تم جدید: گرادیان برند + هاله طلایی، شیشه، گوشه‌های نرم،
   نشانگر طلایی و ریزحرکت‌های فنری. رفتار JS (آکاردئون، حالت آیکون،
   نشانگر شناور) دست‌نخورده می‌ماند؛ فقط لایهٔ بصری بازسازی شده است. */
.sidebar {
  width: 252px;
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  padding: 14px;
  color: #eef6f2;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26'%3E%3Ccircle cx='3' cy='3' r='1.2' fill='%23ffffff' fill-opacity='.045'/%3E%3Ccircle cx='16' cy='16' r='1.2' fill='%23ffffff' fill-opacity='.045'/%3E%3C/svg%3E"),
    radial-gradient(320px 230px at 108% -6%, rgba(251, 191, 36, .22), transparent 62%),
    radial-gradient(280px 340px at -22% 44%, rgba(16, 185, 129, .17), transparent 66%),
    linear-gradient(196deg, #12564a 0%, #0d3b34 42%, #062420 100%);
  box-shadow: -10px 0 34px rgba(4, 31, 26, .28);
  /* نوار اسکرول ستون پنهان است؛ اسکرول با چرخ ماوس/تاچ انجام می‌شود.
     (نوار پیش‌فرض ویندوز به شکل یک ریل روشن/آبی در لبهٔ داخلی دیده می‌شد) */
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-shrink: 0;
}
/* خط نور سبز-طلایی لبهٔ داخلی — جداکنندهٔ زنده از بدنه */
.sidebar::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(180deg, transparent 3%, rgba(52, 211, 153, .45) 28%, rgba(251, 191, 36, .34) 68%, transparent 97%);
  pointer-events: none;
  z-index: 3;
}
.sidebar::-webkit-scrollbar { width: 0; height: 0; display: none; }
/* هیچ اسکرول‌باری در هیچ بخشی از سایدبار (منو، پنل پایین، لیست‌های داخلی) رسم نشود */
.sidebar * { scrollbar-width: none; -ms-overflow-style: none; }
.sidebar *::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* ---------- ردیف بالایی سایدبار ----------
   کلید «فقط-آیکون / عریض» حذف شد و روی خودِ لوگوی کروما نشست (.brand). */

/* ---------- ردیف سال تحصیلی در پنل پایین سایدبار ----------
   چیپ جمع‌وجور: آیکون + برچسب + مقدار؛ ارتفاع کم تا نظم پنل به‌هم نخورد. */
.sstat-year {
  display: flex; align-items: center; gap: 6px;
  width: 100%;
  padding: 0 1px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  font-size: var(--fs-2xs);
  line-height: 1.6;
}
.sstat-year-ic {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 20px; height: 20px; border-radius: 7px;
  color: #fde68a;
  background: rgba(251, 191, 36, .14);
  border: 1px solid rgba(251, 191, 36, .22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
}
.sstat-year-label {
  flex: 1 1 auto; min-width: 0;
  color: #a9cfc1; font-weight: 700; text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sstat-year-val {
  flex: 0 0 auto; max-width: 62%;
  padding: 2px 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--fs-2xs); font-weight: 800; letter-spacing: .2px;
  color: #ffe9ae;
  background: rgba(251, 191, 36, .12);
  border: 1px solid rgba(251, 191, 36, .26);
  border-radius: var(--radius-full);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}
.sstat-year[hidden] { display: none; }

/* ---------- کارت برند: نشان فارسی «کروما» — خودش کلید «فقط-آیکون / عریض» است ---------- */
.brand {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  width: 100%;
  padding: 10px 8px 16px;
  border: 0; background: none;
  font-family: inherit;
  cursor: pointer;
  border-radius: var(--radius-md);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: background var(--dur-fast) var(--ease);
}
.brand:hover { background: rgba(255, 255, 255, .045); }
.brand:active { background: rgba(255, 255, 255, .07); }
.brand:focus-visible { outline: 2px solid rgba(251, 191, 36, .75); outline-offset: 2px; }
.brand-logo {
  width: auto; height: 46px; max-width: 100%;
  object-fit: contain; display: block;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, .32)) drop-shadow(0 0 14px rgba(251, 191, 36, .14));
  transition: transform var(--dur-slow) var(--ease);
  pointer-events: none;
}
.brand:hover .brand-logo { transform: scale(1.04); }
.brand:active .brand-logo { transform: scale(.98); }

/* ---------- ناوبری ---------- */
/* عمداً min-height:0 نگذاشتیم: با آن، منو در ارتفاع کم جمع می‌شد و
   آیتم‌های باز روی پنل پایین (خروج/ابزارها) می‌افتادند. با min-height:auto
   منو به اندازهٔ محتوایش می‌ماند و کل ستون اسکرول می‌شود — مثل نسخهٔ قبلی. */
.sidebar nav {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; gap: 3px;
  flex: 1;
  margin-top: 14px;
}
.sidebar nav .nav-group { margin: 0; }

/* سرِ گروه — برچسب بخش با آیکون و خط طلایی گروهِ فعال */
.nav-group-head {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 8px 6px;
  border: 0; border-radius: var(--radius-sm);
  background: transparent; cursor: pointer; font-family: inherit;
  color: #b3dccd;
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .2px;
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.nav-group-head:hover { color: #dcefe7; background: rgba(255, 255, 255, .045); }
.nav-group-head::before {
  content: ''; position: absolute; right: 0; top: 50%; translate: 0 -50%;
  width: 2px; height: 0; border-radius: 2px;
  background: var(--gold); box-shadow: 0 0 8px rgba(251, 191, 36, .7);
  transition: height var(--dur) var(--ease);
}
.nav-group-ic {
  display: block; width: 14px; height: 14px; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
  opacity: .9;
}
.nav-group-label { flex: 1; text-align: right; }
.nav-group-chev {
  flex: 0 0 auto; width: 13px; height: 13px; opacity: .55;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.nav-group-head[aria-expanded="true"] .nav-group-chev { transform: rotate(180deg); opacity: .9; }
.nav-group:has(a.active) > .nav-group-head {
  color: #fde68a;
  background: linear-gradient(90deg, rgba(251, 191, 36, .11), rgba(255, 255, 255, .015));
}
.nav-group:has(a.active) > .nav-group-head::before { height: 13px; }
.nav-group:has(a.active) > .nav-group-head .nav-group-ic,
.nav-group:has(a.active) > .nav-group-head .nav-group-chev { opacity: 1; }

/* بدنهٔ بازشو (grid-template-rows برای انیمیشن نرم بدون جا آوردن) */
.nav-group-body {
  display: grid; grid-template-rows: 0fr;
  min-height: 0; opacity: 0;
  transition: grid-template-rows var(--dur-slow) var(--ease), opacity var(--dur) var(--ease);
}
.nav-group-inner {
  display: flex; flex-direction: column; gap: 2px;
  min-height: 0; overflow: hidden;
}
.nav-group[data-open="1"] .nav-group-body { grid-template-rows: 1fr; opacity: 1; margin: 1px 0 6px; }

/* لینک‌ها — آیتم‌های ۴۰ پیکسلی با کاشی آیکون */
.sidebar nav a {
  position: relative;
  display: flex; align-items: center; gap: 9px;
  padding: 5px 7px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: #d8ebe3; opacity: .88;
  font-size: var(--fs-sm); font-weight: 600;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
              opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.sidebar nav a:hover { background: rgba(255, 255, 255, .055); color: #fff; opacity: 1; transform: translateX(-2px); }
.sidebar nav a > svg {
  width: 28px; height: 28px; padding: 5px; box-sizing: border-box;
  border-radius: 9px;
  background: rgba(255, 255, 255, .05);
  color: #bfe0d4;
  fill: none; stroke: currentColor;
  stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round;
  flex: 0 0 auto;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease-spring);
}
.sidebar nav a:hover > svg { color: #fde68a; background: rgba(251, 191, 36, .14); }
.sidebar nav a .nav-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* آیتم فعال — قرص طلایی از #nav-cursor پشت متن می‌نشیند */
.sidebar nav a.active { color: #fff; opacity: 1; font-weight: 800; }
.sidebar nav a.active > svg {
  color: #fbbf24;
  background: linear-gradient(135deg, rgba(251, 191, 36, .3), rgba(251, 191, 36, .1));
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .3);
}
.sidebar nav a.active:hover { background: transparent; }
.sidebar nav a.active::before { display: none; }
.sidebar nav a:focus-visible {
  outline: 2px solid rgba(251, 191, 36, .72); outline-offset: 1px;
  border-radius: var(--radius-md);
}

/* زیرمجموعه‌ها هنگام باز شدن، پله‌ای می‌آیند */
@keyframes navItemIn { from { opacity: 0; transform: translateX(12px); } }
.nav-group[data-open="1"] .nav-group-inner > a { animation: navItemIn var(--dur-slow) var(--ease) backwards; }
.nav-group[data-open="1"] .nav-group-inner > a:nth-child(2) { animation-delay: .04s; }
.nav-group[data-open="1"] .nav-group-inner > a:nth-child(3) { animation-delay: .08s; }
.nav-group[data-open="1"] .nav-group-inner > a:nth-child(4) { animation-delay: .12s; }
.nav-group[data-open="1"] .nav-group-inner > a:nth-child(5) { animation-delay: .16s; }
.nav-group[data-open="1"] .nav-group-inner > a:nth-child(6) { animation-delay: .2s; }

/* ---------- پنل وضعیت پایین: روزشمار + دکمه‌های ابزار + خروج ---------- */
.sidebar-status {
  margin-top: 10px;
  padding: 9px 10px;
  display: flex; flex-direction: column; gap: 8px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .03));
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 8px 20px rgba(2, 18, 15, .18);
}
/* طبق درخواست: انتهای سایدبار کاملاً خالی است — نه دکمه‌ای، نه کادری.
   دکمه‌های ابزار روی داشبورد داخل نوار هیرو منتقل می‌شوند و در تب‌های دیگر
   داخل همین ظرفِ مخفی می‌مانند (پس هیچ‌کدام در سایدبار دیده نمی‌شوند). */
.sidebar-status { display: none !important; }
.sstat-row {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 4px 6px;
  font-size: var(--fs-2xs); line-height: 1.7; text-align: center;
  color: #c6e6da; opacity: .95;
}
/* display:flex مقدار hidden را خنثی می‌کند — صراحتاً مخفی می‌ماند */
.sstat-row[hidden] { display: none; }
.sstat-row svg { flex-shrink: 0; }
.sstat-row .emoji-ic { width: 13px; height: 13px; }

/* ردیف دکمه‌ها: چهار ابزار هم‌اندازه + خروج کشیده در سطر بعد */
.tabs-pick-wrap {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, .09);
}
.tabs-pick-wrap .side-btn {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 1 1 0; width: auto; min-width: 30px; height: 31px;
  padding: 0; gap: 5px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 9px;
  background: rgba(255, 255, 255, .07);
  color: #d7ebe3;
  font-family: inherit; font-size: var(--fs-2xs); font-weight: 700; line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.tabs-pick-wrap .side-btn[hidden] { display: none; }
.tabs-pick-wrap .side-btn:disabled { opacity: .55; cursor: wait; transform: none; }
.tabs-pick-wrap .side-btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.tabs-pick-wrap .side-btn:hover {
  background: rgba(251, 191, 36, .16); border-color: rgba(251, 191, 36, .38);
  color: #ffefc4; transform: translateY(-1px);
}
.tabs-pick-wrap .side-btn:active { transform: translateY(0); background: rgba(251, 191, 36, .22); }
.tabs-pick-wrap .side-btn:focus-visible { outline: 2px solid rgba(251, 191, 36, .72); outline-offset: 2px; }
.tabs-pick-wrap .theme-btn { font-size: 15px; padding: 0; }
.tabs-pick-wrap .side-logout-btn {
  flex: 1 1 100%; height: 36px; padding: 0 10px; gap: 7px;
  background: rgba(248, 113, 113, .1);
  border-color: rgba(248, 113, 113, .24);
  color: #ffd7d7;
  font-size: var(--fs-xs); font-weight: 800; line-height: 1.7;
}
.tabs-pick-wrap .side-logout-btn:hover {
  background: rgba(248, 113, 113, .2); border-color: rgba(248, 113, 113, .46); color: #fff;
}
/* بدون overflow:hidden — وگرنه دنبالهٔ حروف فارسی (ج) بریده می‌شود */
.tabs-pick-wrap .side-logout-btn span { white-space: nowrap; }
/* فقط دکمهٔ بکاپِ ناموفق قرمز ملایم می‌شود */
.sstat-tip.is-bad {
  background: rgba(220, 38, 38, .22);
  border-color: rgba(220, 38, 38, .55);
  color: #fecaca;
}
.sstat-tip.is-bad:hover { background: rgba(220, 38, 38, .32); border-color: rgba(220, 38, 38, .7); color: #fff; }

/* ---------- حالت فقط-آیکون ---------- */
body.sidebar-icons { --sbw: 72px; }
body.sidebar-icons .sidebar { width: var(--sbw); padding: 12px 7px; }
body.sidebar-icons .main { margin-right: var(--sbw); }
body.sidebar-icons .brand { padding: 8px 0 12px; }
body.sidebar-icons .brand-logo { width: 100%; height: auto; }
body.sidebar-icons .sidebar-status { display: none; }
body.sidebar-icons .nav-group-head { display: none; }
body.sidebar-icons .nav-group { position: static; margin: 0; }
body.sidebar-icons nav { margin-top: 8px; gap: 3px; }
body.sidebar-icons .nav-group-body {
  grid-template-rows: 1fr; opacity: 1;
  overflow: visible; position: static; transition: none;
}
body.sidebar-icons nav .nav-group[data-open] .nav-group-body { margin: 0; }
body.sidebar-icons .nav-group-inner { overflow: visible; gap: 3px; }
body.sidebar-icons nav a {
  justify-content: center; gap: 0; padding: 5px 0; font-size: 0;
  animation: none;
}
body.sidebar-icons nav a:hover { transform: none; }
body.sidebar-icons nav a .nav-t { display: none; }
body.sidebar-icons nav a .nav-badge { display: none; }
body.sidebar-icons nav a > svg { width: 32px; height: 32px; padding: 7px; border-radius: 10px; }
body.sidebar-icons .nav-group-inner > a { animation: none; }

/* ===== بدنه اصلی ===== */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; margin-right: var(--sbw, 252px); transition: margin-right .25s ease; }
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 30px 10px;
  flex-wrap: wrap; /* در صفحه باریک، چیپ‌ها به خط بعد بروند نه اینکه بیرون بزنند */
}
/* تیترهای نوار بالا حذف شدند (هدرِ هر تب داخل کارت‌های خود صفحه هست)؛
   #page-title فقط به‌صورت مخفی در DOM می‌ماند تا کدهای قدیمی ن break کنند.
   اگر نوار بالا بعد از جابه‌جایی چیپ‌ها خالی شد (داشبورد)، فشرده می‌شود */
.topbar.topbar-empty { padding: 0 30px; }
.topbar-date {
  color: var(--side); font-weight: 700; font-size:var(--fs-sm);
  background: linear-gradient(120deg, #ecfdf5, #fef3c7);
  border: 1px solid #d1e7dd;
  padding: 8px 16px; border-radius: 999px;
  box-shadow: var(--shadow);
  white-space: nowrap;
}
/* — آیتم‌های نوار اطلاعات کارت خوش‌آمد داشبورد — استایل کامل در بخش dash-hero انتهای فایل — */
.topbar-clock {
  font-weight: 700; font-size:var(--fs-md); color: var(--side);
  background: linear-gradient(120deg, #eff6ff, #ecfdf5);
  border: 1px solid #bfdbfe;
  padding: 8px 16px; border-radius: 999px;
  box-shadow: var(--shadow);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.icon-btn {
  border: 0; background: var(--paper); border-radius: var(--radius-sm);
  padding: 8px 12px; cursor: pointer; box-shadow: var(--shadow); font-size:var(--fs-lg);
}
/* منوی همبرگری فقط در صفحه باریک لازم است؛ راهنما/حالت شب همیشه دیده می‌شوند */
#menu-btn { display: none; }
.view { padding: 12px 30px 40px; }

/* پایان سند: هیچ لایهٔ پس‌زمینهٔ جداگانه‌ای روی #view رسم نمی‌شود.
   قبلاً یک گرادیان سفید در ۸۴px آخر صفحه بود تا «انتهای سند» با کارت‌ها
   یکدست شود؛ اما همان گرادیان در نوار پدینگِ کنار سایدبار یک نوار روشن
   عمودی می‌ساخت که با هر اسکرول پایین‌تر بلندتر می‌شد. حالا ستون محتوا
   تا انتها همان پس‌زمینهٔ --bg را دارد و هیچ مرزی دیده نمی‌شود. */
.view { background: none; }

/* ===== شبکه‌ها و کارت‌ها ===== */
.grid { display: grid; gap: 16px; }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: 1.4fr 1fr; }
.grid-dash { grid-template-columns: 1.3fr .9fr; }

.card {
  background:
    /* خط نور ظریف لبه بالای کارت — جزئیات «محصول گران» */
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent-2) 26%, transparent), transparent) top/100% 1px no-repeat,
    var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--pad-card);
  position: relative;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card:hover {
  border-color: color-mix(in srgb, var(--accent-2) 28%, var(--line));
  box-shadow: var(--shadow), 0 6px 22px color-mix(in srgb, var(--accent-2) 10%, transparent);
}
.card h2, .card h3 { margin: 0 0 14px; font-size:var(--fs-lg); font-weight: 700; }
.card > h3:first-child::before, .card > h2:first-child::before {
  content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 3px;
  background: linear-gradient(135deg, var(--accent-2), var(--gold));
  margin-left: 9px; vertical-align: 2px;
}

/* کارت‌های آماری */
.stat { overflow: hidden; transition: transform .18s, box-shadow .18s; }
.stat::after {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--accent-2), var(--gold));
  opacity: 0; transition: opacity .18s;
}
.stat:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(23, 37, 45, .12); }
.stat:hover::after { opacity: 1; }
.stat .label { color: var(--muted); font-size:var(--fs-xs); font-weight: 600; }
.stat .value { font-size:var(--fs-stat); font-weight: 800; margin-top: 5px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat.good .value { color: var(--good); }
.stat.bad .value { color: var(--bad); }
.stat.warn .value { color: var(--warn); }

/* ===== دکمه‌ها ===== */
.btn {
  border: 0; border-radius: var(--radius-sm); padding: 10px 16px; cursor: pointer;
  background: var(--grad-brand); color: #fff; font-weight: 600;
  position: relative; overflow: hidden;
  transition: transform var(--dur) var(--ease), filter var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  box-shadow: 0 4px 14px rgba(13, 59, 52, .25);
}
/* برق جاروب‌شونده روی دکمه هنگام هاور — افکت لوکس بدون JS
   (وضعیت .loading مستثنی است چون ::after همان‌جا اسپینر چرخان است) */
.btn:not(.loading)::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -70%; width: 45%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .32), transparent);
  transform: skewX(-18deg);
  transition: left .55s var(--ease);
  pointer-events: none;
}
.btn:not(.loading):hover::after { left: 135%; }
.btn:hover { filter: brightness(1.1); box-shadow: 0 6px 18px rgba(13, 59, 52, .3); }
.btn:active { transform: scale(.97); }

/* --- موج کلیک (ripple) فاز ۱ ---
   داخل یک wrapper مستقل clip می‌شود تا قانون «overflow: visible» دکمه‌های
   دارای تولتیپ (رفع زیر‌شدن تولتیپ) موج را بیرون نزند. رنگ = currentColor:
   روی دکمه‌های تیره سفید، روی شبح/حاشیه‌دار تیره — در هر دو خوانا. */
.btn .ripwrap {
  position: absolute; inset: 0; border-radius: inherit;
  overflow: hidden; pointer-events: none;
}
.btn .rip {
  position: absolute; border-radius: 50%;
  background: currentColor; opacity: 0;
  will-change: transform, opacity;
  animation: btnRip var(--dur-big) var(--ease-out) forwards;
}
@keyframes btnRip {
  0%   { opacity: .22; transform: scale(.25); }
  60%  { opacity: .1; }
  100% { opacity: 0;  transform: scale(1); }
}
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); border-color: #cbd5e1; }
.btn.accent { background: var(--grad-gold); color: #17252d; box-shadow: 0 4px 14px rgba(217, 119, 6, .3); }
[data-theme="dark"] .btn.accent { color: #17252d; }
.btn.good { background: var(--grad-good); box-shadow: 0 4px 14px rgba(5, 150, 105, .3); }
.btn.danger { background: var(--grad-danger); box-shadow: 0 4px 14px rgba(220, 38, 38, .3); }
.btn.sm { padding: 6px 12px; font-size:var(--fs-sm); border-radius: var(--radius-sm); }
.btn.sel {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 0 0 3px var(--ring);
}

/* دکمه‌های کنار فیلدهای دارای برچسب، هم‌خط با کادر ورودی قرار می‌گیرند */
.row:has(.field) { align-items: flex-end; }
.row:has(.field) > .btn { margin-bottom: 0.5px; }
.row:has(.field) > label:not(.field),
.row:has(.field) > span:not(.field) { padding-bottom: 12px; }

/* ===== فرم‌ها ===== */
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
/* نشان‌های کارت «حضور امروز»: افقی و خوانا — متن هر نشان همیشه یک خط است */
.att-badges { flex-wrap: wrap; }
.att-badges .badge { white-space: nowrap; flex: 0 0 auto; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 140px; }
.field label { font-size:var(--fs-xs); color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea {
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px;
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent-2); box-shadow: 0 0 0 4px var(--ring);
}
.field textarea { min-height: 90px; resize: vertical; }

/* موشن/برند فاز ۱: چک‌باکس و رادیو با رنگ برند — به‌جای آبی پیش‌فرض کروم
   (accent-color بدون risk است و همه‌جا یکدست می‌شود) */
input[type="radio"] { accent-color: var(--accent-2); }

/* فاز ۵: چک‌باکس فنسی — جعبه سفارشی + تیکِ «کشیده‌شونده» هنگام تیک‌خوردن.
   radio بومی می‌ماند؛ فقط checkbox چون رفتار تیک‌زدنش اینجا کاملاً کنترل‌پذیر
   و constructible است (pseudo روی input با appearance:none در کرومیوم رندر می‌شود —
   با probe تأیید شد). حرکت: clip-path (کامپوزیتوری‌شده روی لایه کوچک) + pop فنری. */
input[type="checkbox"] {
  appearance: none; width: 19px; height: 19px; min-width: 19px; min-height: 19px;
  margin: 0; flex-shrink: 0;
  border: 1.6px solid var(--line); border-radius: 6px; background: #fff;
  cursor: pointer; position: relative; vertical-align: middle;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
input[type="checkbox"]:hover:not(:disabled) { border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--ring); }
input[type="checkbox"]:focus-visible {
  outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--ring);
}
input[type="checkbox"]:checked {
  background: var(--accent-2); border-color: var(--accent-2);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent-2) 35%, transparent);
}
/* تیک: دوضلعی L چرخیده — در لحظهٔ تیک با clip-path از چپ به راست «کشیده» می‌شود
   (همان مسیری که آدم با مداد تیک می‌کشد) و جعبه با یک pop فنری می‌نشیند */
input[type="checkbox"]::before {
  content: ''; position: absolute; top: 4.6px; left: 4.2px; width: 9px; height: 4.6px;
  border-left: 2.2px solid #fff; border-bottom: 2.2px solid #fff;
  transform: rotate(-45deg); opacity: 0;
}
input[type="checkbox"]:checked::before { opacity: 1; animation: chkDraw .26s var(--ease-out); }
input[type="checkbox"]:checked:not(:disabled) { animation: chkPop .35s var(--ease-spring); }
@keyframes chkDraw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes chkPop { 0% { transform: scale(.88); } 55% { transform: scale(1.09); } 100% { transform: scale(1); } }
[data-theme="dark"] input[type="checkbox"] { background: var(--surface-2); border-color: #3a4a57; }
[data-theme="dark"] input[type="checkbox"]:checked { background: var(--accent-2); border-color: var(--accent-2); }

/* فوکوس کیبورد یکدست: outline (بدون جابجایی layout) — قواعد اختصاصی‌تر خودشان می‌برند */
:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent-2) 45%, transparent);
  outline-offset: 2px;
}

/* دسترس‌پذیری: لینک پرش به محتوا — فقط با کیبورد دیده می‌شود و روی هر
   پس‌زمینه‌ای خوانا می‌ماند (سبز برند + متن سفید، کنتراست ۵+). */
.skip-link {
  position: fixed; top: 10px; right: 10px; z-index: 1000; /* بالاتر از اسپلش (999) و کانفتی (990) */
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--accent-2); color: #fff; font-size: var(--fs-sm); font-weight: 700;
  text-decoration: none; box-shadow: var(--shadow-md);
  transform: translateY(-160%); transition: transform var(--dur-base) var(--ease-out);
}
.skip-link:focus, .skip-link:focus-visible {
  transform: translateY(0); outline: 3px solid #fff; outline-offset: 2px;
}
/* هدف پرش (view) نباید حلقه فوکوس زشت بگیرد — فقط قابل فوکوس باشد */
#view:focus { outline: none; }

/* ===== جدول =====
   مقادیر اینجا همان است که واقعاً نمایش داده می‌شد: یک بلوک تکراری در
   انتهای فایل (متعلق به جدولِ مدال انضباطی) همین استایل‌ها را سراسری
   بازنویسی می‌کرد. مقدار مؤثر حفظ شد و اینجا به‌نیتِ خودش ثبت شد تا
   برخورد کاسکاد حذف شود و حالت «جدول متراکم» دوباره معنا بگیرد. */
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th {
  text-align: right; font-size:var(--fs-xs); color: var(--muted); font-weight: 600;
  padding: 6px 8px; border-bottom: 1px solid var(--line);
  background: var(--bg);
}
[data-theme="dark"] .table th { background: var(--surface-2); }
.table th:first-child { border-radius: 0 10px 10px 0; }
.table th:last-child { border-radius: var(--radius-sm) 0 0 10px; }
.table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; transition: background var(--dur); }
.table td[dir="ltr"] { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--accent-2) 6%, transparent); }
/* موشن فاز ۱: پس‌زمینهٔ هاور ردیف‌ها نرم (به‌جای پرش لحظه‌ای) */
.table tbody tr td { transition: background-color var(--dur-fast) var(--ease-out); }
/* صیقل نهایی: ورود موجی ردیف‌ها — عمداً فقط opacity (بدون transform) تا
   ستون چسبان نام (sticky-name) در جدول‌های بزرگ قفل بماند؛ کپ ۱۰ گام */
.table tbody tr { animation: rowIn var(--dur) var(--ease-out) backwards; }
.table tbody tr:nth-child(2) { animation-delay: calc(var(--stagger) * 1); }
.table tbody tr:nth-child(3) { animation-delay: calc(var(--stagger) * 2); }
.table tbody tr:nth-child(4) { animation-delay: calc(var(--stagger) * 3); }
.table tbody tr:nth-child(5) { animation-delay: calc(var(--stagger) * 4); }
.table tbody tr:nth-child(6) { animation-delay: calc(var(--stagger) * 5); }
.table tbody tr:nth-child(7) { animation-delay: calc(var(--stagger) * 6); }
.table tbody tr:nth-child(8) { animation-delay: calc(var(--stagger) * 7); }
.table tbody tr:nth-child(9) { animation-delay: calc(var(--stagger) * 8); }
.table tbody tr:nth-child(10) { animation-delay: calc(var(--stagger) * 9); }
.table tbody tr:nth-child(n+11) { animation-delay: calc(var(--stagger) * 10); }
@keyframes rowIn { from { opacity: 0; } }
/* نشانگر هاور ردیف‌های کلیک‌پذیر: نوار کوچک در لبهٔ شروع ردیف (RTL) با فنر
   :where تا specificity صفر شود و ستون چسبان نام (sticky) نشکند */
.table tbody tr.clickable :where(td:first-child) { position: relative; }
.table tbody tr.clickable td:first-child::before {
  content: ''; position: absolute; right: 0; top: 20%; bottom: 20%; width: 3px;
  border-radius: 3px 0 0 3px; background: var(--accent-2);
  opacity: 0; transform: scaleY(.4); pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-base) var(--ease-spring);
}
.table tbody tr.clickable:hover td:first-child::before { opacity: .9; transform: scaleY(1); }
/* مرتب‌سازی/کپی جدول‌ها (util های core.js — additif؛ فقط وجوه data-sort و data-copy) */
.th-sortable { cursor: pointer; user-select: none; }
.th-sortable::after { content: ' \21C5'; font-size: var(--fs-2xs); opacity: .55; color: var(--muted); }
.th-sortable.sorted-asc::after { content: ' \2191'; opacity: 1; color: var(--accent); }
.th-sortable.sorted-desc::after { content: ' \2193'; opacity: 1; color: var(--accent); }
.copy-cell { cursor: copy; }
.clickable { cursor: pointer; }

/* ===== نشان‌ها ===== */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 14px;
  border-radius: 999px; font-size:var(--fs-sm); font-weight: 600;
}
.badge.present, .badge.normal { background: #d1fae5; color: #065f46; }
.badge.absent, .badge.critical { background: #fee2e2; color: #991b1b; }
.badge.late, .badge.important { background: #fef3c7; color: #92400e; }

/* — چیپ‌های وضعیت حضور و غیاب — لمس وضعیت فعال = حذف (مثل گوشی) — */
.att-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.att-chip {
  padding: 6px 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--paper);
  color: var(--ink); font-size: var(--fs-sm); font-weight: 600;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.att-chip:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,.08); }
.att-chip.on { color: #fff; border-color: transparent; }
.att-chip.on::after { content: " ✕"; font-size: 10px; opacity: .95; }
.att-chip.on.att-present { background: #10b981; }
.att-chip.on.att-absent { background: #ef4444; }
.att-chip.on.att-late { background: #f59e0b; }
.att-chip.disabled { opacity: .45; cursor: not-allowed; background: #f1f5f9 !important; color: #94a3b8 !important; border-color: #dce5e0 !important; }
.att-chip.disabled:hover { transform: none; box-shadow: none; }
.badge.auto { background: #dbeafe; color: #1e40af; }
.badge.manual { background: #ede9fe; color: #5b21b6; }
.badge.success { background: #d1fae5; color: #065f46; }
.badge.failed { background: #fee2e2; color: #991b1b; }
.badge.good { background: #d1fae5; color: #065f46; }

/* ===== جستجوی زنده ===== */
.suggest { position: relative; }
.suggest-list {
  position: absolute; top: 100%; right: 0; left: 0; z-index: var(--z-dropdown);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); max-height: 240px; overflow: auto; margin-top: 4px;
  padding: 4px;
  /* صیقل نهایی: ورود نرم منو در هر باز شدن (hidden → قابل‌نمایش) با
     @starting-style — بدون دست‌زدن به JS؛ در کرومیوم جدید پشتیبانی می‌شود */
  transform-origin: top right;
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
@starting-style {
  .suggest-list { opacity: 0; transform: translateY(-5px) scale(.985); }
}
.suggest-list button {
  display: block; width: 100%; text-align: right; border: 0; background: none;
  padding: 8px 12px; cursor: pointer; border-radius: var(--radius-sm);
}
.suggest-list button:hover { background: #ecfdf5; }
.suggest-list small { color: var(--muted); margin-right: 8px; }

/* ===== تقویم ===== */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal .wd {
  text-align: center; font-size:var(--fs-xs); font-weight: 700; color: var(--muted);
  padding: 6px 4px; background: var(--surface-2); border-radius: var(--radius-sm);
}
.cal .day {
  min-height: 78px; border-radius: var(--radius-sm); padding: 8px 8px; background: #fff;
  border: 1.5px solid #edf1f6; font-size:var(--fs-sm); cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between; gap: 2px;
  transition: transform var(--dur) ease, border-color var(--dur) ease, box-shadow var(--dur) ease;
}
.cal .day:hover { border-color: var(--accent-2); box-shadow: 0 6px 16px rgba(5, 150, 105, .14); transform: translateY(-1px); }
.cal .day.today { border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--ring); }
.cal .day.holiday, .cal .day.weekend { background: linear-gradient(160deg, #fef2f2, #fee2e2); border-color: #fecaca; }
.cal .day.holiday .day-num, .cal .day.weekend .day-num { color: #b91c1c; font-weight: 700; }
.cal .day.holiday:hover, .cal .day.weekend:hover { border-color: #f87171; box-shadow: 0 6px 16px rgba(220, 38, 38, .16); }
.cal .day.has-event { box-shadow: inset 0 -3px 0 var(--accent); }
.cal .day-num { font-weight: 600; }
/* فاز ۳: ورود موجی سلول‌های تقویم — پله‌ای در جهت خواندن (راست‌به‌چپ، ردیف‌به‌ردیف)
   با کپ ۳۵۰ms تا دُم موج کشیده نشود. تغییر ماه با لغزش جهت‌دار: --cal-slide را
   JS فقط هنگام جابه‌جایی ماه روی همان گرید تازه ست می‌کند (بار اول لغزش نداریم). */
@keyframes calIn {
  from { opacity: 0; transform: translate(var(--cal-slide, 0px), 10px); }
}
.cal > * { animation: calIn var(--dur-big) var(--ease-out) backwards; }
.cal > *:nth-child(2) { animation-delay: calc(var(--stagger-c) * 1); }
.cal > *:nth-child(3) { animation-delay: calc(var(--stagger-c) * 2); }
.cal > *:nth-child(4) { animation-delay: calc(var(--stagger-c) * 3); }
.cal > *:nth-child(5) { animation-delay: calc(var(--stagger-c) * 4); }
.cal > *:nth-child(6) { animation-delay: calc(var(--stagger-c) * 5); }
.cal > *:nth-child(7) { animation-delay: calc(var(--stagger-c) * 6); }
.cal > *:nth-child(8) { animation-delay: calc(var(--stagger-c) * 7); }
.cal > *:nth-child(9) { animation-delay: calc(var(--stagger-c) * 8); }
.cal > *:nth-child(10) { animation-delay: calc(var(--stagger-c) * 9); }
.cal > *:nth-child(11) { animation-delay: calc(var(--stagger-c) * 10); }
.cal > *:nth-child(12) { animation-delay: calc(var(--stagger-c) * 11); }
.cal > *:nth-child(13) { animation-delay: calc(var(--stagger-c) * 12); }
.cal > *:nth-child(14) { animation-delay: calc(var(--stagger-c) * 13); }
.cal > *:nth-child(15) { animation-delay: calc(var(--stagger-c) * 14); }
.cal > *:nth-child(n+16) { animation-delay: calc(var(--stagger-c) * 15); }
/* «امروز»: عددش یک‌بار فنری می‌پرد (حلقهٔ ثابت today سر جایش است)؛
   from = scale(1) است تا در دورهٔ انتظار پنهان نماند */
.cal .day.today .day-num {
  animation: todayPop .55s var(--ease-spring) calc(var(--dur-big) + var(--stagger-c) * 4) backwards;
}
@keyframes todayPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.28); }
  100% { transform: scale(1); }
}
.day-titles { display: flex; flex-direction: column; gap: 1px; overflow: hidden; }
.day-title {
  font-size:var(--fs-2xs); line-height: 1.55; color: #7a684d; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; font-weight: 500;
}
.day-title.hol { color: #b91c1c; font-weight: 700; }
.day-title.sch { color: #4f46e5; }
.day-more { font-size:var(--fs-2xs); color: var(--muted); font-weight: 600; }
/* تاریخ ریز میلادی و قمری در هر روز تقویم */
.day-alt {
  display: flex; justify-content: space-between; gap: 3px; margin-top: 1px;
  font-size:var(--fs-3xs); line-height: 1.3; color: #94a3b8; font-weight: 400;
}
.day-alt .gr, .day-alt .hj {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 48%;
}
.day-alt .hj { color: #a78bfa; }
.cal-legend {
  display: flex; flex-wrap: wrap; gap: 14px; font-size:var(--fs-xs); color: var(--muted);
  margin-bottom: 12px; align-items: center;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 14px;
}
.lg { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-left: 4px; }
.lg-holiday { background: #dc2626; }
.lg-occasion { background: #d97706; }
.lg-custom { background: #6366f1; }
.lg-weekend { background: #ef9a9a; }
.cal-day-details h4 { margin: 12px 0 6px; font-size:var(--fs-md); }
.cal-day-details ul { margin: 0; padding-right: 18px; }
.cal-day-details li { margin-bottom: 6px; line-height: 1.9; }
.row-holiday td { background: #fef2f2; }
table .badge { margin-left: 3px; }

/* ===== ردیف کلاس ===== */
.class-pill {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-radius: var(--radius-lg); margin-bottom: 10px; cursor: pointer;
  background: linear-gradient(120deg, var(--surface-2), #f1f5f9);
  border: 1px solid var(--line);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.class-pill:hover { transform: translateY(-2px); border-color: #a7d8c8; box-shadow: 0 10px 24px rgba(5, 150, 105, .14); }

/* حالت فشرده (تنظیمات: پایه‌ها/کلاس‌ها) */
.pill-list .class-pill { padding: 8px 12px; margin-bottom: 6px; border-radius: var(--radius-sm); font-size:var(--fs-sm); gap: 6px; }
.pill-list .class-pill .btn.sm { padding: 4px 8px; font-size:var(--fs-xs); }

/* ===== ردیف کلاس دو سطرگی (داشبورد) ===== */
.class-pill-2row { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px 16px; }
.class-row-1, .class-row-2 { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 12px; flex-wrap: wrap; }
.class-row-1 strong { font-size: var(--fs-md); color: var(--ink); }
.class-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.stat { display: flex; align-items: center; gap: 4px; font-size: var(--fs-sm); color: var(--muted); }
.stat-num { font-weight: 700; color: var(--side); }
.stat-present .stat-num { color: var(--good); }
.class-row-2 { margin-top: 4px; }
.class-lessons { display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); color: var(--muted); flex-wrap: wrap; }
.lesson-label { font-weight: 600; color: var(--ink); font-size: var(--fs-xs); opacity: 0.8; }
.lesson-now { font-weight: 600; color: var(--ink); }
.lesson-next { color: var(--accent); font-size: var(--fs-xs); opacity: 0.85; }
.class-right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
details > summary { list-style-position: inside; }

/* فاصله از کادر برای badge و앙ت‌ها */
.class-pill .badge { margin-left: 8px; }
.att-num { margin-left: 8px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--bad) 10%, transparent); color: var(--bad); }
.att-num.late { background: color-mix(in srgb, var(--warn) 10%, transparent); color: var(--warn); }
details[open] > summary { color: var(--side); }

.empty { color: var(--muted); text-align: center; padding: 30px 8px; }
.muted { color: var(--muted); }
.danger-box {
  background: #fef2f2; color: #991b1c; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid #fecaca;
}
.path-box {
  background: #f0fdf9; border: 1px solid #a7d8c8; border-radius: var(--radius-lg);
  padding: 14px 16px; margin: 14px 0;
}
.path-box strong { display: block; margin-bottom: 4px; }
.path-box p { margin: 0 0 10px; color: var(--muted); font-size:var(--fs-sm); line-height: 1.9; }
.profile-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 18px; margin-top: 8px; font-size:var(--fs-sm);
}

/* ===== مودال ===== */
.modal-back {
  position: fixed; inset: 0; z-index: var(--z-modal);
  background: rgba(15, 32, 39, .45); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn var(--dur) var(--ease-out);
}
.modal {
  background: var(--paper);
  border-radius: var(--radius-xl); padding: 22px;
  width: min(620px, 100%); min-width: 320px; max-height: 86vh; overflow: auto;
  box-shadow: var(--shadow-lg);
  /* فاز ۴: ورود فنری — بزیه فنر از scale .92 عبور می‌کند و مودال یک‌بار لطیف اورشوت می‌گیرد */
  animation: modalIn var(--dur-big) var(--ease-spring) backwards;
  resize: both; /* قابل اندازه‌گیری توسط کاربر */
}
/* مودال با tabindex=-1 فوکوس می‌گیرد تا Tab از داخل دیالوگ شروع شود؛
   حلقهٔ فوکوس دورِ خودِ ظرف دیده نمی‌شود (فوکوس برنامه‌ای است) */
.modal:focus { outline: none; }
.modal h3 { margin-top: 0; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
/* فاز ۴: محتوای مودال هم پله‌ای بالا می‌آید — ظریف و کوتاه (کپ ۴ گام) */
@keyframes modalIn { from { opacity: 0; transform: scale(.92) translateY(16px); } }
@keyframes modalRise { from { opacity: 0; transform: translateY(7px); } }
.modal-body > * { animation: modalRise var(--dur) var(--ease-out) backwards; }
.modal-body > *:nth-child(2) { animation-delay: calc(var(--stagger) * 1); }
.modal-body > *:nth-child(3) { animation-delay: calc(var(--stagger) * 2); }
.modal-body > *:nth-child(4) { animation-delay: calc(var(--stagger) * 3); }
.modal-body > *:nth-child(5) { animation-delay: calc(var(--stagger) * 4); }
.modal-body > *:nth-child(n+6) { animation-delay: calc(var(--stagger) * 4); }

/* ===== توست ===== */
/* نوار اعلان‌ها از لبهٔ بالای صفحه سرریز نمی‌کند؛ وقتی جا تمام شود
   اعلان‌های قدیمی‌تر (بالای ستون) بریده می‌شوند و بعد از انقضا می‌روند */
.toast-wrap { position: fixed; left: 20px; bottom: 20px; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 40px); overflow: hidden; }
.toast {
  background: #0d3b34; color: #fff; padding: 12px 18px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); font-size:var(--fs-md); font-weight: 500;
  border-right: 4px solid var(--gold);
  /* فاز ۴: ورود فنری از پایین (wrap لبهٔ پایین است) */
  animation: toastIn var(--dur) var(--ease-spring) backwards;
}
.toast.err { background: #7f1d1d; border-right-color: #fca5a5; }

/* ===== انتخاب سطح ===== */
.level-picks { display: flex; gap: 8px; }
.level-picks label {
  flex: 1; border: 1.5px solid var(--line); border-radius: var(--radius-md); padding: 12px;
  text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
  background: #fff;
}
.level-picks label:hover { border-color: #cbd5e1; }
.level-picks input { display: none; }
.level-picks input:checked + span.normal { color: var(--good); font-weight: 700; }
.level-picks input:checked + span.important { color: var(--warn); font-weight: 700; }
.level-picks input:checked + span.critical { color: var(--bad); font-weight: 700; }
.level-picks input:checked + span { display: inline-block; }

/* ===== نمودار ===== */
.chart-wrap { position: relative; height: 260px; }
.chart-tip {
  position: absolute; background: var(--ink); color: #fff; padding: 8px 10px;
  border-radius: var(--radius-sm); font-size:var(--fs-xs); display: none; max-width: 240px; pointer-events: none;
  box-shadow: var(--shadow-lg);
}

/* ===== تب‌ها ===== */
.tabs {
  display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap;
  background: #fff; padding: 6px; border-radius: var(--radius-lg); border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.tabs button { border-radius: var(--radius-sm); box-shadow: none; }
.tabs button.active { background: var(--grad-brand); color: #fff; }

.preview-ok { color: var(--good); font-weight: 600; }
.preview-error { color: var(--bad); font-weight: 600; }
.preview-dup { color: var(--warn); font-weight: 600; }

/* ===== انتخابگر تاریخ شمسی و ساعت ===== */
/* پنجرهٔ تقویم/ساعت با position:fixed در مختصات بصری جای می‌گیرد
   (مغایرت زوم را core.js با تقسیم بر appZoom جبران می‌کند) */
.dp-pop {
  position: fixed; z-index: var(--z-pop); width: 292px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 12px;
  animation: popIn .15s ease;
}
.dp-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; gap: 8px;
}
.dp-title { font-size:var(--fs-md); }
.dp-nav {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius-xs);
  width: 30px; height: 30px; cursor: pointer; font-size:var(--fs-base); line-height: 1;
}
.dp-nav:hover { background: #ecfdf5; border-color: var(--accent-2); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dp-wd { text-align: center; font-size:var(--fs-xs); color: var(--muted); padding: 3px 0; font-weight: 700; }
.dp-day {
  border: 0; background: var(--surface-2); border-radius: var(--radius-xs); padding: 6px 0;
  cursor: pointer; font-size:var(--fs-xs); font-family: inherit; color: var(--ink);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.dp-day:hover { background: #ecfdf5; }
.dp-day.dp-hol { background: #fef2f2; color: #b91c1c; }
.dp-day.dp-hol:hover { background: #fee2e2; }
.dp-day.dp-today { box-shadow: inset 0 0 0 1.5px var(--accent-2); font-weight: 700; }
.dp-day.dp-sel { background: var(--side); color: #fff; font-weight: 700; }
.dp-foot { display: flex; gap: 6px; margin-top: 10px; justify-content: flex-end; }
.tp-sec { margin-bottom: 8px; }
.tp-label { font-size:var(--fs-xs); color: var(--muted); font-weight: 700; margin-bottom: 5px; }
.tp-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.tp-chips button {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius-xs);
  padding: 5px 8px; cursor: pointer; font-size:var(--fs-xs); font-family: inherit;
}
.tp-chips button:hover { background: #ecfdf5; border-color: var(--accent-2); }
.tp-chips button.sel { background: var(--side); color: #fff; border-color: var(--side); }

/* ===== لوح ساز ===== */
/* ارتفاع قاب تقسیم بر زوم برنامه می‌شود؛ چون zoom روی بدنه، ارتفاع‌های
   vh را هم مقیاس می‌کند و بدون این جبران، پنجره لوح‌ساز با تغییر
   «اندازه نمایش برنامه (زوم)» کوچک می‌شد */
.lohyad-frame {
  width: 100%; height: calc((100vh - 150px) / var(--app-zoom, 1));
  border: 0; border-radius: var(--radius-lg); background: #fff; display: block;
}

@media (max-width: 1100px) {
  .grid-5, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-dash, .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .sidebar { transform: translateX(100%); transition: transform .2s; }
  body.menu-open .sidebar { transform: none; }
  .main { margin-right: 0; }
  #menu-btn { display: inline-block; }
}

/* ===== سایدبار: جمع‌شدن کامل (حالت آیکون در بخش سایدبار ۳.۰ تعریف شده) ===== */
.sidebar { transition: transform .25s var(--ease), width .25s var(--ease); }
body.sidebar-collapsed .sidebar { transform: translateX(105%); opacity: 0; pointer-events: none; }
body.sidebar-collapsed .main { margin-right: 0; }
body.sidebar-collapsed #menu-btn { display: inline-block; }

/* ===== فهرست‌های بازشو «N مورد دیگر» در کارت‌های داشبورد ===== */
.more-list { margin-top: 4px; }
.more-list summary {
  cursor: pointer; list-style: none; user-select: none;
  color: var(--side); font-weight: 700; font-size:var(--fs-xs);
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, .07); text-align: center;
  transition: background var(--dur) ease;
}
.more-list summary:hover { background: rgba(16, 185, 129, .14); }
.more-list summary::-webkit-details-marker { display: none; }
.more-list summary::after { content: ' ▾'; font-size:var(--fs-2xs); }
.more-list[open] summary::after { content: ' ▴'; }
.more-list[open] summary { margin-bottom: 4px; }

/* وضعیت بارگذاری تنظیمات — اسکلتون ملایم بدون حرکات اضافه (baft-e prefer-reduced-motion) */
.skl-line { height: 12px; border-radius: 6px; margin: 10px 0;
  background: linear-gradient(90deg, var(--line) 25%, rgba(148, 163, 184, .35) 50%, var(--line) 75%);
  background-size: 200% 100%; animation: skl-wave 1.4s ease infinite; }
.skl-line.short { width: 46%; }
.skl-line.mid { width: 70%; }
@keyframes skl-wave { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skl-line { animation: none; } }

/* ===== فرم‌های تاشو داخل کارت‌ها (باز/بسته برای اشغال فضای کمتر) ===== */
details.fold > summary {
  cursor: pointer; list-style: none; user-select: none;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; margin: 0 0 4px;
  border: 1px dashed var(--line); border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, .05);
  transition: background var(--dur) ease;
}
details.fold > summary:hover { background: rgba(16, 185, 129, .12); }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: '▴'; font-size:var(--fs-xs); color: var(--side); }
details.fold:not([open]) > summary::after { content: '▾'; }
details.fold:not([open]) > summary { margin-bottom: 0; }

/* ===== تب‌های صفحهٔ «گزارشات و سوابق» در css/records.css تعریف شده‌اند ===== */

@media print {
  .sidebar, .topbar, .btn, nav, .cal-legend { display: none !important; }
  /* جدول‌های اسکرول‌شونده در چاپ کامل نمایش داده شوند؛ سقف ارتفاع و
     اسکرول فقط مربوط به نمایش روی صفحه است — قبلاً چاپ بریده بود */
  .tbl-scroll { max-height: none !important; overflow: visible !important; }
  body { display: block; background: #fff; }
  .main { padding: 0; margin-right: 0; }
  .view { padding: 0; }
  .card { box-shadow: none; border: 0; }
}

/* ===== دکمه حالت شب در نوار بالا ===== */
.theme-btn { display: inline-block; font-size:var(--fs-base); }
[hidden] { display: none !important; }
.toast-action {
  border: 0; background: rgba(255, 255, 255, .18); color: #fff; cursor: pointer;
  border-radius: var(--radius-xs); padding: 5px 12px; margin-right: 12px; font-family: inherit;
  font-weight: 700; font-size:var(--fs-sm);
}
.toast-action:hover { background: rgba(255, 255, 255, .3); }

/* نقطه وضعیت سبز روی چیپ‌های نوار بالا و کارت‌ها */
.ok-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--good); }

/* ===== چیپ‌های نوار بالا: وضعیت سرور، بکاپ و موجودی پیامک ===== */
.top-chip {
  color: var(--side); font-weight: 700; font-size:var(--fs-xs);
  background: var(--paper); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 999px;
  box-shadow: var(--shadow);
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.top-chip .ok-dot { width: 9px; height: 9px; }

/* ===== یکدست‌سازی نوار بالا: همه چیپ‌ها یک استایل واحد ===== */
.topbar-clock, .topbar-date, #top-server {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--side);
  padding: 8px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size:var(--fs-xs);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.top-chip.warn { color: #9a6a12; background: #fff7e6; border-color: #eecd82; }

/* چیپ‌های اطلاعات (تاریخ، ساعت، آب‌وهوا، وضعیت سرور، پیامک) و دکمهٔ اعلان‌ها
   فقط در داشبورد و داخل کاشی‌های کارت خوش‌آمد نشان داده می‌شوند؛ در نوار بالای
   بقیهٔ تب‌ها مخفی‌اند. انتخابگر «فرزند مستقیم .topbar» است تا وقتی داشبورد
   همین عناصر را داخل کاشی‌های خودش جابه‌جا می‌کند از این قانون مستثنا بمانند. */
.topbar > #top-date, .topbar > #top-clock, .topbar > #top-weather,
.topbar > #top-server, .topbar > #top-sms,
.topbar > #notif-btn, .topbar > #dash-vis-btn { display: none !important; }


/* ===== استایل‌های تب وظایف دانش‌آموزان (تفکیک معلم/مدیر) ===== */
.teacher-duty-col {
  background: #f1f8f2 !important;
  border-left: 3px solid #10b981;
}
.admin-task-col {
  background: #eff6ff !important;
  border-left: 3px solid #3b82f6;
}
[data-theme="dark"] .teacher-duty-col {
  background: #064e3b !important;
  border-left: 3px solid #10b981;
}
[data-theme="dark"] .admin-task-col {
  background: #1e3a5f !important;
  border-left: 3px solid #3b82f6;
}
.table th[colspan="2"] {
  font-weight: 700;
}

.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ===== حالت شب ===== */
[data-theme="dark"] {
  --bg: #0a1310;
  --surface-2: #14231d;
  --paper: #12201b;
  --ink: #dce5e0;
  --muted: #8ba69c;
  --line: #24382f;
  --side: #092422;
  --ring: rgba(16, 185, 129, .3);
  /* سایه‌های حالت شب: عمیق‌تر و مشکی‌تر تا خاکستری کثیف نزنند */
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 26px rgba(0, 0, 0, .5);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .65);
}
[data-theme="dark"] body {
  background:
    radial-gradient(1200px 560px at 85% -10%, rgba(16, 185, 129, .15), transparent 62%),
    radial-gradient(1000px 560px at -10% 110%, rgba(217, 119, 6, .11), transparent 62%),
    radial-gradient(920px 540px at 52% 118%, rgba(139, 92, 246, .12), transparent 64%),
    var(--bg);
  color: var(--ink);
}
[data-theme="dark"] .sidebar {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26'%3E%3Ccircle cx='3' cy='3' r='1.2' fill='%23ffffff' fill-opacity='.04'/%3E%3Ccircle cx='16' cy='16' r='1.2' fill='%23ffffff' fill-opacity='.04'/%3E%3C/svg%3E"),
    radial-gradient(320px 230px at 108% -6%, rgba(251, 191, 36, .13), transparent 62%),
    radial-gradient(280px 340px at -22% 44%, rgba(16, 185, 129, .12), transparent 66%),
    linear-gradient(196deg, #0a2b25 0%, #071d19 45%, #03100d 100%);
  box-shadow: -10px 0 34px rgba(0, 0, 0, .45);
}
[data-theme="dark"] .sidebar-status {
  background: linear-gradient(160deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
  border-color: rgba(255, 255, 255, .09);
}
[data-theme="dark"] .topbar-date {
  background: linear-gradient(120deg, #0c2a25, #1e2431);
  border-color: #274036; color: #a7d8c8;
}
[data-theme="dark"] .topbar-clock {
  background: linear-gradient(120deg, #12201b, #0c2a25);
  border-color: #274036; color: #a7d8c8;
}
[data-theme="dark"] .icon-btn {
  background: var(--paper); color: var(--ink);
}
[data-theme="dark"] .btn.ghost {
  background: #1a2b24; color: var(--ink); border-color: var(--line);
}
[data-theme="dark"] .btn.ghost:hover { background: #21352c; border-color: #35544a; }

/* ===== نوار بالا در حالت تاریک — متن خوانا روی زمینه تیره ===== */
[data-theme="dark"] .top-chip,
[data-theme="dark"] .topbar-clock, [data-theme="dark"] .topbar-date,
[data-theme="dark"] #top-server {
  background: linear-gradient(120deg, #12201b, #0c2a25);
  border-color: #274036;
  color: #a7d8c8;
}
[data-theme="dark"] .top-chip.warn {
  background: #3a2f14; border-color: #6b5416; color: #e8c86a;
}
[data-theme="dark"] .field input, [data-theme="dark"] .field select,
[data-theme="dark"] .field textarea,
[data-theme="dark"] .pill-list .row input {
  background: var(--surface-2); color: var(--ink); border-color: var(--line);
}
[data-theme="dark"] .table th { background: var(--surface-2); color: var(--muted); border-bottom-color: var(--line); }
[data-theme="dark"] .table td { border-bottom-color: #1d2f27; }
[data-theme="dark"] .table tr:hover td { background: #1a2b24; }
[data-theme="dark"] .suggest-list { background: var(--paper); border-color: var(--line); }
[data-theme="dark"] .suggest-list button:hover { background: #10231f; }
[data-theme="dark"] .class-pill {
  background: linear-gradient(120deg, #1a2b24, #12201b); border-color: var(--line);
}
[data-theme="dark"] .card h2, [data-theme="dark"] .card h3 { color: var(--ink); }
[data-theme="dark"] .empty { color: var(--muted); }
[data-theme="dark"] .path-box { background: #10231f; border-color: #2a5348; color: var(--ink); }
[data-theme="dark"] .path-box p { color: var(--muted); }
[data-theme="dark"] .danger-box { background: #2a1214; color: #fca5a5; border-color: #58201f; }
[data-theme="dark"] .modal { background: var(--paper); color: var(--ink); }
[data-theme="dark"] .modal-back { background: rgba(0, 0, 0, .6); }
[data-theme="dark"] .toast { background: #0c2a25; }
[data-theme="dark"] .cal .day { background: var(--surface-2); border-color: #1d2f27; }
[data-theme="dark"] .cal .day.holiday, [data-theme="dark"] .cal .day.weekend {
  background: linear-gradient(160deg, #261114, #1d0c0e); border-color: #4a1f22; }
[data-theme="dark"] .cal .wd { background: var(--surface-2); color: var(--muted); }
[data-theme="dark"] .cal-legend { background: var(--surface-2); border-color: var(--line); color: var(--muted); }
[data-theme="dark"] .tabs { background: var(--paper); border-color: var(--line); }
[data-theme="dark"] .stat .label { color: var(--muted); }
[data-theme="dark"] .dp-pop { background: var(--paper); border-color: var(--line); }
[data-theme="dark"] .dp-day { background: var(--surface-2); color: var(--ink); }
[data-theme="dark"] .dp-nav { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .tp-chips button { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .preview-ok { color: #34d399; }
[data-theme="dark"] .preview-error { color: #f87171; }
[data-theme="dark"] .preview-ok { color: #34d399; }
[data-theme="dark"] .day-alt .hj { color: #8b7cf6; }
[data-theme="dark"] .day-title { color: #8d7c5f; }

/* ===== شمارش معکوس رویداد در داشبورد ===== */
.countdown-card {
  display: flex; justify-content: space-between; align-items: center;
  gap: 18px; flex-wrap: wrap; overflow: hidden;
}
.countdown-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 5px;
  background: linear-gradient(90deg, var(--accent-2), var(--gold), var(--bad));
  background-size: 200% 100%; animation: cdFlow 3s linear infinite;
}
.countdown-card.cd-critical::before { background: linear-gradient(90deg, #dc2626, #f59e0b, #dc2626); background-size: 200% 100%; }
.countdown-card.cd-important::before { background: linear-gradient(90deg, #d97706, #fbbf24, #d97706); background-size: 200% 100%; }
@keyframes cdFlow { from { background-position: 0% 0; } to { background-position: 200% 0; } }
.cd-title { font-size:var(--fs-lg); font-weight: 700; margin: 6px 0 3px; }
.cd-info .muted { font-size:var(--fs-xs); }
.countdown { display: flex; align-items: center; gap: 6px; }
.cd-chip {
  min-width: 62px; text-align: center; padding: 8px 6px;
  background: linear-gradient(160deg, var(--surface-2), #eef2f7);
  border: 1.5px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.cd-chip .cd-num { font-size:var(--fs-2xl); font-weight: 800; color: var(--side); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cd-chip .cd-lbl { font-size:var(--fs-2xs); color: var(--muted); font-weight: 600; margin-top: 1px; }
.cd-chip.tick { animation: cdTick .45s ease; }
@keyframes cdTick {
  0% { transform: scale(1); }
  40% { transform: scale(1.14); border-color: var(--accent); }
  100% { transform: scale(1); }
}
.cd-sep { font-size:var(--fs-xl); font-weight: 700; color: var(--muted); animation: cdBlink 1s steps(2, start) infinite; }
@keyframes cdBlink { 50% { opacity: .25; } }
.cd-now { font-size:var(--fs-xl); font-weight: 700; color: var(--good); animation: popIn .3s ease; }
[data-theme="dark"] .cd-chip { background: linear-gradient(160deg, #1a2b24, #12201b); }
[data-theme="dark"] .cd-chip .cd-num { color: #a7d8c8; }

/* ===== ورود و کاربران ===== */
.login-screen {
  position: fixed; inset: 0; z-index: var(--z-login); display: flex; align-items: center; justify-content: center;
  /* فقط پترن نقطه‌ای + گرادیان پایه و هر دو ثابت:
     هیچ background-position ای روی این المان تمام‌صفحه انیمیت نمی‌شود
     (و backdrop-filter هم ندارد) — همان ترکیبی که در کروم باعث می‌شد
     ناحیه‌ای از پس‌زمینه با لبهٔ تیز «جمع» شود. */
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30'%3E%3Ccircle cx='3' cy='3' r='1.3' fill='%23ffffff' fill-opacity='.07'/%3E%3Ccircle cx='18' cy='18' r='1.3' fill='%23ffffff' fill-opacity='.07'/%3E%3C/svg%3E"),
    linear-gradient(160deg, var(--side), #123c34);
  overflow: hidden;
}
/* هاله‌های رنگی: یک لایهٔ جدا و بزرگ‌تر از صفحه که فقط با transform
   حرکت می‌کند (کامپوزیتوری است و هیچ بازرستر/بازچینشی روی پس‌زمینه
   ایجاد نمی‌کند). قبلاً این سه گرادیان با انیمیشن background-position
   روی خود .login-screen جابه‌جا می‌شدند. */
.login-screen::before {
  content: ''; position: absolute; inset: -22% -14%; z-index: 0;
  background:
    radial-gradient(760px 460px at 12% 15%, rgba(52, 211, 153, .28), transparent 62%),
    radial-gradient(640px 400px at 92% 85%, rgba(245, 158, 11, .22), transparent 62%),
    radial-gradient(540px 340px at 68% 35%, rgba(139, 92, 246, .16), transparent 62%);
  animation: loginHaloDrift 34s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes loginHaloDrift {
  from { transform: translate3d(-1.4%, -1%, 0) scale(1.01); }
  to   { transform: translate3d(1.4%, 1%, 0) scale(1.05); }
}
.login-card {
  background: rgba(255, 255, 255, .84);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: var(--radius-xl); padding: 30px 32px; width: min(380px, calc(100vw - 30px));
  box-shadow: var(--shadow-lg), 0 0 70px rgba(16, 185, 129, .2);
  text-align: center;
}
.login-logo {
  width: 88px; height: 88px; border-radius: var(--radius-xl); background: #000; object-fit: cover;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, .45), 0 14px 34px rgba(245, 158, 11, .4);
}
.login-card .field { text-align: right; }
[data-theme=dark] .login-card {
  background: rgba(18, 32, 27, .82);
  border-color: rgba(52, 211, 153, .28);
}

/* ============================================================
   بهبودهای UI نسخه 2.2 — میکرو-تعامل، توپ‌تیپ شیشه‌ای، تایم‌لاین
   ============================================================ */

/* --- آیکون‌های خطی مشترک (core.js → icon()) --- */
.ic { vertical-align: -3.5px; margin-left: 6px; flex-shrink: 0; }

/* --- حلقه فوکوس برند روی همه ورودی‌ها (نه فقط داخل .field) --- */
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus, textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 4px var(--ring);
  outline: none;
}

/* --- اعداد با تایپوگرافی قوی --- */
.num, .topbar-clock, .cd-num { font-variant-numeric: tabular-nums; }

/* --- توپ‌تیپ شیشه‌ای عمومی (چیپ‌های نوار بالا، روزهای تقویم، تایم‌لاین، بطیج‌ها) --- */
[data-tip] { position: relative; }
/* عناصر ادعاشدهٔ DashTip (داخل کانتینر با overflow): تولتیپ CSS غیرفعال —
   DashTip با position:fixed جایش را می‌دهد و هرگز بریده نمی‌شود */
[data-tipjs]::after, [data-tipjs]::before { content: none !important; display: none !important; }
/* داخل ناحیهٔ محتوا (#view) همهٔ تولتیپ‌ها با پنجرهٔ body-level (DashTip) نشان
   داده می‌شوند. تولتیپ CSSِ ::after در صفحه‌های چندبخشی زیر کارتِ بعدی می‌افتد
   (مثل کاشی‌های «دسترسی سریع» داشبورد) و بریده/پنهان می‌شود. */
#view [data-tip]:hover::after, #view [data-tip]:focus-visible::after,
#view [data-tip]:hover::before, #view [data-tip]:focus-visible::before {
  content: none !important; display: none !important;
}
[data-tip]:hover::after, [data-tip]:focus-visible::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 10px); right: 50%; transform: translateX(50%);
  background: rgba(10, 38, 33, .92); backdrop-filter: blur(10px);
  color: #fff; font-size:var(--fs-sm); font-weight: 600; line-height: 1.6;
  padding: 10px 14px; border-radius: var(--radius-md);
  white-space: normal; max-width: 280px; z-index: var(--z-tip); pointer-events: none;
  box-shadow: 0 12px 36px rgba(13, 59, 52, .4);
  border: 1px solid rgba(251, 191, 36, .25);
  animation: tipIn var(--dur) ease;
}
[data-tip]:hover::before, [data-tip]:focus-visible::before {
  content: ''; position: absolute; bottom: 100%; right: 50%; transform: translateX(50%);
  border: 6px solid transparent; border-bottom-color: rgba(10, 38, 33, .92); margin-bottom: -1px;
  z-index: var(--z-tip); pointer-events: none;
}
@keyframes tipIn { from { opacity: 0; transform: translateX(50%) translateY(-4px); } }

/* --- بدون تولتیپ داخل سایدبار ---
   تولتیپ [data-tip] روی آیتم‌های منو باز می‌شد و روی ردیف/تب پایینی می‌افتاد،
   به‌گونه‌ای که نه آیتم هاورشده خوانا بود و نه تب زیرش. از این پس داخل
   سایدبار هیچ توضیح هاوری (CSS یا JS) نمایش داده نمی‌شود. */
.sidebar [data-tip]::after,
.sidebar [data-tip]::before { content: none !important; display: none !important; }

/* --- پنجرهٔ تولتیپ مشترک (body-level) ---
   تولتیپ CSS با pseudo-element داخل کارت‌های overflow:hidden بریده می‌شود و
   برای عناصر لبه‌ای بیرون از صفحه می‌افتد. به‌جای آن یک پنجرهٔ واحد روی body
   ساخته می‌شود (DashTip در core.js) که با position:fixed همیشه بالای همه
   لایه‌ها و کنار همان آیتم دیده می‌شود؛ رفتار همهٔ آیتم‌ها یکی است. */
.tip-pop {
  position: fixed; top: 0; left: 0; z-index: var(--z-tip);
  max-width: min(300px, 88vw); padding: 9px 13px; border-radius: var(--radius-md);
  background: rgba(10, 38, 33, .94); backdrop-filter: blur(10px);
  color: #fff; font-size: var(--fs-sm); font-weight: 600; line-height: 1.7;
  border: 1px solid rgba(251, 191, 36, .25);
  box-shadow: 0 12px 36px rgba(13, 59, 52, .4);
  opacity: 0; visibility: hidden; transform: translateY(-4px); pointer-events: none;
  transition: opacity .16s var(--ease), transform .16s var(--ease), visibility 0s linear .16s;
}
.tip-pop.on {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .16s var(--ease), transform .16s var(--ease), visibility 0s;
}
.tip-pop.up { transform: translateY(4px); }
.tip-pop-a {
  position: absolute; top: -5px; width: 10px; height: 10px; background: rgba(10, 38, 33, .94);
  border-top: 1px solid rgba(251, 191, 36, .25); border-left: 1px solid rgba(251, 191, 36, .25);
  transform: rotate(45deg); border-radius: 2px;
}
.tip-pop.up .tip-pop-a { top: auto; bottom: -5px; transform: rotate(225deg); }
@media (prefers-reduced-motion: reduce) { .tip-pop { transition: none !important; } }

/* --- نشانگر منبع زمان کنار ساعت نوار بالا --- */
.topbar-clock::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: #94a3b8; /* سیستم: خاکستری */
}
.topbar-clock.src-live::before {
  background: var(--good);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, .18);
}
.topbar-clock.src-manual::before { background: var(--warn); }

/* --- نشان اعلان روی آیتم‌های منو — فقط یک نقطهٔ طلایی با هالهٔ ملایم --- */
.sidebar nav a .nav-badge {
  margin-inline-start: auto;
  width: 8px; height: 8px; padding: 0; border-radius: 50%;
  background: var(--gold); color: transparent;
  flex: 0 0 auto; overflow: hidden;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, .16), 0 0 8px rgba(251, 191, 36, .5);
}
.sidebar nav a .nav-badge.warn,
.sidebar nav a .nav-badge.info,
.sidebar nav a .nav-badge.purple { background: var(--gold); color: transparent; }

/* --- ورود پله‌ای آیتم‌های منو هنگام باز شدن برنامه --- */
@keyframes navIn { from { opacity: 0; transform: translateX(14px); } }
.sidebar nav a { animation: navIn .38s var(--ease) backwards; }
.sidebar nav a:nth-child(2) { animation-delay: .025s }
.sidebar nav a:nth-child(3) { animation-delay: .05s }
.sidebar nav a:nth-child(4) { animation-delay: .075s }
.sidebar nav a:nth-child(5) { animation-delay: .1s }
.sidebar nav a:nth-child(6) { animation-delay: .125s }
.sidebar nav a:nth-child(7) { animation-delay: .15s }
.sidebar nav a:nth-child(8) { animation-delay: .175s }
.sidebar nav a:nth-child(9) { animation-delay: .2s }
.sidebar nav a:nth-child(10) { animation-delay: .225s }
.sidebar nav a:nth-child(11) { animation-delay: .25s }
.sidebar nav a:nth-child(12) { animation-delay: .275s }
.sidebar nav a:nth-child(13) { animation-delay: .3s }
.sidebar nav a:nth-child(14) { animation-delay: .325s }

/* --- نقطه رنگی زیر روزهای دارای رویداد + بهبود تقویم --- */
.cal .day { position: relative; }
.cal .day.has-event::after {
  content: ''; position: absolute; bottom: 5px; right: 50%; transform: translateX(50%);
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 2.5px rgba(245, 158, 11, .18);
}
.cal .day.today.has-event::after { background: var(--accent-2); box-shadow: 0 0 0 2.5px rgba(5, 150, 105, .18); }

/* --- شمارنده نتایج زیر جدول‌ها --- */
.result-count {
  color: var(--muted); font-size:var(--fs-xs); font-weight: 600; margin-top: 8px;
}
.result-count strong { color: var(--side); font-variant-numeric: tabular-nums; }

/* --- تیک لحظه‌ای ثبت حضور --- */
.pop-check {
  position: absolute; right: 50%; top: 50%;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--good); color: #fff;
  display: grid; place-items: center; font-size:var(--fs-sm); font-weight: 800;
  z-index: var(--z-high); pointer-events: none;
  box-shadow: 0 4px 12px rgba(5, 150, 105, .4);
  animation: checkPop .75s ease forwards;
}
@keyframes checkPop {
  0% { transform: translate(50%, -50%) scale(.2); opacity: 0; }
  35% { transform: translate(50%, -50%) scale(1.18); opacity: 1; }
  60% { transform: translate(50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(50%, -50%) scale(1); opacity: 0; }
}

.card.dash-card {
  padding: calc(var(--pad-card) + 4px);
}
.card.dash-card, .countdown-card {
  transition: border-color var(--dur) var(--ease);
}
.card.dash-card:hover, .countdown-card:hover {
  border-color: var(--line);
}

/* --- محتوای کارت‌های داشبورد: کمی بزرگ‌تر و خوانا‌تر --- */
.card.dash-card .class-pill { font-size: var(--fs-sm); }
.card.dash-card .class-pill strong { font-size: var(--fs-md); }
.card.dash-card .badge { font-size: var(--fs-sm); }
.card.dash-card .muted { font-size: var(--fs-sm); }
.card.dash-card strong { font-size: var(--fs-sm); }
.card.dash-card small { font-size: var(--fs-xs); }
.card.dash-card #live-period-info { font-size: var(--fs-sm); }
.card.dash-card .bl-seg span { font-size: var(--fs-2xs); }
.card.dash-card #bday-card strong { font-size: var(--fs-sm); }
.card.dash-card #events-card strong { font-size: var(--fs-sm); }
.card.dash-card #alert-card strong { font-size: var(--fs-sm); }
.card.dash-card #staff-card strong { font-size: var(--fs-sm); }

/* --- تایم‌لاین زنگ‌های امروز در داشبورد --- */
.bell-timeline {
  position: relative; height: 30px; margin-top: 12px; margin-bottom: 26px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.bl-seg {
  position: absolute; top: 6px; height: 17px; border-radius: 5px;
  background: linear-gradient(180deg, #10b981, #059669);
  /* overflow: hidden حذف شد تا tooltipهای data-tip نمایش داده شوند */
}
.bl-seg.brk { background: var(--line); }
.bl-seg span {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size:var(--fs-2xs); color: #fff; font-weight: 700; white-space: nowrap;
}
.bl-seg.brk span { color: var(--muted); font-size: var(--fs-2xs); }
.bl-now {
  position: absolute; top: 2px; bottom: 2px; width: 2.5px;
  background: var(--bad); border-radius: 2px; z-index: var(--z-base);
  transition: right .8s ease;
}
.bl-now::after {
  content: ''; position: absolute; top: -3px; right: -2.5px;
  width: 7.5px; height: 7.5px; border-radius: 50%; background: var(--bad);
}

/* ============================================================
   ماژول «کلاس‌های زنده» — بازطراحی دسکتاپ (جدول فشرده + فیلتر)
   ============================================================ */
.live-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  /* دکمهٔ جمع‌کردن کارت (مطلق، گوشهٔ چپ) نباید روی «به‌روزرسانی» و دکمهٔ
     تازه‌سازی بیفتد؛ همان فاصله‌ای که برای h3 کارت‌های دیگر رزرو شده */
  padding-left: 42px;
}
.live-card-head h3 { margin: 0; }
.live-fresh {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-2xs); color: var(--muted);
}
.live-fresh .btn { padding: 4px 8px; }
.live-refresh .ic { display: block; }
.live-refresh.spin .ic { animation: liveSpin .8s linear infinite; }
@keyframes liveSpin { to { transform: rotate(360deg); } }

.live-period-line { margin: 6px 0 0 !important; font-size: var(--fs-sm); }
.live-period-line strong { color: var(--side); }

/* تایم‌لاین: نوار + لجند و ساعت‌ها در یک ردیف جدا (بدون همپوشانی با هشدار) */
.bell-wrap { margin: 10px 0 12px; }
.bell-wrap[hidden] { display: none; }
.bell-wrap .bell-timeline { margin: 0; }
.bell-meta {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; flex-wrap: wrap; margin-top: 6px;
  font-size: var(--fs-2xs); color: var(--muted);
}
.bell-legend { display: inline-flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.bell-legend span { display: inline-flex; align-items: center; gap: 4px; }
.bell-legend i { display: inline-block; width: 11px; height: 7px; border-radius: 3px; }
.bell-legend .bl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.bell-legend .bl-swatch.done { background: linear-gradient(180deg, #10b981, #059669); }
.bell-legend .bl-swatch.brk { background: var(--line); }
.bl-times { display: inline-flex; gap: 10px; align-items: center; font-variant-numeric: tabular-nums; }
.bl-now-time { color: #b91c1c; font-weight: 700; }
.bl-seg.past { opacity: .42; }
.bl-seg.current {
  box-shadow: 0 0 0 2px color-mix(in srgb, #059669 30%, transparent),
              0 0 10px color-mix(in srgb, #059669 35%, transparent);
}
.bl-seg.next { outline: 1.5px dashed #34d399; outline-offset: 1px; }
.bl-seg.brk.current { box-shadow: 0 0 0 2px color-mix(in srgb, #92400e 18%, transparent); }
[dir="rtl"] .bl-now-time { direction: rtl; }

.live-no-bell {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin: 10px 0 4px; padding: 8px 11px; border-radius: var(--radius-sm);
  background: #fffbeb; border: 1px solid #fde68a; color: #78350f; font-size: var(--fs-sm);
}
.live-no-bell a { color: #92400e; font-weight: 700; }

/* هشدار/موفقیت — قابل اقدام، نه یک بج منفعل */
.live-alert {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 10px 0 6px; padding: 9px 12px;
  border-radius: var(--radius-sm); background: #fff7ed; border: 1px solid #fed7aa;
  color: #7c2d12; font-size: var(--fs-sm);
}
.live-alert > span:nth-child(2) { flex: 1; min-width: 170px; }
.live-alert.ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.live-alert-ico { font-size: 15px; }
.live-alert-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.live-alert-actions .btn { padding: 4px 10px; font-size: var(--fs-xs); }

/* فیلترها */
.live-filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 10px; }
.live-filter {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--line); background: var(--paper); color: var(--muted);
  border-radius: 999px; padding: 5px 11px; cursor: pointer;
  font-family: inherit; font-size: var(--fs-xs); font-weight: 600;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.live-filter:hover { border-color: #a7d8c8; color: var(--ink); }
.live-filter.on { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.live-filter b { font-weight: 800; opacity: .85; }
.live-filter:focus-visible, .lc-open:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* جدول فشردهٔ کلاس‌ها — در عرض کم به‌صورت افقی اسکرول می‌شود */
.live-table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.live-table { width: 100%; min-width: 590px; border-collapse: collapse; font-size: var(--fs-sm); }
.live-table th {
  text-align: right; font-size: var(--fs-2xs); font-weight: 700; color: var(--muted);
  padding: 2px 8px 6px; white-space: nowrap;
}
.live-table td {
  padding: 9px 8px; vertical-align: middle;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: transparent;
}
.live-row { cursor: pointer; transition: background var(--dur) var(--ease); }
.live-row:hover td { background: color-mix(in srgb, var(--accent-2) 6%, var(--paper)); }
.live-row:focus-within td { background: color-mix(in srgb, var(--accent-2) 8%, var(--paper)); }
.live-table .lc-name { width: 21%; min-width: 118px; }
.live-table .lc-att { width: 19%; min-width: 112px; }
.live-table .lc-cell { width: 48px; text-align: center; }
.live-table .lc-lesson { width: 24%; min-width: 118px; }
.live-table .lc-act { width: 84px; text-align: left; }
.live-table .lc-chev-cell { width: 18px; text-align: left; padding-left: 3px; }

.lc-open {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  border: 0; background: none; padding: 0; margin: 0; cursor: pointer;
  font: inherit; color: var(--ink); text-align: right; border-radius: 4px;
}
.lc-open strong { font-size: var(--fs-sm); font-weight: 800; }
.lc-open small { font-size: var(--fs-2xs); color: var(--muted); }
.lc-open:hover strong { color: var(--accent-2); }

.att-mini {
  height: 5px; border-radius: 999px; background: var(--line);
  overflow: hidden; margin-bottom: 4px;
}
.att-mini i { display: block; height: 100%; border-radius: 999px; background: var(--good); transition: width .4s var(--ease); }
.att-mini i.st-none { background: #f87171; }
.att-mini i.st-partial { background: #f59e0b; }
.att-mini i.st-done { background: #10b981; }
.lc-att-txt { font-size: var(--fs-2xs); color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 4px; }
.lc-state {
  display: inline-block; font-size: var(--fs-2xs); font-weight: 700;
  padding: 1px 6px; border-radius: 999px; white-space: nowrap;
}
.lc-state.st-none { background: #fee2e2; color: #991b1b; }
.lc-state.st-partial { background: #fef3c7; color: #92400e; }
.lc-state.st-done { background: #d1fae5; color: #065f46; }

.lc-num { font-weight: 800; font-variant-numeric: tabular-nums; }
.lc-num.good { color: #047857; }
.lc-num.bad { color: #b91c1c; }
.lc-num.warn { color: #b45309; }
.lc-zero { color: #94a3b8; font-weight: 600; }

.lc-lesson { font-size: var(--fs-xs); line-height: 1.65; }
.lc-subject { font-weight: 700; color: var(--ink); }
.lc-teacher { display: block; color: var(--muted); font-size: var(--fs-2xs); }
.lc-break { color: #92400e; font-weight: 600; }

.live-table .lc-act .btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 4px 9px; font-size: var(--fs-2xs); white-space: nowrap; text-decoration: none;
}
.lc-chev { color: var(--muted); font-size: 16px; line-height: 1; }
.live-empty td { text-align: center; color: var(--muted); padding: 22px 8px; }

.live-holiday {
  display: flex; align-items: center; gap: 12px;
  margin: 10px 0 4px; padding: 16px 14px;
  background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--radius-lg);
}
.live-holiday .lh-emoji { font-size: 26px; }
.live-holiday p { margin: 4px 0 0; font-size: var(--fs-sm); }

.live-modal-sum {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 8px 0 12px; font-size: var(--fs-sm);
}
.live-modal-sum .muted { font-size: var(--fs-sm); }

/* حالت تاریک */
[data-theme="dark"] .live-alert { background: #3a2a12; border-color: #7c5a1e; color: #fde68a; }
[data-theme="dark"] .live-alert.ok { background: #0f2f27; border-color: #1f6b57; color: #a7f3d0; }
[data-theme="dark"] .live-no-bell { background: #33270f; border-color: #6b531c; color: #fcd34d; }
[data-theme="dark"] .live-no-bell a { color: #fcd34d; }
[data-theme="dark"] .lc-state.st-none { background: #4a1d1d; color: #fecaca; }
[data-theme="dark"] .lc-state.st-partial { background: #4a3512; color: #fde68a; }
[data-theme="dark"] .lc-state.st-done { background: #0f2f27; color: #a7f3d0; }
[data-theme="dark"] .bl-now-time { color: #fca5a5; }
[data-theme="dark"] .live-row:hover td { background: #16252c; }
[data-theme="dark"] .live-row:focus-within td { background: #182a32; }

/* در ستون باریک داشبورد (یا پنجره کوچک) جدول به کارت‌های فشرده تبدیل می‌شود
   تا نام کلاس هرگز پشت اسکرول افقی پنهان نماند. */
#live-card { container-type: inline-size; }
@container (max-width: 640px) {
  .live-table-wrap { overflow: visible; margin: 0; padding: 0; }
  .live-table { display: block; min-width: 0; }
  .live-table thead { display: none; }
  .live-table tbody { display: block; }
  .live-table tr.live-row {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px 10px; padding: 10px 2px;
    border-top: 1px solid var(--line); cursor: pointer;
  }
  .live-row:last-of-type { border-bottom: 1px solid var(--line); }
  .live-table td { display: block; padding: 1px 0; border: 0; background: none !important; }
  .live-row .lc-name { grid-column: 1 / span 2; grid-row: 1; }
  .live-row .lc-act { grid-column: 3; grid-row: 1; justify-self: start; text-align: left; }
  .live-row .lc-chev-cell { display: none; }
  .live-row .lc-att { grid-column: 1 / -1; grid-row: 2; max-width: 260px; }
  .live-row .lc-cell { display: flex; align-items: center; gap: 5px; text-align: right; }
  .live-row .lc-cell::before {
    content: attr(data-label); font-size: var(--fs-2xs);
    color: var(--muted); font-weight: 600;
  }
  .live-row .lc-lesson { grid-column: 1 / -1; grid-row: 4; padding-top: 4px; }
  .live-row .lc-lesson .lc-teacher { display: inline-block; margin-right: 6px; }
  .live-empty { display: block; }
  .live-empty td { display: block; padding: 20px 8px; text-align: center; }
}

/* --- احترام به تنظیم «کاهش حرکت» ویندوز --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ============================================================
   پکیج پریمیوم نسخه 2.3 — اسپلش، ripple، هاله طلایی، حالت تمرکز
   ============================================================ */

/* --- اسپلش سینمایی شروع --- */
#boot-splash {
  position: fixed; inset: 0; z-index: var(--z-splash);
  display: grid; place-items: center;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26'%3E%3Ccircle cx='3' cy='3' r='1.2' fill='%23ffffff' fill-opacity='.05'/%3E%3Ccircle cx='16' cy='16' r='1.2' fill='%23ffffff' fill-opacity='.05'/%3E%3C/svg%3E"),
    radial-gradient(1200px 800px at 50% 40%, rgba(16, 185, 129, .22), transparent 75%),
    linear-gradient(200deg, #124d42 0%, var(--side) 45%, #082621 100%);
  animation: splashIn .5s ease;
  overflow: hidden;
}
/* خروج اسپلش: پس‌زمینهٔ تیره تا آخرین لحظه مات می‌ماند و فقط محتوا
   (لوگو/گام‌ها/نوار) محو می‌شود. اگر خود لایه شفاف شود، صفحهٔ ورودِ
   رندرشده از پشت لوگو به‌صورت شبح دیده می‌شد. */
#boot-splash.bye { pointer-events: none; }
#boot-splash.bye .splash-inner,
#boot-splash.bye::after {
  opacity: 0;
  transition: opacity .25s ease;
}

/* شروع کار: تا حذف کامل اسپلش، بدنهٔ برنامه دیده نشود (نه شبحِ ورود، نه سایدبار) */
body.booting .sidebar,
body.booting .main { visibility: hidden; }
@keyframes splashIn { from { opacity: 0; } }
.splash-inner { position: relative; text-align: center; overflow: visible; }
.splash-inner img {
  /* لوگوی طلایی شفاف — بدون پس‌زمینه، بزرگ و با هاله نرم */
  width: 230px; height: 230px; object-fit: contain;
  filter: drop-shadow(0 24px 50px rgba(0, 0, 0, .55))
          drop-shadow(0 0 55px rgba(251, 191, 36, .30));
  animation: splashPop .9s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes splashPop {
  0% { transform: scale(.55); opacity: 0; filter: brightness(2.2) drop-shadow(0 24px 50px rgba(0,0,0,.55)); }
  60% { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); }
}
.splash-name {
  margin-top: 22px; font-size:var(--fs-hero); font-weight: 400; letter-spacing: 1px;
  font-family: Lalezar, Vazirmatn, Tahoma, sans-serif;
  background: linear-gradient(115deg, #fef3c7 5%, #fbbf24 45%, #f59e0b 75%, #b45309 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: splashName .9s ease backwards .15s;
}
@keyframes splashName { from { opacity: 0; transform: translateY(10px); } }
/* نور جاروب‌شونده روی کل صفحه اسپلش */
.splash-sheen {
  position: fixed; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 32%,
    rgba(255, 255, 255, .10) 42%, rgba(255, 255, 255, .28) 50%,
    rgba(255, 255, 255, .10) 58%, transparent 68%);
  transform: translateX(140%);
  animation: sheen 1.5s ease .2s forwards;
}
@keyframes sheen { to { transform: translateX(-140%); } }

/* --- ripple دکمه‌ها --- */
.btn { position: relative; overflow: hidden; }
.ripple-ink {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, .35) 0%, rgba(255, 255, 255, .12) 45%, transparent 70%);
  transform: scale(0); animation: ripple .6s ease-out forwards;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* --- دکمه جمع‌کردن کارت داشبورد --- */
.dash-fold {
  position: absolute; top: 10px; left: 10px; z-index: var(--z-tool);
  width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--muted); cursor: pointer;
  font-size:var(--fs-xs); line-height: 1; display: grid; place-items: center;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.dash-fold:hover { background: var(--accent-2); color: #fff; border-color: var(--accent-2); }
.dash-fold.up { transform: rotate(-90deg); }
/* جای خالی سمت چپِ سربرگ، تا دکمه جمع‌کردن روی متن/محتوای کارت نیفتد */
.dash-card > h3:first-child, .dash-card > .row:first-child { padding-left: 42px; }
.dash-card.folded { padding-bottom: 12px; }
.dash-card.folded > *:not(h3):not(.dash-fold):not(.dash-head) { display: none !important; }
/* کارت‌هایی که سربرگشان داخل ردیف است (مثل یادآوری) — سربرگشان باقی می‌ماند */
.dash-card.folded > .dash-head { display: flex !important; align-items: center; }
.dash-card.folded h3 { margin-bottom: 0 !important; }

/* --- ترنزیشن ورود صفحه --- */
/* --- ورود پله‌ای محتوای صفحه (فاز ۲) --- */
/* چون render() کل #view را بازسازی می‌کند، فرزندان تازه «عناصر جدید»اند و
   انیمیشن خودبه‌خود پخش می‌شود — بدون نیاز به کلاس کمکی (کلاس page-in قدیمی
   هرگز از JS ست نمی‌شد و مرده بود). فقط transform/opacity (کامپوزیتور) و
   با prefers-reduced-motion بی‌اثر. */
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } }
.view > * { animation: pageIn var(--dur-big) var(--ease-out) backwards; }
.view > *:nth-child(n+2) { animation-delay: calc(var(--stagger) * 1); }
.view > *:nth-child(n+3) { animation-delay: calc(var(--stagger) * 2); }
.view > *:nth-child(n+4) { animation-delay: calc(var(--stagger) * 3); }
.view > *:nth-child(n+5) { animation-delay: calc(var(--stagger) * 4); }
.view > *:nth-child(n+6) { animation-delay: calc(var(--stagger) * 5); }
.view > *:nth-child(n+7) { animation-delay: calc(var(--stagger) * 6); }
.view > *:nth-child(n+8) { animation-delay: calc(var(--stagger) * 7); }
.view > *:nth-child(n+9) { animation-delay: calc(var(--stagger) * 8); }
/* گریدها به‌عنوان بلوک حرکت نکنند؛ فرزندان‌شان پله‌ای وارد شوند (بدون جمع‌شدن حرکت) */
.view > .grid-dash, .view > .grid-2, .view > .grid-4, .view > .grid-5 { animation: none; }
.view > .grid-dash > *, .view > .grid-2 > *, .view > .grid-4 > *, .view > .grid-5 > * {
  animation: pageIn var(--dur-big) var(--ease-out) backwards;
  animation-delay: calc(var(--stagger) * 2);
}
.view > .grid-dash > :nth-child(n+2), .view > .grid-2 > :nth-child(n+2),
.view > .grid-4 > :nth-child(n+2), .view > .grid-5 > :nth-child(n+2) { animation-delay: calc(var(--stagger) * 3); }
.view > .grid-dash > :nth-child(n+3), .view > .grid-2 > :nth-child(n+3),
.view > .grid-4 > :nth-child(n+3), .view > .grid-5 > :nth-child(n+3) { animation-delay: calc(var(--stagger) * 4); }
.view > .grid-dash > :nth-child(n+4), .view > .grid-2 > :nth-child(n+4),
.view > .grid-4 > :nth-child(n+4), .view > .grid-5 > :nth-child(n+4) { animation-delay: calc(var(--stagger) * 5); }

/* --- flip عددی شمارش معکوس --- */
.cd-chip { perspective: 300px; }
.cd-chip.flip .cd-num { animation: numFlip .45s ease; }
@keyframes numFlip {
  0% { transform: rotateX(0); }
  45% { transform: rotateX(88deg); opacity: .4; }
  55% { transform: rotateX(-88deg); opacity: .6; }
  100% { transform: rotateX(0); opacity: 1; }
}

/* --- پارالاکس و پترن صفحه ورود (حرکت هاله‌ها در .login-screen::before
   با transform انجام می‌شود؛ اینجا فقط ترنزیشن لوگو) --- */
.login-logo { transition: transform .18s ease-out; will-change: transform; }

/* ===== پنجره‌های باز/بسته‌شونده کلاس‌ها در حضور و غیاب ===== */
.cls-window {
  border: 1px solid var(--line); border-radius: var(--radius-md);
  margin-bottom: 10px; background: var(--paper); overflow: hidden;
  transition: box-shadow var(--dur-slow) ease, border-color var(--dur-slow) ease;
}
.cls-window.open { border-color: #a7d8c8; box-shadow: 0 6px 18px rgba(13, 59, 52, .10); }
.cls-window-top { display: flex; align-items: stretch; }
.cls-window-head {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; background: transparent; border: 0; cursor: pointer;
  font-family: inherit; text-align: right; font-size:var(--fs-md); color: var(--ink);
}
.cls-window-head:hover { background: rgba(16, 185, 129, .06); }
.cls-window-head strong { font-size:var(--fs-md); }
.cls-window-head .cls-arrow {
  display: inline-block; color: var(--side); font-size:var(--fs-xs);
  transition: transform var(--dur-slow) ease;
}
.cls-window.open .cls-window-head .cls-arrow { transform: rotate(-90deg); }
.cls-window-sum { margin-right: auto; display: inline-flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.cls-window .cls-allpresent { align-self: center; margin-left: 10px; white-space: nowrap; flex-shrink: 0; }
.cls-window-body { padding: 4px 14px 14px; border-top: 1px dashed var(--line); }
.cls-window-body[hidden] { display: none; }

/* کنترل‌های مرور روز (روز قبل/بعد/امروز + تاریخ) — همه هم‌قد و در یک خط صاف */
.day-controls { display: flex; align-items: stretch; gap: 6px; }
.day-controls input {
  width: 132px; margin: 0; text-align: center; padding: 6px 10px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.day-controls input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 4px var(--ring); }
.day-controls .btn { white-space: nowrap; margin: 0; }
[data-theme="dark"] .day-controls input {
  background: var(--surface-2); color: var(--ink); border-color: var(--line);
}

/* ===== اعلان سینمایی تغییر زنگ ===== */
.bell-notify {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: var(--z-bell); display: flex; align-items: center; gap: 14px;
  min-width: 340px; max-width: min(480px, calc(100vw - 32px));
  padding: 14px 20px 16px; border-radius: 18px; cursor: pointer;
  color: #fff; direction: rtl;
  background: linear-gradient(135deg, #0d3b34 0%, #115e50 55%, #14795f 100%);
  border: 1px solid rgba(251, 191, 36, .45);
  box-shadow: 0 18px 44px rgba(13, 59, 52, .45), inset 0 1px 0 rgba(255, 255, 255, .14);
  animation: bellIn .5s cubic-bezier(.21, 1.02, .55, 1) backwards;
}
.bell-notify.break { background: linear-gradient(135deg, #7c2d12 0%, #b45309 55%, #d97706 100%); }
.bell-notify.end { background: linear-gradient(135deg, #1e293b 0%, #334155 60%, #475569 100%); }
.bell-notify .bn-icon {
  font-size:var(--fs-stat); width: 54px; height: 54px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .14); border-radius: 14px;
  animation: bellSwing 1.1s ease .15s 2;
}
.bell-notify .bn-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bell-notify .bn-text strong { font-size:var(--fs-lg); font-weight: 800; letter-spacing: -.01em; }
.bell-notify .bn-text small { font-size:var(--fs-xs); opacity: .88; line-height: 1.6; }
.bell-notify .bn-bar {
  position: absolute; right: 14px; bottom: 8px; left: 14px; height: 3px;
  border-radius: 99px; background: rgba(255, 255, 255, .22); overflow: hidden;
}
.bell-notify .bn-bar::after {
  content: ''; display: block; height: 100%; width: 100%;
  border-radius: 99px; background: #fbbf24;
  animation: bellBar 9s linear forwards;
}
.bell-notify.bye { animation: bellOut .45s ease forwards; }
@keyframes bellIn { from { opacity: 0; transform: translateX(-50%) translateY(-26px) scale(.94); } }
@keyframes bellOut { to { opacity: 0; transform: translateX(-50%) translateY(-22px) scale(.96); } }
@keyframes bellSwing {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(16deg); }
  40% { transform: rotate(-13deg); }
  60% { transform: rotate(8deg); }
  80% { transform: rotate(-5deg); }
}
@keyframes bellBar { from { width: 100%; } to { width: 0%; } }

/* ===== نشان درس زنگ بعدی در داشبورد ===== */
.badge.next-sub { background: #eef2ff; color: #4338ca; border: 1px dashed #a5b4fc; }
.badge.next-sub small { font-weight: 600; font-size:var(--fs-2xs); opacity: .85; }
[data-theme="dark"] .badge.next-sub { background: #23244a; color: #c7d2fe; border-color: #4c51b8; }


/* --- ripple/لودینگ دکمه ورود --- */
.btn.loading { opacity: .85; pointer-events: none; }
.btn-spin {
  display: inline-block; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff;
  vertical-align: -2px; margin-left: 6px;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- سنجه قدرت رمز --- */
.pw-wrap { position: relative; display: flex; align-items: center; }
.pw-wrap input { width: 100%; padding-left: 42px; }
.pw-eye {
  position: absolute; left: 6px; border: 0; background: transparent; cursor: pointer;
  font-size:var(--fs-base); opacity: .65; padding: 4px; border-radius: 8px;
}
.pw-eye:hover { opacity: 1; background: var(--bg); }
.pw-meter { display: flex; gap: 4px; align-items: center; margin-top: 7px; }
.pw-meter i {
  height: 5px; flex: 1; border-radius: 99px; background: var(--line);
  transition: background var(--dur) var(--ease);
}
.pw-meter i.on.s1, .pw-meter i.on.s0 { background: var(--bad); }
.pw-meter i.on.s2 { background: var(--warn); }
.pw-meter i.on.s3 { background: #84cc16; }
.pw-meter i.on.s4 { background: var(--good); }
.pw-label { font-size:var(--fs-xs); font-weight: 700; color: var(--muted); margin-right: 7px; min-width: 60px; }
.pw-label.s0, .pw-label.s1 { color: var(--bad); }
.pw-label.s2 { color: var(--warn); }
.pw-label.s3 { color: #65a30d; }
.pw-label.s4 { color: var(--good); }

/* --- کانفتی --- */
.confetti-cv {
  position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: var(--z-flash); pointer-events: none;
}

/* --- slip زنده مبلغ --- */
.money-slip {
  display: block; margin-top: 4px; font-size:var(--fs-xs); font-weight: 700;
  color: var(--accent-2); font-variant-numeric: tabular-nums;
}

/* --- رنگ‌آمیزی شرطی ردیف‌های مالی --- */
.table tr.row-debt td { background: rgba(217, 119, 6, .05); }
.table tr.row-debt-high td { background: rgba(220, 38, 38, .07); }
.table tr.row-debt-high td:first-child { position: relative; }
/* فاز ۵: نوار بدهی بازطراحی شد — نوارِ گردِ گرادیانی در لبهٔ راست سلول اول
   (لبهٔ آغازین در RTL) با هالهٔ نرم و ورود یک‌بارهٔ scaleY؛ به‌جای inset-box-shadow
   که خشک و بی‌عمق بود و روی سلول چسبان sticky-name هم به پس‌زمینهٔ paper گم می‌شد.
   صیقل نهایی: روی ::after نشسته تا با نشانگر هاور ردیف‌های کلیک‌پذیر (::before) نجنگد */
.table tr.row-debt-high td:first-child::after {
  content: ''; position: absolute; top: 20%; bottom: 20%; right: 0; width: 3.5px;
  border-radius: 4px 0 0 4px;
  background: linear-gradient(180deg, #f87171, var(--bad));
  box-shadow: 0 0 10px rgba(220, 38, 38, .35);
  animation: debtBarIn var(--dur-big) var(--ease-out) backwards;
  pointer-events: none;
}
@keyframes debtBarIn { from { opacity: 0; transform: scaleY(.3); } }
/* روی ردیف بدهیِ کلیک‌پذیر، نشانگر سبز هاور پنهان می‌ماند — یک نشانگر کافی است */
.table tr.row-debt-high.clickable:hover td:first-child::before { opacity: 0; }
/* سلول چسبانِ sticky-name پس‌زمینهٔ paper دارد و تینت قرمز ردیف را می‌پوشاند —
   هماهنگ می‌شود تا نوار داخل هالهٔ ردیف بنشیند */
.table.sticky-name tr.row-debt-high td:first-child { background: color-mix(in srgb, var(--bad) 7%, var(--paper)); }
[data-theme="dark"] .table.sticky-name tr.row-debt-high td:first-child { background: color-mix(in srgb, var(--bad) 10%, #12201b); }
[data-theme="dark"] .table tr.row-debt-high td:first-child::after { box-shadow: 0 0 10px rgba(248, 113, 113, .28); }
.table tr.row-clear td { background: rgba(5, 150, 105, .05); }
[data-theme="dark"] .table tr.row-debt td { background: rgba(217, 119, 6, .08); }
[data-theme="dark"] .table tr.row-debt-high td { background: rgba(220, 38, 38, .1); }
[data-theme="dark"] .table tr.row-clear td { background: rgba(5, 150, 105, .08); }

/* --- هاله نارنجی ردیف‌های تکراری هنگام ورود گروهی --- */
@keyframes dupPulse {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(217, 119, 6, .55); }
  50% { box-shadow: inset 0 0 0 2px rgba(217, 119, 6, .95); }
}
.table tr.imp-dup td {
  background: rgba(245, 158, 11, .09);
  animation: dupPulse 1.6s ease-in-out 3;
}
.table tr.imp-dup td:first-child { box-shadow: inset 3px 0 0 var(--warn); }

/* --- اسکرول‌بار باریک جدول‌ها --- */
.tbl-scroll { scrollbar-width: thin; scrollbar-color: #c9d4ce transparent; }
.tbl-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.tbl-scroll::-webkit-scrollbar-thumb {
  background: #c9d4ce; border-radius: 99px; border: 2px solid transparent; background-clip: content-box;
}
.tbl-scroll::-webkit-scrollbar-thumb:hover { background: var(--accent-2); background-clip: content-box; }

/* --- tooltip چندخطی برای راهنمای بلند --- */
[data-tip]:hover::after, [data-tip]:focus-visible::after {
  white-space: normal; width: max-content; max-width: 300px;
}




/* ————— گروه‌های نگاه: همه در یک ردیف هم‌عرض و هم‌تراز ————— */
.ng-groups {
  display: flex; flex-wrap: nowrap; gap: 8px; margin-top: 8px;
  overflow-x: auto; padding-bottom: 4px;
}
.ng-groups::-webkit-scrollbar { height: 6px; }
.ng-groups::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.ng-group {
  flex: 1 1 0; min-width: 96px; display: flex; align-items: center; justify-content: space-between;
  gap: 6px; padding: 8px 12px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--bg); color: inherit;
  font-family: inherit; transition: border-color .15s, background .15s, transform .15s;
  white-space: nowrap;
}
.ng-group:hover { border-color: var(--gold); transform: translateY(-1px); }
.ng-group.has-items { border-color: #a78bfa66; background: #f5f3ff55; }
.ng-group .ng-name {
  font-size:var(--fs-xs); font-weight: 700; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis;
}
.ng-group.has-items .ng-name { color: #6d28d9; }
.ng-group .ng-badge {
  flex-shrink: 0; min-width: 22px; height: 22px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size:var(--fs-xs); font-weight: 800; padding: 0 6px;
  background: rgba(100, 116, 139, .14); color: var(--muted);
}
.ng-group .ng-badge.on { background: #7c3aed; color: #fff; }
[data-theme="dark"] .ng-group.has-items { background: #4c1d9533; }
[data-theme="dark"] .ng-group.has-items .ng-name { color: #c4b5fd; }

/* ————— انتخاب چند نوع شرایط در فرم ثبت نگاه (چیپ‌های چندانتخابی) ————— */
.ng-type-picks {
  display: flex; flex-wrap: wrap; gap: 7px; margin-top: 6px;
}
.ng-type-pick { position: relative; cursor: pointer; }
.ng-type-pick input {
  position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer;
}
.ng-type-pick span {
  display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--bg);
  font-size:var(--fs-xs); font-weight: 600; color: var(--muted);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease);
  user-select: none;
}
.ng-type-pick:hover span { border-color: #a78bfa; color: #6d28d9; }
.ng-type-pick input:checked + span {
  border-color: #7c3aed; background: #7c3aed; color: #fff;
  box-shadow: 0 1px 6px #7c3aed44;
}
.ng-type-pick input:focus-visible + span { outline: 2px solid #a78bfa; outline-offset: 2px; }
[data-theme="dark"] .ng-type-pick input:checked + span {
  background: #6d28d9; border-color: #8b5cf6;
}

/* ————— تول‌بار جابه‌جایی کارت‌های داشبورد (دستگیره + بالا/پایین) —————
 * یک ردیف مرتب کنار دکمه جمع‌کردن، فقط هنگام hover — بدون هیچ تداخلی */
.dash-card { position: relative; }
.dash-tools {
  position: absolute; top: 9px; left: 40px; display: none; gap: 3px; z-index: var(--z-tool);
}
.dash-card:hover .dash-tools { display: flex; }
.dash-grip {
  width: 22px; height: 22px; border: 0; border-radius: 7px;
  background: rgba(255, 255, 255, .9); color: #64748b; font-size:var(--fs-xs);
  cursor: grab; box-shadow: 0 1px 4px rgba(15, 40, 35, .18);
  line-height: 1; display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
}
.dash-grip:active { cursor: grabbing; background: var(--gold); color: #fff; }
.dash-card.drag-ghost { opacity: .35; outline: 2px dashed var(--gold); }
.dash-drop-mark {
  height: 4px; border-radius: 999px; background: var(--gold); margin: 2px 8px;
  box-shadow: 0 0 0 4px rgba(212, 175, 55, .18); animation: dropPulse 1s infinite;
}
@keyframes dropPulse { 50% { opacity: .45; } }

/* ————— فیلدهای یادآوری داشبورد — هماهنگ با استایل کلی برنامه ————— */
.rem-fields {
  display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap;
}
.rem-fields .rem-inp {
  flex: 1; min-width: 120px; padding: 8px 12px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink);
  font-family: inherit; font-size:var(--fs-sm); transition: border-color .15s, box-shadow .15s;
}
.rem-fields .rem-inp:focus {
  outline: none; border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, .12);
}
.rem-fields .rem-mini {
  width: 86px; padding: 8px 10px; text-align: center;
  padding: 8px 10px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink);
  font-family: inherit; font-size:var(--fs-xs); transition: border-color .15s, box-shadow .15s;
}
.rem-fields .rem-mini:focus {
  outline: none; border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, .12);
}


.dash-mv {
  width: 20px; height: 20px; border: 0; border-radius: 6px; cursor: pointer;
  background: rgba(255, 255, 255, .9); color: #475569; font-size:var(--fs-xs); line-height: 1;
  box-shadow: 0 1px 3px rgba(15, 40, 35, .15); transition: background .15s;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.dash-mv:hover { background: var(--gold); color: #fff; }
[data-theme="dark"] .dash-tools .dash-grip,
[data-theme="dark"] .dash-tools .dash-mv { background: rgba(30, 41, 59, .92); color: #cbd5e1; }
[data-theme="dark"] .dash-tools .dash-mv:hover { background: var(--gold); color: #17252d; }


/* ————— بخش‌بندی تنظیمات عمومی ————— */
.set-group {
  border: 1.5px solid var(--line); border-radius: 16px; padding: 14px 16px 16px;
  margin-top: 16px; background: var(--bg);
}
.set-group .path-box { background: var(--paper); }
.set-group-head {
  font-weight: 800; font-size:var(--fs-md); color: var(--ink);
  display: flex; align-items: center; gap: 8px; cursor: default; list-style: none;
}
details.set-group > .set-group-head { cursor: pointer; }
details.set-group > .set-group-head::after {
  content: '▾'; margin-right: auto; color: var(--muted); font-size:var(--fs-sm); transition: transform .2s;
}
details.set-group[open] > .set-group-head::after { transform: rotate(180deg); }
details.set-group > .set-group-head::-webkit-details-marker { display: none; }
.set-group.tech { border-style: dashed; background: transparent; }
.set-group.tech .set-group-head { color: #64748b; }
.set-group-body { margin-top: 12px; }
details.set-group:not([open]) { padding: 12px 16px; }


/* ————— چیپ‌های دسته‌بندی کتابخانه ————— */
.bk-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.bk-cat {
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--bg);
  color: var(--ink); font-family: inherit; font-size:var(--fs-xs); font-weight: 700;
  padding: 5px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.bk-cat:hover { border-color: var(--gold); transform: translateY(-1px); }
.bk-cat.on { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.bk-cat small {
  background: rgba(100, 116, 139, .15); border-radius: 999px; padding: 1px 8px;
  font-size:var(--fs-2xs); font-weight: 800; color: inherit; opacity: .85;
}
.bk-cat.on small { background: rgba(255, 255, 255, .25); }

/* ============================================================
   پولیش سراسری — بازطراحی دقیق با تکیه بر دیزاین توکن‌ها
   (فوکوس‌رینگ دسترس‌پذیری، حالت‌های تعاملی، ایست خالی، تایپوگرافی)
   ============================================================ */

/* — فوکوس واضح برای کیبورد — دسترس‌پذیری، همه اجزای تعاملی — */
:focus-visible {
  outline: 2.5px solid #0d9488;
  outline-offset: 2px;
  border-radius: 6px;
}
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  outline: none; /* رینگ خودش با box-shadow داده می‌شود */
}
.btn:focus-visible, .icon-btn:focus-visible, .tabs button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring), var(--shadow);
}

/* — دکمه‌ها: عمق لمسی طبیعی‌تر (فشار به‌جای جمع‌شدن) — */
.btn { will-change: transform; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.985); box-shadow: 0 2px 8px rgba(13, 59, 52, .2); }
.btn.ghost:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(23, 37, 45, .08); }
.btn.ghost:active { transform: translateY(1px); box-shadow: none; }
.btn.sm { font-weight: 600; }

/* — ورودی‌ها: هاور قبل از فوکوس + placeholder آرام — */
.field input:hover:not(:focus), .field select:hover:not(:focus), .field textarea:hover:not(:focus) {
  border-color: #cbd5e1;
}
.field select { cursor: pointer; }
.field ::placeholder { color: #a8b3c2; opacity: 1; }
[data-theme="dark"] .field ::placeholder { color: #5b6b7d; }

/* — جدول: هدر وزین‌تر، اعداد هم‌عرض، ردیف نرم‌تر — */
.table th { letter-spacing: .01em; }
.table td { line-height: 1.7; }
.table tr { transition: background var(--dur); }

/* — نشان‌ها: حلقه ظریف داخلی برای عمق — */
.badge { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
[data-theme="dark"] .badge { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }

/* — ایست خالی: پنل مرتب با ریتم بصری به‌جای متن تنها — */
.empty {
  background: var(--surface-2);
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 26px 16px;
  font-size:var(--fs-sm);
  font-weight: 500;
}
[data-theme="dark"] .empty { background: rgba(255, 255, 255, .02); border-color: #2b3b4c; }

/* — تیترها و پاراگراف‌ها: شکست سطر متوازن — */
.card h2, .card h3, .topbar h1 { text-wrap: balance; }
.card p, .muted, .field label { text-wrap: pretty; }

/* — مودال: عمق واقعی‌تر — */
.modal { box-shadow: 0 30px 80px rgba(8, 38, 33, .3), 0 4px 18px rgba(8, 38, 33, .12); }
[data-theme="dark"] .modal { box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }

/* — اسکرول‌بار حالت تاریک — */
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #2b3b4c; border: 2px solid var(--bg); border-radius: var(--radius-xs);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #35544a; }
[data-theme="dark"] .ng-groups::-webkit-scrollbar-thumb { background: #2b3b4c; }

/* — لینک‌های سایدبار: فوکوس‌رینگ طلایی — */
.sidebar nav a:focus-visible {
  outline: 2px solid rgba(251, 191, 36, .72); outline-offset: 1px; border-radius: var(--radius-md);
}

/* — احترام به تنظیم کاهش حرکت سیستم — */

/* بلوک تکراری reduced-motion حذف شد */


/* ============================================================
   پکیج نسخه 2.4 — بازطراحی سیستمی: توست/مودال برنددار، جدول چسبان،
   اسکلتون، نوار پیشرفت، مرکز اعلان، empty تصویری، چاپ برنددار و…
   همه قواعد جدید اینجا و از توکن‌های :root تغذیه می‌شوند.
   ============================================================ */

/* — دکمه‌ها: چینش آیکون + متن — */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.btn .ic { margin-left: 0; }
.btn.loading::after {
  content: ''; display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.btn.ghost.loading::after { border-color: rgba(23, 37, 45, .2); border-top-color: var(--side); }
.btn.loading { pointer-events: none; opacity: .85; }
.ic-red { color: var(--bad); }
.btn.danger .ic-red { color: #fecaca; }

/* — دکمه‌های آیکونی — */
.icon-btn { display: inline-grid; place-items: center; }
.icon-btn svg { display: block; }
@media (max-width: 800px) { #menu-btn { display: inline-grid; } }
body.sidebar-collapsed #menu-btn { display: inline-grid; }

/* — توپ‌تیپ هاور آیتم‌های منوی سایدبار حذف شد: دیگر هیچ توضیح هاوری در
   سایدبار نمایش داده نمی‌شود (قبلاً روی تب‌های زیرین می‌افتاد و خوانایی را
   از بین می‌برد) — */

/* — انتقال انیمیت تم روشن/تیره — */
body.theme-anim, body.theme-anim *, body.theme-anim *::before, body.theme-anim *::after {
  transition: background-color .24s var(--ease), background .24s var(--ease),
    border-color .24s var(--ease), color .24s var(--ease), fill .24s var(--ease);
}

/* — اسکرول نرم — */
html { scroll-behavior: smooth; }

/* — نوار پیشرفت API بالای صفحه — */
#api-progress {
  position: fixed; top: 0; right: 0; left: 0; height: 3px; z-index: var(--z-toast);
  pointer-events: none; opacity: 0; transform: scaleX(0); transform-origin: right;
  background: linear-gradient(90deg, var(--accent-2), var(--gold), var(--accent-2));
  background-size: 200% 100%; animation: cdFlow 1.6s linear infinite;
  transition: opacity .25s var(--ease), transform .35s var(--ease);
}
#api-progress.on { opacity: 1; transform: scaleX(.72); }
#api-progress.done { opacity: 0; transform: scaleX(1); transition: transform .25s var(--ease), opacity .35s .2s; }

/* — نوار هشدار سیستم (بکاپ ناموفق / خطای DB) — */
#sys-alert-bar {
  position: fixed; top: 0; right: 0; left: 0; height: 3px; z-index: var(--z-splash);
  pointer-events: none; background: linear-gradient(90deg, #dc2626, #f87171, #dc2626);
  background-size: 200% 100%; animation: cdFlow 2.4s linear infinite;
}
#sys-alert-bar[hidden] { display: none; }

/* — LED وضعیت — */
.ok-dot.pulse { animation: ledPulse 2.4s ease-in-out infinite; }
.ok-dot.bad { background: var(--bad); }
.ok-dot.bad.pulse { animation-name: ledPulseBad; }
.ok-dot.warn { background: var(--warn); }
@keyframes ledPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, .4); } 55% { box-shadow: 0 0 0 6px rgba(5, 150, 105, 0); } }
@keyframes ledPulseBad { 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .45); } 55% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); } }

/* — breadcrumb — */
.crumbs {
  display: flex; align-items: center; gap: 7px; padding: 0 30px; margin: 2px 0 -4px;
  font-size: var(--fs-xs); color: var(--muted); min-height: 26px;
}
.crumbs[hidden] { display: none; }
.crumbs .cr-back {
  width: 24px; height: 24px; border: 1px solid var(--line); background: var(--paper);
  border-radius: 8px; cursor: pointer; display: grid; place-items: center;
  color: var(--muted); box-shadow: var(--shadow-xs);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.crumbs .cr-back:hover { color: var(--accent-2); border-color: #a7d8c8; transform: translateX(2px); }
.crumbs .cr-cur { color: var(--side); font-weight: 700; }
.crumbs .cr-sep { opacity: .45; }

/* نشانگر فعال شناور */
.sidebar nav a.active::before { display: none; }
/* فاز ۲: pill مگنتی — یک قاب کامل که بین آیتم‌ها سر می‌خورد (زیر متن آیتم‌ها،
   بالای پس‌زمینه سایدبار) + نوچ طلایی لبهٔ صفحه که با آن همراهی می‌کند */
#nav-cursor {
  position: absolute; right: 14px; left: 14px; top: 0; height: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(100deg, rgba(251, 191, 36, .26), rgba(255, 255, 255, .06) 58%, rgba(16, 185, 129, .12));
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .3), 0 8px 20px rgba(245, 158, 11, .16);
  transition: top .4s var(--ease), height .4s var(--ease), opacity .25s;
  opacity: 0; pointer-events: none; z-index: 0;
}
#nav-cursor.on { opacity: 1; }
/* نوچ طلایی لبه حذف شد — قرص فعال خودش قاب طلایی و هاله دارد و
   نشانگر گروهِ فعال روی سرِ گروه می‌نشیند (بدون شلوغی دوگانه) */
body.sidebar-icons #nav-cursor { right: 7px; left: 7px; }
body.sidebar-collapsed #nav-cursor { opacity: 0; }

/* — مرکز اعلان — */
#notif-btn { position: relative; }
#notif-btn .n-badge {
  position: absolute; top: -5px; left: -5px; min-width: 16px; height: 16px;
  border-radius: 99px; background: var(--bad); color: #fff; font-size: 9.5px;
  font-weight: 800; display: grid; place-items: center; padding: 0 4px;
  box-shadow: 0 2px 6px rgba(220, 38, 38, .4);
  /* فاز ۴: هر شمارندهٔ تازه فنری می‌نشیند */
  animation: numPop .45s var(--ease-spring) backwards;
}
.nc-list { max-height: 380px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.nc-item { display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; border-radius: var(--radius-sm); }
.nc-item:hover { background: var(--surface-2); }
.nc-item .t-ic { width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0; display: grid; place-items: center; background: rgba(5, 150, 105, .1); color: var(--good); }
.nc-item.err .t-ic { background: rgba(220, 38, 38, .1); color: var(--bad); }
.nc-item.warn .t-ic { background: rgba(217, 119, 6, .12); color: var(--warn); }
.nc-item .t-msg { flex: 1; font-size: var(--fs-sm); line-height: 1.7; }
.nc-item .t-time { color: var(--muted); font-size: var(--fs-2xs); white-space: nowrap; padding-top: 3px; }
/* فاز ۴: ردیف‌های مرکز اعلان پله‌ای می‌آیند — لیست خودش ثابت می‌ماند تا حرکت دوبله نشود */
.nc-modal .nc-list { animation: none; }
.nc-modal .nc-item { animation: modalRise var(--dur) var(--ease-out) backwards; }
.nc-modal .nc-item:nth-child(2) { animation-delay: calc(var(--stagger) * 1); }
.nc-modal .nc-item:nth-child(3) { animation-delay: calc(var(--stagger) * 2); }
.nc-modal .nc-item:nth-child(4) { animation-delay: calc(var(--stagger) * 3); }
.nc-modal .nc-item:nth-child(5) { animation-delay: calc(var(--stagger) * 4); }
.nc-modal .nc-item:nth-child(6) { animation-delay: calc(var(--stagger) * 5); }
.nc-modal .nc-item:nth-child(7) { animation-delay: calc(var(--stagger) * 6); }
.nc-modal .nc-item:nth-child(8) { animation-delay: calc(var(--stagger) * 7); }
.nc-modal .nc-item:nth-child(n+9) { animation-delay: calc(var(--stagger) * 8); }
.nc-empty { text-align: center; color: var(--muted); font-size: var(--fs-sm); padding: 26px 10px; }

/* — توست استاندارد — */
.toast {
  display: flex; align-items: flex-start; gap: 10px; position: relative; overflow: hidden;
  padding: 11px 13px 13px; min-width: 250px; max-width: 380px;
  background: linear-gradient(135deg, #10514a, var(--side));
  border: 1px solid rgba(255, 255, 255, .09); border-right: 4px solid var(--accent-2);
  color: #fff; font-size: var(--fs-sm); font-weight: 500;
  box-shadow: var(--shadow-lg);
}
.toast .t-ic {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 10px;
  display: grid; place-items: center; background: rgba(255, 255, 255, .13); color: #a7f3d0;
}
.toast .t-body { flex: 1; min-width: 0; line-height: 1.75; padding-top: 4px; word-break: break-word; }
.toast .t-x {
  border: 0; background: transparent; color: rgba(255, 255, 255, .5); cursor: pointer;
  font-size: 14px; line-height: 1; padding: 4px 5px; border-radius: 7px; flex-shrink: 0;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.toast .t-x:hover { color: #fff; background: rgba(255, 255, 255, .14); }
.toast .t-bar { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: rgba(255, 255, 255, .12); }
.toast .t-bar::after {
  content: ''; display: block; height: 100%; width: 100%; background: var(--gold);
  /* صیقل نهایی: تخلیهٔ نوار با transform (کامپوزیتوری) به‌جای انیمیشن width */
  transform-origin: right center;
  animation: toastBar var(--ttl, 3400ms) linear forwards;
}
.toast.ok { border-right-color: var(--good); }
.toast.ok .t-ic { color: #6ee7b7; }
.toast.warn { border-right-color: var(--gold); }
.toast.warn .t-ic { color: #fcd34d; }
.toast.err {
  border-right-color: #f87171; background: linear-gradient(135deg, #7f1d1d, #671717);
  /* فاز ۴: اول لطیف بنشیند، بعد بلرزد — قبلاً shake جایگزینِ ورود می‌شد و پرش داشت */
  animation: toastIn var(--dur) var(--ease-spring) backwards, toastShake .42s var(--ease) calc(var(--dur) + .06s);
}
.toast.err .t-ic { color: #fca5a5; }
.toast.bye { opacity: 0; transform: translateY(10px) scale(.96); transition: opacity .2s var(--ease-out), transform .2s var(--ease-out); }
@keyframes toastBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.97); } }
@keyframes toastShake {
  20% { transform: translateX(5px); } 40% { transform: translateX(-4px); }
  60% { transform: translateX(3px); } 80% { transform: translateX(-2px); }
}
[data-theme="dark"] .toast { background: linear-gradient(135deg, #0c2a25, #071d19); }
[data-theme="dark"] .toast.err { background: linear-gradient(135deg, #4c1010, #340b0b); }
.toast .toast-action { margin-right: 0; align-self: center; }

/* — مودال برنددار — */
.modal { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.modal-body { padding: 18px 22px 20px; overflow: auto; }
.modal-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px 13px 18px; flex-shrink: 0;
  background: var(--grad-brand); color: #fff;
}
.modal-head h3 { margin: 0; font-size: var(--fs-lg); font-weight: 700; color: #fff; flex: 1; min-width: 0; }
.modal-x {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .16); color: #fff; cursor: pointer;
  display: grid; place-items: center;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.modal-x:hover { background: rgba(255, 255, 255, .32); transform: rotate(90deg); }
.modal-head.bare { position: absolute; top: 10px; left: 10px; background: transparent; padding: 0; }
.modal-head.bare .modal-x { background: var(--surface-2); color: var(--muted); box-shadow: var(--shadow-xs); }
.modal-head.bare .modal-x:hover { background: #fde8e8; color: var(--bad); transform: none; }
.modal.bare-head { padding-top: 34px; }
.modal-back.bye { animation: backOut .21s var(--ease-out) forwards; }
.modal-back.bye .modal { animation: modalOut .21s var(--ease-out) forwards; }
@keyframes backOut { to { opacity: 0; } }
@keyframes modalOut { to { opacity: 0; transform: scale(.95) translateY(10px); } }
body.modal-open { overflow: hidden; }
/* کانفیرم مهربان */
.confirm-ic {
  width: 46px; height: 46px; border-radius: 14px; margin-bottom: 10px;
  background: #fee2e2; color: var(--bad); display: grid; place-items: center;
}
[data-theme="dark"] .confirm-ic { background: rgba(220, 38, 38, .16); }
.confirm-text { color: var(--muted); font-size: var(--fs-sm); line-height: 1.9; margin: 4px 0 0; white-space: pre-line; }

/* — جدول‌ها: سرستون چسبان، zebra، دنسیتی، سایه اسکرول — */
.table th {
  position: sticky; top: 0; z-index: var(--z-tool); cursor: pointer; user-select: none;
  box-shadow: 0 1px 0 var(--line);
}
.table th[data-sort-dir="asc"]::after { content: '▲'; font-size: 8.5px; margin-right: 5px; color: var(--accent-2); }
.table th[data-sort-dir="desc"]::after { content: '▼'; font-size: 8.5px; margin-right: 5px; color: var(--accent-2); }
.table tbody tr:nth-child(even) td { background: rgba(23, 37, 45, .016); }
[data-theme="dark"] .table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .022); }
[data-theme="dark"] .table tbody tr:hover td { background: #1a2b24; }
.table.sticky-name th:first-child, .table.sticky-name td:first-child {
  position: sticky; right: 0; z-index: var(--z-base); background: var(--paper); box-shadow: -1px 0 0 var(--line);
}
.table.sticky-name tbody tr:hover td:first-child { background: #f1f5f4; }
[data-theme="dark"] .table.sticky-name td:first-child { background: #12201b; }
[data-theme="dark"] .table.sticky-name tbody tr:hover td:first-child { background: #1a2b24; }
.table tfoot td {
  background: rgba(5, 150, 105, .06); border-top: 2px solid #a7d8c8;
  font-weight: 800; color: var(--side); font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .table tfoot td { background: rgba(16, 185, 129, .08); border-top-color: #2a5348; color: #a7d8c8; }
/* سایه لبه‌ها هنگام اسکرول افقی (تکنیک background-attachment: local)
   ⚠ موقعیت گرادیان‌ها باید left/right باشد؛ center بودن‌شان یک نوار عمودی
   در «وسط» همهٔ جدول‌ها نقاشی می‌کرد */
.tbl-scroll {
  /* تقسیم بر --app-zoom: در زومِ غیر از ۱۰۰٪، سقف ارتفاع در فضای
     زوم‌شده‌ی body تفسیر می‌شود و بدون این تقسیم بهترین ارتفاع به‌جای
     (ارتفاع پنجره − ۲۰۵)، (ارتفاع پنجره × زوم − ۲۰۵×زوم) می‌افتد */
  overflow: auto; max-height: calc((100vh - 205px) / var(--app-zoom, 1));
  background:
    linear-gradient(90deg, rgba(23, 37, 45, 0), var(--paper) 70%) right / 44px 100% no-repeat local,
    linear-gradient(270deg, rgba(23, 37, 45, 0), var(--paper) 70%) left / 44px 100% no-repeat local,
    linear-gradient(270deg, rgba(23, 37, 45, .14), rgba(23, 37, 45, 0)) right / 44px 100% no-repeat scroll,
    linear-gradient(90deg, rgba(23, 37, 45, .14), rgba(23, 37, 45, 0)) left / 44px 100% no-repeat scroll;
}
[data-theme="dark"] .tbl-scroll {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0), var(--paper) 70%) right / 44px 100% no-repeat local,
    linear-gradient(270deg, rgba(0, 0, 0, 0), var(--paper) 70%) left / 44px 100% no-repeat local,
    linear-gradient(270deg, rgba(0, 0, 0, .35), rgba(0, 0, 0, 0)) right / 44px 100% no-repeat scroll,
    linear-gradient(90deg, rgba(0, 0, 0, .35), rgba(0, 0, 0, 0)) left / 44px 100% no-repeat scroll;
}

/* — فرم‌ها: select سفارشی، خطای زیر فیلد، تیک موفق — */
/* فاز ۵: `.field select` هم صریحاً اضافه شد — قبلاً shorthandِ `background:#fff`
   در `.field input,.field select` (خط ~۴۵۹) تصویر فلش را در فیلدهای فرم
   می‌بلعید و فلش فقط روی selectهای بیرونِ .field دیده می‌شد */
.field select, select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 10px center; padding-left: 30px;
}
/* در تم تیره، shorthand تیرهٔ `.field select` (خط ~۱۰۶۱، specificity بالاتر)
   فلش را دوباره می‌بلعید — اینجا با همان specificity و دیرتر بازنویسی می‌شود */
[data-theme="dark"] .field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 10px center;
}
.field { position: relative; }
.field.has-err input, .field.has-err select, .field.has-err textarea {
  border-color: var(--bad); box-shadow: 0 0 0 4px rgba(220, 38, 38, .11);
}
.field-err-msg {
  display: flex; align-items: center; gap: 5px; color: var(--bad);
  font-size: var(--fs-xs); font-weight: 600; margin-top: 4px;
}
.field .money-slip { padding-left: 26px; }
input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; opacity: .6; }

/* — لیست پیشنهاد: هایلایت کیبورد + دکمه پاک‌کردن — */
.suggest-list button.hl { background: #e5f6ef; box-shadow: inset 0 0 0 1.5px var(--accent-2); }
[data-theme="dark"] .suggest-list button.hl { background: #10231f; }
.suggest-clear {
  position: absolute; left: 9px; bottom: 9px; width: 20px; height: 20px;
  border: 0; border-radius: 50%; background: rgba(23, 37, 45, .08); color: var(--muted);
  cursor: pointer; font-size: 10px; line-height: 1; display: none; place-items: center;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.suggest-clear:hover { background: #fde8e8; color: var(--bad); }
.suggest.has-value .suggest-clear { display: grid; }
.suggest input { padding-left: 34px; }

/* — پالس تغییر عدد آمار — */
.stat .value.bump { animation: bump .5s var(--ease); }
@keyframes bump { 35% { transform: scale(1.14); color: var(--accent-2); } }
.stat .value { display: inline-block; }

/* — هاله نورانی کارت‌ها دنبال‌کننده ماوس (spotlight) — */
.card.dash-card::after {
  background: radial-gradient(240px circle at var(--mx, 30%) var(--my, 0%),
    rgba(251, 191, 36, .38), rgba(16, 185, 129, .16) 48%, transparent 72%);
}

/* — دونات حضور — */
.donut { position: relative; width: 86px; height: 86px; flex-shrink: 0; }
.donut svg { transform: rotate(-90deg); display: block; }
.donut .d-num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-weight: 800; font-size: var(--fs-lg); color: var(--side); font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .donut .d-num { color: #a7d8c8; }
.donut .d-track { stroke: var(--line); }

/* — empty state تصویری — */
.empty { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.empty .e-ill {
  color: var(--accent-2); opacity: .55;
  /* صیقل نهایی: تصویرسازی empty یک‌بار نرم بالا می‌آید */
  animation: emptyIllIn .55s var(--ease-out) backwards;
}
@keyframes emptyIllIn { from { opacity: 0; transform: scale(.9) translateY(5px); } }
.empty .e-act { margin-top: 5px; }
.empty.sq { display: block; } /* حالت‌های قدیمی تک‌خطی (داخل suggest و …) */

/* — خروجی PNG چارت — */
.chart-export {
  position: absolute; top: 6px; left: 6px; z-index: var(--z-tool);
  width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper); color: var(--muted); cursor: pointer;
  display: grid; place-items: center; box-shadow: var(--shadow-xs);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.chart-export:hover { color: var(--accent-2); border-color: #a7d8c8; }

/* — reveal اسکرولی بخش‌های بلند — */
.rev { opacity: 0; transform: translateY(18px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.rev.rev-in { opacity: 1; transform: none; }

/* — گارد لمسی: افکت hover فقط با ماوس واقعی — */
@media (hover: none) {
  .btn:hover, .btn.ghost:hover, .stat:hover, .card.dash-card:hover,
  .countdown-card:hover, .class-pill:hover, .cal .day:hover,
.sidebar nav a:hover, .bk-cat:hover, .ng-group:hover { transform: none; }
}


/* — badgeها در تم تیره: شفاف با متن روشن — */
[data-theme="dark"] .badge.present, [data-theme="dark"] .badge.normal,
[data-theme="dark"] .badge.success, [data-theme="dark"] .badge.good {
  background: rgba(16, 185, 129, .15); color: #6ee7b7;
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, .28);
}
[data-theme="dark"] .badge.absent, [data-theme="dark"] .badge.failed,
[data-theme="dark"] .badge.critical {
  background: rgba(220, 38, 38, .15); color: #fca5a5;
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, .3);
}
[data-theme="dark"] .badge.late, [data-theme="dark"] .badge.important {
  background: rgba(217, 119, 6, .16); color: #fcd34d;
  box-shadow: inset 0 0 0 1px rgba(217, 119, 6, .3);
}
[data-theme="dark"] .badge.auto {
  background: rgba(37, 99, 235, .18); color: #93c5fd;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .32);
}
[data-theme="dark"] .badge.manual {
  background: rgba(124, 58, 237, .18); color: #c4b5fd;
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, .32);
}
[data-theme="dark"] .att-chip.disabled {
  opacity: .45; cursor: not-allowed;
  background: #1e2a3a !important; color: #64748b !important; border-color: #334155 !important;
}
[data-theme="dark"] .att-chip.disabled:hover { transform: none; box-shadow: none; }

/* — سطح‌بندی تم تیره: جدایی واقعی کارت از زمینه — */
[data-theme="dark"] .card {
  border-color: #2c3f52;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), var(--shadow);
}
[data-theme="dark"] .table th { background: var(--surface-2); }
[data-theme="dark"] .tbl-scroll { scrollbar-color: #2b3b4c transparent; }

/* — جمع‌کردن انیمیت‌دار کارت داشبورد — */
.dash-card { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), height var(--dur-slow) var(--ease); }
.dash-card.folded > *:not(h3):not(.dash-fold):not(.dash-head) { display: none !important; }
.dash-card.animating { overflow: hidden; }

/* — تور راهنما (onboarding) — */
.tour-target {
  position: relative; z-index: calc(var(--z-tip) + 1);
  box-shadow: 0 0 0 4px rgba(251, 191, 36, .55), 0 10px 34px rgba(0, 0, 0, .35);
  border-radius: var(--radius-md);
}
.tour-card {
  position: absolute; z-index: calc(var(--z-tip) + 2); width: 285px;
  background: rgba(9, 34, 29, .95); color: #fff; backdrop-filter: blur(10px);
  border: 1px solid rgba(251, 191, 36, .4); border-radius: var(--radius-lg);
  padding: 15px 16px; box-shadow: var(--shadow-lg);
  animation: popIn .25s var(--ease);
}
.tour-card h4 { margin: 0 0 6px; font-size: var(--fs-md); color: #fde68a; }
.tour-card p { margin: 0 0 12px; font-size: var(--fs-xs); line-height: 1.9; color: #dce8e2; }
.tour-row { display: flex; gap: 8px; justify-content: space-between; align-items: center; }
.tour-step { font-size: var(--fs-2xs); color: #8fb8ab; }
.tour-skip { border: 0; background: transparent; color: #8fb8ab; cursor: pointer; font-size: var(--fs-xs); font-family: inherit; }
.tour-skip:hover { color: #fff; }

/* — صفحه ورود غنی‌تر — */
.login-check { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--muted); margin: 12px 2px 2px; }
.login-check input { width: 19px; height: 19px; }
/* نشانگر وضعیت اتصال — کارت ورود سفید است، پس رنگ‌ها تیره انتخاب شده‌اند تا خوانا باشند */
.login-status-wrap { margin: 0 0 12px; text-align: center; }
.login-status {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%; padding: 5px 10px;
  font-size: var(--fs-2xs); line-height: 1.7; white-space: nowrap;
  color: var(--ink); background: #f1f5f9; border: 1px solid var(--line);
  border-radius: 999px;
}
.login-status .ok-dot { width: 8px; height: 8px; flex: none; }
.login-status-label { font-weight: 700; color: var(--muted); white-space: nowrap; }
.login-status.on { background: #ecfdf5; border-color: #a7f3d0; }
.login-status.on .login-status-label,
.login-status.on #lg-status-text { color: #047857; }
.login-status.off { background: #fef2f2; border-color: #fecaca; }
.login-status.off .login-status-label,
.login-status.off #lg-status-text { color: #b91c1c; }
.login-status.off .ok-dot { background: var(--bad); }
/* دایره‌ی ℹ — هاور/فوکس تولتیپ شیشه‌ای [data-tip] با توضیح معنی چراغ */
.login-status-help {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 16px; height: 16px; border-radius: 50%; cursor: help;
  background: rgba(15, 23, 42, .08); color: var(--muted);
  transition: background var(--dur) ease, color var(--dur) ease;
}
.login-status-help:hover, .login-status-help:focus-visible { background: rgba(15, 23, 42, .16); color: var(--ink); outline: none; }
/* راهنمای رفع مشکل فقط در حالت قطع و زیر همان چیپ */
.login-status-hint { margin-top: -4px; font-size: var(--fs-2xs); line-height: 1.8; color: var(--bad); }
.login-status-hint[hidden] { display: none; }
/* تم تیره: چیپ شب‌رنگ با متن روشن */
[data-theme=dark] .login-status { background: rgba(255, 255, 255, .06); border-color: var(--line); }
[data-theme=dark] .login-status.on { background: rgba(5, 150, 105, .16); border-color: rgba(52, 211, 153, .35); }
[data-theme=dark] .login-status.on .login-status-label,
[data-theme=dark] .login-status.on #lg-status-text { color: #6ee7b7; }
[data-theme=dark] .login-status.off { background: rgba(220, 38, 38, .14); border-color: rgba(248, 113, 113, .32); }
[data-theme=dark] .login-status.off .login-status-label,
[data-theme=dark] .login-status.off #lg-status-text { color: #fca5a5; }
[data-theme=dark] .login-status-help { background: rgba(255, 255, 255, .1); color: var(--muted); }
[data-theme=dark] .login-status-help:hover, [data-theme=dark] .login-status-help:focus-visible { background: rgba(255, 255, 255, .22); color: #fff; }
[data-theme=dark] .login-status-hint { color: #fca5a5; }

/* — اسپلش: گام‌های بارگذاری — */
#splash-steps { margin-top: 18px; display: flex; flex-direction: column; gap: 5px; align-items: center; min-height: 66px; }
#splash-steps .s-step {
  color: #a7d8c8; font-size: var(--fs-xs); font-weight: 500;
  display: flex; align-items: center; gap: 6px; animation: fadeIn .35s ease backwards;
}
#splash-steps .s-step svg { color: var(--gold); }

/* — راهنمای میانبرها — */
.sc-list { display: flex; flex-direction: column; gap: 4px; }
.sc-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--radius-sm); }
.sc-row:hover { background: var(--surface-2); }
.sc-row kbd {
  font-family: inherit; background: var(--surface-2); border: 1px solid var(--line);
  border-bottom-width: 2.5px; border-radius: 7px; padding: 3px 9px;
  font-size: var(--fs-xs); font-weight: 700; color: var(--side); min-width: 74px; text-align: center;
}
.sc-row .sc-d { flex: 1; font-size: var(--fs-sm); color: var(--ink); }

/* — آیکون‌های چیپ‌های تاپ‌بار — */
.top-chip .ic { width: 14px; height: 14px; }
.theme-btn svg { transition: transform .45s var(--ease); }
.theme-btn:active svg { transform: rotate(90deg); }

/* — بنتوی داشبورد (اختیاری) — */
body.dash-bento .grid-dash { grid-template-columns: repeat(2, 1fr); }
body.dash-bento .grid-dash > .dash-card:first-child { grid-column: span 2; }

/* — چاپ برنددار یکدست — */
.print-brand {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 3px solid #0d3b34; padding-bottom: 10px; margin-bottom: 16px;
}
.print-brand .pb-l { display: flex; align-items: center; gap: 10px; }
.print-brand img { height: 44px; width: 44px; object-fit: contain; }
.print-brand .pb-name { font-size: var(--fs-xl); font-weight: 800; color: #0d3b34; }
.print-brand .pb-name small { display: block; font-size: 10px; font-weight: 400; color: #64748b; }
.print-brand .pb-meta { text-align: left; font-size: 10.5px; color: #64748b; line-height: 1.8; }
.print-sign { margin-top: 26px; display: flex; justify-content: space-between; font-size: 11px; color: #334155; page-break-inside: avoid; }
.print-sign span { border-top: 1.5px dotted #94a3b8; padding-top: 5px; min-width: 150px; text-align: center; }
.wm-conf { position: fixed; inset: 0; display: grid; place-items: center; pointer-events: none; }
.wm-conf span {
  font-size: var(--fs-wm); font-weight: 800; color: rgba(220, 38, 38, .055);
  transform: rotate(-28deg); letter-spacing: 14px; white-space: nowrap;
  border: 4px solid rgba(220, 38, 38, .05); padding: 10px 30px; border-radius: 20px;
}

/* — پکیج بازخورد کاربر: نشان تب‌های گزارشات + ستون‌های داشبورد — */
.rec-badge {
  background: var(--gold); color: #082621; font-size: var(--fs-2xs); font-weight: 800;
  line-height: 1.7; padding: 1px 8px; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, .35);
}
.rec-tab.active .rec-badge { background: var(--gold); color: #082621; }
.dash-col { min-height: 130px; border-radius: var(--radius-lg); }
.dash-col.dragover { outline: 2.5px dashed var(--accent-2); outline-offset: 5px; background: rgba(16, 185, 129, .05); }

/* ————— داشبورد: ردیف بالا (کارت حضور + بنر سلام) ————— */
.dash-hero-row {
  display: grid;
  grid-template-columns: minmax(280px, 400px) minmax(0, 1fr);
  gap: 14px; align-items: stretch; margin-bottom: 2px;
}
@media (max-width: 1080px) { .dash-hero-row { grid-template-columns: 1fr; } }

/* ————— کارت «حضور امروز» — ستون اول ردیف بالا داشبورد —————
   چیدمان: دونات + تیتر و خلاصه در یک ردیف؛ نشان‌ها در نوار کامل‌عرض زیر.
   اگر عرض کارت کم بیاید، ستون کنار دونات به ردیف بعد می‌رود (فشرده نمی‌شود). */
.att-card {
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
  height: 100%; box-sizing: border-box;
}
/* ارتفاع ردیف بالا را همین کارت تعیین می‌کند؛ پدینگ و دونات فشرده نگه داشته
   می‌شوند تا کل ماژول کوتاه بماند (سلکتور قوی‌تر از .card.dash-card) */
.card.dash-card.att-card { padding: 12px 16px; }
.att-main { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.att-donut, .att-donut svg { width: 64px; height: 64px; }
.att-side { display: flex; flex-direction: column; gap: 5px; flex: 1 1 150px; min-width: 0; }
.att-title {
  display: flex; align-items: center; gap: 7px;
  font-size: var(--fs-md); font-weight: 800; color: var(--ink);
}
.att-title .ic { color: var(--side); }
[data-theme="dark"] .att-title .ic { color: #a7d8c8; }
.att-sub {
  font-size: var(--fs-sm); font-weight: 600; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.att-badges { border-top: 1px dashed var(--line); padding-top: 8px; }
@media (max-width: 1080px) { .att-card { align-items: stretch; } }

.dash-hero {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  margin-bottom: 14px; border: 1px solid var(--line); background: var(--paper);
}
.dash-hero-row .dash-hero { margin-bottom: 0; height: 100%; }
.dash-hero-bg {
  position: absolute; inset: 0;
  /* پس‌زمینه تزیینی حذف شد؛ کارت salutations بر پایه سطح کاغذ و لبه suffice است */
  background: none;
  pointer-events: none;
}
.dash-hero-in {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; padding: 9px 18px; height: 100%; box-sizing: border-box;
}
/* ————————————————————————————————————————————————
   ماژول اطلاعات داشبورد (بالای صفحه): خوش‌آمد + نوار وضعیت
   چیدمان:  [ سلام و نقش کاربر ]  |  اکنون · اتصال · آب‌وهوا · پیامک
   سلسله‌مراتب بصری: ۱) سلام و نام  ۲) مقدار هر کاشی  ۳) برچسب و توضیح فرعی
   رنگ فقط معنا دارد: سبز=متصل، قرمز=قطع/هشدار، آبی=پیامک، خاکستری=فرعی
   ———————————————————————————————————————————————— */
.dash-hello { min-width: 0; flex: 0 1 auto; }

/* — بخش خوش‌آمدگویی: نگاه اول — */
.dash-hello-top { display: flex; align-items: center; gap: 12px; }
.dash-hello-txt {
  font-size: calc(var(--fs-xl) * 1.1); font-weight: 800; letter-spacing: -.3px; line-height: 1.35;
  color: var(--ink);
}
/* ردیف زیر سلام: نقش کاربر و کلاس — تأکید کم‌تر از سلام */
.dash-hello-sub {
  font-size: var(--fs-xs); color: var(--muted); margin-top: 3px;
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap; line-height: 1.6;
}
.dash-hello-sub .h-role {
  display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: var(--side);
  background: color-mix(in srgb, var(--side) 8%, transparent);
  border-radius: var(--radius-full); padding: 1px 9px;
}
.dash-hello-sub .h-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--line); }
.dash-hello-sub svg { color: var(--muted); }

/* — کاشی‌های نوار وضعیت: برچسب بالا، مقدار پایین، خط عمودی بین کاشی‌ها — */
/* کاشی‌ها کل فضای خالی کنار بخش خوش‌آمد را پر می‌کنند (flex-grow) و با
   flex-basis: 320px اگر جا نباشد یک‌جا به ردیف بعد می‌روند — پس هیچ‌وقت
   شکاف خالی وسط کارت باقی نمی‌ماند */
.dash-chips {
  display: flex; align-items: stretch; flex-wrap: wrap;
  flex: 1 1 320px; min-width: 0;
}
/* کاشی‌ها با پایهٔ صفر و رشد یکسان عرض می‌گیرند: اگر جا باشد همه یک‌اندازه
   می‌شوند و اگر جا نشود، هر کاشی حداقل به عرض محتوایش می‌ماند (هیچ متنی
   بریده یا سه‌نقطه نمی‌شود) */
.hero-tile {
  position: relative; display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center;
  gap: 2px; flex: 1 1 0; padding: 4px 12px; cursor: default;
  border-radius: var(--radius-md);
  transition: background var(--dur) ease;
}
.hero-tile + .hero-tile {
  border-inline-start: 1px solid var(--line);
  /* گوشهٔ کاشی گرد است؛ خط جداکننده صاف بماند تا شبیه پرانتز نشود */
  border-start-start-radius: 0; border-end-start-radius: 0;
}
.hero-tile:hover { background: color-mix(in srgb, var(--side) 6%, transparent); }
/* خط عمودیِ کنارِ کاشیِ هاورشده محو می‌شود تا پس‌زمینهٔ گردد تکه‌تکه نماند */
.hero-tile:hover, .hero-tile:hover + .hero-tile { border-inline-start-color: transparent; }
.hero-tile-lab {
  font-size: var(--fs-2xs); color: var(--muted); font-weight: 700; letter-spacing: .1px;
  line-height: 1.4; white-space: nowrap;
}
/* محتوای هر کاشی، همان عناصر واقعی نوار بالا (ساعت، تاریخ، سرور، آب‌وهوا، پیامک) —
   پس مقادیر و تازه‌سازی زنده‌شان دست‌نخورده می‌ماند */
.hero-tile .top-chip, .hero-tile .topbar-clock, .hero-tile .topbar-date {
  position: relative !important; display: inline-flex !important; align-items: center; gap: 6px;
  flex-wrap: wrap; height: auto; padding: 0 !important; margin: 0; border-radius: 0;
  background: none !important; border: 0 !important; box-shadow: none !important;
  font-size: var(--fs-sm); font-weight: 800; color: var(--ink); white-space: nowrap;
  line-height: 1.3; min-width: 0; max-width: 100%;
}
.hero-tile .cell-ic { display: inline-flex; align-items: center; flex: none; }
/* در کاشی، برچسب «اکنون» نقش آیکون تقویم را هم بازی می‌کند؛ آیکون پنهان می‌شود
   تا تاریخ کنار ساعت جا شود و تاریخ هیچ‌وقت بریده نشود (در نوار بالا می‌ماند) */
.hero-tile .topbar-date .cell-ic { display: none; }
.hero-tile .cell-v, .hero-tile .topbar-clock {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
/* توضیح فرعی در کاشی، زیر مقدار می‌نشیند (در نوار بالا کنار مقدار می‌آید).
   در کاشی «اکنون»، تاریخ فقط وقتی جا نشد به خط بعد می‌رود */
.hero-tile .cell-s {
  flex-basis: 100%; font-size: var(--fs-2xs); font-weight: 700; color: var(--muted);
  line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
/* کاشی «اکنون»: ساعت و تاریخ در یک خط و هم‌تراز کنار هم (هر دو راست‌چین
   در جریان RTL) — به‌جای دو خط با تراز ناهماهنگ */
.hero-tile.t-now { flex-flow: row wrap; align-items: center; gap: 2px 10px; }
.hero-tile.t-now .hero-tile-lab { flex-basis: 100%; }
.hero-tile.t-now .topbar-date { flex-basis: auto; }
/* — رنگ هدفمند آیکون و نشانگرها — */
.hero-tile .cell-ic .ic { color: var(--muted); }
.hero-tile.t-now #top-clock { font-variant-numeric: tabular-nums; font-size: var(--fs-base); letter-spacing: .4px; }
.hero-tile.t-air #top-weather .cell-e { color: var(--side); }
.hero-tile.t-live #top-server .cell-ic .ic, .hero-tile.t-live #top-server .ok-dot { color: var(--good); background: var(--good); }
.hero-tile.t-live #top-server.warn .cell-ic .ic, .hero-tile.t-live #top-server.warn .ok-dot { color: var(--bad); background: var(--bad); }
.hero-tile.t-msg #top-sms .cell-ic .ic { color: var(--info); }
.hero-tile.t-msg #top-sms.warn .cell-ic .ic { color: var(--warn); }
.hero-tile.t-air #top-weather.warn .cell-v { color: var(--bad); }
/* کاشی «اعلان‌ها» — دکمهٔ زنگ بدون قابِ دکمه، هم‌تراز و هم‌سبکِ بقیهٔ کاشی‌ها؛
   نشانِ تعداد اعلان نخوانده سرِ زنگ می‌نشیند و کلیک، مرکز اعلان را باز می‌کند */
.hero-tile.t-bell { cursor: pointer; }
.hero-tile.t-bell .icon-btn {
  background: none; border: 0; box-shadow: none; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0; color: var(--side);
}
.hero-tile.t-bell .icon-btn svg { width: 19px; height: 19px; display: block; transition: color var(--dur) ease; }
.hero-tile.t-bell:hover .icon-btn svg { color: var(--accent-2); }
.hero-tile.t-bell .n-badge { top: -7px; left: -10px; }
[data-theme="dark"] .hero-tile.t-bell .icon-btn svg { color: #a7d8c8; }
[data-theme="dark"] .hero-tile.t-bell:hover .icon-btn svg { color: var(--gold); }
/* کاشی «کارت‌ها» (⚙ تنظیم کارت‌های داشبورد) — همان سبک کاشی اعلان‌ها */
.hero-tile.t-vis { cursor: pointer; }
.hero-tile.t-vis .icon-btn {
  background: none; border: 0; box-shadow: none; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0; color: var(--side);
}
.hero-tile.t-vis .icon-btn svg { width: 19px; height: 19px; display: block; transition: color var(--dur) ease; }
.hero-tile.t-vis:hover .icon-btn svg { color: var(--accent-2); }
[data-theme="dark"] .hero-tile.t-vis .icon-btn svg { color: #a7d8c8; }
[data-theme="dark"] .hero-tile.t-vis:hover .icon-btn svg { color: var(--gold); }
/* کاشی «نیازمند اقدام» — ساختار داخلی مثل چیپ‌ها (آیکون + مقدار + توضیح فرعی) */
.hero-tile.t-act .act-main {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-sm); font-weight: 800; color: var(--ink); line-height: 1.3; white-space: nowrap;
}
.hero-tile.t-act .cell-s { flex-basis: 100%; white-space: normal; line-height: 1.7; }
.hero-tile.t-act .cell-ic .ic { color: var(--warn); }
.hero-tile.t-act:not(.is-warn) .cell-ic .ic { color: var(--good); }
/* کاشی هشدار (موجودی کم، قطع سرور، هشدار آب‌وهوا) — پیش از هاور هم پیدا باشد */
.hero-tile.is-warn { background: color-mix(in srgb, var(--warn) 11%, transparent); }
[data-theme="dark"] .hero-tile:hover { background: rgba(255, 255, 255, .05); }
[data-theme="dark"] .hero-tile.is-warn { background: rgba(217, 119, 6, .17); }
[data-theme="dark"] .dash-hello-sub .h-role { background: rgba(255, 255, 255, .07); color: #a7d8c8; }
[data-theme="dark"] .hero-tile.t-air #top-weather .cell-e { color: #a7d8c8; }

/* — ساختار یکدست محتوای چیپ‌ها: آیکون + مقدار + توضیح فرعی —
   همین عناصر در نوار بالا (بیرون از داشبورد) نیز استفاده می‌شوند */
.cell-ic { display: inline-flex; align-items: center; flex: none; }
.cell-e { font-size: 15px; line-height: 1; }
.cell-v { font-weight: 800; }
.cell-s { color: var(--muted); font-weight: 700; }
.topbar .cell-s::before { content: ' · '; }

/* تولتیپ‌های CSS داخل ماژول خاموش‌اند — همه با پنجرهٔ مشترک DashTip کار می‌کنند
   (تولتیپ CSS داخل کارت overflow:hidden بریده می‌شود) */
.dash-hero [data-tip]::after, .dash-hero [data-tip]::before { display: none !important; }

/* — واکنش‌گرایی: اگر نوار وضعیت کنار سلام جا نشد، تمام‌عرض زیر آن می‌نشیند —
   این حالت با JS از روی عرض واقعی کارت تنظیم می‌شود (hero-stacked) تا با
   جمع‌شدن سایدبار یا تغییر اندازهٔ پنجره هم درست بماند. */
.dash-hero-in.hero-stacked { flex-direction: column; align-items: stretch; gap: 12px; }
.dash-hero-in.hero-stacked .dash-chips { margin-inline-start: 0; width: 100%; }
.dash-hero-in.hero-stacked .dash-hello { flex: none; }
@media (max-width: 1080px) { .dash-hero-in { padding: 10px 16px; gap: 14px; } }
@media (max-width: 860px) {
  .dash-hello-txt { font-size: var(--fs-xl); }
}
@media (max-width: 640px) {
  .hero-tile { flex-basis: calc(50% - 1px); border-radius: var(--radius-sm); }
  .hero-tile + .hero-tile { border-inline-start: 0; }
  .hero-tile { background: color-mix(in srgb, var(--side) 4%, transparent); }
  [data-theme="dark"] .hero-tile { background: rgba(255, 255, 255, .04); }
}

/* ============================================================
   ماژول هشدار موارد انضباطی (Disciplinary Alerts)
   ============================================================ */

/* بیلج‌های مخصوص انضباطی — واریانت پررنگ (عمداً سراسری: کتابخانه و
   صفحه انتظار هم از همین واریانت پررنگ برای وضعیت‌های بحرانی استفاده می‌کنند) */
.badge.critical { background: var(--bad); color: white; }
.badge.warn { background: #f59e0b; color: #451a03; }
.badge.good { background: var(--good); color: white; }

/* تب‌های مدال‌های انضباطی — دامنه‌دار (فقط داخل مودال).
   تا پیش از این این استایل‌ها سراسری بودند و ظاهر تب‌های همهٔ صفحه‌ها
   (مثل تنظیمات) را بی‌قید بازنویسی می‌کرد؛ حالا تب بیرونِ مودال به
   تعریف اصلی خودش در بالای فایل بازمی‌گردد. */
.modal .tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 12px; flex-wrap: wrap; }
.modal .tab-btn { background: none; border: none; padding: 8px 12px; cursor: pointer; color: var(--muted); font-size: var(--fs-sm); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: 0.15s; }
.modal .tab-btn:hover { color: var(--ink); }
.modal .tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
/* کنتراست روشن: طلایی روی کاغذ سفید ۳.۱۹ — در حالت روشن فقط از کهربایی تیره‌تر */
[data-theme="light"] .modal .tab-btn.active { color: var(--warn); border-bottom-color: var(--warn); }

/* کارت هشدار انضباطی در داشبورد */
#disc-alert-card { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
#disc-alert-card:hover { box-shadow: var(--shadow-lg); }

/* استایل خط کلاس در هشدار انضباطی */
.class-pill[data-disc] { cursor: pointer; transition: background var(--dur) ease; }
.class-pill[data-disc]:hover { background: color-mix(in srgb, var(--side) 4%, transparent); }
.class-pill[data-disc]:hover .badge { transform: scale(1.05); }

/* دکمه‌ها در هدر کارت انضباطی */
#disc-alert-card .dash-head .btn.ghost.sm { padding: 4px 8px; font-size: var(--fs-xs); }

/* رفع سراسری مخفی‌شدن تولتیپ [data-tip] زیر دکمه/ردیف بعدی:
   هاور .class-pill / .cal .day / .stat / .card ترنسفورم می‌گیرد و stacking-context
   می‌سازد، پس تولتیپ (::after) داخل همان context حبس می‌شود و عنصر بعدی
   (دکمه «نمایش همه»، ردیف بعدی، کارت بعدی) روی آن می‌افتد.
   با بالا بردن z-index ردیف/کارت هاورشده، تولتیپ همیشه روی عنصر بعدی می‌آید. */
#disc-alert-card { overflow: visible; }
.card.dash-card:hover { z-index: 20; }
.class-pill { position: relative; }
.class-pill:hover { z-index: 30; }
.cal .day:hover { z-index: 30; }
.stat:hover { overflow: visible; z-index: 30; }
.bell-timeline { overflow: visible; }
.bell-timeline .bl-seg:hover { z-index: 30; }
/* دکمه‌ها overflow:hidden دارند (برای ripple) که تولتیپ را می‌بُرد */
.btn[data-tip]:hover, button[data-tip]:hover { overflow: visible; }
.class-pill [data-tip]:hover::after,
.cal .day[data-tip]:hover::after,
.stat [data-tip]:hover::after,
.bell-timeline [data-tip]:hover::after,
.class-pill [data-tip]:hover::before,
.cal .day[data-tip]:hover::before,
.stat [data-tip]:hover::before,
.bell-timeline [data-tip]:hover::before { z-index: 600; }
#disc-alert-card #disc-view-all { position: relative; z-index: 1; }
#disc-full-list .class-pill { position: relative; }
#disc-full-list .class-pill:hover { z-index: 30; }

/* scrollbar برای لیست کامل */
#disc-full-list::-webkit-scrollbar { width: 8px; }
#disc-full-list::-webkit-scrollbar-track { background: transparent; }
#disc-full-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
#disc-full-list::-webkit-scrollbar-thumb:hover { background: var(--muted); }
[data-theme="dark"] #disc-full-list::-webkit-scrollbar-thumb { background: #334155; }
[data-theme="dark"] #disc-full-list::-webkit-scrollbar-thumb:hover { background: #475569; }

/* مدال تنظیمات انضباطی - گرید ورودی‌ها */
.modal .grid label { display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.modal .grid input.inp[type="number"] { width: 100%; }
.modal textarea.inp { font-family: inherit; resize: vertical; min-height: 80px; }

/* انیمیشن ورود کارت */
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.dash-card { animation: slideUp 0.3s ease-out; }

/* ===============
   مرحله ۳ — آیکون‌های SVG جایگزین ایموجی (سرویس‌شده توسط js/icons.js)
   =============== */
.emoji-ic {
  display: inline-flex; width: 1em; height: 1em; vertical-align: -.125em; flex: none;
  transform: translateY(.06em); /* هم‌ترازی نوری با متن فارسی */
}
.emoji-ic svg { width: 100%; height: 100%; display: block; }
.emoji-ic.ok     { color: var(--good); }
.emoji-ic.bad    { color: var(--bad); }
.emoji-ic.warn   { color: var(--warn); }
.emoji-ic.gold   { color: var(--gold); }
.emoji-ic.purple { color: #8b5cf6; }
.emoji-ic.blue   { color: #2f6fd0; }
.emoji-ic.muted  { color: var(--muted); opacity: .85; }
[data-theme="dark"] .emoji-ic.bad  { color: #f87171; }
[data-theme="dark"] .emoji-ic.ok   { color: #34d399; }
[data-theme="dark"] .emoji-ic.warn { color: #fbbf24; }
[data-theme="dark"] .emoji-ic.gold { color: #fbbf24; }
[data-theme="dark"] .emoji-ic.blue { color: #60a5fa; }
[data-theme="dark"] .emoji-ic.purple { color: #a78bfa; }
/* ایموجی داخل دکمه‌ها با اندازه ثابت دکمه هم‌خوان می‌شود */
.btn .emoji-ic, .icon-btn .emoji-ic, .side-btn .emoji-ic { width: 1.05em; height: 1.05em; }
/* ===============
   مرحله ۴ — زبان حرکت
   (گارد سراسری prefers-reduced-motion در خط ~1290 همه را خنثی می‌کند)
   =============== */

/* — استاگر ورود بخش‌های صفحه: فقط برای ریویل اسکرولی (عناصر زیرِ تای) —
   تأخیرها از توکن stagger می‌آیند تا با نردبان pageIn هم‌ریتم باشند */
.view > .rev:nth-child(2) { transition-delay: calc(var(--stagger) * 2); }
.view > .rev:nth-child(3) { transition-delay: calc(var(--stagger) * 4); }
.view > .rev:nth-child(4) { transition-delay: calc(var(--stagger) * 6); }
.view > .rev:nth-child(5) { transition-delay: calc(var(--stagger) * 8); }
.view > .rev:nth-child(6) { transition-delay: calc(var(--stagger) * 10); }

/* — استاگر کارت‌ها داخل هر گرید (لایه دوم ورود) — هم‌تراز با نردبان pageIn
   ولی با شخصیت خودش: اسکیل ظریف .985. زمان‌بندی از توکن‌های موشن — */
.grid > .card, .view > .card { animation: cardIn var(--dur-big) var(--ease-out) backwards; }
.grid > .card:nth-child(2), .view > .card:nth-child(2) { animation-delay: calc(var(--stagger) * 1); }
.grid > .card:nth-child(3), .view > .card:nth-child(3) { animation-delay: calc(var(--stagger) * 2); }
.grid > .card:nth-child(4), .view > .card:nth-child(4) { animation-delay: calc(var(--stagger) * 3); }
.grid > .card:nth-child(5), .view > .card:nth-child(5) { animation-delay: calc(var(--stagger) * 4); }
.grid > .card:nth-child(6), .view > .card:nth-child(6) { animation-delay: calc(var(--stagger) * 5); }
.grid > .card:nth-child(7), .view > .card:nth-child(7) { animation-delay: calc(var(--stagger) * 6); }
.grid > .card:nth-child(8), .view > .card:nth-child(8) { animation-delay: calc(var(--stagger) * 7); }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
}

/* — پالس اعداد آماری: هر بار کارت رندر شود عدد با فشار ملایم می‌نشیند — */
.stat .value { animation: numPop .5s var(--ease) backwards .25s; }
@keyframes numPop {
  from { opacity: 0; transform: translateY(9px) scale(.9); }
}

/* — بازخورد لمسی فشار دکمه — */
.btn:active { transform: translateY(0) scale(.97); }

/* — تکمیل گارد لمسی: باقی hoverهای جابه‌جاشونده روی دستگاه لمسی خنثی — */
@media (hover: none) {
  .brand-logo:hover, .att-chip:hover, .rec-tab:hover,
  .crumbs .cr-back:hover, .modal-x:hover, .chart-export:hover,
  .class-pill[data-disc]:hover .badge { transform: none; }
}
/* ===============
   مرحله ۵ — کامپوننت‌های امضایی
   =============== */

/* — داشبورد Bento: هر کاشی هویت رنگی خودش —
   رنگ از متغیر --tint می‌آید؛ نوار لبه + شست‌وشوی ملایم + خط نور هم‌رنگ */
.grid-dash .dash-card { --tint: var(--accent-2); }
#live-card { --tint: #059669; }        /* کلاس‌های زنده — سبز برند */
#bday-card { --tint: #db2777; }        /* تولدها — صورتی */
#staff-card { --tint: #2563eb; }       /* کارکنان — آبی */
#alert-card { --tint: #dc2626; }       /* هشدارها — قرمز */
#disc-alert-card { --tint: #d97706; }  /* انضباط — کهربایی */
#rem-card { --tint: #0d9488; }         /* یادآوری‌ها — فیروزه‌ای */
#events-card { --tint: #7c3aed; }      /* رویدادها — بنفش */

.grid-dash .dash-card {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--tint) 6%, transparent), transparent 42%),
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--tint) 30%, transparent), transparent) top/100% 1px no-repeat,
    var(--paper);
}
.grid-dash .dash-card::before {
  content: ''; position: absolute; top: 12px; bottom: 12px; right: 0;
  width: 3.5px; border-radius: 4px 0 0 4px;
  background: linear-gradient(180deg, var(--tint), color-mix(in srgb, var(--tint) 50%, transparent));
  box-shadow: 0 0 12px color-mix(in srgb, var(--tint) 40%, transparent);
  pointer-events: none;
}
.grid-dash .dash-card h3 .ic { color: var(--tint); }
[data-theme="dark"] .grid-dash .dash-card {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--tint) 10%, transparent), transparent 44%),
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--tint) 32%, transparent), transparent) top/100% 1px no-repeat,
    var(--paper);
}
[data-theme="dark"] .grid-dash .dash-card h3 .ic { color: color-mix(in srgb, var(--tint) 68%, #a7d8c8); }

/* — مودال امضایی: ورود با منحنی برند + هاله سبز اطراف —
   (فاز ۴: انیمیشن با سیستم اصلی یکدست شد — modalIn فنری — هاله و پس‌زمینه حفظ) */
.modal-back { background: rgba(5, 24, 20, .52); }
.modal {
  animation: modalIn var(--dur-big) var(--ease-spring) backwards;
  box-shadow: var(--shadow-lg), 0 0 70px color-mix(in srgb, var(--accent-2) 14%, transparent);
}
.modal-head { box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .14); }

/* — توست: برق لبه بالایی + سایه نرم‌تر — */
.toast { box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .09); }

/* — empty state: هاله نور پشت تصویرسازی — */
.empty .e-ill { filter: drop-shadow(0 8px 20px color-mix(in srgb, var(--accent-2) 26%, transparent)); }
/* ===============
   مرحله ۶ — اسپلش و ورود (سینمایی ۲.۰)
   =============== */

/* — اسپلش: هاله‌های Aurora + تپش ملایم پشت لوگو — */
#boot-splash {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26'%3E%3Ccircle cx='3' cy='3' r='1.2' fill='%23ffffff' fill-opacity='.05'/%3E%3Ccircle cx='16' cy='16' r='1.2' fill='%23ffffff' fill-opacity='.05'/%3E%3C/svg%3E"),
    radial-gradient(1200px 800px at 50% 40%, rgba(16, 185, 129, .22), transparent 75%),
    radial-gradient(760px 480px at 12% -6%, rgba(52, 211, 153, .2), transparent 62%),
    radial-gradient(640px 420px at 90% 108%, rgba(245, 158, 11, .17), transparent 62%),
    radial-gradient(540px 360px at 72% 22%, rgba(139, 92, 246, .13), transparent 62%),
    linear-gradient(200deg, #124d42 0%, var(--side) 45%, #082621 100%);
}
.splash-inner::before {
  content: ''; position: absolute; top: 50%; left: 50%; z-index: -1;
  width: 420px; height: 420px; transform: translate(-50%, -58%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, .16), rgba(16, 185, 129, .1) 45%, transparent 70%);
  animation: splashBreath 3.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes splashBreath {
  0%, 100% { opacity: .65; transform: translate(-50%, -58%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -58%) scale(1.09); }
}
/* شناور شدن آرام لوگو بعد از فرود */
.splash-inner img {
  animation: splashPop .9s cubic-bezier(.2, .9, .3, 1.2),
             logoFloat 3.2s ease-in-out 1s infinite alternate;
}
@keyframes logoFloat {
  from { transform: translateY(0); }
  to { transform: translateY(-9px); }
}
/* درخشش جاروب‌شونده روی نام طلایی
   ⚠ شورت‌هند background هر longhand قبلی (از جمله background-clip:text) را
   ریست می‌کند؛ پس clip باید بعد از آن دوباره اعلام شود — وگرنه نام به
   مستطیل توپر طلایی تبدیل می‌شود */
.splash-name {
  background: linear-gradient(115deg, #fef3c7 5%, #fbbf24 45%, #f59e0b 75%, #b45309 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: splashName .9s ease backwards .15s, nameShine 2.6s linear 1.2s infinite;
}
@keyframes nameShine {
  0% { background-position: 110% 0; }
  100% { background-position: -110% 0; }
}
/* ورود گام‌ها: هر گام از پایین سُر می‌خورد و تیکش می‌پرد */
#splash-steps .s-step {
  animation: stepIn .3s var(--ease) backwards;
}
@keyframes stepIn {
  from { opacity: 0; transform: translateY(7px); }
}
/* نوار پیشرفت ظریف لبه پایین اسپلش */
#boot-splash::after {
  content: ''; position: absolute; bottom: 0; right: 0; left: 0; height: 2.5px;
  background: linear-gradient(90deg, transparent, var(--gold), rgba(52, 211, 153, .8), transparent);
  background-size: 50% 100%;
  animation: splashBar 2.2s linear infinite;
  opacity: .8; pointer-events: none;
}
@keyframes splashBar {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* — صفحه ورود: کارت بالای لایهٔ هاله‌ها — */
.login-card { z-index: 1; }
/* ورود کارت: بالا آمدن نرم از پایین */
.login-card { animation: loginCardIn .55s var(--ease) backwards .1s; }
@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(22px) scale(.97); }
}
/* هاله لوگوی ورود: تنفس حلقه طلایی */
.login-logo { animation: loginLogoPulse 2.8s ease-in-out infinite; }
@keyframes loginLogoPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(251, 191, 36, .45), 0 14px 34px rgba(245, 158, 11, .4); }
  50% { box-shadow: 0 0 0 5px rgba(251, 191, 36, .3), 0 14px 44px rgba(245, 158, 11, .55); }
}

/* ============================================================
   ورود سینمایی (فاز ۷) — همه یک‌باره (بدون لوپ تازه: سقف ۳ لوپ
   محیطی صفحه ورود از قبل پر است: پترن، هاله‌ها، تنفس لوگو)
   ============================================================ */
.login-card { position: relative; isolation: isolate; }
/* ۱) هالهٔ طلایی پشت کارت: یک‌بار می‌نشیند و آرام می‌ماند */
.login-card::before {
  content: ''; position: absolute; inset: -14px; z-index: -1;
  border-radius: var(--radius-xl);
  background: radial-gradient(62% 56% at 50% 10%, rgba(251, 191, 36, .42), transparent 72%);
  filter: blur(12px); opacity: 0;
  animation: loginAura 1.4s var(--ease-out) .08s forwards;
  pointer-events: none;
}
@keyframes loginAura {
  from { opacity: 0; transform: scale(.94); }
  60% { opacity: .9; }
  to { opacity: .5; transform: scale(1); }
}
/* ۲) جاروب نور روی شیشهٔ کارت — فقط transform (کامپوزیتوری) */
.login-sheen {
  position: absolute; inset: 0; border-radius: inherit; overflow: hidden;
  pointer-events: none; z-index: 2;
}
.login-sheen::before {
  content: ''; position: absolute; top: -30%; bottom: -30%; left: -45%; width: 45%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .6), transparent);
  /* حالت پایه = حالت پایانی (کامل بیرون از کارت) تا هیچ بازمانده‌ای روی شیشه نماند */
  transform: translateX(340%) skewX(-18deg);
  opacity: 0;
  animation: loginSheen 1s var(--ease) .45s backwards;
}
/* نور با تمام‌شدن انیمیشن محو می‌شود؛ بدون fill-forwards هم چیزی روی کارت جا نمی‌ماند */
@keyframes loginSheen {
  0%   { transform: translateX(0) skewX(-18deg); opacity: 0; }
  12%  { opacity: 1; }
  82%  { opacity: 1; }
  100% { transform: translateX(340%) skewX(-18deg); opacity: 0; }
}
/* ۳) برند: لوگو + واردمارک طلایی */
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.login-wordmark {
  direction: ltr; font-size: 13px; font-weight: 800; letter-spacing: 6px;
  text-transform: uppercase; color: transparent;
  background: var(--grad-gold); -webkit-background-clip: text; background-clip: text;
}
/* ۴) کسکید ورود اجزای کارت — هر جزء کمی بعد از قبلی (یک‌باره، backwards) */
.login-card > * { animation: loginStepIn .55s var(--ease-out) backwards; }
.login-card > :nth-child(1) { animation-delay: .06s; }
.login-card > :nth-child(2) { animation-delay: .12s; }
.login-card > :nth-child(3) { animation-delay: .18s; }
.login-card > :nth-child(4) { animation-delay: .24s; }
.login-card > :nth-child(5) { animation-delay: .30s; }
.login-card > :nth-child(6) { animation-delay: .35s; }
.login-card > :nth-child(7) { animation-delay: .40s; }
.login-card > :nth-child(8) { animation-delay: .45s; }
.login-card > :nth-child(n+9) { animation-delay: .50s; }
@keyframes loginStepIn {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}
/* فیلدهای ورود: هاله سبز هنگام تایپ */
.login-card .field input:focus {
  border-color: var(--accent-2) !important;
  box-shadow: 0 0 0 3.5px rgba(5, 150, 105, .16);
}
/* ---------- حضور زنده (آنلاین‌ها) — تب «کاربران و اتصال» ---------- */
.online-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--good, #16a34a);
  margin-inline-end: 6px;
  flex-shrink: 0;
  animation: onlinePulse 2.2s ease-in-out infinite;
}
@keyframes onlinePulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(34, 197, 94, .22); }
  50%      { box-shadow: 0 0 0 6px rgba(34, 197, 94, .10); }
}
.onl-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line, rgba(255,255,255,.1));
  border-radius: var(--radius-md, 12px);
  margin-bottom: 8px;
  background: rgba(255,255,255,.04);
}
.onl-row small { line-height: 1.8; }
/* نقطهٔ «قبلاً آنلاین بوده» (کهربایی ساکن) و «هرگز آنلاین نشده» (خاکستری) */
.seen-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent, #f59e0b);
  margin-inline-end: 6px;
  flex-shrink: 0;
}
.seen-dot.never {
  background: var(--muted, #6b7280);
  opacity: .7;
}
.tbl-scroll { overflow-x: auto; }

/* ============================================================
   داشبورد ۲.۰ (۲۰۲۶-۱۱-۲۲)
   دسترسی سریع · مرکز اقدام · روند ۷ روز · زنگ جاری · تراکم
   ============================================================ */

/* — هویت رنگی دو کارت تازه (هم‌خانوادهٔ تینت‌های مرحله ۵) — */
#action-card { --tint: #d97706; }   /* مرکز اقدام — کهربایی */
#trend-card { --tint: #0ea5e9; }    /* روند حضور — آبی آسمانی */

/* — نوار دسترسی سریع — */
.dash-quick {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 14px 0 2px;
}
.dash-qa {
  display: flex; align-items: center; gap: 9px;
  text-align: start; cursor: pointer; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 9px 12px;
  transition: border-color var(--dur) ease, background var(--dur) ease, transform var(--dur) ease;
}
.dash-qa:hover {
  border-color: color-mix(in srgb, var(--accent-2) 45%, var(--line));
  background: color-mix(in srgb, var(--accent-2) 6%, var(--paper));
}
.dash-qa:active { transform: scale(.985); }
.qa-ic {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent-2) 12%, transparent);
  color: var(--side);
}
[data-theme="dark"] .qa-ic { color: #a7d8c8; background: rgba(167, 216, 200, .12); }
.qa-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.qa-txt b { font-size: var(--fs-sm); }
.qa-txt small { font-size: var(--fs-2xs); color: var(--muted); font-weight: 600; }
.qa-help { opacity: .86; }
.qa-help .qa-ic { font-weight: 800; font-size: var(--fs-md); }

/* — کارت روند ۷ روز — */
.trend-head { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.trend-kpi {
  flex: 1 1 92px; min-width: 0;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 7px 10px;
}
.trend-kpi b {
  display: block; font-size: var(--fs-lg); font-weight: 800;
  color: var(--side); font-variant-numeric: tabular-nums; white-space: nowrap;
}
[data-theme="dark"] .trend-kpi b { color: #a7d8c8; }
.trend-kpi b.up { color: var(--good); }
.trend-kpi b.down { color: var(--bad); }
.trend-kpi span { font-size: var(--fs-2xs); color: var(--muted); font-weight: 600; }
.trend-chart {
  display: flex; align-items: stretch; gap: 6px;
  height: 112px; padding-top: 4px;
  border-bottom: 1px solid var(--line);
}
.trend-col {
  flex: 1 1 0; min-width: 0; height: 100%;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  justify-items: center; align-items: end; gap: 3px;
  cursor: default;
}
.trend-col b { font-size: var(--fs-2xs); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.trend-col > span { font-size: var(--fs-2xs); color: var(--muted); white-space: nowrap; }
.trend-bar {
  display: block; width: 100%; max-width: 32px; min-height: 3px;
  align-self: end; border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-2) 78%, #fff), var(--accent-2));
  transition: height .45s var(--ease);
}
.trend-col.is-empty .trend-bar { background: var(--line); }
.trend-col.is-today .trend-bar { background: linear-gradient(180deg, var(--gold), #d97706); }
.trend-col.is-low .trend-bar { background: linear-gradient(180deg, #f87171, var(--bad)); }
.trend-foot {
  display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  margin-top: 8px; font-size: var(--fs-xs); color: var(--muted);
}
.trend-foot b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* — مرکز اقدام — */
.action-empty { display: flex; align-items: center; gap: 10px; padding: 8px 2px; color: var(--good); }
.action-empty .ic { flex: none; }
.action-empty strong { font-size: var(--fs-sm); }
.action-empty p { margin: 1px 0 0; font-size: var(--fs-xs); }
.action-row {
  display: flex; align-items: center; gap: 9px; width: 100%;
  text-align: start; background: none; border: 0;
  border-bottom: 1px dashed var(--line); padding: 9px 2px;
  cursor: pointer; color: var(--ink);
}
.action-row:last-child { border-bottom: 0; }
.action-row:hover { background: color-mix(in srgb, var(--side) 4%, transparent); }
.ar-ic {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--warn) 13%, transparent); color: var(--warn);
}
.action-row.tone-bad .ar-ic { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.action-row.tone-info .ar-ic { background: color-mix(in srgb, var(--info) 12%, transparent); color: var(--info); }
.action-row.tone-gold .ar-ic { background: color-mix(in srgb, var(--gold) 16%, transparent); color: #b45309; }
.ar-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.ar-txt b { font-size: var(--fs-sm); font-weight: 700; }
.ar-txt small { font-size: var(--fs-2xs); color: var(--muted); }
.ar-n { font-weight: 800; font-size: var(--fs-md); color: var(--side); font-variant-numeric: tabular-nums; }
[data-theme="dark"] .ar-n { color: #a7d8c8; }
.ar-go { display: flex; color: var(--muted); transition: color var(--dur) ease, transform var(--dur) ease; }
.action-row:hover .ar-go { color: var(--accent-2); transform: translateX(-2px); }

/* در چیدمان پشته‌ایِ نوار وضعیت، flex-basis:320px نباید به «ارتفاع» نوار
   تبدیل شود وگرنه کاشی‌ها ۳۲۰ پیکسل بلند می‌شوند؛ ارتفاع را به محتوا می‌سپاریم. */
.dash-hero-in.hero-stacked .dash-chips { flex: 0 0 auto; height: auto; }

/* — کاشی «زنگ جاری» — */
.hero-tile.t-period { min-width: 96px; }
.hero-tile.t-period .hp-main {
  max-width: 100%; font-size: var(--fs-sm); font-weight: 800; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hero-tile.t-period .hp-sub { font-size: var(--fs-2xs); color: var(--muted); white-space: nowrap; }
.hero-tile.t-period .hp-bar {
  display: block; width: 100%; height: 3px; margin-top: 3px;
  border-radius: 99px; background: var(--line); overflow: hidden;
}
.hero-tile.t-period .hp-bar i {
  display: block; height: 100%; width: 0;
  background: var(--accent-2); border-radius: 99px;
  transition: width .6s var(--ease);
}
.hero-tile.t-period.is-live .hp-bar i { background: linear-gradient(90deg, var(--accent-2), var(--gold)); }

/* — کارت حضور: کل کارت قابل کلیک است — */
.att-card[role="button"] { cursor: pointer; }
.att-card[role="button"]:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
.att-go {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-2xs); font-weight: 700; color: var(--side);
}
.att-card[role="button"]:hover .att-go { color: var(--accent-2); }
[data-theme="dark"] .att-go { color: #a7d8c8; }

/* — سرستون چسبان جدول کلاس‌ها (فقط وقتی جدول واقعاً اسکرول دارد) — */
.live-table-wrap { max-height: min(62vh, 640px); overflow: auto; }
.live-table thead th { position: sticky; top: 0; z-index: 3; background: var(--paper); box-shadow: 0 1px 0 var(--line); }
@container (max-width: 640px) { .live-table-wrap { max-height: none; overflow: visible; margin: 0; padding: 0; } }

/* — تنظیمات چیدمان/تراکم داخل مودال ⚙ — */
.dash-prefs {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line);
}
.dash-prefs .field { flex: 1 1 190px; }
.seg-row { display: flex; gap: 7px; flex-wrap: wrap; }
.seg-row label {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: var(--fs-sm); padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 999px;
}
.seg-row label:has(input:checked) {
  border-color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 9%, transparent);
}
.seg-row input { width: auto; margin: 0; }

/* — حالت تراکم فشرده — */
body.dash-compact .card.dash-card { padding-top: 9px; padding-bottom: 9px; }
body.dash-compact .card.dash-card h3 { margin-bottom: 6px; }
body.dash-compact .dash-card .class-pill { padding-top: 3px; padding-bottom: 3px; }
body.dash-compact .dash-quick { gap: 6px; }
body.dash-compact .dash-qa { padding: 6px 10px; }
body.dash-compact .live-table td { padding-top: 5px; padding-bottom: 5px; }
body.dash-compact .trend-chart { height: 86px; }

/* — چیدمان دو ستون متوازن (کلاس قدیمی dash-bento هم پشتیبانی می‌شود) — */
body.dash-bento .grid-dash { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
/* روی پنجره/تبلت باریک، حتی اگر «متوازن» انتخاب شده باشد، تک‌ستونی می‌مانیم
   تا کارت‌ها به هم فشرده نشوند (قاعدهٔ بالاتر و قدیمی‌تر را هم خنثی می‌کند). */
@media (max-width: 1100px) {
  body.dash-bento .grid-dash { grid-template-columns: 1fr; }
}

/* — میانبرهای صفحه — */
.kbd-list { display: flex; flex-direction: column; gap: 4px; }
.kbd-list > div {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 2px; border-bottom: 1px dashed var(--line);
}
.kbd-list > div:last-child { border-bottom: 0; }
.kbd-list kbd {
  min-width: 36px; text-align: center; padding: 3px 8px;
  border-radius: 7px; border: 1px solid var(--line);
  background: var(--surface-2); font-family: inherit;
  font-size: var(--fs-xs); font-weight: 800;
}
.kbd-list span { font-size: var(--fs-sm); }

/* ============================================================
   داشبورد ۳.۰ (۲۰۲۶-۱۱-۲۲)
   هیروی تیرهٔ زمردی · کارت حضور پرمیوم · سرستون یکدست ماژول‌ها
   ============================================================ */

/* ————— ردیف بالا: کارت حضور + هیرو ————— */
.dash-hero-row {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 16px;
}

/* ————— کارت «حضور امروز» — نسخهٔ پرمیوم ————— */
.card.dash-card.att-card {
  position: relative;
  overflow: hidden;
  padding: 16px 18px;
  border-color: color-mix(in srgb, var(--accent-2) 22%, var(--line));
  background:
    radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--accent-2) 12%, transparent), transparent 62%),
    linear-gradient(180deg, var(--paper), color-mix(in srgb, var(--accent-2) 4%, var(--paper)));
}
.att-card::after {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--accent-2), #34d399 55%, var(--gold));
}
.att-card .att-main { gap: 12px 16px; }
.att-card .att-donut, .att-card .att-donut svg { width: 96px; height: 96px; }
.att-card .donut .d-num { font-size: 20px; font-weight: 800; }
.att-eyebrow {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--fs-2xs); font-weight: 800; letter-spacing: .2px;
  color: var(--accent-2);
}
.att-card .att-title {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 30px; font-weight: 800; line-height: 1.1;
  letter-spacing: -.5px; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.att-card .att-title small {
  font-size: var(--fs-xs); font-weight: 700; color: var(--muted);
  letter-spacing: 0;
}
.att-card .att-sub { font-size: var(--fs-2xs); }
.att-card .att-go { margin-top: 2px; }
.att-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px; margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.att-stats .am {
  display: flex; flex-direction: column; gap: 1px;
  padding: 6px 8px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line);
  min-width: 0;
}
.att-stats .am span {
  font-size: var(--fs-3xs); color: var(--muted); font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.att-stats .am b {
  font-size: var(--fs-md); font-weight: 800;
  font-variant-numeric: tabular-nums; line-height: 1.3;
}
.att-stats .am-present b { color: var(--good); }
.att-stats .am-absent b { color: var(--bad); }
.att-stats .am-late b { color: var(--warn); }
.att-stats .am-miss b { color: var(--muted); }

/* ————— هیروی تیرهٔ زمردی ————— */
.dash-hero {
  --hero-ink: #f2fbf7;
  --hero-mut: rgba(226, 248, 240, .68);
  border: 1px solid rgba(255, 255, 255, .08);
  background:
    radial-gradient(120% 170% at 100% 0%, #0f766e 0%, transparent 58%),
    radial-gradient(95% 150% at 0% 100%, #065f46 0%, transparent 56%),
    linear-gradient(135deg, #0b3d34 0%, #0d4a3e 48%, #082f2a 100%);
  box-shadow: 0 18px 40px -20px rgba(8, 47, 42, .6), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.dash-hero-bg {
  background:
    radial-gradient(circle at 16% 22%, rgba(245, 158, 11, .16), transparent 42%),
    radial-gradient(circle at 84% 88%, rgba(16, 185, 129, .24), transparent 48%);
}
.dash-hero-in {
  flex-direction: column; align-items: stretch;
  gap: 14px; padding: 16px 18px;
}
.dash-hero-top {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px 22px; flex-wrap: wrap;
}
.dash-hero .dash-hello-txt {
  color: var(--hero-ink);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .18);
}
.dash-hero .dash-hello-sub { color: var(--hero-mut); }
.dash-hero .dash-hello-sub .h-role {
  background: rgba(255, 255, 255, .13);
  color: #d9f7ec;
}
.dash-hero .dash-hello-sub .h-dot { background: rgba(255, 255, 255, .3); }
.dash-hero .dash-hello-sub svg { color: var(--hero-mut); }

/* کاشی‌های شیشه‌ای وضعیت داخل هیرو */
.dash-hero .dash-chips {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px; flex: none; width: 100%;
}
.dash-hero .hero-tile {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  padding: 8px 10px;
  backdrop-filter: blur(4px);
}
.dash-hero .hero-tile + .hero-tile {
  border-inline-start: 1px solid rgba(255, 255, 255, .1);
  border-start-start-radius: 12px; border-end-start-radius: 12px;
}
.dash-hero .hero-tile:hover { background: rgba(255, 255, 255, .13); }
.dash-hero .hero-tile:hover + .hero-tile { border-inline-start-color: rgba(255, 255, 255, .1); }
.dash-hero .hero-tile.is-warn { background: rgba(245, 158, 11, .2); }
.dash-hero .hero-tile-lab { color: var(--hero-mut); }
.dash-hero .hero-tile .top-chip,
.dash-hero .hero-tile .topbar-clock,
.dash-hero .hero-tile .topbar-date { color: var(--hero-ink); }
.dash-hero .hero-tile .cell-s { color: var(--hero-mut); }
.dash-hero .hero-tile .cell-ic .ic { color: rgba(214, 245, 234, .78); }
.dash-hero .hero-tile.t-now #top-clock { color: var(--hero-ink); }
.dash-hero .hero-tile.t-air #top-weather .cell-e { color: #a7f3d0; }
.dash-hero .hero-tile.t-air #top-weather.warn .cell-v { color: #fca5a5; }
.dash-hero .hero-tile.t-live #top-server .cell-ic .ic,
.dash-hero .hero-tile.t-live #top-server .ok-dot { color: #6ee7b7; background-color: #6ee7b7; }
.dash-hero .hero-tile.t-live #top-server.warn .cell-ic .ic,
.dash-hero .hero-tile.t-live #top-server.warn .ok-dot { color: #fca5a5; background-color: #fca5a5; }
.dash-hero .hero-tile.t-msg #top-sms .cell-ic .ic { color: #93c5fd; }
.dash-hero .hero-tile.t-msg #top-sms.warn .cell-ic .ic { color: #fcd34d; }
.dash-hero .hero-tile.t-bell .icon-btn,
.dash-hero .hero-tile.t-vis .icon-btn { color: #d9f7ec; }
.dash-hero .hero-tile.t-bell .icon-btn svg,
.dash-hero .hero-tile.t-vis .icon-btn svg { color: #d9f7ec; }
.dash-hero .hero-tile.t-bell:hover .icon-btn svg,
.dash-hero .hero-tile.t-vis:hover .icon-btn svg { color: #fcd34d; }
.dash-hero .hero-tile.t-act .act-main { color: var(--hero-ink); }
.dash-hero .hero-tile.t-act .cell-s { color: var(--hero-mut); }
.dash-hero .hero-tile.t-act .cell-ic .ic { color: #fcd34d; }
.dash-hero .hero-tile.t-act:not(.is-warn) .cell-ic .ic { color: #6ee7b7; }
.dash-hero .hero-tile.t-period .hp-main { color: var(--hero-ink); }
.dash-hero .hero-tile.t-period .hp-sub { color: var(--hero-mut); }
.dash-hero .hero-tile.t-period .hp-bar { background: rgba(255, 255, 255, .16); }
.dash-hero .hero-tile.t-period .hp-bar i { background: #6ee7b7; }
.dash-hero .hero-tile.t-period.is-live .hp-bar i { background: linear-gradient(90deg, #34d399, #fbbf24); }

/* — نوار پیشرفت سال تحصیلی — */
.dash-year {
  flex: 1 1 230px; max-width: 360px; min-width: 200px;
  padding: 9px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .12);
  color: #eafaf3;
}
.dy-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; font-size: var(--fs-2xs); font-weight: 700;
}
.dy-row span { color: var(--hero-mut); }
.dy-row b { color: #fde68a; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dy-bar {
  height: 5px; border-radius: 99px; margin: 6px 0 4px;
  background: rgba(255, 255, 255, .16); overflow: hidden;
}
.dy-bar i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #fbbf24, #34d399);
  transition: width .5s var(--ease);
}
.dy-sub { font-size: var(--fs-3xs); color: var(--hero-mut); font-weight: 600; }

/* ————— سرستون یکدست ماژول‌های داشبورد ————— */
#cal-card { --tint: #0ea5e9; }
.dmod {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 12px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.dmod-ic {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  color: var(--tint, var(--accent-2));
  background: color-mix(in srgb, var(--tint, var(--accent-2)) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--tint, var(--accent-2)) 24%, transparent);
}
.dmod-txt {
  min-width: 0; flex: 1 1 auto;
  display: flex; flex-direction: column; gap: 1px;
}
.dmod-txt h3 {
  margin: 0; font-size: var(--fs-md); font-weight: 800; line-height: 1.45;
  color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dmod-txt small {
  font-size: var(--fs-2xs); color: var(--muted); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dmod-act {
  flex: none; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  justify-content: flex-end;
}
.dmod-act .live-fresh { gap: 6px; }

/* ————— تایم‌لاین زنگ‌ها: پنل جمع‌وجور داخل کارت کلاس‌ها ————— */
#live-card .bell-wrap {
  margin: 4px 0 12px; padding: 9px 12px 7px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
}
#live-card .bell-timeline {
  margin: 0 0 8px; height: 28px;
  background: var(--paper);
  border-radius: 9px;
}
#live-card .bl-seg { top: 5px; height: 18px; border-radius: 6px; }
#live-card .bell-meta { margin-top: 0; }

/* ————— دسترسی سریع: کاشی‌های رنگی ————— */
.dash-quick {
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 10px; margin: 16px 0 2px;
}
.dash-qa {
  --qa: var(--accent-2);
  position: relative; overflow: hidden;
  gap: 10px; padding: 11px 12px;
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(23, 37, 45, .04);
  transition: border-color var(--dur) ease, background var(--dur) ease,
              transform var(--dur) ease, box-shadow var(--dur) ease;
}
.dash-qa::before {
  content: ''; position: absolute; inset-inline-start: 0; top: 10px; bottom: 10px;
  width: 3px; border-radius: 99px; background: var(--qa); opacity: .85;
}
.dash-qa:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--qa) 48%, var(--line));
  background: var(--paper);
  box-shadow: 0 12px 26px -14px color-mix(in srgb, var(--qa) 62%, transparent);
}
.dash-qa[data-qa="attendance"] { --qa: #059669; }
.dash-qa[data-qa="reports"] { --qa: #d97706; }
.dash-qa[data-qa="students"] { --qa: #2563eb; }
.dash-qa[data-qa="schedule"] { --qa: #7c3aed; }
.dash-qa[data-qa="stats"] { --qa: #0ea5e9; }
.dash-qa[data-qa="print"] { --qa: #64748b; }
.dash-qa[data-qa="notebook"] { --qa: #db2777; }
.dash-qa[data-qa="help"] { --qa: #0d9488; }
.dash-qa .qa-ic {
  width: 36px; height: 36px; border-radius: 11px;
  background: color-mix(in srgb, var(--qa) 13%, transparent);
  color: var(--qa);
}
.dash-qa .qa-txt b { font-size: var(--fs-sm); font-weight: 800; }
.dash-qa .qa-txt small { font-size: var(--fs-3xs); }
.qa-help .qa-ic { font-size: var(--fs-md); font-weight: 800; }

/* ————— خلاصهٔ زندهٔ کلاس‌ها + فیلترها ————— */
.live-summary {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px; margin: 2px 0 12px;
}
.ls-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px; padding: 7px 10px;
  border-radius: 10px; background: var(--surface-2);
  border: 1px solid var(--line); min-width: 0;
}
.ls-item span {
  font-size: var(--fs-2xs); color: var(--muted); font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ls-item b {
  font-size: var(--fs-md); font-weight: 800;
  font-variant-numeric: tabular-nums; color: var(--side);
}
[data-theme="dark"] .ls-item b { color: #a7d8c8; }
.ls-item.ls-ok {
  background: color-mix(in srgb, var(--good) 8%, var(--surface-2));
  border-color: color-mix(in srgb, var(--good) 22%, var(--line));
}
.ls-item.ls-ok b { color: var(--good); }
.ls-item.ls-warn {
  background: color-mix(in srgb, var(--warn) 8%, var(--surface-2));
  border-color: color-mix(in srgb, var(--warn) 24%, var(--line));
}
.ls-item.ls-warn b { color: var(--warn); }
.ls-item.ls-bad {
  background: color-mix(in srgb, var(--bad) 7%, var(--surface-2));
  border-color: color-mix(in srgb, var(--bad) 22%, var(--line));
}
.ls-item.ls-bad b { color: var(--bad); }
.live-filters { margin: 6px 0 12px; gap: 7px; }
.live-filter {
  padding: 5px 12px;
  background: var(--surface-2);
  transition: background var(--dur) ease, border-color var(--dur) ease,
              color var(--dur) ease, transform var(--dur) ease;
}
.live-filter:hover { background: var(--paper); transform: translateY(-1px); }
.live-filter.on {
  background: linear-gradient(135deg, var(--accent-2), #059669);
  border-color: transparent;
  box-shadow: 0 5px 14px -6px rgba(4, 120, 87, .65);
}
.live-table th { padding-top: 0; }
.live-table-wrap { margin-top: 2px; }

/* ————— روند ۷ روز: شبکه، میانگین، میله‌های نرم ————— */
#trend-card .trend-head { gap: 8px; margin-bottom: 14px; }
#trend-card .trend-kpi {
  background: linear-gradient(180deg, var(--surface-2), color-mix(in srgb, var(--info) 4%, var(--surface-2)));
  border-radius: var(--radius-md);
}
.trend-chart {
  position: relative; height: 136px;
  padding: 18px 2px 0; gap: 8px;
  background-image: linear-gradient(to top, color-mix(in srgb, var(--line) 85%, transparent) 1px, transparent 1px);
  background-size: 100% 25%;
  background-position: 0 100%;
  border-bottom: 1px solid var(--line);
}
.trend-col b { font-size: var(--fs-2xs); }
.trend-col > span { font-size: var(--fs-2xs); font-weight: 600; }
.trend-bar {
  max-width: 30px; border-radius: 7px 7px 3px 3px;
  box-shadow: 0 3px 10px -5px color-mix(in srgb, var(--accent-2) 70%, transparent);
}
.trend-col.is-today .trend-bar {
  box-shadow: 0 3px 12px -5px rgba(217, 119, 6, .8);
}
.trend-avg {
  position: absolute; inset-inline: 0;
  bottom: calc(18px + (100% - 42px) * var(--avg) / 100);
  border-top: 1.5px dashed color-mix(in srgb, var(--gold) 78%, transparent);
  pointer-events: none;
}
.trend-avg span {
  position: absolute; inset-inline-start: 0; top: -17px;
  font-size: var(--fs-3xs); font-weight: 800; color: #b45309;
  background: var(--paper); padding: 0 5px; border-radius: 5px;
  border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line));
}
[data-theme="dark"] .trend-avg span { color: #fcd34d; }
.trend-foot {
  margin-top: 10px; padding-top: 8px;
  border-top: 1px dashed var(--line);
}

/* ————— مرکز اقدام ————— */
#action-card .dmod-act .badge { font-size: var(--fs-2xs); }
.action-row {
  border-bottom: 0; border-radius: 10px;
  padding: 9px 8px; margin-bottom: 3px;
  animation: dashRowIn .32s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 35ms);
}
.action-row:last-child { margin-bottom: 0; }
.action-row:hover { background: color-mix(in srgb, var(--side) 5%, transparent); }
.ar-ic { width: 32px; height: 32px; border-radius: 10px; }
.ar-n {
  min-width: 30px; text-align: center;
  padding: 2px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--warn) 12%, transparent);
}
.action-row.tone-bad .ar-n { background: color-mix(in srgb, var(--bad) 11%, transparent); color: var(--bad); }
.action-row.tone-info .ar-n { background: color-mix(in srgb, var(--info) 11%, transparent); color: var(--info); }
.action-row.tone-gold .ar-n { background: color-mix(in srgb, var(--gold) 16%, transparent); color: #b45309; }
.action-row.tone-good .ar-n { background: color-mix(in srgb, var(--good) 11%, transparent); color: var(--good); }
@keyframes dashRowIn {
  from { opacity: 0; transform: translateY(6px); }
}

/* ————— ردیف افراد (تولدها / کادر) ————— */
.dash-person {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 2px; border-bottom: 1px dashed var(--line);
}
.dash-person:last-child { border-bottom: 0; }
.dp-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-size: var(--fs-sm); font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #db2777, #f472b6);
  box-shadow: 0 3px 8px -3px rgba(219, 39, 119, .55);
}
.dp-avatar.staff {
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  box-shadow: 0 3px 8px -3px rgba(37, 99, 235, .55);
}
.dp-main {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column; line-height: 1.45;
}
.dp-main strong {
  font-size: var(--fs-sm); font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dp-main small {
  font-size: var(--fs-3xs); color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-person .badge { flex: none; }
.dash-subhead {
  display: flex; align-items: center; gap: 6px;
  margin: 14px 0 2px; padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-xs); font-weight: 800; color: var(--side);
}
.dash-subhead span { font-size: var(--fs-3xs); font-weight: 600; color: var(--muted); }
[data-theme="dark"] .dash-subhead { color: #a7d8c8; }

/* ————— ردیف هشدارها ————— */
.dash-alert-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 9px; border-radius: 10px;
  border: 1px solid transparent;
}
.dash-alert-row + .dash-alert-row { margin-top: 5px; }
.dash-alert-row.is-critical {
  background: color-mix(in srgb, var(--bad) 7%, transparent);
  border-color: color-mix(in srgb, var(--bad) 18%, transparent);
}
.dash-alert-row.is-warn {
  background: color-mix(in srgb, var(--warn) 7%, transparent);
  border-color: color-mix(in srgb, var(--warn) 17%, transparent);
}
.dash-alert-row.is-disc {
  background: color-mix(in srgb, var(--gold) 8%, transparent);
  border-color: color-mix(in srgb, var(--gold) 22%, transparent);
  cursor: pointer;
  transition: background var(--dur) ease, border-color var(--dur) ease;
}
.dash-alert-row.is-disc:hover {
  background: color-mix(in srgb, var(--gold) 14%, transparent);
  border-color: color-mix(in srgb, var(--gold) 38%, transparent);
}
.dar-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--warn);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 16%, transparent);
}
.is-critical .dar-dot {
  background: var(--bad);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 16%, transparent);
}
.is-disc .dar-dot {
  background: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent);
}
.dar-main {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column; line-height: 1.45;
}
.dar-main strong { font-size: var(--fs-sm); font-weight: 700; }
.dar-main small {
  font-size: var(--fs-3xs); color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-alert-row .badge { flex: none; }
.dash-empty-inline {
  display: flex; align-items: center; gap: 9px;
  padding: 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--good) 8%, transparent);
  border: 1px dashed color-mix(in srgb, var(--good) 32%, transparent);
  color: var(--good); font-size: var(--fs-sm); font-weight: 600;
}
.dash-empty-inline .ic { flex: none; }
.dash-empty-inline.ok { color: var(--good); }
.dash-empty-inline.neutral {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--muted);
}

/* ————— رویدادهای پیش رو ————— */
.dash-event {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 2px; border-bottom: 1px dashed var(--line);
}
.dash-event:last-child { border-bottom: 0; }
.de-date {
  width: 46px; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 5px 0; border-radius: 10px; line-height: 1.2;
  background: color-mix(in srgb, #7c3aed 9%, var(--surface-2));
  border: 1px solid color-mix(in srgb, #7c3aed 20%, var(--line));
}
.de-date b {
  font-size: var(--fs-md); font-weight: 800; color: #6d28d9;
  font-variant-numeric: tabular-nums;
}
.de-date span { font-size: var(--fs-3xs); color: var(--muted); }
[data-theme="dark"] .de-date b { color: #c4b5fd; }
.de-main {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column; line-height: 1.45;
}
.de-main strong {
  font-size: var(--fs-sm); font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.de-main small {
  font-size: var(--fs-3xs); color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-event .badge { flex: none; }

/* ————— یادآوری: گروه فیلدهای جعبه‌ای ————— */
.rem-fields {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px; align-items: center; margin-top: 4px;
}
.rem-fields .rem-inp { grid-column: 1 / -1; width: 100%; min-width: 0; }
.rem-fields .rem-mini { width: 100%; min-width: 0; }
.rem-fields .rem-inp, .rem-fields .rem-mini {
  padding: 9px 12px; border-radius: 11px;
  background: var(--surface-2);
}
.rem-fields .btn { padding: 9px 12px; white-space: nowrap; }

/* ————— تقویم: سلول‌های مدرن و عدد امروز ————— */
#cal-card { padding-bottom: 18px; }
.cal-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cal-actions .btn { padding: 4px 9px; }
.cal { gap: 6px; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal .day {
  min-height: 82px; min-width: 0; padding: 7px;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--paper);
  transition: transform var(--dur) ease, border-color var(--dur) ease, box-shadow var(--dur) ease;
}
.cal .day-num, .cal .day-titles { min-width: 0; }
.cal .day:hover {
  transform: translateY(-2px);
  border-color: var(--accent-2);
  box-shadow: 0 8px 18px -8px rgba(4, 120, 87, .35);
}
.cal .day.today {
  background: color-mix(in srgb, var(--accent-2) 7%, var(--paper));
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px var(--ring);
}
[data-theme="dark"] .cal .day.today {
  background: color-mix(in srgb, var(--accent-2) 14%, var(--surface-2));
}
.cal .day-num { font-weight: 600; }
.cal .day-n {
  display: inline-grid; place-items: center;
  min-width: 24px; height: 24px; padding: 0 5px;
  border-radius: 8px; font-weight: 800;
  font-variant-numeric: tabular-nums; line-height: 1;
}
.cal .day.today .day-n {
  background: var(--accent-2); color: #fff;
  box-shadow: 0 3px 8px -2px rgba(4, 120, 87, .55);
}
.cal .day.holiday .day-n, .cal .day.weekend .day-n {
  color: #b91c1c; background: rgba(220, 38, 38, .1);
}
[data-theme="dark"] .cal .day.holiday .day-n,
[data-theme="dark"] .cal .day.weekend .day-n {
  color: #fca5a5; background: rgba(220, 38, 38, .16);
}
[data-theme="dark"] .cal .day.holiday,
[data-theme="dark"] .cal .day.weekend {
  background: color-mix(in srgb, #dc2626 12%, var(--surface-2));
  border-color: color-mix(in srgb, #dc2626 30%, var(--line));
}
.cal-legend {
  gap: 12px; padding: 7px 12px;
  border-radius: 10px; margin-bottom: 10px;
  font-size: var(--fs-2xs);
}

/* ————— واکنش‌گرایی ————— */
@media (max-width: 1080px) {
  .dash-hero-row { grid-template-columns: 1fr; }
  .card.dash-card.att-card { padding: 14px 16px; }
}
@media (min-width: 761px) and (max-width: 1080px) {
  .card.dash-card.att-card { flex-direction: row; align-items: center; gap: 18px; }
  .att-card .att-main { flex: 0 1 auto; }
  .att-card .att-stats {
    flex: 1 1 320px; margin-top: 0; padding-top: 0;
    padding-inline-start: 16px; border-top: 0;
    border-inline-start: 1px dashed var(--line);
  }
}
@media (max-width: 860px) {
  .dash-hero-top { align-items: stretch; }
  .dash-year { max-width: none; flex: 1 1 100%; }
  .dash-hero-in { padding: 14px 16px; }
  .dash-hero .dash-chips { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
}
@media (max-width: 640px) {
  .dash-quick { grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); }
  .live-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dmod { flex-wrap: wrap; }
  .dmod-txt h3, .dmod-txt small { white-space: normal; }
  .dmod-act { width: 100%; justify-content: flex-end; }
  .cal .day { min-height: 64px; padding: 5px; }
  .cal .day-alt { display: none; }
  .cal .day-n { min-width: 21px; height: 21px; font-size: var(--fs-2xs); }
  .dash-event, .dash-person { padding: 7px 0; }
  .de-date { width: 40px; }
  .rem-fields { grid-template-columns: 1fr 1fr; }
  .rem-fields .btn { grid-column: 1 / -1; justify-content: center; }
  .trend-chart { height: 118px; }
}
@media (max-width: 460px) {
  .att-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .att-card .att-donut, .att-card .att-donut svg { width: 82px; height: 82px; }
  .att-card .att-title { font-size: 26px; }
  .dash-hero .dash-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-person .badge, .dash-event .badge, .dash-alert-row .badge { font-size: var(--fs-3xs); }
}
@media (prefers-reduced-motion: reduce) {
  .dash-qa:hover, .cal .day:hover, .action-row { transform: none; animation: none; }
}

/* ============================================================
   داشبورد ۴.۰ (۲۰۲۶-۱۱-۲۲)
   نوار عریض بالای صفحه · ماژول کلاس‌ها تمام‌عرض · شبکهٔ سه‌ستونهٔ فشرده
   ============================================================ */

/* ————— هیرو: نوار عریض تمام‌عرض ————— */
.dash-hero-row { display: block; margin-bottom: 0; }
.dash-hero-row .dash-hero { margin-bottom: 0; height: auto; }
.dash-hero-in { flex-direction: column; align-items: stretch; gap: 12px; padding: 16px 20px; }
.dash-hero-top { align-items: center; gap: 10px 18px; }
.dash-hero .dash-hello-txt { font-size: calc(var(--fs-2xl) * .95); }
.dash-hero .dash-chips { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }

/* — دو دکمهٔ ابزار داخل نوار (اعلان‌ها / کارت‌ها) — */
.hero-actions { display: flex; align-items: center; gap: 8px; flex: none; margin-inline-start: auto; }
.hero-act {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 11px; border-radius: 11px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
  cursor: pointer; transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.hero-act:hover { background: rgba(255, 255, 255, .17); border-color: rgba(255, 255, 255, .3); transform: translateY(-1px); }
.hero-act .icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: auto; height: auto; padding: 0; margin: 0;
  border: 0; background: none; box-shadow: none; color: #eafaf3;
}
.hero-act .icon-btn svg { width: 17px; height: 17px; display: block; }
.hero-act.ha-bell .icon-btn svg { color: #fcd34d; }
.hero-act .ha-lab { font-size: var(--fs-2xs); font-weight: 700; color: #d9f7ec; white-space: nowrap; }
.hero-act .n-badge { top: -6px; left: -8px; }

/* ————— دسترسی سریع فشرده‌تر ————— */
.dash-quick { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 14px 0 0; }
.dash-qa { padding: 9px 11px; gap: 9px; }
.dash-qa .qa-ic { width: 32px; height: 32px; border-radius: 10px; }

/* ————— ماژول کلاس‌ها: نوار تمام‌عرض ————— */
.card.dash-card.live-wide { margin: 14px 0 0; padding: 14px 16px; }
.live-wide .live-summary { margin: 2px 0 10px; }
.live-wide .live-table th { padding-top: 4px; }
.live-wide .live-table td { padding-top: 6px; padding-bottom: 6px; }
.live-wide .bell-wrap { margin: 2px 0 10px; }

/* ————— شمارش معکوس رویداد: زیر ماژول کلاس‌ها، نه بالای صفحه ————— */
#event-countdown { margin-top: 14px; }
#event-countdown:empty { display: none; }
.countdown-card { margin: 0; padding: 12px 16px; }
.countdown-card .cd-title { font-size: var(--fs-md); margin: 4px 0 2px; }
.cd-chip { min-width: 56px; padding: 6px 5px; border-radius: var(--radius-md); }
.cd-chip .cd-num { font-size: var(--fs-xl); }
.cd-sep { font-size: var(--fs-md); }

/* ————— شبکهٔ ماژول‌ها: سه ستون فشرده ————— */
body .grid-dash { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; margin-top: 14px; }
body.dash-bento .grid-dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-dash .dash-col { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.grid-dash .dash-card { padding: 12px 14px; border-radius: 14px; }
.grid-dash .dmod { margin-bottom: 8px; padding-bottom: 8px; padding-inline-end: 30px; gap: 8px; }
.grid-dash .dmod-ic { width: 30px; height: 30px; border-radius: 9px; }
.grid-dash .dmod-txt h3 { font-size: var(--fs-sm); }
.grid-dash .dmod-txt small { font-size: var(--fs-3xs); }
.grid-dash .dmod-act .btn.sm { padding: 3px 8px; }
.grid-dash .dash-person { padding: 6px 2px; }
.grid-dash .dash-alert-row { padding: 7px 8px; }
.grid-dash .dash-event { padding: 6px 2px; }
.grid-dash .dash-empty-inline { padding: 9px 10px; font-size: var(--fs-xs); }
.grid-dash .action-row { padding: 7px 6px; }
.grid-dash .trend-chart { height: 108px; }
.grid-dash .trend-foot { margin-top: 8px; }
.grid-dash .more-list summary { padding: 4px 0; }

/* — کارت حضور: نسخهٔ فشردهٔ ماژولی — */
.card.dash-card.att-card { height: auto; justify-content: flex-start; padding: 12px 14px; gap: 0; }
#att-card .att-main { gap: 10px 14px; }
#att-card .att-donut, #att-card .att-donut svg { width: 78px; height: 78px; }
#att-card .donut .d-num { font-size: 17px; }
#att-card .att-title { font-size: 24px; }
#att-card .att-stats { margin-top: 10px; padding-top: 10px; }
#att-card .att-stats .am { padding: 5px 7px; }

/* — تقویم: پایین صفحه و فشرده‌تر — */
#cal-card { margin-top: 14px; padding: 14px 16px 16px; }
#cal-card .cal .day { min-height: 72px; }
#cal-card .cal-legend { margin-bottom: 8px; }

/* — ابزار جابه‌جایی همیشگی (اختیاری از پنجرهٔ ⚙) — */
body.dash-tools-on .dash-tools { display: flex; opacity: .85; }
body.dash-tools-on .dash-card:hover .dash-tools { opacity: 1; }

/* — پنجرهٔ نمایش/چیدمان — */
.dash-vis-tools { display: flex; gap: 6px; margin: 2px 0 8px; }
.dash-vis-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; }
.dash-vis-item {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface-2); font-size: var(--fs-xs); cursor: pointer;
}
.dash-vis-item:hover { border-color: var(--accent-2); }
.dash-vis-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-vis-check { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: var(--fs-sm); }

/* ————— واکنش‌گرایی ————— */
@media (max-width: 1500px) {
  body .grid-dash, body.dash-bento .grid-dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  .dash-hero .dash-chips { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-actions { margin-inline-start: 0; }
}
@media (max-width: 900px) {
  body .grid-dash, body.dash-bento .grid-dash { grid-template-columns: 1fr; }
  .dash-hero-top { align-items: flex-start; }
  .hero-actions { width: 100%; }
  .hero-act { flex: 1 1 0; justify-content: center; }
}
@media (max-width: 640px) {
  .dash-hero .dash-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-hero-in { padding: 14px; }
  .grid-dash .dash-card, .card.dash-card.live-wide, #cal-card { padding: 11px 12px; }
  .dash-vis-grid { grid-template-columns: 1fr; }
  .dash-quick { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .cd-chip { min-width: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-act:hover { transform: none; }
}

/* ============================================================
   داشبورد ۴.۱ — ماژول‌های حضور/اقدام/روند داخل نوار بالا
   نوار در دسکتاپ همان ارتفاع ۲۲۴px می‌ماند؛ داده‌ها فشرده شده‌اند
   ============================================================ */

/* — چیدمان کلی نوار: سربرگ باریک + بدنهٔ دو بخشی — */
.dash-hero-row .dash-hero { height: auto; }
.dash-hero .dash-hero-in {
  display: flex; flex-direction: column; align-items: stretch;
  flex-wrap: nowrap; justify-content: flex-start;
  gap: 8px; padding: 12px 16px; height: 100%;
}
.dash-hero .dash-hero-top {
  display: flex; align-items: center; flex-wrap: nowrap;
  gap: 8px 12px; min-height: 0;
}
.dash-hero .dash-hello { flex: 1 1 auto; min-width: 0; }
.dash-hero .dash-hello-txt {
  font-size: var(--fs-xl); line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-hero .dash-hello-sub { margin-top: 1px; font-size: var(--fs-2xs); line-height: 1.4; }

/* — سال تحصیلی: گوشهٔ نوار، فشرده — */
.dash-hero .dash-hero-top .dash-year {
  flex: 0 0 auto; min-width: 204px; max-width: 236px;
  padding: 4px 9px; border-radius: 10px;
}
.dash-hero .dash-hero-top .dy-row { font-size: var(--fs-3xs); gap: 6px; }
.dash-hero .dash-hero-top .dy-row span {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dash-hero .dash-hero-top .dy-bar { height: 4px; margin: 4px 0 2px; }
.dash-hero .dash-hero-top .dy-sub { font-size: var(--fs-3xs); }

/* — دو دکمهٔ ابزار — */
.dash-hero .hero-actions { gap: 6px; }
.dash-hero .hero-act { padding: 5px 9px; border-radius: 9px; }
.dash-hero .hero-act .icon-btn svg { width: 15px; height: 15px; }
.dash-hero .hero-act .ha-lab { font-size: var(--fs-3xs); }

/* — بدنهٔ نوار: سه پنل + ریل اطلاعات (سمت چپ) — */
.hero-body {
  display: grid; grid-template-columns: minmax(0, 1fr) 196px;
  gap: 10px; flex: 1 1 auto; min-height: 0;
}
.hero-modules {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px; min-width: 0; min-height: 0;
}
.hero-mod {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  padding: 8px 10px; border-radius: 12px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .12);
  color: var(--hero-ink);
  backdrop-filter: blur(4px);
  overflow: hidden;
  transition: background .15s ease, border-color .15s ease;
}
.hero-mod.hm-att { cursor: pointer; }
.hero-mod.hm-att:hover { background: rgba(255, 255, 255, .13); border-color: rgba(255, 255, 255, .26); }
.hero-mod.hm-att:focus-visible { outline: 2px solid #fcd34d; outline-offset: 2px; }

/* سربرگ مشترک پنل‌ها */
.hm-head {
  display: flex; align-items: center; gap: 6px;
  padding-bottom: 5px; margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, .11);
  flex: none;
}
.hm-head h4 {
  margin: 0; font-size: var(--fs-2xs); font-weight: 800;
  color: var(--hero-ink); white-space: nowrap;
}
.hm-ic {
  width: 22px; height: 22px; border-radius: 7px; flex: none;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .12); color: #d9f7ec;
}
.hm-ic .ic { width: 13px; height: 13px; }
.hm-ic-good { background: rgba(16, 185, 129, .22); color: #6ee7b7; }
.hm-ic-warn { background: rgba(245, 158, 11, .22); color: #fcd34d; }
.hm-ic-info { background: rgba(59, 130, 246, .24); color: #93c5fd; }
.hm-note {
  margin-inline-start: auto; font-size: var(--fs-3xs);
  color: var(--hero-mut); font-weight: 700; white-space: nowrap;
}
.hm-go { display: inline-flex; color: var(--hero-mut); transition: color .15s ease; }
.hero-mod.hm-att:hover .hm-go { color: #fcd34d; }
.hm-avg {
  margin-inline-start: auto; font-size: var(--fs-3xs); font-weight: 800;
  color: #fde68a; white-space: nowrap;
}
.hm-badge { margin-inline-start: auto; font-size: var(--fs-3xs); padding: 1px 7px; }

/* — پنل حضور: دونات + چهار شمارندهٔ کوچک — */
.hm-att-body { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-height: 0; }
.hm-donut, .hm-donut svg { width: 68px; height: 68px; flex: none; }
.hm-donut .d-num { font-size: 15px; font-weight: 800; color: var(--hero-ink); }
.hm-att-stats {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 6px; flex: 1 1 auto; min-width: 0;
}
.hm-am {
  display: flex; flex-direction: column; justify-content: center;
  padding: 3px 7px; border-radius: 8px;
  background: rgba(255, 255, 255, .06); min-width: 0;
}
.hm-am b { font-size: var(--fs-md); font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.hm-am span { font-size: var(--fs-3xs); color: var(--hero-mut); font-weight: 700; }
.hm-am.am-present b { color: #6ee7b7; }
.hm-am.am-absent b { color: #fca5a5; }
.hm-am.am-late b { color: #fcd34d; }
.hm-am.am-miss b { color: #e2e8f0; }

/* — پنل مرکز اقدام: ردیف‌های دوستونه و فشرده — */
.hm-act-body {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 6px; align-content: start;
  flex: 1 1 auto; min-height: 0; overflow: hidden;
}
.hm-act-body .action-row {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 2px 6px; border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 8px; background: rgba(255, 255, 255, .05);
  color: var(--hero-ink); text-align: start;
}
.hm-act-body .action-row:hover { background: rgba(255, 255, 255, .14); }
.hm-act-body .ar-ic {
  width: 18px; height: 18px; border-radius: 6px; flex: none;
  display: grid; place-items: center;
  background: rgba(245, 158, 11, .22); color: #fcd34d;
}
.hm-act-body .ar-ic .ic { width: 11px; height: 11px; }
.hm-act-body .action-row.tone-bad .ar-ic { background: rgba(239, 68, 68, .24); color: #fca5a5; }
.hm-act-body .action-row.tone-info .ar-ic { background: rgba(59, 130, 246, .24); color: #93c5fd; }
.hm-act-body .action-row.tone-gold .ar-ic { background: rgba(245, 158, 11, .22); color: #fcd34d; }
.hm-act-body .action-row.tone-zero { background: rgba(255, 255, 255, .03); border-color: rgba(255, 255, 255, .06); }
.hm-act-body .action-row.tone-zero .ar-ic { background: rgba(255, 255, 255, .07); color: var(--hero-mut); }
.hm-act-body .action-row.tone-zero .ar-txt b { color: var(--hero-mut); font-weight: 600; }
.hm-act-body .action-row.tone-zero .ar-n { color: rgba(226, 248, 240, .45); }
.hm-act-body .ar-txt { flex: 1 1 auto; min-width: 0; display: block; line-height: 1.3; }
.hm-act-body .ar-txt b {
  display: block; font-size: var(--fs-3xs); font-weight: 700;
  color: var(--hero-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hm-act-body .ar-txt small { display: none; }
.hm-act-body .ar-n { font-size: var(--fs-2xs); font-weight: 800; color: #fde68a; }
.hm-act-body .ar-go { display: none; }
.hm-act-body .action-empty {
  grid-column: 1 / -1; padding: 2px; gap: 7px;
  color: #6ee7b7; align-items: center;
}
.hm-act-body .action-empty .ic { width: 17px; height: 17px; flex: none; }
.hm-act-body .action-empty strong { font-size: var(--fs-2xs); }
.hm-act-body .action-empty p { margin: 0; font-size: var(--fs-3xs); color: var(--hero-mut); }

/* — پنل روند: نمودار کوچک، میانگین در سربرگ — */
.hm-trend-body { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.hm-trend-body .trend-head,
.hm-trend-body .trend-foot,
.hm-trend-body .trend-avg { display: none !important; }
.hm-trend-body .trend-chart {
  height: 100%; min-height: 0; padding: 4px 0 0; gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, .16);
  background-image: none;
}
.hm-trend-body .trend-col { gap: 2px; }
.hm-trend-body .trend-col b { font-size: var(--fs-3xs); color: var(--hero-ink); }
.hm-trend-body .trend-col > span { font-size: var(--fs-3xs); color: var(--hero-mut); font-weight: 600; }
.hm-trend-body .trend-bar {
  max-width: 24px; border-radius: 6px 6px 2px 2px; box-shadow: none;
  background: linear-gradient(180deg, #5eead4, #10b981);
}
.hm-trend-body .trend-col.is-today .trend-bar { background: linear-gradient(180deg, #fbbf24, #f59e0b); }
.hm-trend-body .trend-col.is-low .trend-bar { background: linear-gradient(180deg, #fca5a5, #ef4444); }
.hm-trend-body .trend-col.is-empty .trend-bar { background: rgba(255, 255, 255, .16); }
.hm-trend-body .dash-empty-inline,
.hm-trend-body .dash-empty-inline.neutral {
  background: transparent; border: 0; padding: 4px 2px;
  color: var(--hero-mut); font-size: var(--fs-3xs); align-items: flex-start;
}
.hm-trend-body .dash-empty-inline .ic { color: #93c5fd; flex: none; }

/* — ریل اطلاعات: پنج کاشی فشرده در ستون کنار پنل‌ها — */
.dash-hero .dash-chips.hero-rail {
  display: flex; flex-direction: column; align-items: stretch;
  gap: 4px; width: auto; min-width: 0;
}
.dash-hero .hero-rail .hero-tile {
  display: flex; flex-direction: row; align-items: center; justify-content: flex-start;
  gap: 6px; flex: 1 1 0; min-height: 24px; padding: 2px 8px;
  text-align: start; border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .09);
}
.dash-hero .hero-rail .hero-tile + .hero-tile {
  border-inline-start: 1px solid rgba(255, 255, 255, .09);
  border-radius: 8px;
}
.dash-hero .hero-rail .hero-tile:hover { background: rgba(255, 255, 255, .14); }
.dash-hero .hero-rail .hero-tile-lab {
  flex: 0 0 auto; width: 56px; font-size: var(--fs-3xs); text-align: start;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-hero .hero-rail .hero-tile .top-chip,
.dash-hero .hero-rail .hero-tile .topbar-clock,
.dash-hero .hero-rail .hero-tile .topbar-date {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 4px;
}
.dash-hero .hero-rail .hero-tile .cell-v,
.dash-hero .hero-rail .hero-tile .topbar-clock {
  font-size: var(--fs-2xs); font-weight: 800;
}
.dash-hero .hero-rail .hero-tile .topbar-date .cell-v {
  font-size: var(--fs-3xs); font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-hero .hero-rail .hero-tile .cell-s { display: none; }
.dash-hero .hero-rail .hero-tile.t-now { flex-wrap: nowrap; }
.dash-hero .hero-rail .hero-tile.t-now .hero-tile-lab { flex-basis: auto; width: auto; }
.dash-hero .hero-rail .hero-tile.t-now #top-clock { font-size: var(--fs-2xs); letter-spacing: 0; }
.dash-hero .hero-rail .hero-tile.t-period .hp-main { font-size: var(--fs-2xs); }
.dash-hero .hero-rail .hero-tile.t-period .hp-sub {
  font-size: var(--fs-3xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-hero .hero-rail .hero-tile.t-period .hp-bar { display: none; }
.dash-hero .hero-rail .hero-tile .cell-ic .ic { width: 12px; height: 12px; }

/* — ارتفاع ثابت نوار در دسکتاپ (معادل همان ارتفاع قبلی در زوم ۹۵٪) — */
@media (min-width: 1500px) {
  .dash-hero-row .dash-hero { height: 236px; }
  .hero-mod { min-height: 0; }
}

/* — واکنش‌گرایی: زیر ۱۵۰۰px نوار آزاد و ریل افقی می‌شود — */
@media (max-width: 1499px) {
  .hero-body { grid-template-columns: 1fr; }
  .hero-mod { min-height: 138px; }
  .dash-hero .dash-chips.hero-rail { flex-direction: row; flex-wrap: wrap; }
  .dash-hero .hero-rail .hero-tile { flex: 1 1 118px; }
}
@media (max-width: 1100px) {
  .hero-modules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-trend { grid-column: 1 / -1; }
  .dash-hero .dash-hero-top .dash-year { min-width: 180px; }
}
@media (max-width: 760px) {
  .hero-modules { grid-template-columns: 1fr; }
  .hm-trend { grid-column: auto; }
  .dash-hero .dash-hero-top { flex-wrap: wrap; }
  .dash-hero .hero-actions { margin-inline-start: 0; }
  .dash-hero .dash-hero-top .dash-year { order: 3; flex: 1 1 100%; max-width: none; }
  .dash-hero .dash-chips.hero-rail { flex-direction: row; }
  .dash-hero .hero-rail .hero-tile { flex: 1 1 132px; }
}

/* ============================================================
   داشبورد ۴.۲ — نوار بالا یکپارچه (بازخورد پنج تصویر)
   • حضور، مرکز اقدام و روند دیگر سه جعبهٔ جدا نیستند.
   • روند ۷ روز به شکل اسپارک‌لاین ریز داخل پنل حضور آمده.
   • سال تحصیلی به نوار تمام‌عرض پایین رفته و بزرگ‌تر شده.
   • ساعت/تاریخ بزرگ و ریل باریک‌تر شده.
   • دکمه‌های ابزار سایدبار کنار اعلان‌ها/کارت‌ها آمده‌اند.
   ============================================================ */

/* — بدنه: محتوای یکپارچه (راست) + پنل «اکنون» (چپ) + نوار سال (پایین) — */
.dash-hero .hero-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 154px;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px 10px;
  flex: 1 1 auto; min-height: 0;
}
.dash-hero .hero-main {
  grid-column: 1; grid-row: 1;
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  column-gap: 18px;
  min-width: 0; min-height: 0;
  background: none; border: 0; border-radius: 0;
}
.dash-hero .hero-sec {
  display: flex; flex-direction: column;
  min-width: 0; min-height: 0;
  padding: 2px 4px;
  background: none; border: 0; border-radius: 0;
  color: var(--hero-ink);
  overflow: hidden;
}
.dash-hero .hero-sec + .hero-sec {
  border-inline-start: 1px solid rgba(255, 255, 255, .14);
  padding-inline-start: 14px;
}
.dash-hero .hero-att { cursor: pointer; border-radius: 9px; transition: background .15s ease; }
.dash-hero .hero-att:hover { background: rgba(255, 255, 255, .06); }
.dash-hero .hero-att:focus-visible { outline: 2px solid #fcd34d; outline-offset: 2px; }

/* — سربرگ مشترک دو پنل — */
.dash-hero .hm-head {
  display: flex; align-items: center; gap: 6px;
  padding-bottom: 4px; margin-bottom: 5px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  flex: none;
}
.dash-hero .hm-head h4 { font-size: var(--fs-2xs); }
.dash-hero .hm-ic { width: 21px; height: 21px; border-radius: 7px; }
.dash-hero .hm-ic .ic { width: 12px; height: 12px; }
.dash-hero .hm-note { font-size: var(--fs-3xs); }
.dash-hero .hm-badge { font-size: var(--fs-3xs); padding: 1px 7px; }

/* — پنل حضور: دونات + چهار شمارنده + اسپارک‌لاین ریز روند — */
.dash-hero .hm-att-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(110px, 160px);
  align-items: center; gap: 10px;
  flex: 1 1 auto; min-height: 0;
}
.dash-hero .hm-donut, .dash-hero .hm-donut svg { width: 62px; height: 62px; }
.dash-hero .hm-donut .d-num { font-size: 14px; font-weight: 800; color: var(--hero-ink); }
.dash-hero .hm-att-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px; min-width: 0; align-content: center;
}
.dash-hero .hm-am {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; padding: 4px 2px; border-radius: 8px; min-width: 0;
}
.dash-hero .hm-am b { font-size: 15px; font-weight: 800; line-height: 1.1; }
.dash-hero .hm-am span {
  font-size: 9.5px; font-weight: 600; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}

/* اسپارک‌لاین: فقط میله‌های ریز، هم‌رنگ پالت نوار */
.dash-hero .hm-spark {
  display: flex; flex-direction: column; justify-content: center; gap: 3px;
  align-self: stretch; min-width: 0;
  padding-inline-start: 10px;
  border-inline-start: 1px dashed rgba(255, 255, 255, .14);
}
.dash-hero .hm-spark-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
  font-size: var(--fs-3xs); font-weight: 700; color: var(--hero-mut);
  white-space: nowrap; min-width: 0;
}
.dash-hero .hm-spark-head span { overflow: hidden; text-overflow: ellipsis; }
.dash-hero .hm-spark-head b { font-size: var(--fs-2xs); font-weight: 800; color: #fde68a; white-space: nowrap; }
.dash-hero .hm-spark-bars { height: 34px; min-height: 34px; min-width: 0; overflow: hidden; }
.dash-hero .hm-spark-bars .trend-chart {
  height: 100%; min-height: 0; padding: 0; gap: 3px;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
  background-image: none;
}
.dash-hero .hm-spark-bars .trend-head,
.dash-hero .hm-spark-bars .trend-foot,
.dash-hero .hm-spark-bars .trend-avg,
.dash-hero .hm-spark-bars .trend-col b,
.dash-hero .hm-spark-bars .trend-col > span { display: none !important; }
.dash-hero .hm-spark-bars .trend-col { grid-template-rows: minmax(0, 1fr); gap: 0; }
.dash-hero .hm-spark-bars .trend-bar {
  max-width: 100%; min-height: 2px; border-radius: 3px 3px 1px 1px;
  background: linear-gradient(180deg, #5eead4, #10b981);
  box-shadow: none;
}
.dash-hero .hm-spark-bars .trend-col.is-today .trend-bar { background: linear-gradient(180deg, #fbbf24, #f59e0b); }
.dash-hero .hm-spark-bars .trend-col.is-low .trend-bar { background: linear-gradient(180deg, #fca5a5, #ef4444); }
.dash-hero .hm-spark-bars .trend-col.is-empty .trend-bar { background: rgba(255, 255, 255, .18); }
.dash-hero .hm-spark-bars .dash-empty-inline,
.dash-hero .hm-spark-bars .empty {
  background: transparent; border: 0; padding: 0; margin: 0; min-height: 0;
  color: var(--hero-mut); font-size: 9px; line-height: 1.35;
  display: block; overflow: hidden;
}
.dash-hero .hm-spark-bars .dash-empty-inline .ic,
.dash-hero .hm-spark-bars .empty .e-ill { display: none; }

/* — مرکز اقدام: ردیف‌های فشردهٔ دوستونه بدون جعبهٔ جدا — */
.dash-hero .hm-act-body {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 6px; align-content: start;
  flex: 1 1 auto; min-height: 0; overflow: hidden;
}
.dash-hero .hm-act-body .action-row {
  min-width: 0; width: 100%;
  gap: 6px; padding: 5px 3px;
  border-bottom: 0; border-radius: 7px;
}
.dash-hero .hm-act-body .action-row:hover { background: rgba(255, 255, 255, .08); }
.dash-hero .hm-act-body .ar-ic {
  width: 18px; height: 18px; border-radius: 6px;
  background: rgba(251, 191, 36, .16); color: #fcd34d;
}
.dash-hero .hm-act-body .ar-ic .ic,
.dash-hero .hm-act-body .ar-ic svg { width: 11px; height: 11px; }
.dash-hero .hm-act-body .action-row.tone-bad .ar-ic { background: rgba(248, 113, 113, .18); color: #fca5a5; }
.dash-hero .hm-act-body .action-row.tone-info .ar-ic { background: rgba(147, 197, 253, .18); color: #93c5fd; }
.dash-hero .hm-act-body .action-row.tone-gold .ar-ic { background: rgba(251, 191, 36, .2); color: #fcd34d; }
.dash-hero .hm-act-body .ar-txt { min-width: 0; line-height: 1.25; }
.dash-hero .hm-act-body .ar-txt b {
  font-size: 10.5px; font-weight: 700; color: var(--hero-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-hero .hm-act-body .ar-txt small { display: none; }
.dash-hero .hm-act-body .ar-n {
  font-size: 11px; font-weight: 800; color: #fde68a;
  flex: none; font-variant-numeric: tabular-nums;
}
.dash-hero .hm-act-body .ar-go { flex: none; color: var(--hero-mut); }
.dash-hero .hm-act-body .ar-go .ic,
.dash-hero .hm-act-body .ar-go svg { width: 11px; height: 11px; }
.dash-hero .hm-act-body .action-row.tone-zero { opacity: .68; }
.dash-hero .hm-act-body .action-row.tone-zero:hover { opacity: .85; }

/* — پنل «اکنون»: ساعت و تاریخ بزرگ، وضعیت‌های ریز، زنگ جاری — */
.dash-hero .hero-now {
  grid-column: 2; grid-row: 1;
  position: relative;
  display: flex; flex-direction: column; gap: 0;
  min-width: 0; min-height: 0; overflow: hidden;
  padding: 7px 9px; border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
}
.dash-hero .now-dot {
  flex: none;
  width: 6px; height: 6px; border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, .16);
}
.dash-hero .now-time {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; min-width: 0;
}
.dash-hero .now-time .topbar-clock {
  display: block; padding: 0; margin: 0;
  background: none; border: 0; box-shadow: none;
  font-family: "Segoe UI", Vazirmatn, Tahoma, sans-serif;
  font-size: 29px; font-weight: 700; font-variant-numeric: tabular-nums;
  letter-spacing: .2px; line-height: 1.12;
  color: var(--hero-ink);
}
.dash-hero .now-time .topbar-clock::before { display: none; }
.dash-hero .now-date { margin-top: 1px; }
.dash-hero .now-date .topbar-date {
  display: block; padding: 0; margin: 0;
  background: none; border: 0; box-shadow: none;
  font-family: "Segoe UI", Vazirmatn, Tahoma, sans-serif;
  color: var(--hero-mut); font-size: 11.5px; font-weight: 600;
  line-height: 1.35; white-space: nowrap;
}
.dash-hero .now-date .topbar-date .cell-ic { display: none; }
.dash-hero .now-date .topbar-date .cell-v {
  font-size: 11.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; display: block;
}
.dash-hero .now-sep {
  height: 1px; margin: 5px 0 5px;
  background: rgba(255, 255, 255, .12);
}
.dash-hero .now-status {
  display: flex; align-items: stretch; gap: 3px;
  min-width: 0; flex-wrap: nowrap;
}
.dash-hero .now-chip {
  flex: 1 1 0; min-width: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 2px 4px; border-radius: 7px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .09);
}
.dash-hero .now-chip[hidden] { display: none; }
.dash-hero .now-chip .top-chip {
  display: flex; align-items: center; gap: 3px; min-width: 0;
  padding: 0; margin: 0; background: none; border: 0; box-shadow: none;
  color: var(--hero-ink); font-size: 10px; font-weight: 700; white-space: nowrap;
}
/* شناسه‌های نوار بالا specificity بالاتری دارند؛ داخل کاشی‌های ریز خنثی می‌شوند */
.dash-hero .now-chip #top-server,
.dash-hero .now-chip #top-weather,
.dash-hero .now-chip #top-sms {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 0; margin: 0; background: none; border: 0; box-shadow: none;
  border-radius: 0; color: var(--hero-ink); font-size: 10px; font-weight: 800;
  white-space: nowrap;
}
.dash-hero .now-chip .cell-s { display: none; }
.dash-hero .now-chip .cell-v {
  font-size: 10px; font-weight: 800; min-width: 0;
  overflow: hidden; text-overflow: ellipsis;
}
.dash-hero .now-chip .cell-ic .ic { width: 11px; height: 11px; }
.dash-hero .now-chip.t-live .cell-ic { color: #6ee7b7; }
.dash-hero .now-chip.t-air .cell-ic { color: #93c5fd; }
.dash-hero .now-chip.t-msg .cell-ic { color: #fcd34d; }
.dash-hero .now-chip .warn { color: #fca5a5; }
.dash-hero .now-period {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center;
  gap: 0 6px; min-width: 0;
  margin-top: 4px; padding: 4px 0 0; border-radius: 0;
  background: none;
  border: 0; border-top: 1px solid rgba(255, 255, 255, .08);
}
.dash-hero .now-period .np-lab {
  grid-column: 1; grid-row: 1; line-height: 1.2;
  font-size: 9px; font-weight: 700; color: var(--hero-mut); white-space: nowrap;
}
.dash-hero .now-period .hp-main {
  grid-column: 2; grid-row: 1; justify-self: end; min-width: 0; line-height: 1.2;
  font-size: var(--fs-3xs); font-weight: 800; color: var(--hero-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-hero .now-period .hp-sub {
  grid-column: 1 / -1; grid-row: 2; min-width: 0; line-height: 1.2;
  font-size: 9px; font-weight: 600; color: var(--hero-mut);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-hero .now-period .hp-bar { display: none; }

/* چینش وسط پنل «اکنون» در دسکتاپ: ساعت، تاریخ، وضعیت‌ها و زنگ جاری همه در مرکز */
@media (min-width: 1181px) {
  .dash-hero .hero-now { align-items: center; text-align: center; }
  .dash-hero .now-time,
  .dash-hero .now-date,
  .dash-hero .now-sep { width: 100%; }
  .dash-hero .now-time .topbar-clock { width: auto; text-align: center; }
  .dash-hero .now-date .topbar-date .cell-v { text-align: center; }
  .dash-hero .now-status { width: 100%; }
  .dash-hero .now-period {
    display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center;
    gap: 0 5px; width: 100%;
  }
  .dash-hero .now-period .np-lab,
  .dash-hero .now-period .hp-main {
    grid-column: auto; grid-row: auto; justify-self: auto;
  }
  .dash-hero .now-period .hp-sub {
    flex: 1 1 100%; grid-column: auto; grid-row: auto;
    text-align: center;
  }
}

/* — نوار سال تحصیلی: تمام‌عرض و بزرگ‌تر، پایین نوار — */
.dash-hero .hero-year { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
.dash-hero .hero-year .dash-year {
  display: flex; align-items: center; gap: 10px;
  width: 100%; max-width: none; min-width: 0;
  padding: 5px 12px; border-radius: 9px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  color: var(--hero-ink);
}
.dash-hero .hero-year .dy-label {
  flex: none; font-size: 12px; font-weight: 700;
  color: var(--hero-mut); white-space: nowrap;
}
.dash-hero .hero-year .dy-label b { color: #fde68a; font-weight: 800; }
.dash-hero .hero-year .dy-bar {
  flex: 1 1 auto; height: 6px; margin: 0; border-radius: 99px;
  background: rgba(255, 255, 255, .16); overflow: hidden;
}
.dash-hero .hero-year .dy-bar i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #fbbf24, #34d399);
  transition: width .5s var(--ease);
}
.dash-hero .hero-year .dy-left {
  flex: none; font-size: 12px; font-weight: 800;
  color: #fde68a; white-space: nowrap;
}
.dash-hero .hero-year .dy-sub {
  flex: none; font-size: 12px; font-weight: 700;
  color: var(--hero-mut); white-space: nowrap;
}

/* — دکمه‌های ابزار نوار: اعلان/کارت با برچسب، چهار ابزار سایدبار آیکونی — */
.dash-hero .hero-actions { gap: 6px; }
.dash-hero .hero-act { padding: 5px 9px; border-radius: 9px; }
.dash-hero .hero-act.ha-icon { padding: 5px 8px; }
.dash-hero .hero-act .side-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; padding: 0; margin: 0;
  border: 0; background: none; box-shadow: none;
  color: #eafaf3; font-size: 15px; line-height: 1; cursor: pointer;
}
.dash-hero .hero-act .side-btn svg { width: 16px; height: 16px; display: block; }
.dash-hero .hero-act .side-btn:hover { background: none; transform: none; color: #fff; }
.dash-hero .hero-act .side-btn.is-bad { color: #fca5a5; }
.dash-hero .hero-act.ha-cal .side-btn svg { color: #93c5fd; }
.dash-hero .hero-act.ha-db .side-btn svg { color: #6ee7b7; }
.dash-hero .hero-act.ha-refresh .side-btn svg { color: #fcd34d; }
.dash-hero .hero-act.ha-theme .side-btn { color: #fde68a; }
.dash-hero .hero-act.ha-logout {
  background: rgba(248, 113, 113, .16);
  border-color: rgba(248, 113, 113, .32);
}
.dash-hero .hero-act.ha-logout .side-btn {
  width: auto; height: auto; gap: 5px;
  font-size: 10.5px; font-weight: 700; line-height: 1;
  color: #ffd7d7;
}
.dash-hero .hero-act.ha-logout .side-btn svg { width: 14px; height: 14px; }
.dash-hero .hero-act.ha-logout .side-btn:hover { color: #fff; }
.dash-hero .hero-act:has(> button[hidden]) { display: none; }

/* — پنل پایین سایدبار بدون کارت سال تحصیلی جمع‌وجور می‌شود — */
.sidebar-status { padding: 8px; }
.sidebar-status .tabs-pick-wrap { padding-top: 0; border-top: 0; }

/* — واکنش‌گرایی — */
@media (max-width: 1180px) {
  .dash-hero .hero-body { grid-template-columns: 1fr; grid-template-rows: auto auto auto; }
  .dash-hero .hero-main { grid-column: 1; grid-row: 1; grid-template-columns: 1fr; }
  .dash-hero .hero-sec + .hero-sec {
    border-inline-start: 0; padding-inline-start: 4px;
    border-top: 1px solid rgba(255, 255, 255, .14);
    padding-top: 8px; margin-top: 6px;
  }
  .dash-hero .hero-now {
    grid-column: 1; grid-row: 2;
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 12px;
    padding: 7px 10px;
  }
  .dash-hero .now-dot, .dash-hero .now-sep { display: none; }
  .dash-hero .now-time .topbar-clock { font-size: 26px; }
  .dash-hero .now-period {
    flex: 1 1 100%; margin-top: 0; padding: 0;
    border-top: 0;
  }
  .dash-hero .hero-year { grid-column: 1; grid-row: 3; }
  .dash-hero .now-status { flex: 1 1 100%; }
}
@media (max-width: 760px) {
  .dash-hero .dash-hero-top { flex-wrap: wrap; }
  .dash-hero .hero-actions {
    margin-inline-start: 0; width: 100%;
    justify-content: flex-start; flex-wrap: wrap;
  }
  .dash-hero .hm-act-body { grid-template-columns: 1fr; }
  .dash-hero .hm-att-body { grid-template-columns: auto minmax(0, 1fr); }
  .dash-hero .hm-spark {
    grid-column: 1 / -1;
    padding-inline-start: 0; border-inline-start: 0;
    border-top: 1px dashed rgba(255, 255, 255, .14); padding-top: 6px;
  }
  .dash-hero .hero-year .dy-label,
  .dash-hero .hero-year .dy-sub { display: none; }
}



