/* ==========================================================================
   app.css — افزودنی‌های ظاهری روی tailwind.css (که از قبل کامپایل شده است)
   آیکون‌های سه‌بعدی، تقویم شمسی، ناوبری موبایل، تب‌ها و جدول‌های کارتی
   ========================================================================== */

/* ---------- آیکون‌های سه‌بعدی ---------- */
.i3 { display: inline-block; flex-shrink: 0; vertical-align: middle; overflow: visible; }
.i3-16 { width: 16px; height: 16px; }
.i3-20 { width: 20px; height: 20px; }
.i3-24 { width: 24px; height: 24px; }
.i3-28 { width: 28px; height: 28px; }
.i3-32 { width: 32px; height: 32px; }
.i3-36 { width: 36px; height: 36px; }
.i3-44 { width: 44px; height: 44px; }
.i3-40 { width: 40px; height: 40px; }
.i3-48 { width: 48px; height: 48px; }
.i3-56 { width: 56px; height: 56px; }
.i3-64 { width: 64px; height: 64px; }
.i3-80 { width: 80px; height: 80px; }
.i3-96 { width: 96px; height: 96px; }
.i3-bob { animation: i3-bob 4.2s ease-in-out infinite; }
@keyframes i3-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .i3-bob { animation: none; } }

.x-label { display: flex; align-items: center; gap: 6px; }
.x-heading { display: flex; align-items: center; gap: 10px; }
.x-section-title {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; color: #1c1c2c; font-size: 15px; margin: 28px 0 12px;
}

/* ---------- بدنهٔ صفحه ---------- */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { -webkit-tap-highlight-color: transparent; }
.x-page-alerts { margin-bottom: 4px; }
.x-msg { white-space: normal; word-break: break-word; line-height: 1.9; }
.x-nowrap { white-space: nowrap; }
.x-ltr { direction: ltr; unicode-bidi: plaintext; text-align: right; }
.x-time { font-variant-numeric: tabular-nums; direction: ltr; display: inline-block; }
.x-role {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: #f1ecff; color: #4c2cc4;
}
.x-role--teacher { background: #e7f0ff; color: #1b55b8; }
.x-role--assistant { background: #ffe9f4; color: #a3186a; }
.x-role--unknown { background: #ececf3; color: #6b6b88; }
.x-recipient { display: flex; flex-direction: column; gap: 4px; min-width: 9rem; }
.x-recipient strong { color: #1c1c2c; font-weight: 700; }

/* ---------- تقویم شمسی (روی همهٔ لایه‌ها) ---------- */
.jdp-backdrop {
  position: fixed; inset: 0; z-index: 2147483000;
  background: rgba(24, 16, 60, .38); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.jdp-panel {
  position: fixed; z-index: 2147483001; direction: rtl;
  width: 320px; max-width: calc(100vw - 20px);
  background: #fff; border-radius: 24px; padding: 14px;
  box-shadow: 0 0 0 1px rgba(30, 27, 60, .07), 0 24px 60px -12px rgba(30, 27, 60, .35), 0 8px 20px -8px rgba(30, 27, 60, .2);
  font-family: 'Vazirmatn', Tahoma, sans-serif; color: #2a2a40;
  animation: jdp-in .16s ease-out both;
}
.jdp-panel.is-modal { left: 50%; top: 50%; margin: 0; transform: translate(-50%, -50%); width: min(340px, calc(100vw - 24px)); animation: jdp-in-modal .2s ease-out both; }
@keyframes jdp-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes jdp-in-modal { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } to { opacity: 1; transform: translate(-50%, -50%); } }
.jdp-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 10px; }
.jdp-nav {
  width: 38px; height: 38px; border-radius: 12px; border: 0; cursor: pointer;
  background: #f4f2ff; color: #5b34d6; display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, transform .1s;
}
.jdp-nav:hover { background: #e9e3ff; }
.jdp-nav:active { transform: scale(.94); }
.jdp-selects { display: flex; gap: 6px; flex: 1; justify-content: center; }
.jdp-select {
  appearance: none; -webkit-appearance: none; border: 0; cursor: pointer; text-align: center;
  background: #f8f8fc; border-radius: 12px; padding: 8px 10px; font: inherit; font-size: 14px; font-weight: 700; color: #2a2a40;
  min-width: 0;
}
.jdp-select:focus-visible { outline: 2px solid #7c4ff0; }
.jdp-week, .jdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.jdp-week { margin-bottom: 4px; }
.jdp-week div { height: 28px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #8b8ba6; }
.jdp-week div:last-child { color: #e0475f; }
.jdp-grid { row-gap: 4px; justify-items: center; }
.jdp-day {
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; background: transparent;
  font: inherit; font-size: 14px; font-weight: 500; color: #2a2a40;
  display: flex; align-items: center; justify-content: center; transition: background .12s, transform .1s;
}
.jdp-day:hover { background: #f1ecff; }
.jdp-day:active { transform: scale(.92); }
.jdp-day.is-friday { color: #e0475f; }
.jdp-day.is-today { box-shadow: inset 0 0 0 1.5px #7c4ff0; color: #4c2cc4; font-weight: 700; }
.jdp-day.is-selected { background: linear-gradient(135deg, #7c3ce8, #2790fb); color: #fff; font-weight: 700; box-shadow: 0 6px 14px -4px rgba(106, 60, 227, .55); }
.jdp-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 12px; border-top: 1px solid #ececf3; }
.jdp-link { border: 0; background: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; padding: 8px 12px; border-radius: 10px; }
.jdp-link--today { color: #5b34d6; }
.jdp-link--today:hover { background: #f4f2ff; }
.jdp-link--clear { color: #8b8ba6; }
.jdp-link--clear:hover { background: #f4f4f8; }
.jdp-toggle { z-index: 1; }
@media (max-width: 640px) {
  .jdp-day { width: 42px; height: 42px; font-size: 15px; }
  .jdp-nav { width: 42px; height: 42px; }
  .jdp-select { padding: 10px 10px; font-size: 15px; }
}

/* ---------- تب‌ها و نوار ناوبری پایین (موبایل) ---------- */
.x-tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 40; display: flex; gap: 2px;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-top: 1px solid #ececf3; box-shadow: 0 -10px 30px -14px rgba(30, 27, 60, .22);
}
.x-tab {
  position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 7px 2px 6px; border: 0; border-radius: 18px; background: transparent; cursor: pointer; text-decoration: none;
  font: inherit; font-size: 11px; font-weight: 700; color: #6b6b88; line-height: 1.2; text-align: center;
  transition: background .18s, color .18s; min-height: 58px;
}
.x-tab .i3 { width: 30px; height: 30px; transition: transform .2s cubic-bezier(.2, .9, .3, 1.4); }
.x-tab.is-active { background: #f1ecff; color: #4c2cc4; }
.x-tab.is-active .i3 { transform: translateY(-2px) scale(1.1); }
.x-tab:active { transform: scale(.96); }
.x-tab-label { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x-badge {
  position: absolute; top: 2px; inset-inline-start: calc(50% + 8px);
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
  background: #ef4444; color: #fff; font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #fff;
}
.x-nbadge {
  position: absolute; top: -5px; left: -6px; z-index: 2; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #ef4444; color: #fff; font-size: 10px; font-weight: 800; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #fff; pointer-events: none;
}
.x-nbadge--amber { background: #f59e0b; }
.x-tabbar--admin { display: flex; }
@media (min-width: 1024px) { .x-tabbar--admin, .x-sheet--admin { display: none !important; } }
@media (min-width: 768px) { .x-sheet--staff { max-width: 30rem; margin-inline: auto; border-radius: 28px; bottom: 1.5rem; } }
.x-tab[hidden] { display: none; }
@media (max-width: 1023px) { body.has-nav-admin main { padding-bottom: 7.5rem; } }
@media (max-width: 767px) { body.has-nav-tabs main { padding-bottom: 7.5rem; } }
@media (min-width: 768px) {
  .x-tabbar--tabs {
    position: sticky; inset-inline: auto; top: 5.25rem; bottom: auto; z-index: 30;
    margin-bottom: 20px; padding: 6px; border: 1px solid #ececf3; border-radius: 24px; background: rgba(255, 255, 255, .92);
    box-shadow: 0 10px 30px -16px rgba(30, 27, 60, .25);
  }
  .x-tabbar--tabs .x-tab { flex-direction: row; gap: 10px; font-size: 14px; min-height: 52px; padding: 8px 14px; border-radius: 18px; }
  .x-tabbar--tabs .x-tab .i3 { width: 32px; height: 32px; }
  .x-tabbar--tabs .x-tab { position: relative; }
  /* روی دسکتاپ/تبلت، بج باید کنار متن نام گزینه دیده شود، نه به‌صورت مطلق روی گوشهٔ آیکون */
  .x-tabbar--tabs .x-badge { position: static; margin-inline-start: 2px; }
}
html.js .x-tabpanel:not(.is-active) { display: none; }
.x-tabpanel.is-active { animation: x-panel-in .28s ease-out both; }
@keyframes x-panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* برگهٔ «بیشتر» (منوی کامل مدیر در موبایل) */
.x-sheet-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(24, 16, 60, .42);
  opacity: 0; pointer-events: none; transition: opacity .22s;
}
.x-sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }
.x-sheet {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 61; background: #fff;
  border-radius: 28px 28px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateY(105%); transition: transform .3s cubic-bezier(.2, .9, .3, 1);
  box-shadow: 0 -20px 60px -20px rgba(30, 27, 60, .4); max-height: 88vh; overflow-y: auto;
}
.x-sheet.is-open { transform: none; }
.x-sheet-grip { width: 44px; height: 5px; border-radius: 999px; background: #dcdce8; margin: 0 auto 14px; }
.x-sheet-title { font-weight: 800; color: #1c1c2c; font-size: 15px; margin: 0 4px 12px; display: flex; align-items: center; gap: 8px; }
.x-sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.x-sheet-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 96px;
  padding: 12px 6px; border-radius: 20px; background: #f8f8fc; text-decoration: none; border: 1px solid transparent;
  font: inherit; font-size: 12.5px; font-weight: 700; color: #3b3b55; text-align: center; cursor: pointer; transition: transform .1s, background .15s;
}
.x-sheet-item .i3 { width: 40px; height: 40px; }
.x-sheet-item:active { transform: scale(.96); }
.x-sheet-item.is-active { background: #f1ecff; border-color: #cfc2ff; color: #4c2cc4; }
.x-sheet-item--danger { background: #fff1f2; color: #be1d3a; }
.x-sheet-user { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 12px; border-radius: 18px; background: #f8f8fc; font-size: 13px; font-weight: 700; color: #2a2a40; }

/* ---------- دکمهٔ رمز عبور و خروج در هدر ---------- */
.x-hdr-btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; text-decoration: none;
  border-radius: 16px; padding: 6px 12px 6px 10px; background: #f4f4f8; color: #52526b;
  font: inherit; font-size: 13px; font-weight: 700; min-height: 42px; transition: background .15s, color .15s;
}
.x-hdr-btn:hover { background: #ebe6ff; color: #4c2cc4; }
.x-hdr-btn--danger:hover { background: #ffe9ec; color: #d12a45; }
.x-hdr-btn .i3 { width: 28px; height: 28px; }
@media (max-width: 640px) { .x-hdr-btn { padding: 6px; } .x-hdr-btn span { display: none; } }
.x-md-only { display: none; }
@media (min-width: 768px) { .x-md-only { display: inline; } }
.x-hdr-name { font-size: 14px; font-weight: 600; color: #52526b; max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x-hdr-group { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ---------- کارت‌های آماری / نکته ---------- */
.x-hint { display: flex; align-items: flex-start; gap: 10px; border-radius: 16px; background: #f8f8fc; box-shadow: inset 0 0 0 1px #ececf3; padding: 10px 14px; font-size: 12px; line-height: 1.9; color: #8b8ba6; margin-top: 16px; }
.x-hint .i3 { margin-top: 2px; }
.x-hint--warn { background: #fff8e6; box-shadow: inset 0 0 0 1px #fde7a8; color: #8a5a06; }
.x-stat { position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; border-radius: 24px; padding: 18px 20px; color: #fff; box-shadow: 0 10px 24px -12px rgba(30, 27, 60, .4); }
.x-stat--red { background: linear-gradient(135deg, #f9566b, #c81f3f); }
.x-stat--sky { background: linear-gradient(135deg, #38a8f5, #1a64c4); }
.x-stat::after { content: ""; position: absolute; left: -28px; bottom: -34px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.x-stat-num { font-size: 32px; font-weight: 800; line-height: 1; }
.x-stat-txt { font-size: 13px; opacity: .88; margin-top: 6px; }
.x-feature { display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, .92); font-size: 14px; }
.x-break-chip { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; padding: 2px 9px; border-radius: 999px; background: #fff3d6; color: #8a5a06; font-size: 11px; font-weight: 700; }

/* ---------- فرم رمز عبور ---------- */
.x-pw-wrap { position: relative; }
.x-pw-wrap .field-input { padding-inline-end: 3rem; }
.x-pw-eye { position: absolute; inset-block: 0; inset-inline-end: 6px; width: 40px; border: 0; background: none; cursor: pointer; color: #8b8ba6; display: flex; align-items: center; justify-content: center; border-radius: 12px; }
.x-pw-eye:hover { color: #5b34d6; background: #f4f2ff; }

/* ---------- موبایل: هدف‌های لمسی بزرگ‌تر ---------- */
@media (max-width: 640px) {
  main { padding-inline: 12px !important; padding-top: 14px !important; }
  .panel { padding: 16px !important; border-radius: 22px !important; }
  .field-input { min-height: 48px; font-size: 16px !important; padding-top: 10px; padding-bottom: 10px; }
  textarea.field-input { min-height: 84px; }
  select.field-input { padding-inline-end: 12px; }
  .btn-primary, .btn-secondary, .btn-warning, .btn-success, .btn-danger, .btn-soft-brand { min-height: 48px; font-size: 14px !important; }
  .btn-sm { min-height: 42px; padding: 8px 14px !important; font-size: 13px !important; }
  .x-block-sm { width: 100%; }
  input[type="checkbox"] { width: 24px !important; height: 24px !important; }
  .x-section-title { margin-top: 22px; }
}

/* ---------- جدول‌ها روی موبایل به‌شکل کارت ---------- */
@media (max-width: 640px) {
  .x-cards { display: block; }
  .x-cards thead { display: none; }
  .x-cards tbody, .x-cards tr, .x-cards td { display: block; width: 100%; }
  .x-cards tr { margin-bottom: 12px; padding: 8px 14px; border-radius: 20px; background: #fff; box-shadow: 0 0 0 1px #ececf3, 0 6px 16px -10px rgba(30, 27, 60, .18); }
  .x-cards td { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 8px 0 !important; border: 0 !important; text-align: start; min-width: 0 !important; max-width: none !important; }
  .x-cards td + td { border-top: 1px dashed #ececf3 !important; }
  .x-cards td::before { content: attr(data-label); flex-shrink: 0; font-size: 12px; font-weight: 700; color: #8b8ba6; padding-top: 2px; }
  .x-cards td[data-label=""]::before { display: none; }
  .x-cards td[data-label=""] { justify-content: flex-end; }
  .x-cards td.x-cell-full { display: block; }
  .x-cards td.x-cell-full::before { display: block; margin-bottom: 6px; }
  .x-cards td > form, .x-cards td > div { max-width: 100%; }
  .x-cards td.x-cell-full > form, .x-cards td.x-cell-full > div { width: 100%; }
  .table-wrap:has(.x-cards) { box-shadow: none !important; overflow: visible; }
  .x-cards td .truncate { white-space: normal; overflow: visible; text-overflow: clip; }
  .x-cards td .min-w-\[16rem\], .x-cards th { min-width: 0 !important; }
}

/* ---------- فیلتر دانش‌آموز، ورود گروهی و جزئیات مرخصی ---------- */
[hidden] { display: none !important; }
.x-grid-4 { display: grid; grid-template-columns: 1fr; gap: 1rem; align-items: end; }
@media (min-width: 640px) { .x-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.x-notes { font-size: 12px; line-height: 2; color: #6b6b85; }
.x-notes ul { list-style: disc; padding-inline-start: 1.25rem; margin: 6px 0 0; }
.x-notes .x-code { direction: ltr; text-align: left; font-family: ui-monospace, monospace; font-size: 11px; color: #3b3b55; margin: 6px 0; word-break: break-all; }
.x-dl { display: grid; grid-template-columns: 1fr; gap: 12px 24px; font-size: 14px; }
@media (min-width: 640px) { .x-dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } .x-dl .x-dl-wide { grid-column: span 2; } }
.x-dl dt { font-size: 12px; color: #8b8ba6; }
.x-dl dd { margin: 0; }
button:disabled.btn-danger { opacity: .5; cursor: not-allowed; }

/* ---------- نشان تعداد آیتم‌ها در گوشهٔ بالا-چپ پنل ---------- */
.x-panel-count {
  position: absolute; top: -8px; left: -8px; z-index: 5;
  min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #7c3ce8, #2790fb); color: #fff;
  font-size: 13px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 3px #fff, 0 6px 14px -4px rgba(106, 60, 227, .5);
  pointer-events: none; user-select: none;
}
.x-panel-count.is-zero { background: #b6b6cc; box-shadow: 0 0 0 3px #fff; }

/* ---------- کارنامه ---------- */
.rc-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; text-align: center; }
.rc-stat { border-radius: 16px; background: #f8f8fc; box-shadow: 0 0 0 1px #ececf3; padding: 12px 6px; }
.rc-stat small { display: block; color: #8b8ba6; font-size: 12px; }
.rc-stat b { display: block; color: #1c1c2c; font-size: 22px; line-height: 1.5; }
.rc-stat b em { font-style: normal; color: #8b8ba6; font-size: 12px; font-weight: 500; }
@media (max-width: 480px) { .rc-stat b { font-size: 18px; } }
.rc-wide { max-width: 48rem; }
.rc-classgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; max-height: 14rem; overflow-y: auto; border-radius: 16px; box-shadow: 0 0 0 1px #ececf3; padding: 12px; background: #f8f8fc; }
.rc-formrow { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.rc-formrow > .grow { flex: 1 1 14rem; }
.rc-chip { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; background: #f8f8fc; box-shadow: 0 0 0 1px #dcdce8; padding: 4px 6px 4px 14px; font-size: 14px; }
.rc-bar { width: 96px; height: 8px; border-radius: 999px; background: #ececf3; overflow: hidden; flex-shrink: 0; }
.rc-bar > i { display: block; height: 100%; background: #10b981; }
.rc-rows { border-radius: 16px; background: #fff; box-shadow: 0 0 0 1px #ececf3; }
.rc-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.rc-row + .rc-row { border-top: 1px solid #ececf3; }
.rc-row input.field-input { width: 6rem; text-align: center; }
html[data-theme="dark"] .rc-stat { background: var(--dm-surface-2); box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
html[data-theme="dark"] .rc-stat b { color: #f1f1f8; }
html[data-theme="dark"] .rc-chip, html[data-theme="dark"] .rc-classgrid { background: var(--dm-surface-2); box-shadow: 0 0 0 1px rgba(255,255,255,.1); }
html[data-theme="dark"] .rc-rows { background: var(--dm-surface); box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
html[data-theme="dark"] .rc-row + .rc-row { border-color: rgba(255,255,255,.08); }


/* ===== ثبت نمره (معلم و مدیر) ===== */
.gr-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.gr-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.gr-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; background: #f8f8fc; box-shadow: 0 0 0 1px #ececf3; padding: 6px 14px; font-size: 13px; color: #4a4a63; }
.gr-pill b { color: #1c1c2c; }
.gr-progress { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #6b6b85; margin-bottom: 16px; }
.gr-progress .rc-bar { flex: 1; width: auto; height: 10px; }
.gr-list { display: grid; gap: 8px; }
.gr-row { display: grid; grid-template-columns: 28px 1fr 7rem; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px; background: #fff; box-shadow: 0 0 0 1px #ececf3; transition: box-shadow .15s, background .15s; }
.gr-row:focus-within { box-shadow: 0 0 0 2px #8b5cf6; background: #faf8ff; }
.gr-row .gr-no { color: #8b8ba6; font-size: 12px; text-align: center; }
.gr-row .gr-name { font-weight: 600; color: #1c1c2c; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gr-row input.field-input { width: 100%; text-align: center; font-weight: 700; font-size: 16px; }
.gr-row.is-bad { box-shadow: 0 0 0 2px #ef4444; background: #fef2f2; }
.gr-row.is-done .gr-no { color: #10b981; }
.gr-actions { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 16px; padding: 12px 14px; border-radius: 18px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); box-shadow: 0 0 0 1px #ececf3, 0 8px 24px rgba(60,40,120,.08); }
.gr-actions .gr-hint { font-size: 12px; color: #8b8ba6; }
.gr-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.gr-tile { display: flex; align-items: center; gap: 12px; min-width: 0; border-radius: 18px; padding: 14px 16px; background: #fff; box-shadow: 0 0 0 1px #ececf3; transition: box-shadow .2s, transform .2s; }
.gr-tile:hover { box-shadow: 0 0 0 2px #c4b5fd; transform: translateY(-1px); }
.gr-tile .gr-tile-body { min-width: 0; flex: 1; }
.gr-tile .gr-tile-title { font-weight: 700; color: #1c1c2c; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gr-tile .gr-tile-sub { font-size: 12px; color: #8b8ba6; margin-top: 2px; }
.gr-tile .rc-bar { width: 100%; margin-top: 8px; }
.gr-tile.is-full .rc-bar > i { background: #10b981; }
html[data-theme="dark"] .gr-pill, html[data-theme="dark"] .gr-row, html[data-theme="dark"] .gr-tile { background: var(--dm-surface); box-shadow: 0 0 0 1px rgba(255,255,255,.08); color: #e6e6f2; }
html[data-theme="dark"] .gr-row:focus-within { background: var(--dm-surface-2); box-shadow: 0 0 0 2px #8b5cf6; }
html[data-theme="dark"] .gr-row .gr-name, html[data-theme="dark"] .gr-pill b, html[data-theme="dark"] .gr-tile .gr-tile-title { color: #f1f1f8; }
html[data-theme="dark"] .gr-row.is-bad { background: rgba(239,68,68,.12); }
html[data-theme="dark"] .gr-actions { background: rgba(28,28,44,.92); box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
@media (max-width: 480px) { .gr-row { grid-template-columns: 22px 1fr 5.5rem; gap: 8px; padding: 8px 10px; } }

/* ===== برنامهٔ هفتگی ===== */
.sc-toolbar { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.sc-tool { display: flex; align-items: center; gap: 8px; }
.sc-tool.grow { flex: 1 1 200px; }
.sc-tool .field-input { min-width: 0; }
.sc-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr) 190px; gap: 16px; align-items: start; }
.sc-side { display: flex; flex-direction: column; gap: 8px; min-height: 120px; padding: 10px; border-radius: 20px; background: #f8f8fc; box-shadow: 0 0 0 1px #ececf3; position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow-y: auto; }
.sc-side.is-over { box-shadow: 0 0 0 2px #ef4444; background: #fef2f2; }
.sc-teacher { --h: 260; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 14px; cursor: grab; user-select: none; background: hsl(var(--h) 80% 94%); box-shadow: 0 0 0 1px hsl(var(--h) 60% 82%); transition: transform .12s, box-shadow .12s; }
.sc-teacher:hover { transform: translateY(-1px); }
.sc-teacher.is-selected { box-shadow: 0 0 0 2px hsl(var(--h) 70% 45%); }
.sc-teacher.is-dragging, .sc-slot.is-dragging { opacity: .45; }
.sc-avatar { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: hsl(var(--h) 60% 48%); }
.sc-tname { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; line-height: 1.45; color: #1c1c2c; white-space: normal; overflow-wrap: anywhere; word-break: normal; }
.sc-hours { flex: none; font-size: 11px; color: hsl(var(--h) 40% 35%); }
.sc-gridwrap { overflow-x: auto; border-radius: 20px; background: #fff; box-shadow: 0 0 0 1px #ececf3; }
.sc-grid { width: 100%; min-width: 560px; border-collapse: separate; border-spacing: 6px; table-layout: fixed; }
.sc-grid th { font-size: 13px; color: #4a4a63; font-weight: 700; padding: 8px 4px; }
.sc-grid .sc-corner, .sc-grid .sc-period { width: 84px; white-space: nowrap; }
.sc-grid .sc-period { color: #1c1c2c; background: #f1eefe; border-radius: 14px; }
.sc-grid th small { display: block; font-weight: 500; font-size: 11px; color: #8b8ba6; margin-top: 2px; }
html[data-theme="dark"] .sc-grid .sc-period { background: var(--dm-surface-2); color: #f1f1f8; }
.sc-cell { height: 92px; vertical-align: middle; border-radius: 14px; background: #f8f8fc; box-shadow: inset 0 0 0 1px #ececf3; text-align: center; padding: 0; transition: background .12s; }
.sc-cell:not(.is-full):hover { background: #f1eefe; cursor: pointer; }
.sc-cell.is-over { background: #ede9fe; box-shadow: inset 0 0 0 2px #8b5cf6; }
.sc-plus { color: #c9c9da; font-size: 22px; }
.sc-slot { --h: 260; height: 100%; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; padding: 6px; border-radius: 14px; background: hsl(var(--h) 80% 93%); box-shadow: inset 0 0 0 1px hsl(var(--h) 60% 80%); cursor: grab; text-align: start; }
.sc-slot.no-subject { box-shadow: inset 0 0 0 2px #f59e0b; }
.sc-slot-top { display: flex; align-items: flex-start; gap: 4px; }
.sc-slot .sc-tname { font-size: 12px; line-height: 1.4; }
.sc-x { flex: none; width: 20px; height: 20px; line-height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.08); color: #6b6b85; font-size: 11px; cursor: pointer; }
.sc-x:hover { background: #ef4444; color: #fff; }
.sc-subject { width: 100%; font-family: inherit; font-size: 12px; padding: 4px 6px; border-radius: 8px; border: 1px solid rgba(0,0,0,.12); background: #fff; color: #1c1c2c; }
.sc-warn { margin-bottom: 10px; padding: 8px 12px; border-radius: 12px; background: #fffbeb; color: #b45309; font-size: 13px; }
.sc-sum { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.sc-sumrow { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: #f8f8fc; box-shadow: 0 0 0 1px #ececf3; font-size: 13px; }
.sc-sumrow span { flex: 1; min-width: 0; color: #6b6b85; white-space: normal; overflow-wrap: anywhere; }
.sc-sumrow em { font-style: normal; color: #8b8ba6; font-size: 12px; }
.sc-toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); z-index: 60; max-width: 90vw; padding: 10px 18px; border-radius: 14px; background: #1c1c2c; color: #fff; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
@media (max-width: 1100px) {
  .sc-layout { grid-template-columns: 1fr; }
  .sc-side { position: static; flex-direction: row; flex-wrap: wrap; max-height: none; min-height: 0; }
  .sc-teacher { flex: 1 1 160px; }
  .sc-center { order: 3; }
}
html[data-theme="dark"] .sc-side, html[data-theme="dark"] .sc-gridwrap, html[data-theme="dark"] .sc-sumrow { background: var(--dm-surface); box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
html[data-theme="dark"] .sc-cell { background: var(--dm-surface-2); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
html[data-theme="dark"] .sc-grid th, html[data-theme="dark"] .sc-sumrow b { color: #e6e6f2; }
html[data-theme="dark"] .sc-teacher, html[data-theme="dark"] .sc-slot { background: hsl(var(--h) 30% 22%); box-shadow: inset 0 0 0 1px hsl(var(--h) 30% 34%); }
html[data-theme="dark"] .sc-tname { color: #f1f1f8; }
html[data-theme="dark"] .sc-hours { color: #c9c9da; }
html[data-theme="dark"] .sc-subject { background: var(--dm-surface); color: #f1f1f8; border-color: rgba(255,255,255,.15); }


/* ===== تحلیل کارنامه (پنل مدیر) ===== */
.an-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.an-kpis--tight { margin-bottom: 16px; }
.an-kpi { border-radius: 18px; background: #fff; box-shadow: 0 0 0 1px #ececf3; padding: 12px 14px; text-align: center; }
.an-kpi small { display: block; color: #8b8ba6; font-size: 12px; }
.an-kpi b { display: block; color: #1c1c2c; font-size: 22px; line-height: 1.5; }
.an-kpi b em { font-style: normal; color: #8b8ba6; font-size: 12px; font-weight: 500; }
.an-kpi > span { display: block; font-size: 12px; }
.an-kpi.is-up { box-shadow: 0 0 0 1.5px #a7f3d0; background: #f3fdf8; }
.an-kpi.is-down { box-shadow: 0 0 0 1.5px #fecaca; background: #fff6f6; }

.an-delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.an-delta.is-up { color: #059669; }
.an-delta.is-down { color: #dc2626; }
.an-delta.is-flat { color: #8b8ba6; }

.an-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px; border-radius: 18px; background: #fff; box-shadow: 0 0 0 1px #ececf3; scrollbar-width: thin; }
.an-tab { flex: 0 0 auto; padding: 9px 14px; border-radius: 14px; font-size: 13.5px; font-weight: 600; color: #6b6b85; white-space: nowrap; transition: background .15s, color .15s; }
.an-tab:hover { background: #f4f3ff; color: #5b2ec9; }
.an-tab.is-active { background: linear-gradient(135deg, #7c3ce8, #6a3ce3 45%, #2790fb); color: #fff; box-shadow: 0 6px 16px -6px rgba(106, 60, 227, .5); }

.an-controls { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 12px; }
.an-seg { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.an-seg-label { font-size: 12px; color: #8b8ba6; margin-inline-end: 4px; }
.an-seg a { padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: #52526b; background: #f6f6f9; box-shadow: inset 0 0 0 1px #dcdce8; }
.an-seg a:hover { background: #ebe9fe; }
.an-seg a.is-on { background: #6a3ce3; color: #fff; box-shadow: none; }
.an-note { font-size: 12.5px; line-height: 1.9; color: #6b6b85; background: #f8f8fc; border-radius: 14px; padding: 10px 14px; box-shadow: 0 0 0 1px #ececf3; margin-bottom: 14px; }

.an-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.an-podium-card { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; padding: 14px 10px; border-radius: 20px; background: #fff; box-shadow: 0 0 0 1px #ececf3; transition: transform .2s, box-shadow .2s; min-width: 0; }
.an-podium-card:hover { transform: translateY(-2px); box-shadow: 0 0 0 2px #c4b5fd; }
.an-podium-card b { color: #1c1c2c; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-podium-card > small { color: #8b8ba6; font-size: 11.5px; }
.an-podium-nums { display: flex; flex-direction: column; align-items: center; margin-top: 6px; }
.an-podium-nums small { color: #8b8ba6; font-size: 11.5px; }
.an-medal { font-size: 28px; line-height: 1.2; }
.an-p1 { background: linear-gradient(180deg, #fffbeb, #fff); box-shadow: 0 0 0 1.5px #fde68a; }
.an-p2 { background: linear-gradient(180deg, #f6f7fb, #fff); }
.an-p3 { background: linear-gradient(180deg, #fff7ed, #fff); }
@media (max-width: 560px) { .an-podium { grid-template-columns: 1fr; } }

/* توزیع نمرات */
.an-dist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.an-dist { border-radius: 20px; background: #fff; box-shadow: 0 0 0 1px #ececf3; padding: 14px 14px 12px; min-width: 0; }
.an-dist.is-total { grid-column: 1 / -1; background: #faf9ff; box-shadow: 0 0 0 1.5px #ddd6fe; }
.an-dist header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.an-dist h4 { font-weight: 700; color: #1c1c2c; font-size: 14.5px; }
.an-dist-n { font-size: 12px; color: #8b8ba6; }
.an-hist { direction: ltr; display: flex; align-items: stretch; gap: 3px; height: 130px; margin-bottom: 10px; }
.an-hist-col { flex: 1 1 0; display: flex; flex-direction: column; min-width: 0; }
.an-hist-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-bottom: 1px solid #dcdce8; }
.an-hist-bar { position: relative; flex: 1 1 0; max-width: 16px; min-height: 0; border-radius: 4px 4px 0 0; }
.an-hist-bar.is-cur { background: #6a3ce3; }
.an-hist-bar.is-base { background: #cfc6f7; }
.an-hist-col.is-fail .is-cur { background: #ef4444; }
.an-hist-col.is-fail .is-base { background: #fbc4c4; }
.an-hist-bar em { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 10px; color: #6b6b85; line-height: 1.4; }
.an-hist-label { font-size: 9.5px; color: #8b8ba6; text-align: center; padding-top: 3px; white-space: nowrap; }
.an-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; }
.an-stats div { min-width: 0; }
.an-stats dt { font-size: 11px; color: #8b8ba6; }
.an-stats dd { font-size: 13px; font-weight: 700; color: #1c1c2c; }

/* دانش‌آموز */
.an-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.an-chip { padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #f8f8fc; box-shadow: inset 0 0 0 1px #dcdce8; color: #2c2c40; }
.an-chip small { color: #8b8ba6; margin-inline-start: 4px; }
.an-chip:hover { background: #ebe9fe; }
.an-chip.is-on { background: #6a3ce3; color: #fff; box-shadow: none; }
.an-chip.is-on small { color: #ddd6fe; }
.an-insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 16px; }
.an-insight { border-radius: 16px; padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13px; }
.an-insight > b { flex: 0 0 100%; font-size: 12px; }
.an-insight span { font-weight: 600; }
.an-insight em { font-style: normal; font-size: 12px; }
.an-insight.is-good { background: #f3fdf8; box-shadow: inset 0 0 0 1px #a7f3d0; color: #047857; }
.an-insight.is-bad { background: #fff6f6; box-shadow: inset 0 0 0 1px #fecaca; color: #b91c1c; }
.an-bar { position: relative; height: 10px; border-radius: 999px; background: #ececf3; min-width: 140px; }
.an-bar > i { position: absolute; inset-block: 0; right: 0; border-radius: 999px; background: #6a3ce3; }
.an-bar > i.is-fail { background: #ef4444; }
.an-mark { position: absolute; top: -3px; width: 3px; height: 16px; border-radius: 2px; transform: translateX(50%); }
.an-mark--class { background: #0ea5e9; }
.an-mark--grade { background: #f59e0b; }
.an-spark { width: 100%; max-width: 560px; height: auto; }
.an-spark-axis { stroke: #dcdce8; stroke-width: .4; }
.an-spark-line { fill: none; stroke: #6a3ce3; stroke-width: .9; stroke-linejoin: round; stroke-linecap: round; }
.an-spark-dot { fill: #fff; stroke: #6a3ce3; stroke-width: .8; }
.an-spark-val { font-size: 3.6px; font-weight: 700; fill: #1c1c2c; }
.an-spark-lbl { font-size: 3.4px; fill: #8b8ba6; }

/* خوشه‌ها */
.an-scatter-wrap { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: center; margin-bottom: 18px; }
@media (max-width: 720px) { .an-scatter-wrap { grid-template-columns: 1fr; } }
.an-scatter { width: 100%; height: auto; border-radius: 16px; }
.an-scatter-bg { fill: #faf9ff; stroke: #e4e0fb; stroke-width: .3; }
.an-scatter-zero { stroke: #c9c4e8; stroke-width: .3; stroke-dasharray: 1.2 1.2; }
.an-scatter-axis { font-size: 3px; fill: #8b8ba6; }
.an-legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: #2c2c40; font-weight: 600; }
.an-legend li { display: flex; align-items: center; gap: 8px; }
.an-legend small { color: #8b8ba6; font-weight: 500; }
.an-legend i, .an-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
circle.an-c0, i.an-c0 { fill: #10b981; background: #10b981; }
circle.an-c1, i.an-c1 { fill: #0ea5e9; background: #0ea5e9; }
circle.an-c2, i.an-c2 { fill: #f59e0b; background: #f59e0b; }
circle.an-c3, i.an-c3 { fill: #ef4444; background: #ef4444; }
circle[class^="an-c"] { fill-opacity: .75; }
.an-cluster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.an-cluster { border-radius: 20px; background: #fff; box-shadow: 0 0 0 1px #ececf3; padding: 14px; min-width: 0; }
.an-cluster header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.an-cluster h4 { font-weight: 700; color: #1c1c2c; font-size: 14.5px; flex: 1 1 auto; }
.an-cluster-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0; text-align: center; }
.an-cluster-nums small { display: block; font-size: 11px; color: #8b8ba6; }
.an-cluster-nums b { font-size: 15px; color: #1c1c2c; }
.an-cluster summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: #5b2ec9; padding: 6px 0; }
.an-members { max-height: 18rem; overflow-y: auto; font-size: 13px; }
.an-members li { display: flex; align-items: center; gap: 8px; padding: 5px 2px; border-top: 1px solid #f0f0f6; }
.an-members li a { font-weight: 600; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-members li a:hover { color: #6a3ce3; }
.an-members li small { color: #8b8ba6; }
.an-members li span { display: inline-flex; gap: 6px; align-items: center; font-weight: 700; }

/* معلمان */
.an-teachers { display: grid; gap: 10px; }
.an-teacher { border-radius: 18px; background: #fff; box-shadow: 0 0 0 1px #ececf3; overflow: hidden; }
.an-teacher.is-red { box-shadow: 0 0 0 1.5px #fecaca; }
.an-teacher.is-amber { box-shadow: 0 0 0 1.5px #fde68a; }
.an-teacher.is-emerald { box-shadow: 0 0 0 1.5px #a7f3d0; }
.an-teacher > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(150px, 1.6fr) repeat(5, minmax(70px, .7fr)) minmax(160px, 1.8fr); gap: 10px; align-items: center; padding: 12px 14px; }
.an-teacher > summary::-webkit-details-marker { display: none; }
.an-teacher[open] > summary { background: #faf9ff; border-bottom: 1px solid #ececf3; }
.an-t-name b { display: block; color: #1c1c2c; }
.an-t-name small { color: #8b8ba6; font-size: 11.5px; }
.an-t-num { text-align: center; min-width: 0; }
.an-t-num small { display: block; font-size: 10.5px; color: #8b8ba6; white-space: nowrap; }
.an-t-num b { font-size: 14px; color: #1c1c2c; }
.an-t-flags { display: flex; flex-wrap: wrap; gap: 4px; }
.an-teacher .table-wrap { margin: 10px; box-shadow: 0 0 0 1px #ececf3; }
@media (max-width: 900px) {
  .an-teacher > summary { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .an-t-name, .an-t-flags { grid-column: 1 / -1; }
}
@media (max-width: 560px) { .an-wide-col { display: none !important; } }

/* ----- تیره ----- */
html[data-theme="dark"] .an-kpi, html[data-theme="dark"] .an-tabs, html[data-theme="dark"] .an-podium-card,
html[data-theme="dark"] .an-dist, html[data-theme="dark"] .an-cluster, html[data-theme="dark"] .an-teacher { background: var(--dm-surface); box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
html[data-theme="dark"] .an-dist.is-total, html[data-theme="dark"] .an-teacher[open] > summary, html[data-theme="dark"] .an-note, html[data-theme="dark"] .an-chip, html[data-theme="dark"] .an-seg a { background: var(--dm-surface-2); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); color: #e6e6f2; }
html[data-theme="dark"] .an-kpi b, html[data-theme="dark"] .an-podium-card b, html[data-theme="dark"] .an-dist h4, html[data-theme="dark"] .an-stats dd,
html[data-theme="dark"] .an-cluster h4, html[data-theme="dark"] .an-cluster-nums b, html[data-theme="dark"] .an-t-name b, html[data-theme="dark"] .an-t-num b { color: #f1f1f8; }
html[data-theme="dark"] .an-tab { color: #b7b7cf; }
html[data-theme="dark"] .an-tab:hover { background: var(--dm-surface-2); color: #fff; }
html[data-theme="dark"] .an-tab.is-active, html[data-theme="dark"] .an-seg a.is-on, html[data-theme="dark"] .an-chip.is-on { color: #fff; }
html[data-theme="dark"] .an-p1, html[data-theme="dark"] .an-p2, html[data-theme="dark"] .an-p3 { background: var(--dm-surface); }
html[data-theme="dark"] .an-kpi.is-up { background: rgba(16,185,129,.1); box-shadow: 0 0 0 1.5px rgba(16,185,129,.4); }
html[data-theme="dark"] .an-kpi.is-down { background: rgba(239,68,68,.1); box-shadow: 0 0 0 1.5px rgba(239,68,68,.4); }
html[data-theme="dark"] .an-bar { background: var(--dm-surface-3); }
html[data-theme="dark"] .an-hist-bar.is-base { background: #4b4580; }
html[data-theme="dark"] .an-hist-col.is-fail .is-base { background: #7a3340; }
html[data-theme="dark"] .an-hist-bars { border-color: var(--dm-border); }
html[data-theme="dark"] .an-scatter-bg { fill: var(--dm-surface-2); stroke: var(--dm-border); }
html[data-theme="dark"] .an-spark-val { fill: #f1f1f8; }
html[data-theme="dark"] .an-spark-dot { fill: var(--dm-surface); }
html[data-theme="dark"] .an-legend, html[data-theme="dark"] .an-members li a { color: #e6e6f2; }
html[data-theme="dark"] .an-members li { border-color: var(--dm-border); }
html[data-theme="dark"] .an-insight.is-good { background: rgba(16,185,129,.1); color: #6ee7b7; }
html[data-theme="dark"] .an-insight.is-bad { background: rgba(239,68,68,.1); color: #fca5a5; }
html[data-theme="dark"] .an-delta.is-up { color: #34d399; }
html[data-theme="dark"] .an-delta.is-down { color: #f87171; }


/* ---------- جدول‌های وسط‌چین (وضعیت اعلان‌ها) ---------- */
.x-center th, .x-center td { text-align: center; vertical-align: middle; }
.x-center .x-stack { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.x-center .x-guardian { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; }
.x-center-block { text-align: center; }
@media (max-width: 767px) {
  .x-cards.x-center td { text-align: center; }
  .x-cards.x-center td > * { text-align: center; }
}

/* ---------- کارت‌های «اطلاع غیبت از قبل» ---------- */
.x-notice-box { margin-bottom: 24px; padding: 14px; border-radius: 22px; background: #f0fbf6; box-shadow: inset 0 0 0 1px #bfe9d3; }
.x-notice-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 12px; font-size: 14px; font-weight: 800; color: #0b5d3b; }
.x-notice-sub { font-size: 11.5px; font-weight: 600; color: #4d8a6c; }
.x-notice-count { margin-inline-start: auto; min-width: 26px; height: 26px; padding: 0 9px; border-radius: 999px; background: #10b981; color: #fff; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.x-notice-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 10px; }
.x-notice-card { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: 16px; background: #fff; box-shadow: 0 1px 0 rgba(30, 27, 60, .04), inset 0 0 0 1px #d6efe2; }
.x-notice-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.x-notice-name { font-size: 14px; font-weight: 800; color: #1c1c2c; min-width: 0; overflow-wrap: anywhere; }
.x-notice-class { flex: none; padding: 3px 10px; border-radius: 999px; background: #eef2ff; color: #3b3fa8; font-size: 11.5px; font-weight: 700; }
.x-notice-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.x-notice-date { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 10px; background: #ecfdf5; color: #0b6b44; font-size: 12px; font-weight: 700; }
.x-notice-to { margin-inline: 4px; font-weight: 600; opacity: .75; }
.x-notice-reason { padding: 4px 10px; border-radius: 10px; background: #f5f5fa; color: #55556f; font-size: 12px; font-weight: 600; }

/* ---------- platform/sysadmin sidebar: همان design system پنل‌های مدرسه ---------- */
.sys-side-link{display:flex;align-items:center;gap:10px;width:100%;padding:9px 12px;border-radius:16px;color:#68687f;text-decoration:none;font-size:13px;font-weight:700;transition:background .15s,color .15s,transform .15s}
.sys-side-link:hover{background:#f5f3ff;color:#5730c9;transform:translateY(-1px)}
.sys-side-link.is-active{background-image:linear-gradient(135deg,#7c3ce8,#6a3ce3 48%,#2790fb);color:#fff;box-shadow:0 7px 18px -10px rgba(106,60,227,.55)}
.sys-side-link.is-active .sys-side-meta{color:rgba(255,255,255,.75)}
.sys-side-meta{font-size:10px;color:#a3a3b8;font-weight:500;display:block;margin-top:1px}
.sys-table-wrap{overflow:auto;border-radius:20px;box-shadow:inset 0 0 0 1px #ececf3}
.sys-table{width:100%;border-collapse:separate;border-spacing:0;min-width:760px;background:#fff}
.sys-table th{padding:12px 14px;color:#8b8ba6;font-size:11px;font-weight:800;text-align:right;border-bottom:1px solid #ececf3;background:#fafafe}
.sys-table td{padding:13px 14px;border-bottom:1px solid #f0f0f5;font-size:13px;vertical-align:middle}
.sys-table tr:last-child td{border-bottom:0}
.sys-module-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:10px}
.sys-module-card{display:flex;gap:10px;align-items:flex-start;padding:12px;border-radius:18px;background:#fafafe;box-shadow:inset 0 0 0 1px #ececf3;transition:transform .15s,box-shadow .15s}
.sys-module-card:hover{transform:translateY(-1px);box-shadow:0 8px 24px -18px rgba(30,27,60,.35),inset 0 0 0 1px #dcd7fb}
html[data-theme="dark"] .sys-side-link:not(.is-active){color:var(--dm-text-4)}
html[data-theme="dark"] .sys-side-link:not(.is-active):hover{background:var(--dm-surface-2);color:var(--dm-text-1)}
html[data-theme="dark"] .sys-table,.sys-table-wrap{background:var(--dm-surface-1)}
html[data-theme="dark"] .sys-table th{background:var(--dm-surface-2);color:var(--dm-text-4);border-color:var(--dm-border)}
html[data-theme="dark"] .sys-table td{border-color:var(--dm-border);color:var(--dm-text-2)}
html[data-theme="dark"] .sys-module-card{background:var(--dm-surface-2);box-shadow:inset 0 0 0 1px var(--dm-border)}
@media(max-width:1023px){.sys-desktop-nav{display:none!important}}
