/* ============================================================
   سامانهٔ دبیرستان — طرح‌بندی و اجزای رابط کاربری (RTL)
   تم: سمپاد — نیلی/بنفش عمیق + طلایی
   ============================================================ */

/* فونت Vazirmatn به‌صورت محلی از app/static/fonts سرو می‌شود؛ هیچ درخواستی به
   Google Fonts یا شبکهٔ بیرونی زده نمی‌شود. فایل یک فونت متغیر است و وزن
   ۱۰۰ تا ۹۰۰ را پوشش می‌دهد. در صورت بارگیری‌نشدن فایل، فونت‌های سیستمی
   فارسی موجود در font-family به‌عنوان پشتیبان استفاده می‌شوند. */
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/Vazirmatn-Variable.woff2") format("woff2");
}

:root {
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-2: #eef2f7;
  --bg: #f4f6fb;
  --card: #ffffff;

  --brand: #312e81;
  --brand-2: #4338ca;
  --brand-3: #6366f1;
  --brand-soft: #eef0ff;
  --gold: #b8860b;
  --gold-2: #d4a017;
  --gold-soft: #fdf6e3;

  --ok: #15803d;
  --ok-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --bad: #b91c1c;
  --bad-soft: #fee2e2;
  --info: #0369a1;
  --info-soft: #e0f2fe;

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --sh-1: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .06);
  --sh-2: 0 4px 16px rgba(15, 23, 42, .07);
  --sh-3: 0 18px 48px rgba(30, 27, 75, .16);
  --sidebar-w: 252px; /* ۲۰٪ عریض‌تر از ۲۱۰px قبلی */
  --topbar-h: 68px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Vazirmatn", Tahoma, "IRANSans", "Segoe UI", sans-serif;
  font-size: 14.5px;
  line-height: 1.9;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(1100px 480px at 100% -12%, #e8e9ff 0%, rgba(232, 233, 255, 0) 62%),
    radial-gradient(900px 420px at 0% 0%, #fdf3d9 0%, rgba(253, 243, 217, 0) 55%);
  background-attachment: fixed;
}

a { color: var(--brand-2); text-decoration: none; }
a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 { margin: 0 0 .6rem; line-height: 1.55; font-weight: 700; letter-spacing: -.2px; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.06rem; }
h4 { font-size: .96rem; }
p { margin: .5rem 0; }
small { color: var(--muted); font-size: .82em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  background: var(--brand-soft); color: var(--brand);
  padding: 2px 6px; border-radius: 6px; font-size: .88em; direction: ltr; display: inline-block;
}
img { max-width: 100%; }

/* ---------------- layout ---------------- */
.app { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0; /* سمت راست در حالت RTL */
  width: var(--sidebar-w);
  background: linear-gradient(178deg, #241f5c 0%, #1b1747 52%, #14112f 100%);
  color: #d9d7f5;
  display: flex;
  flex-direction: column;
  z-index: 60;
  box-shadow: -14px 0 40px rgba(15, 23, 42, .16);
  overflow: hidden;
}
.sidebar::after {
  content: "";
  position: absolute; inset-inline-end: 0; top: 0; bottom: 0; width: 1px; /* لبه سمت چپ سایدبار */
  background: linear-gradient(180deg, rgba(212, 160, 23, .5), rgba(99, 102, 241, .25), transparent);
}
.sb-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.sb-logo {
  width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 13px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--gold-2), #a97a06);
  color: #241f5c; font-weight: 900; font-size: 19px;
  box-shadow: 0 6px 18px rgba(212, 160, 23, .32);
}
.sb-brand b { display: block; color: #fff; font-size: .92rem; line-height: 1.5; font-weight: 700; white-space: normal; }
.sb-brand span { display: block; font-size: .72rem; color: #a9a5d8; letter-spacing: .4px; }

.sb-scroll { flex: 1; overflow-y: auto; padding: 14px 12px 22px; scrollbar-width: thin; }
.sb-scroll::-webkit-scrollbar { width: 6px; }
.sb-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 99px; }

.sb-cap {
  font-size: .68rem; letter-spacing: 1.2px; color: #8d88c4;
  padding: 14px 12px 6px; font-weight: 700;
}
.sb-link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; margin: 2px 0;
  border-radius: 11px;
  color: #cfccef; font-size: .9rem; font-weight: 500;
  transition: background .16s, color .16s, transform .16s;
  text-decoration: none;
}
.sb-link:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; transform: translateX(-2px); }
.sb-link.on {
  background: linear-gradient(90deg, rgba(212, 160, 23, .22), rgba(99, 102, 241, .28));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(212, 160, 23, .35);
}
.sb-link.on .sb-ico { background: rgba(212, 160, 23, .9); color: #241f5c; }
.sb-ico {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .09);
  font-size: 15px; color: #e6e4ff;
}
.sb-ico svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sb-badge {
  margin-inline-start: auto;
  background: var(--gold-2); color: #241f5c;
  font-size: .7rem; font-weight: 700; padding: 1px 8px; border-radius: 99px;
}
.sb-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .07); }

.main {
  margin-inline-start: var(--sidebar-w); /* فاصله از سمت راست */
  min-height: 100vh;
  display: flex; flex-direction: column;
}

.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 26px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.tb-title { font-weight: 700; font-size: 1.02rem; color: var(--ink); }
.tb-title small { display: block; font-weight: 400; font-size: .74rem; color: var(--muted); }
.tb-spacer { margin-inline-start: auto; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: #fff; border: 1px solid var(--line); color: var(--ink-2);
  cursor: pointer; transition: .16s;
}
.icon-btn:hover { border-color: var(--brand-3); color: var(--brand-2); background: var(--brand-soft); }
.icon-btn svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#sbToggle { display: none; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 99px; padding: 4px 6px 4px 14px;
}
.user-chip .av {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--brand-3), var(--brand));
  color: #fff; font-weight: 700; font-size: .82rem;
}
.user-chip b { font-size: .85rem; font-weight: 600; line-height: 1.3; }
.user-chip span { display: block; font-size: .7rem; color: var(--muted); }

.content { flex: 1; padding: 26px 28px 44px; max-width: 1320px; width: 100%; }

.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1, .page-head h2 { margin: 0; }
.page-head .sub-t { color: var(--muted); font-size: .85rem; }

.crumbs { display: flex; gap: 6px; align-items: center; font-size: .78rem; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.crumbs span { opacity: .55; }

.foot {
  padding: 16px 28px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .76rem;
  display: flex; gap: 10px 18px; flex-wrap: wrap; align-items: center;
}
.foot-brand b { color: var(--brand); font-size: .84rem; }
.foot-phone { margin-inline-start: auto; direction: rtl; }
.foot-phone b { color: var(--ink); letter-spacing: .3px; }

/* گالری صفحهٔ اصلی و جعبهٔ اطلاعات مدرسه */
.home-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 12px; }
.home-gallery-tile { display: block; position: relative; overflow: hidden; border-radius: 16px; border: 1px solid var(--line); background: var(--brand-soft); box-shadow: var(--sh-1); }
.home-gallery-tile img { display: block; width: 100%; height: 148px; object-fit: cover; transition: transform .35s; }
.home-gallery-tile:hover img { transform: scale(1.05); }
.home-gallery-tile span { position: absolute; inset-inline: 0; bottom: 0; padding: 18px 12px 9px; color: #fff; font-size: .78rem; background: linear-gradient(0deg, rgba(15,23,42,.78), transparent); }
.home-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.home-info-item { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; box-shadow: var(--sh-1); }
.home-info-item b { display: block; color: var(--brand); font-size: .84rem; margin-bottom: 4px; }
.home-info-item p { margin: 0; color: var(--ink-2); font-size: .9rem; line-height: 2; }

/* نمایش تمام‌صفحهٔ گالری با کلیدهای قبلی/بعدی */
.gallery-tile.is-active { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.lightbox { position: fixed; inset: 0; z-index: 200; display: none; background: rgba(10, 12, 30, .92); padding: 22px; }
.lightbox.open { display: grid; grid-template-rows: 1fr auto; gap: 12px; }
.lightbox-stage { position: relative; display: grid; place-items: center; min-height: 0; }
.lightbox-stage img { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.lightbox-close { position: absolute; top: 0; inset-inline-end: 0; z-index: 3; background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.lightbox-stage img { max-height: calc(100vh - 150px); }
.lightbox[aria-hidden="true"] { display: none; }
.lightbox-nav { display: flex; align-items: center; justify-content: center; gap: 14px; color: #e2e8f0; }
.lightbox-nav button { border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.1); color: #fff; border-radius: 12px; padding: 8px 18px; cursor: pointer; font-size: .95rem; }
.lightbox-nav button:hover { background: var(--gold-2); color: #241f5c; }
.lightbox-count { font-size: .82rem; color: #cbd5e1; direction: ltr; }
.lightbox-title { color: #f8fafc; font-size: .9rem; font-weight: 600; max-width: 45vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 620px) { .foot-phone { margin-inline-start: 0; } .home-gallery-tile img { height: 118px; } }

/* ---------------- cards ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  margin: 0 0 18px;
  box-shadow: var(--sh-1);
}
.card > h3:first-child, .card > h2:first-child { margin-top: 0; }
.card-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-h h3 { margin: 0; }
.card-h .tb-spacer { margin-inline-start: auto; }
.card-hint { color: var(--muted); font-size: .78rem; font-weight: 400; }

.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.g-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.card.grid, .card.g-2, .card.g-3 { margin-bottom: 0; }

/* ---------------- Dashboard Cards (New) ---------------- */
.dash-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--sh-1);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.dash-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-3);
  text-decoration: none;
  color: inherit;
  border-color: var(--brand-3);
}
.dash-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: 0 0 54px;
}
.dash-icon svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dash-card h3 { margin: 0 0 4px; font-size: 1.05rem; color: var(--ink); }
.dash-card p { margin: 0; font-size: .8rem; color: var(--muted); }

/* ---------------- KPI ---------------- */
.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 0 0 18px; }
.kpi > div {
  position: relative; overflow: hidden;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px 18px 14px;
  box-shadow: var(--sh-1);
  font-size: .78rem; color: var(--muted); font-weight: 500;
}
.kpi > div::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--brand-3), var(--brand));
}
.kpi > div:nth-child(3n+2)::before { background: linear-gradient(180deg, var(--gold-2), #a97a06); }
.kpi > div:nth-child(3n+3)::before { background: linear-gradient(180deg, #22c55e, #15803d); }
.kpi b {
  display: block; font-size: 1.6rem; font-weight: 700; color: var(--ink);
  line-height: 1.4; margin-top: 2px; letter-spacing: -.5px;
}
.kpi b small { font-size: .55em; font-weight: 500; color: var(--muted); }
.kpi .k-ico {
  position: absolute; inset-inline-end: 14px; top: 14px;
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-2);
}
.kpi .k-ico svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------- buttons ---------------- */
.btn, button, input[type="submit"] {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: inherit; font-size: .86rem; font-weight: 600;
  padding: 9px 18px; border-radius: 11px;
  border: 1px solid transparent;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  color: #fff; cursor: pointer;
  box-shadow: 0 4px 12px rgba(49, 46, 129, .22);
  transition: transform .12s, box-shadow .16s, background .16s, color .16s;
  text-decoration: none; line-height: 1.6; white-space: nowrap;
}
.btn:hover, button:hover, input[type="submit"]:hover {
  background: linear-gradient(180deg, var(--brand-3), var(--brand-2));
  color: #fff; text-decoration: none;
  box-shadow: 0 7px 20px rgba(49, 46, 129, .3);
  transform: translateY(-1px);
}
.btn:active, button:active { transform: translateY(0); }
.btn.ghost, button.ghost {
  background: #fff; color: var(--brand-2); border-color: var(--line);
  box-shadow: var(--sh-1);
}
.btn.ghost:hover, button.ghost:hover { background: var(--brand-soft); border-color: var(--brand-3); color: var(--brand); }
.btn.gold { background: linear-gradient(180deg, var(--gold-2), #a97a06); color: #241f5c; box-shadow: 0 4px 14px rgba(184, 134, 11, .3); }
.btn.gold:hover { background: linear-gradient(180deg, #e6b52a, var(--gold-2)); color: #241f5c; }
.btn.danger, button.danger { background: linear-gradient(180deg, #dc2626, #991b1b); box-shadow: 0 4px 12px rgba(185, 28, 28, .25); }
.btn.sm, button.sm { padding: 5px 12px; font-size: .78rem; border-radius: 9px; }
.btn.xs, button.xs { padding: 3px 9px; font-size: .72rem; border-radius: 8px; box-shadow: none; }
.btn.block { width: 100%; }

/* ---------------- forms ---------------- */
label { font-size: .8rem; font-weight: 600; color: var(--ink-2); display: block; }
input, textarea, select {
  font-family: inherit; font-size: .88rem; color: var(--ink);
  width: 100%; padding: 9px 12px; margin: 4px 0 0;
  background: #fff;
  border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--brand-3);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .16);
}
input[type="file"] { padding: 7px 10px; background: #fbfcff; font-size: .8rem; }
input[type="checkbox"], input[type="radio"] { width: auto; margin: 0 4px 0 0; vertical-align: middle; }
textarea { min-height: 110px; resize: vertical; line-height: 1.9; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(0% + 14px) calc(50% + 2px), calc(0% + 19px) calc(50% + 2px); background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-inline-start: 32px; }
select[multiple] { background-image: none; padding-inline-start: 12px; }

.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.form-row > * { flex: 1 1 160px; }
.form-row > button { flex: 0 0 auto; }
.inline { display: inline; }
.inline-form { display: inline-flex; gap: 4px; align-items: center; margin: 0; }

/* filter bar */
.flt {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  background: linear-gradient(180deg, #fbfcff, #f6f8fd);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
  margin: 0 0 18px;
}
.flt label { font-size: .74rem; color: var(--muted); letter-spacing: .2px; }
.flt label select, .flt label input { margin-top: 3px; font-weight: 500; }
.flt button { align-self: end; }

.err { color: var(--bad); background: var(--bad-soft); border: 1px solid #fecaca; padding: 9px 14px; border-radius: 10px; font-size: .85rem; }

/* ---------------- tables ---------------- */
.table-wrap {
  overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r);
  background: #fff; margin: 0 0 14px;
  scrollbar-width: thin;
}
.table-wrap::-webkit-scrollbar { height: 8px; }
.table-wrap::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .85rem; }
thead th {
  position: sticky; top: 0; z-index: 2;
  background: linear-gradient(180deg, #f8faff, #eef1fa);
  color: var(--ink-2); font-weight: 700; font-size: .78rem;
  text-align: right; white-space: nowrap;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}
tbody td, table > tr > td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .13s; }
tbody tr:hover { background: #f8faff; }
tbody tr:nth-child(even) { background: #fcfdff; }
tbody tr:nth-child(even):hover { background: #f5f8ff; }
td.n, th.n { text-align: center; font-variant-numeric: tabular-nums; }
td.num { font-variant-numeric: tabular-nums; font-weight: 600; }
tfoot td { background: #f8faff; font-weight: 700; border-top: 2px solid var(--line); }

/* legacy bare tables (no wrapper) */
.card > table, .content > table { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.card > table td, .card > table th { padding: 9px 14px; border-bottom: 1px solid var(--line-2); }
.card > table tr:last-child td { border-bottom: 0; }

/* score row colors */
.sc-great td, tr.sc-great td { background: #e7f8ee !important; }
.sc-good td, tr.sc-good td { background: #eef4fe !important; }
.sc-mid td, tr.sc-mid td { background: #fff8e6 !important; }
.sc-bad td, tr.sc-bad td { background: #fdeaea !important; }

/* ---------------- badges / pills ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 700; line-height: 1.7;
  padding: 2px 10px; border-radius: 99px;
  background: var(--brand-soft); color: var(--brand);
  border: 1px solid #dcdcfb;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: #bbf7d0; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: #fde68a; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: #fecaca; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: #bae6fd; }
.badge.gold { background: var(--gold-soft); color: var(--gold); border-color: #f2e0b0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------------- tabs ---------------- */
.sub, .tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }
.sub a, .tabs a {
  padding: 8px 16px; border-radius: 11px;
  background: #fff; border: 1px solid var(--line);
  color: var(--ink-2); font-size: .84rem; font-weight: 600;
  text-decoration: none; box-shadow: var(--sh-1);
  transition: .16s;
}
.sub a:hover, .tabs a:hover { border-color: var(--brand-3); color: var(--brand-2); text-decoration: none; }
.sub a.on, .tabs a.on {
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  border-color: transparent; color: #fff;
  box-shadow: 0 6px 18px rgba(49, 46, 129, .26);
}

/* ---------------- alerts ---------------- */
.alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 16px; border-radius: var(--r);
  font-size: .86rem; margin: 0 0 16px;
  border: 1px solid var(--line); background: #fff;
}
.alert.ok { background: var(--ok-soft); border-color: #bbf7d0; color: #14532d; }
.alert.warn { background: var(--warn-soft); border-color: #fde68a; color: #78350f; }
.alert.bad { background: var(--bad-soft); border-color: #fecaca; color: #7f1d1d; }
.alert.info { background: var(--info-soft); border-color: #bae6fd; color: #0c4a6e; }
.alert b { font-weight: 700; }

/* ---------------- news / gallery ---------------- */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.news-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--sh-1);
  display: flex; flex-direction: column;
  transition: transform .18s, box-shadow .18s;
}
.news-card:hover { transform: translateY(-3px); box-shadow: var(--sh-3); }
.news-card .cover { width: 100%; height: 172px; object-fit: cover; display: block; background: var(--brand-soft); }
.news-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.news-card h3 { margin: 0; font-size: 1rem; line-height: 1.65; }
.news-card h3 a { color: var(--ink); }
.news-card h3 a:hover { color: var(--brand-2); text-decoration: none; }
.news-card .meta { font-size: .74rem; color: var(--muted); }
.news-card p { margin: 0; color: var(--ink-2); font-size: .84rem; line-height: 1.9; }
.news-card .more { margin-top: auto; font-size: .8rem; font-weight: 600; }

.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.gal-grid figure {
  margin: 0; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; box-shadow: var(--sh-1);
}
.gal-grid img { width: 100%; height: 150px; object-fit: cover; display: block; }
.gal-grid figcaption { padding: 8px 12px; font-size: .8rem; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.gal-grid figcaption form { margin-inline-start: auto; }

.article { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0; overflow: hidden; box-shadow: var(--sh-1); }
.article .hero { width: 100%; max-height: 380px; object-fit: cover; display: block; }
.article .inner { padding: 24px 28px 32px; }
.article .inner h2 { margin-bottom: 4px; }
.article .prose { line-height: 2.15; font-size: .95rem; color: var(--ink-2); }
.article .prose img { border-radius: var(--r); }

/* ---------------- charts ---------------- */
.chart { width: 100%; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .c-grid { stroke: #e8edf6; stroke-width: 1; }
.chart .c-axis { fill: #94a3b8; font-size: 10px; font-family: inherit; }
.chart .c-lbl { fill: #475569; font-size: 10.5px; font-family: inherit; }
.chart .c-val { fill: #334155; font-size: 10px; font-weight: 700; font-family: inherit; }
.chart .c-bar { transition: opacity .15s; }
.chart .c-bar:hover { opacity: .78; }
.legend-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: .78rem; color: var(--ink-2); margin-top: 8px; }
.legend-row i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; vertical-align: -1px; margin-inline-end: 5px; }
.chart-empty { color: var(--muted); font-size: .85rem; padding: 26px; text-align: center; background: #fbfcff; border: 1px dashed var(--line); border-radius: var(--r); }

/* ---------------- report card ---------------- */
.rc-h {
  background: linear-gradient(135deg, #241f5c, #3b3486 55%, #4c4499);
  color: #fff; padding: 20px 24px; border-radius: var(--r-lg);
  margin-bottom: 18px; position: relative; overflow: hidden;
  box-shadow: var(--sh-3);
}
.rc-h::after {
  content: ""; position: absolute; inset-inline-start: -60px; top: -60px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 160, 23, .35), transparent 68%);
}
.rc-h h2 { margin: 0 0 8px; color: #fff; font-size: 1.15rem; }
.rc-h .rc-meta { font-size: .84rem; color: #d9d7f5; line-height: 2; }
.rc-h .rc-meta b { color: #fff; }
.rc-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 0 0 18px; }
.rc-box div {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px; text-align: center; font-size: .76rem; color: var(--muted);
  box-shadow: var(--sh-1);
}
.rc-box b { display: block; font-size: 1.35rem; color: var(--ink); margin-top: 2px; }

/* ---------------- login / auth ---------------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.auth-card {
  width: 100%; max-width: 420px;
  background: #fff; border: 1px solid var(--line); border-radius: 24px;
  padding: 34px 32px 30px; box-shadow: var(--sh-3);
}
.auth-logo {
  width: 62px; height: 62px; border-radius: 18px; margin: 0 auto 16px;
  display: grid; place-items: center; font-weight: 900; font-size: 26px;
  background: linear-gradient(145deg, var(--gold-2), #a97a06); color: #241f5c;
  box-shadow: 0 10px 26px rgba(212, 160, 23, .34);
}
.auth-card h2 { text-align: center; margin-bottom: 4px; }
.auth-card .auth-sub { text-align: center; color: var(--muted); font-size: .82rem; margin-bottom: 22px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card button { width: 100%; margin-top: 6px; padding: 11px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: .8rem; color: var(--muted); }

/* ---------------- editor toolbar ---------------- */
#ed {
  min-height: 240px; border: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r);
  padding: 14px 16px; background: #fff; line-height: 2.1; font-size: .92rem;
}
#ed:focus { outline: none; border-color: var(--brand-3); box-shadow: 0 0 0 3px rgba(99, 102, 241, .14); }
#ed img, .nb img, .prose img { max-width: 100%; border-radius: var(--r); }
.tb {
  display: flex; gap: 6px; flex-wrap: wrap;
  background: #f6f8fd; padding: 8px; border: 1px solid var(--line); border-bottom: 0;
  border-radius: var(--r) var(--r) 0 0;
}
.tb button, .tb label {
  background: #fff; color: var(--ink-2); border: 1px solid var(--line);
  padding: 4px 11px; border-radius: 8px; cursor: pointer;
  font-size: .78rem; font-weight: 600; width: auto; margin: 0; box-shadow: none;
}
.tb button:hover, .tb label:hover { background: var(--brand-soft); border-color: var(--brand-3); color: var(--brand); }
.pv { width: 220px; height: 124px; object-fit: cover; border-radius: var(--r); border: 1px solid var(--line); }
.cover-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 12px 0; }

/* ---------------- details/summary ---------------- */
details {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 0; margin: 0 0 16px; box-shadow: var(--sh-1); overflow: hidden;
}
details > summary {
  cursor: pointer; padding: 12px 18px; font-weight: 600; font-size: .88rem;
  background: #fbfcff; list-style: none; display: flex; align-items: center; gap: 8px;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "＋"; color: var(--brand-2); font-weight: 700; }
details[open] > summary::before { content: "−"; }
details > summary:hover { background: var(--brand-soft); color: var(--brand); }
details > form, details > div, details > p { padding: 14px 18px; margin: 0; }

/* ---------------- misc ---------------- */
.msg-item { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.msg-item:last-child { border-bottom: 0; }
.msg-item .mh { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.msg-item .mh b { color: var(--ink); }
.msg-item p { margin: 4px 0 0; color: var(--ink-2); font-size: .86rem; }
.nowrap { white-space: nowrap; }
.ltr { direction: ltr; display: inline-block; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.hide { display: none !important; }
.only-mobile { display: none; }
.chip-list { display: flex; gap: 8px; flex-wrap: wrap; }
.stat-line { display: flex; gap: 18px; flex-wrap: wrap; font-size: .84rem; color: var(--ink-2); }
.stat-line b { color: var(--ink); }
.risk-high { color: var(--bad); font-weight: 700; }
.risk-mid { color: var(--warn); font-weight: 700; }
.risk-low { color: var(--ok); font-weight: 700; }
.scrim {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(2px); z-index: 55; opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
body.sb-open .scrim { opacity: 1; pointer-events: auto; }

/* ---------------- responsive ---------------- */
@media (max-width: 1080px) {
  .content { padding: 20px 18px 40px; }
  .topbar { padding: 0 16px; }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 216px; }
  #sbToggle { display: grid; }
  .sidebar {
    transform: translateX(100%); /* پنهان کردن به سمت راست */
    transition: transform .26s cubic-bezier(.4, 0, .2, 1);
    box-shadow: none;
  }
  body.sb-open .sidebar { transform: translateX(0); box-shadow: -20px 0 60px rgba(15, 23, 42, .3); }
  .main { margin-inline-start: 0; } /* حذف فاصله در موبایل */
  .content { padding: 16px 14px 36px; }
  .tb-title small { display: none; }
  .user-chip b, .user-chip span { display: none; }
  .user-chip { padding: 4px; }
  .only-mobile { display: initial; }
  .card { padding: 16px; border-radius: var(--r); }
  .kpi { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
  .kpi b { font-size: 1.3rem; }
  .news-grid { grid-template-columns: 1fr; }
  .article .inner { padding: 18px; }
  .flt { grid-template-columns: 1fr 1fr; }
  .foot { padding: 14px 16px; }
}
@media (max-width: 520px) {
  .flt { grid-template-columns: 1fr; }
  .kpi { grid-template-columns: 1fr 1fr; }
  .auth-card { padding: 26px 20px; }
}

@media print {
  .sidebar, .topbar, .foot, .scrim, .no-print { display: none !important; }
  .main { margin: 0; }
  body { background: #fff; }
  .card, .table-wrap { box-shadow: none; border-color: #ccc; break-inside: avoid; }
}
/* ---------------- report dialog (دریافت فایل کارنامه) ---------------- */
.fld { display: block; margin-bottom: 14px; }
.fld > span { display: block; margin-bottom: 2px; font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.fld > input, .fld > select { margin-top: 4px; }

.rmodal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 18px; }
.rmodal[hidden] { display: none; }
.rmodal-scrim { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px); }
.rmodal-card {
  position: relative; width: 100%; max-width: 420px;
  background: #fff; border-radius: 16px; border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(15, 23, 42, .35);
  animation: rmodal-in .18s ease-out;
}
@keyframes rmodal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.rmodal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line-2);
}
.rmodal-head b { font-size: .95rem; }
.rmodal-x {
  border: 0; background: transparent; font-size: 1.4rem; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 0 4px;
}
.rmodal-x:hover { color: var(--ink); }
.rmodal-body { padding: 16px 18px 6px; }
.rmodal-foot {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 18px 16px; border-top: 1px solid var(--line-2);
}
.rmodal-foot .btn { flex: 0 0 auto; }
body.rmodal-open { overflow: hidden; }
@media (max-width: 520px) {
  .rmodal-card { max-width: 100%; }
  .rmodal-foot { flex-wrap: wrap; }
  .rmodal-foot .btn { flex: 1 1 30%; }
}

/* ---- نوار پیشرفت بارگذاری کارنامه‌ها ---- */
.upbar { margin-top: 16px; }
.upbar-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; margin-bottom: 6px; font-size: .85rem;
}
.upbar-track {
  height: 12px; border-radius: 999px; overflow: hidden;
  background: #e8edf5; border: 1px solid var(--line-2);
}
.upbar-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #22c55e);
  transition: width .25s ease;
}
.upbar-fill.done { background: linear-gradient(90deg, #16a34a, #22c55e); }
.upbar-fill.err { background: linear-gradient(90deg, #dc2626, #f97316); }
.upbar-msg { margin-top: 6px; font-size: .8rem; color: var(--muted); }
.upbar-msg .err, .upbar-msg.err { color: #b91c1c; }

/* ---------------- صفحهٔ اصلی، تحلیل سؤال و اجزای ارتقایافته ---------------- */
.home-slider {
  position: relative; isolation: isolate; min-height: 260px; height: clamp(270px, 36vw, 460px);
  overflow: hidden; border-radius: 22px; margin: 0 0 30px; color: #fff;
  background: #10142f;
  border: 1px solid rgba(15, 23, 42, .08);
  box-shadow: 0 16px 36px rgba(31, 28, 88, .14);
}
.home-slide { position: absolute; inset: 0; display: none; overflow: hidden; }
.home-slide.is-active { display: block; animation: slideReveal .55s ease both; }
.home-slide > img { position: absolute; display: block; }
/* تصویر اسلایدر واضح و بدون فیلتر نمایش داده می‌شود؛ در حالت contain هیچ لبه‌ای بریده نمی‌شود. */
.home-slide { background: #10142f; }
.home-slide > .home-slide-image { inset: 0; z-index: 1; width: 100%; height: 100%; max-width: none; object-fit: contain; object-position: center; padding: 6px; filter: none; transform: none; image-rendering: auto; }
.home-slider[data-fit="cover"] .home-slide > .home-slide-image { object-fit: cover; }
.home-slide:not(.home-slide-fallback) > .home-slide-shade,
.home-slide:not(.home-slide-fallback) > .home-slide-copy { display: none !important; }
.home-slide-shade { position: absolute; z-index: 2; inset: 0; background: linear-gradient(90deg, rgba(19, 17, 58, .22), rgba(19, 17, 58, .9) 88%), linear-gradient(0deg, rgba(12, 10, 42, .55), transparent 60%); }
.home-slide-copy { position: absolute; inset-inline-start: 7%; top: 50%; transform: translateY(-50%); z-index: 3; width: min(660px, 78%); }
.home-slide-copy h1 { color: #fff; font-size: clamp(1.6rem, 3.6vw, 2.8rem); line-height: 1.5; margin: 8px 0 12px; }
.home-slide-copy p { max-width: 560px; color: rgba(255,255,255,.88); font-size: 1.02rem; margin: 0 0 20px; }
.home-eyebrow { display: inline-flex; align-items: center; gap: 8px; color: #c7d2fe; font-size: .8rem; font-weight: 700; letter-spacing: .25px; }
.home-eyebrow::before { content: ""; width: 23px; height: 2px; border-radius: 2px; background: var(--gold-2); }
.home-slide-fallback { background: radial-gradient(circle at 18% 20%, rgba(212,160,23,.55), transparent 30%), linear-gradient(125deg, #17133d, #3730a3 65%, #b8860b); }
.home-slider-nav { position: absolute; z-index: 4; inset-inline: 22px; bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; direction: ltr; }
.home-slider-nav > button { border: 1px solid rgba(255,255,255,.45); color: #fff; background: rgba(20,18,60,.42); backdrop-filter: blur(10px); width: 35px; height: 35px; border-radius: 50%; cursor: pointer; font-size: 1.5rem; line-height: 1; }
.home-slider-nav > button:hover { background: var(--gold); color: #201944; }
.home-slider-dots { display: flex; align-items: center; gap: 7px; margin-inline: auto; }
.home-slider-dot { border: 0; padding: 0; width: 7px; height: 7px; border-radius: 99px; background: rgba(255,255,255,.55); cursor: pointer; transition: width .2s, background .2s; }
.home-slider-dot.is-active { width: 24px; background: var(--gold-2); }
@keyframes slideReveal { from { opacity: .72; } to { opacity: 1; } }
.home-section-head { display: flex; align-items: end; justify-content: space-between; margin: 6px 2px 16px; }
.home-section-head h2 { margin: 3px 0 0; color: var(--brand); font-size: 1.45rem; }
.home-news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 17px; }
.home-news-card { padding: 0; margin: 0; overflow: hidden; border: 1px solid rgba(226,232,240,.86); transition: transform .18s ease, box-shadow .18s ease; }
.home-news-card:hover { transform: translateY(-3px); box-shadow: var(--sh-3); }
.home-news-cover { display: block; height: 178px; overflow: hidden; background: #eef0ff; }
.home-news-cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.home-news-card:hover .home-news-cover img { transform: scale(1.035); }
.home-news-body { padding: 17px 19px 19px; }
.home-news-body h3 { margin: 7px 0 8px; font-size: 1.02rem; }
.home-news-body h3 a { color: var(--ink); }
.home-news-body p { color: var(--muted); font-size: .88rem; line-height: 1.95; }
.home-read-more { display: inline-flex; margin-top: 6px; font-size: .82rem; font-weight: 700; }
.home-empty { grid-column: 1 / -1; text-align: center; padding: 30px; }

.gallery-admin-card { margin-bottom: 22px; }
.gallery-upload-form, .slider-setting-form { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.gallery-upload-form label, .slider-setting-form label, .topic-select-form label { display: grid; gap: 5px; color: var(--muted); font-size: .8rem; flex: 1 1 220px; }
.gallery-upload-form label input, .slider-setting-form label input { width: 100%; }
.slider-setting-form { padding-top: 15px; margin-top: 16px; border-top: 1px solid var(--line-2); }
.slider-setting-form small { flex: 1 1 200px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 17px; }
.gallery-tile { overflow: hidden; margin: 0; padding: 9px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--sh-1); }
.gallery-tile > a { display: block; border-radius: 11px; overflow: hidden; background: var(--brand-soft); }
.gallery-tile img { display: block; width: 100%; height: 172px; object-fit: cover; transition: transform .3s; }
.gallery-tile:hover img { transform: scale(1.04); }
.gallery-tile figcaption { padding: 10px 5px 5px; font-weight: 600; }
.gallery-tile form { padding: 0 5px 5px; }

.exam-kpi { margin-bottom: 18px; }
.kpi-word { font-size: 1rem !important; line-height: 1.65; }
.text-ok { color: var(--ok) !important; }
.text-bad { color: var(--bad) !important; }
.text-warn { color: var(--warn) !important; }
.topic-edit-card { margin-bottom: 20px; }
.topic-edit-card .card-h { align-items: center; }
.topic-edit-card .card-h p { margin: 2px 0 0; }
.topic-input-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 10px; }
.topic-input-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; background: #f8faff; border: 1px solid var(--line-2); border-radius: 11px; }
.topic-input-row span { flex: 0 0 74px; color: var(--brand); font-weight: 700; font-size: .82rem; }
.topic-input-row input { min-width: 0; width: 100%; }
.question-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 16px; }
.question-card { padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(180deg, #fff 0%, #fbfcff 100%); box-shadow: var(--sh-1); }
.question-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 15px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.question-card-head h3 { color: var(--muted); font-size: .84rem; font-weight: 500; margin: 3px 0 0; }
.question-num { color: var(--brand); font-size: 1.1rem; font-weight: 900; }
.answer-key { padding: 5px 9px; border-radius: 8px; color: #4338ca; background: #eef0ff; font-size: .78rem; white-space: nowrap; }
.question-results-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.question-result { display: grid; justify-items: center; gap: 2px; padding: 9px 4px; border-radius: 11px; }
.question-result small { color: currentColor; opacity: .85; }
.question-result strong { font-size: 1.25rem; line-height: 1.5; }
.question-result span { font-size: .78rem; }
.question-result.correct { background: #e8f8ee; color: #137344; }
.question-result.wrong { background: #fff0f0; color: #b42336; }
.question-result.blank { background: #fff7e5; color: #9a6209; }
.question-bar { display: flex; overflow: hidden; height: 8px; margin: 12px 0 15px; border-radius: 99px; background: #e8edf6; }
.bar-correct { background: #22a06b; }.bar-wrong { background: #e5484d; }.bar-blank { background: #e5a323; }
.item-analysis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 15px; }
.item-analysis > div { display: grid; gap: 2px; padding: 10px; border-radius: 10px; background: #f2f5fb; }
.item-analysis small { font-size: .72rem; }.item-analysis b { font-size: 1.05rem; color: var(--brand); }.item-analysis span { font-size: .75rem; color: var(--muted); line-height: 1.6; }
.analysis-footnote { margin-top: 18px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 13px; background: #f8faff; color: var(--ink-2); font-size: .83rem; line-height: 2; }
.polished-table { min-width: 650px; }
.polished-table thead th { background: linear-gradient(180deg, #f2f4ff, #e9ecfb); }
.status-pill { display: inline-flex; justify-content: center; min-width: 54px; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; }
.status-pill.is-ok { background: #dcfce7; color: #166534; }.status-pill.is-bad { background: #fee2e2; color: #991b1b; }.status-pill.is-warn { background: #fef3c7; color: #92400e; }
.topic-select-form { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.topic-select-form label { min-width: min(100%, 320px); }
.topic-trend-list { display: grid; gap: 13px; }
.topic-trend-row { display: grid; grid-template-columns: minmax(110px, 220px) minmax(80px, 1fr) 55px; gap: 12px; align-items: center; }
.topic-trend-label { display: grid; min-width: 0; gap: 1px; }.topic-trend-label b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; }.topic-trend-label small { font-size: .73rem; }
.topic-trend-track, .mini-progress { overflow: hidden; height: 10px; border-radius: 99px; background: #e9edf6; }
.topic-trend-track span, .mini-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6366f1, #22a06b); }
.topic-trend-row > strong { color: var(--brand); text-align: left; font-size: .86rem; }
.mini-progress { display: inline-block; width: 100px; height: 7px; vertical-align: middle; margin-inline-end: 7px; }
.student-trend-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.student-trend-chips span { padding: 2px 6px; border-radius: 6px; color: #4338ca; background: #eef0ff; font-size: .72rem; white-space: nowrap; }

.mobile-nav { display: none; }
@media (max-width: 900px) {
  .sidebar { display: none !important; }
  .scrim { display: none !important; }
  .mobile-nav { display: none; gap: 5px; padding: 12px; margin: 0 12px 9px; max-height: min(58vh, 460px); overflow-y: auto; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.97); box-shadow: var(--sh-2); grid-template-columns: repeat(2, minmax(0,1fr)); }
  body.mobile-nav-open .mobile-nav { display: grid; animation: menuDrop .16s ease both; }
  .mobile-nav a { display: flex; align-items: center; min-height: 42px; padding: 8px 11px; border-radius: 10px; color: var(--ink-2); background: #f7f8ff; font-size: .82rem; font-weight: 600; }
  .mobile-nav a:active, .mobile-nav a:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
  .mobile-nav form { grid-column: 1 / -1; padding-top: 5px; }
  .mobile-nav form button { min-height: 40px; }
  .main { min-width: 0; }
  .content { min-width: 0; overflow-x: clip; }
  .home-slider { min-height: 285px; height: 56vw; max-height: 390px; border-radius: 18px; }
  .home-slide-copy { width: 84%; inset-inline-start: 6%; }
  .home-slide-copy h1 { font-size: clamp(1.4rem, 5.2vw, 2.1rem); }
  .home-slide-copy p { font-size: .88rem; }
  .home-news-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px),1fr)); }
  .question-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 305px),1fr)); }
}
@keyframes menuDrop { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 520px) {
  .topbar { gap: 8px; padding: 0 10px; }
  .tb-title { font-size: .88rem; }
  .content { padding: 12px 10px 28px; }
  .home-slider { min-height: 290px; height: 80vw; max-height: 345px; margin-bottom: 23px; }
  .home-slide-shade { background: linear-gradient(180deg, rgba(19,17,58,.18), rgba(19,17,58,.9)); }
  .home-slide-copy { top: 48%; width: 88%; }
  /* در حالت نمایش کامل، موبایل به چیدمان دو بخشی می‌رود تا عکس پانوراما زیر متن گم نشود. */
  .home-slider[data-fit="contain"] .home-slide > .home-slide-image { inset: 0; height: 100%; width: 100%; object-fit: contain; }
  .home-slide:not(.home-slide-fallback) > .home-slide-shade,
  .home-slide:not(.home-slide-fallback) > .home-slide-copy { display: none !important; }
  .home-slide-copy h1 { font-size: 1.45rem; }
  .home-slide-copy p { font-size: .82rem; }
  .home-slider-nav { inset-inline: 12px; bottom: 11px; }
  .home-news-cover { height: 155px; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
  .gallery-tile { padding: 6px; border-radius: 12px; }
  .gallery-tile img { height: 120px; }
  .gallery-tile figcaption { font-size: .78rem; line-height: 1.6; }
  .mobile-nav { margin-inline: 8px; grid-template-columns: 1fr 1fr; padding: 8px; }
  .question-grid { grid-template-columns: minmax(0,1fr); }
  .question-card { padding: 13px; }
  .topic-trend-row { grid-template-columns: 1fr 42px; gap: 7px; }
  .topic-trend-label { grid-column: 1 / -1; }
  .topic-trend-row > strong { grid-column: 2; grid-row: 2; }
  .topic-trend-track { grid-column: 1; grid-row: 2; }
  .mini-progress { width: 64px; }
  .topic-input-grid { grid-template-columns: 1fr; }
  .item-analysis { gap: 7px; }
  .table-wrap { max-width: 100%; }
}

/* ---- گزارش جامع آزمون و نمایش تطبیقی جدول‌ها ---- */
.exam-report-head { align-items: flex-start; gap: 14px; }
.exam-report-head h1 { margin-bottom: 4px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.exam-filter-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 18px; }
.exam-filter-form label { display: grid; gap: 6px; min-width: min(100%, 250px); color: var(--muted); font-size: .82rem; }
.exam-summary-kpi { grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); }
.exam-summary-kpi .kpi-sub { display: inline-block; margin-inline-start: 3px; color: var(--muted); font-size: .7rem; font-weight: 500; }
.exam-report { min-width: 0; }
.exam-report-tabs { display: flex; flex-wrap: nowrap; gap: 8px; margin: 0 0 16px; padding: 4px 2px 9px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
.exam-report-tabs button { flex: 0 0 auto; min-height: 42px; padding: 9px 17px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink-2); box-shadow: var(--sh-1); cursor: pointer; font: inherit; font-size: .84rem; font-weight: 700; white-space: nowrap; }
.exam-report-tabs button:hover { border-color: var(--brand-3); color: var(--brand); }
.exam-report-tabs button.on { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--brand-2), var(--brand)); box-shadow: 0 6px 16px rgba(49,46,129,.2); }
.exam-report-pane { min-width: 0; animation: reportPaneIn .18s ease both; }
@keyframes reportPaneIn { from { opacity: .65; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.exam-report-two-col { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; margin-bottom: 16px; }
.exam-report-card { min-width: 0; margin: 0; }
.exam-histogram { display: grid; gap: 13px; padding: 4px 0; }
.exam-hist-row { display: grid; grid-template-columns: 85px minmax(60px,1fr) 35px 50px; gap: 9px; align-items: center; font-size: .82rem; }
.exam-hist-label { color: var(--ink-2); direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.exam-hist-track { height: 11px; overflow: hidden; border-radius: 99px; background: #edf0f8; }
.exam-hist-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4f46e5, #12a780); min-width: 0; }
.exam-hist-row strong { text-align: center; color: var(--ink); }
.exam-hist-row small { color: var(--muted); text-align: left; }
.exam-response-kpis { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.response-stat { display: grid; gap: 5px; padding: 14px 9px; border-radius: 13px; text-align: center; }
.response-stat span { font-size: .82rem; }
.response-stat b { font-size: 1.45rem; }
.stat-correct { background: #e8f8ee; color: #137344; }
.stat-wrong { background: #fff0f0; color: #b42336; }
.stat-blank { background: #fff7e5; color: #9a6209; }
.exam-note { margin: 14px 0 0; font-size: .78rem; line-height: 1.9; }
.report-student-list { display: grid; gap: 4px; }
.report-student-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line-2); }
.report-student-row:last-child { border-bottom: 0; }
.report-student-rank { display: inline-grid; place-items: center; flex: 0 0 30px; height: 30px; border-radius: 10px; color: #3730a3; background: #eef0ff; font-weight: 800; }
.report-student-rank.risk-rank { color: #9f1239; background: #fff0f2; }
.report-student-name { display: grid; gap: 1px; flex: 1; min-width: 0; font-size: .85rem; font-weight: 700; }
.report-student-name small { color: var(--muted); font-size: .72rem; font-weight: 500; }
.report-student-row > b { direction: ltr; font-variant-numeric: tabular-nums; }
.exam-method-note { margin-top: 16px; line-height: 1.95; }
.exam-question-kpis { grid-template-columns: repeat(auto-fit,minmax(135px,1fr)); }
.wide-data-table { min-width: 980px; }
.wide-data-table td:first-child, .wide-data-table th:first-child { white-space: nowrap; }
.student-name-cell { min-width: 145px; font-weight: 650; }
.rank-cell { color: var(--brand); font-weight: 800; }
.score-cell { font-weight: 850; color: var(--brand); }
.table-subline { display: block; font-size: .71rem; color: var(--muted); margin-top: 4px; }
.report-list-subtitle { font-size: .78rem; flex: 1 1 100%; }
.exam-topic-bars { margin-bottom: 16px; }
.exam-topic-table { margin-top: 16px; }
.slider-admin-panel { border-top: 3px solid var(--brand-3); }
.slider-selected-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,190px),1fr)); gap: 12px; margin-top: 17px; }
.slider-selected-tile { min-width: 0; margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcff; }
.slider-selected-tile img { width: 100%; height: 125px; object-fit: cover; display: block; border-radius: 9px; background: #eef0ff; }
.slider-selected-tile img[data-slider-fit="contain"] { object-fit: contain; background: linear-gradient(135deg,#1d1b4b,#4841a0); }
.slider-size-tip { margin-top: 14px; padding: 13px 15px; border: 1px solid #cbd5ff; border-radius: 12px; background: linear-gradient(120deg,#f7f8ff,#eef4ff); color: var(--ink-2); }
.slider-size-tip strong { display: block; color: var(--brand); font-size: .9rem; }
.slider-size-tip p { margin: 4px 0 0; line-height: 1.85; font-size: .8rem; color: var(--muted); }
.slider-setting-form select { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-size: .85rem; }
.slider-selected-tile figcaption { display: grid; gap: 3px; padding: 8px 2px; }
.slider-selected-tile figcaption b { font-size: .82rem; overflow-wrap: anywhere; }
.slider-selected-tile figcaption small { color: var(--muted); font-size: .72rem; }
.slider-empty { grid-column: 1 / -1; padding: 17px; border: 1px dashed #c7c8e7; border-radius: 13px; background: #f8f8ff; }
.slider-empty p { margin: 5px 0 0; color: var(--muted); font-size: .83rem; line-height: 1.9; }
.mobile-table-tabs { display: none; }
.table-scroll-cue { display: none; }
.table-wrap { max-width: 100%; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
.table-wrap table { max-width: none; }
@media (max-width: 760px) {
  .exam-report-head { display: grid; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  .exam-report-two-col { grid-template-columns: minmax(0,1fr); }
  .exam-report-tabs { margin-inline: -2px; }
  .exam-hist-row { grid-template-columns: 74px minmax(40px,1fr) 28px 43px; gap: 6px; font-size: .75rem; }
  .exam-report-card, .exam-report-pane .card { padding: 13px; }
  .exam-filter-form label { min-width: 100%; }
  .mobile-table-tabs { display: flex; flex-wrap: nowrap; gap: 7px; max-width: 100%; padding: 4px 0 10px; overflow-x: auto; }
  .mobile-table-tabs button { flex: 0 0 auto; max-width: 80vw; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink-2); white-space: nowrap; font: inherit; font-size: .78rem; font-weight: 700; }
  .mobile-table-tabs button.on { color: #fff; background: var(--brand); border-color: var(--brand); }
  .table-wrap.mobile-table-member:not(.mobile-table-active) { display: none !important; }
  .table-wrap.is-horiz-scroll { position: relative; }
  .table-scroll-cue { display: block; padding: 6px 10px; border-bottom: 1px solid var(--line-2); background: #f7f8ff; color: var(--muted); font-size: .72rem; text-align: center; white-space: normal; direction: rtl; }
  .wide-data-table th:first-child, .wide-data-table td:first-child { position: sticky; right: 0; z-index: 1; background: #fff; box-shadow: -4px 0 6px rgba(15,23,42,.05); }
  .wide-data-table thead th:first-child { z-index: 3; background: #eef1fa; }
  .wide-data-table tbody tr:nth-child(even) td:first-child { background: #fcfdff; }
  .slider-selected-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .slider-selected-tile img { height: 105px; }
}
@media (max-width: 440px) {
  .exam-response-kpis { gap: 6px; }
  .response-stat { padding: 10px 4px; }
  .response-stat b { font-size: 1.2rem; }
  .report-student-row { gap: 7px; }
  .slider-setting-form label, .gallery-upload-form label { flex-basis: 100%; }
}
.exam-question-chart-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-bottom: 16px; }
.question-mini-row { display: grid; grid-template-columns: 72px minmax(40px,1fr) 44px; gap: 8px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: .8rem; }
.question-mini-row:last-child { border-bottom: 0; }
.question-mini-row > span { color: var(--ink-2); white-space: nowrap; }
.question-mini-row > b { text-align: left; color: var(--brand); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .exam-question-chart-grid { grid-template-columns: minmax(0,1fr); } }

/* ---- تب سراسری جدول‌ها و اسکرول عمودی/افقی در همهٔ صفحه‌ها ---- */
.page-table-tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin: 0 0 14px;
  padding: 5px 2px 10px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.page-table-tabs button {
  flex: 0 0 auto;
  max-width: min(80vw, 320px);
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink-2);
  box-shadow: var(--sh-1);
  cursor: pointer;
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page-table-tabs button:hover { color: var(--brand); border-color: var(--brand-3); }
.page-table-tabs button.on { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--brand-2), var(--brand)); }
.page-table-member:not(.page-table-active),
.page-table-host-inactive { display: none !important; }
.page-table-wrap, .table-wrap {
  max-width: 100%;
  max-height: min(70vh, 680px);
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  scrollbar-width: thin;
}
.table-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.table-wrap::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
.table-wrap table { max-width: none; }
.table-wrap thead th { position: sticky; top: 0; z-index: 4; }
.table-scroll-cue[hidden] { display: none !important; }
@media (max-width: 760px) {
  .page-table-tabs { margin-inline: -2px; padding-bottom: 9px; }
  .page-table-tabs button { min-height: 42px; padding: 9px 12px; font-size: .78rem; }
  .table-wrap, .page-table-wrap { max-height: 68vh; max-width: 100%; }
  .table-wrap table { width: max-content; min-width: 100%; }
  .table-wrap th, .table-wrap td { white-space: nowrap; }
  .table-wrap .table-scroll-cue { position: sticky; top: 0; z-index: 5; }
}

/* ---- صفحهٔ یکپارچهٔ تنظیمات ---- */
.settings-head { align-items: flex-start; }
.settings-layout { min-width: 0; }
.settings-tabs { display: flex; flex-wrap: nowrap; gap: 8px; max-width: 100%; overflow-x: auto; margin-bottom: 16px; padding: 3px 2px 9px; }
.settings-tabs button { flex: 0 0 auto; min-height: 42px; padding: 9px 17px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink-2); box-shadow: var(--sh-1); cursor: pointer; font: inherit; font-size: .85rem; font-weight: 750; white-space: nowrap; }
.settings-tabs button.on { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--brand-2), var(--brand)); }
.settings-pane { min-width: 0; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.settings-card { min-width: 0; margin: 0 0 16px; }
.settings-card-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: var(--brand-soft); font-size: 1.15rem; }
.settings-identity { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.settings-identity > div { min-width: 0; padding: 11px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: #fbfcff; }
.settings-identity dt { color: var(--muted); font-size: .74rem; margin-bottom: 4px; }
.settings-identity dd { margin: 0; font-weight: 750; overflow-wrap: anywhere; }
.settings-password-form { display: grid; gap: 12px; }
.settings-password-form label { display: grid; gap: 6px; color: var(--muted); font-size: .81rem; }
.settings-password-form input { width: 100%; }
.settings-help { font-size: .78rem; line-height: 1.9; margin: 10px 0 0; }
.settings-security-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 2px 0 16px; }
.settings-security-row p { margin: 4px 0 0; font-size: .8rem; line-height: 1.85; }
.settings-slider-upload { margin-top: 8px; }
.settings-slider-timing { align-items: end; }
.settings-slides-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.settings-slides-heading h4 { margin: 0; }
@media (max-width: 760px) {
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .settings-identity { grid-template-columns: minmax(0, 1fr); }
  .settings-security-row { flex-wrap: wrap; }
  .settings-security-row > .badge { flex: 0 0 auto; }
}
.page-table-tabs { position: sticky; top: 64px; z-index: 28; background: color-mix(in srgb, var(--bg) 93%, transparent); backdrop-filter: blur(8px); }
.table-wrap .table-scroll-cue { position: static !important; top: auto !important; }
@media (max-width: 900px) { .page-table-tabs { top: 58px; } }

/* ================= ماژول برنامه‌ریزی و ساعت مطالعه ================= */
.study-hero {
  display:flex; align-items:center; gap:18px; flex-wrap:wrap; margin:0 0 20px; padding:22px 24px;
  border:1px solid #deddfb; border-radius:22px; color:#24204f;
  background:radial-gradient(circle at 95% 5%,rgba(255,255,255,.9),transparent 34%),linear-gradient(120deg,#f0efff,#f8f8ff 60%,#e9e8ff);
  box-shadow:0 10px 28px rgba(51,45,130,.07); overflow:hidden;
}
.study-hero-green { border-color:#c9efdf; background:radial-gradient(circle at 95% 5%,rgba(255,255,255,.95),transparent 34%),linear-gradient(120deg,#e8fbf2,#f8fffb 58%,#e0f7ed); }
.study-hero-blue { border-color:#cfe7ff; background:radial-gradient(circle at 95% 5%,rgba(255,255,255,.95),transparent 34%),linear-gradient(120deg,#e9f4ff,#f9fcff 58%,#e5f0ff); }
.study-hero-amber { border-color:#f5e3bb; background:radial-gradient(circle at 95% 5%,rgba(255,255,255,.95),transparent 34%),linear-gradient(120deg,#fff6df,#fffdf7 58%,#fdf0d1); }
.study-hero-icon { flex:0 0 66px; width:66px; height:66px; display:grid; place-items:center; border-radius:19px; color:#4f46b8; background:rgba(255,255,255,.8); border:1px solid rgba(91,82,190,.13); box-shadow:0 8px 18px rgba(58,48,142,.09); font-size:2rem; font-weight:800; }
.study-hero-green .study-hero-icon { color:#0b9462; border-color:#c6efdf; }
.study-hero-blue .study-hero-icon { color:#1765b1; border-color:#cde5ff; }
.study-hero-amber .study-hero-icon { color:#9b6806; border-color:#f1dfb6; }
.study-hero-copy { flex:1 1 300px; min-width:0; }
.study-kicker { display:block; color:#6964a4; font-size:.75rem; font-weight:800; letter-spacing:.1px; }
.study-hero-green .study-kicker { color:#16845d; }
.study-hero-blue .study-kicker { color:#266fb1; }
.study-hero-amber .study-kicker { color:#99650a; }
.study-hero h1 { margin:3px 0 5px; color:#25204f; font-size:clamp(1.35rem,2.8vw,1.9rem); line-height:1.5; }
.study-hero p { margin:0; max-width:850px; color:#5e6078; font-size:.87rem; line-height:1.9; }
.study-hero-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.study-hero-actions .btn { white-space:nowrap; }
.study-date-badge { display:grid; gap:3px; min-width:145px; padding:12px 15px; border:1px solid #cfe3fb; border-radius:15px; background:rgba(255,255,255,.76); text-align:center; }
.study-date-badge small { color:#6480a3; font-size:.75rem; }
.study-date-badge b { color:#1e4d82; font-size:1.02rem; }
.study-date-badge span { color:#668098; font-size:.74rem; }
.study-card { min-width:0; margin:0 0 18px; padding:19px; }
.study-card .card-h { align-items:center; gap:12px; margin-bottom:15px; }
.study-card .card-h h2 { margin:0; color:var(--brand); font-size:1.05rem; }
.study-card .card-h p { margin:4px 0 0; color:var(--muted); font-size:.79rem; line-height:1.8; }
.study-step { flex:0 0 36px; width:36px; height:36px; display:grid; place-items:center; color:#fff; background:#6258cf; border-radius:12px; font-weight:800; font-size:1.2rem; }
.study-step-green { background:#14966a; }
.study-inline-form,.study-filter-bar { display:flex; align-items:end; flex-wrap:wrap; gap:12px; }
.study-inline-form label,.study-filter-bar label { display:grid; flex:1 1 220px; min-width:0; gap:6px; color:var(--muted); font-size:.8rem; }
.study-inline-form label small { color:#6a78a1; font-size:.72rem; line-height:1.7; }
.study-inline-form input,.study-inline-form select,.study-filter-bar select { width:100%; min-width:0; min-height:43px; border:1px solid var(--line); border-radius:11px; background:#fff; color:var(--ink); font:inherit; padding:8px 10px; }
.study-management-grid { align-items:start; margin-bottom:18px; }
.study-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.study-form-grid label,.study-plan-edit-form label { display:grid; gap:6px; min-width:0; color:var(--muted); font-size:.79rem; font-weight:650; }
.study-form-grid input:not([type=color]),.study-form-grid select,.study-form-grid textarea,.study-plan-edit-form input { width:100%; min-width:0; min-height:42px; padding:8px 10px; border:1px solid #dce2ee; border-radius:10px; background:#fff; color:var(--ink); font:inherit; font-size:.86rem; }
.study-form-grid textarea { resize:vertical; min-height:68px; }
.study-form-grid label small { color:#8490a4; font-size:.7rem; font-weight:400; line-height:1.7; }
.study-color-field input[type=color] { width:100%; height:43px; padding:4px; border:1px solid #dce2ee; border-radius:10px; background:#fff; }
.study-wide-field { grid-column:1 / -1; }
.study-form-actions { display:flex; align-items:end; align-self:end; grid-column:1 / -1; gap:8px; }
.study-guide-card { position:relative; overflow:hidden; border-color:#e2e4f8; background:linear-gradient(145deg,#fbfbff,#f4f5ff); padding:22px; }
.study-guide-green { border-color:#d5f0e4; background:linear-gradient(145deg,#fcfffd,#effaf5); }
.study-guide-mark { display:inline-grid; place-items:center; width:42px; height:42px; border-radius:13px; background:#e8e7ff; color:#5b51c6; font-size:1.45rem; }
.study-guide-green .study-guide-mark { color:#12865d; background:#d9f6e9; }
.study-guide-card h2 { margin:12px 0 16px; color:var(--brand); font-size:1.05rem; }
.study-guide-item { display:grid; gap:3px; padding:11px 0; border-bottom:1px solid rgba(106,111,160,.13); }
.study-guide-item b { color:var(--ink-2); font-size:.86rem; }
.study-guide-item span { color:var(--muted); font-size:.78rem; line-height:1.8; }
.study-guide-card > p { margin:14px 0 0; font-size:.78rem; line-height:1.9; }
.study-schedule-section { margin-top:8px; }
.study-section-title { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; margin:5px 2px 14px; }
.study-section-title h2 { margin:3px 0 0; color:var(--brand); font-size:1.25rem; }
.study-week-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:13px; align-items:stretch; }
.study-day-card { min-width:0; border:1px solid var(--line); border-radius:16px; background:#fff; overflow:hidden; box-shadow:var(--sh-1); }
.study-day-card > header { display:flex; align-items:center; gap:9px; padding:13px 14px; border-bottom:1px solid var(--line-2); background:linear-gradient(120deg,#f8f8ff,#fff); }
.study-day-number { display:grid; place-items:center; flex:0 0 30px; width:30px; height:30px; border-radius:10px; background:#ecebff; color:#554cba; font-size:.82rem; font-weight:800; }
.study-day-card > header h3 { margin:0; flex:1; color:var(--ink-2); font-size:.91rem; }
.study-day-card > header small { color:var(--muted); font-size:.7rem; }
.study-day-lessons { display:grid; gap:8px; padding:10px; }
.study-lesson-block { display:flex; align-items:stretch; gap:9px; padding:10px 9px; border:1px solid #e7e9f1; border-right:3px solid var(--lesson-color,#6258cf); border-radius:11px; background:#fff; min-width:0; }
.study-lesson-color { flex:0 0 8px; width:8px; border-radius:99px; background:var(--lesson-color,#6258cf); opacity:.9; }
.study-lesson-main { display:grid; gap:3px; flex:1; min-width:0; }
.study-lesson-main b { color:var(--ink); font-size:.84rem; overflow-wrap:anywhere; }
.study-lesson-main span { color:var(--brand); font-size:.76rem; font-weight:700; direction:rtl; }
.study-lesson-main small { color:var(--muted); font-size:.7rem; }
.study-remove { width:26px; height:26px; border:1px solid #fee2e2; border-radius:8px; color:#b91c1c; background:#fff7f7; font-size:1.15rem; line-height:1; cursor:pointer; }
.study-day-empty,.study-empty-inline { padding:16px; border:1px dashed #d9deeb; border-radius:11px; color:var(--muted); background:#fafbff; text-align:center; font-size:.82rem; line-height:1.9; }
.study-empty { padding:27px; text-align:center; }
.study-empty h2 { color:var(--brand); }
.study-empty p { color:var(--muted); line-height:1.9; }
.study-subject-pill { display:inline-flex; align-items:center; max-width:220px; padding:4px 9px; border-radius:9px; color:#4842a6; background:#eeedff; font-size:.78rem; font-weight:700; white-space:normal; }
.study-table-wrap { max-width:100%; max-height:min(65vh,600px); overflow:auto; border:1px solid var(--line-2); border-radius:12px; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; touch-action:pan-x pan-y; }
.study-table-wrap table { width:100%; min-width:760px; border-collapse:separate; border-spacing:0; }
.study-table-wrap th { position:sticky; top:0; z-index:2; background:#f1f3fb; color:#45436d; }
.study-table-wrap th,.study-table-wrap td { padding:11px 13px; vertical-align:middle; }
.study-table-tip { margin:0; color:var(--muted); font-size:.78rem; line-height:1.9; }
.study-date-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:17px; }
.study-date-toolbar form { flex:1 1 330px; }
.study-date-note { flex:1 1 250px; color:var(--muted); font-size:.78rem; line-height:1.9; }
.study-kpi-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin:0 0 18px; }
.study-kpi { display:grid; gap:7px; min-width:0; padding:16px; border:1px solid #e3e1fa; border-radius:16px; background:linear-gradient(145deg,#fff,#f5f4ff); box-shadow:var(--sh-1); }
.study-kpi > span { color:#6b688d; font-size:.76rem; font-weight:700; }
.study-kpi > b { color:#403894; font-size:1.7rem; line-height:1.35; font-variant-numeric:tabular-nums; }
.study-kpi > b small { font-size:.76rem; font-weight:650; }
.study-kpi > small { color:var(--muted); font-size:.7rem; line-height:1.7; }
.study-kpi-blue { border-color:#d2e7fc; background:linear-gradient(145deg,#fff,#eff7ff); }
.study-kpi-blue > b { color:#1769ad; }
.study-kpi-green { border-color:#d5f0e3; background:linear-gradient(145deg,#fff,#effaf4); }
.study-kpi-green > b { color:#14825a; }
.study-kpi-gold { border-color:#f3e4bd; background:linear-gradient(145deg,#fff,#fff8e8); }
.study-kpi-gold > b { color:#9a690a; }
.study-plans-list { display:grid; gap:11px; }
.study-plan-card { border:1px solid #e4e6f1; border-radius:14px; padding:13px; background:linear-gradient(160deg,#fff,#fbfbff); }
.study-plan-card-head { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
.study-plan-card-head > div { display:flex; align-items:center; gap:8px; }
.study-plan-card-head h3 { margin:0; color:var(--brand); font-size:.9rem; }
.study-plan-dot { width:10px; height:10px; border-radius:50%; background:#665bd0; box-shadow:0 0 0 4px #eeeeff; }
.study-tag { display:inline-flex; padding:4px 8px; border-radius:8px; font-size:.68rem; font-weight:750; }
.study-tag.recommended { color:#087e56; background:#e1f8ed; }
.study-tag.personal { color:#5950a8; background:#ecebff; }
.study-plan-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; }
.study-plan-edit-form input { min-height:39px; }
.study-note-field { margin-top:9px; }
.study-plan-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-top:10px; }
.study-add-details { margin-top:13px; border:1px dashed #cbd0e7; border-radius:12px; padding:11px 13px; background:#fafaff; }
.study-add-details summary { color:var(--brand); cursor:pointer; font-size:.83rem; font-weight:750; }
.study-add-details .study-form-grid { margin-top:12px; }
.study-form-grid.compact { grid-template-columns:repeat(2,minmax(0,1fr)); }
.study-log-entry-card { border-color:#d9f0e4; }
.study-log-entry-card .card-h h2 { color:#0f815a; }
.study-encouragement { display:flex; align-items:flex-start; gap:10px; padding:12px; margin-top:14px; border:1px solid #d5f0e3; border-radius:12px; background:#f2fcf7; color:#3b6b58; font-size:.76rem; line-height:1.9; }
.study-encouragement b { flex:0 0 auto; color:#0f815a; }
.study-status { display:inline-flex; align-items:center; padding:4px 8px; border-radius:8px; font-size:.7rem; font-weight:750; white-space:nowrap; }
.study-status.active { color:#087d55; background:#e1f8ed; }
.study-status.inactive { color:#a44343; background:#fff0f0; }
.study-grade-good { color:#09825d; }
.study-grade-low { color:#c24141; }
.study-period-label { margin-top:12px; color:var(--muted); font-size:.78rem; }
.study-student-bars { display:grid; gap:11px; }
.study-student-bar-row { display:grid; grid-template-columns:minmax(130px,220px) minmax(60px,1fr); align-items:center; gap:13px; }
.study-student-bar-name { display:flex; justify-content:space-between; align-items:center; gap:8px; min-width:0; }
.study-student-bar-name b { min-width:0; color:var(--ink-2); font-size:.79rem; overflow-wrap:anywhere; }
.study-student-bar-name small { flex:0 0 auto; color:var(--muted); font-size:.72rem; }
.study-progress-track { overflow:hidden; height:10px; border-radius:99px; background:#f0effb; }
.study-progress-track span { display:block; height:100%; min-width:0; border-radius:99px; background:linear-gradient(90deg,#7367da,#25a879); }
.study-correlation-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,210px),1fr)); gap:10px; }
.study-correlation-card { min-width:0; padding:13px; border:1px solid var(--line-2); border-radius:13px; background:#fcfcff; display:grid; gap:6px; }
.study-correlation-card > span { color:var(--ink-2); font-size:.82rem; font-weight:750; }
.study-correlation-card > b { color:var(--brand); font-size:1.4rem; }
.study-correlation-card > small { color:var(--muted); font-size:.7rem; line-height:1.7; }
.study-corr-track { height:7px; border-radius:99px; background:#eeeef8; overflow:hidden; }
.study-corr-track span { display:block; height:100%; background:#8f8bd4; border-radius:99px; }
.study-corr-track span.pos { background:#15a36d; }
.study-corr-track span.neg { background:#d26a6a; }
@media (max-width:1100px) {
  .study-week-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .study-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .study-hero-actions { flex-basis:100%; }
}
@media (max-width:760px) {
  .study-hero { align-items:flex-start; padding:16px; gap:12px; border-radius:17px; }
  .study-hero-icon { width:49px; height:49px; flex-basis:49px; border-radius:14px; font-size:1.5rem; }
  .study-hero-copy { flex-basis:calc(100% - 65px); }
  .study-hero p { font-size:.8rem; }
  .study-hero-actions { gap:7px; }
  .study-hero-actions .btn { flex:1 1 auto; text-align:center; }
  .study-date-badge { flex:1 1 100%; display:flex; align-items:center; justify-content:space-between; text-align:right; }
  .study-card { padding:13px; border-radius:15px; }
  .study-form-grid,.study-form-grid.compact { grid-template-columns:minmax(0,1fr); }
  .study-wide-field,.study-form-actions { grid-column:1; }
  .study-week-grid { grid-template-columns:minmax(0,1fr); }
  .study-day-card > header { padding:11px 12px; }
  .study-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .study-kpi { padding:12px 10px; border-radius:13px; }
  .study-kpi > span { font-size:.7rem; line-height:1.6; }
  .study-kpi > b { font-size:1.35rem; }
  .study-plan-fields { grid-template-columns:minmax(0,1fr); }
  .study-plan-card { padding:11px; }
  .study-inline-form label,.study-filter-bar label { flex-basis:100%; }
  .study-inline-form .btn,.study-filter-bar .btn { width:100%; }
  .study-student-bar-row { grid-template-columns:minmax(0,1fr); gap:5px; }
  .study-student-bar-name { justify-content:space-between; }
  .study-student-bars { gap:14px; }
  .study-encouragement { flex-direction:column; gap:3px; }
  .study-table-wrap table { min-width:760px; }
}
@media (max-width:420px) {
  .study-kpi-grid { grid-template-columns:minmax(0,1fr); }
  .study-date-toolbar { padding:12px; }
  .study-plan-actions .btn { flex:1 1 auto; }
}


/* بهبود نمودار هدف/عملکرد مطالعه و جدول‌های تب‌دار */
.study-target-card { overflow:hidden; }
.study-target-legend { display:flex; gap:16px; flex-wrap:wrap; align-items:center; color:var(--muted); font-size:.78rem; margin:4px 0 12px; }
.study-target-legend span { display:inline-flex; align-items:center; gap:7px; }
.study-target-legend i { width:11px; height:11px; display:inline-block; border-radius:4px; }
.study-target-legend-goal { background:#9a91e8; }
.study-target-legend-actual { background:#20a879; }
.study-target-chart { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:8px; align-items:end; min-height:205px; padding:12px 7px 4px; border-bottom:1px solid var(--line); background:repeating-linear-gradient(to top,transparent 0,transparent 48px,#eef0f7 49px,#eef0f7 50px); border-radius:12px; }
.study-target-day { min-width:0; display:flex; align-items:center; flex-direction:column; gap:4px; text-align:center; font-size:.72rem; }
.study-target-bars { height:130px; width:100%; max-width:42px; display:flex; align-items:end; justify-content:center; gap:3px; border-radius:9px 9px 0 0; overflow:hidden; position:relative; }
.study-target-bar,.study-actual-bar { width:42%; min-height:0; display:block; border-radius:6px 6px 0 0; align-self:end; transition:height .25s ease; }
.study-target-bar { background:linear-gradient(180deg,#b6aefa,#8377db); opacity:.92; }
.study-actual-bar { background:linear-gradient(180deg,#54d7a4,#14996d); }
.study-target-day>b { font-size:.74rem; color:var(--ink-2); }
.study-target-day>small { color:var(--muted); font-size:.62rem; white-space:nowrap; }
.study-target-numbers { color:var(--muted); font-size:.63rem; white-space:nowrap; }
.study-target-foot { color:var(--muted); font-size:.75rem; margin-top:10px; }
.study-weekday-list { display:grid; gap:10px; }
.study-weekday-card { border:1px solid var(--line); border-radius:14px; background:var(--card); overflow:hidden; }
.study-weekday-card>summary { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:13px 15px; cursor:pointer; background:linear-gradient(120deg,#f8f8ff,#fff); list-style:none; }
.study-weekday-card>summary::-webkit-details-marker { display:none; }
.study-weekday-title { display:flex; align-items:center; gap:10px; }
.study-weekday-title b { color:var(--brand); }
.study-weekday-title small { color:var(--muted); }
.study-weekday-count { background:var(--brand-soft); color:var(--brand); border-radius:99px; padding:3px 9px; font-size:.73rem; }
.study-weekday-items { display:grid; gap:10px; padding:12px; }
.study-weekly-item { border:1px solid var(--line-2); border-radius:12px; padding:12px; }
.study-weekly-item-head { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; margin-bottom:8px; }
.study-weekly-item-head b { color:var(--brand); }
.study-weekly-edit { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; align-items:end; }
.study-weekly-edit label { display:flex; flex-direction:column; gap:5px; font-size:.75rem; font-weight:700; min-width:0; }
.study-weekly-edit input { min-width:0; width:100%; min-height:37px; }
.study-weekly-note { grid-column:1/-1; }
.study-weekly-actions { grid-column:1/-1; display:flex; gap:7px; flex-wrap:wrap; }
.study-data-tablist { display:flex; gap:8px; flex-wrap:wrap; padding:5px; border:1px solid var(--line); background:var(--bg); border-radius:13px; margin:8px 0 14px; }
.study-data-tab { border:1px solid transparent; background:transparent; color:var(--muted); font:inherit; font-weight:800; border-radius:10px; padding:8px 13px; cursor:pointer; }
.study-data-tab.is-active { color:var(--brand); background:var(--card); border-color:#dfe3f2; box-shadow:var(--sh-1); }
.study-data-panel[hidden] { display:none!important; }
.study-data-panel { min-width:0; }
.study-data-panel-head { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; margin:5px 0 12px; }
.study-data-panel-head h3 { margin:0; color:var(--brand); font-size:1rem; }
.study-data-panel-head span { color:var(--muted); font-size:.76rem; }
.study-period-filter { align-items:end; }
.study-period-filter label { display:flex; flex-direction:column; gap:5px; min-width:min(100%,160px); }
.study-period-filter label small { color:var(--muted); font-size:.7rem; font-weight:400; }
.study-period-filter .study-to-date { display:flex; }
.study-comparison-chart { display:grid; gap:12px; }
.study-comparison-row { display:grid; grid-template-columns:minmax(125px,220px) minmax(70px,1fr) 54px; gap:10px; align-items:center; }
.study-comparison-name { display:grid; min-width:0; }
.study-comparison-name b { font-size:.79rem; overflow-wrap:anywhere; }
.study-comparison-name small { color:var(--muted); font-size:.69rem; }
.study-comparison-track { height:20px; position:relative; overflow:hidden; border-radius:99px; background:#f0effb; }
.study-target-track,.study-actual-track { position:absolute; inset-inline-start:0; border-radius:99px; display:block; }
.study-target-track { top:3px; height:4px; background:#9a91e8; }
.study-actual-track { bottom:3px; height:7px; background:linear-gradient(90deg,#54d7a4,#14996d); }
.study-comparison-percent { text-align:left; font-size:.75rem; font-weight:800; color:var(--brand); }
@media(max-width:760px) {
  .study-target-chart { gap:3px; padding-inline:1px; min-height:190px; }
  .study-target-bars { height:115px; max-width:30px; gap:2px; }
  .study-target-day>small { font-size:.56rem; }
  .study-target-numbers { font-size:.57rem; }
  .study-weekly-edit { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .study-weekly-edit .study-weekly-note,.study-weekly-actions { grid-column:1/-1; }
  .study-data-tablist { display:grid; grid-template-columns:repeat(auto-fit,minmax(110px,1fr)); }
  .study-data-tab { padding:8px 7px; font-size:.8rem; }
  .study-comparison-row { grid-template-columns:minmax(0,1fr) 70px; gap:5px 10px; }
  .study-comparison-track { grid-column:1; grid-row:2; }
  .study-comparison-percent { grid-column:2; grid-row:2; }
  .study-period-filter label { min-width:0; width:100%; }
  .study-period-filter>* { flex:1 1 100%; }
}

/* News list: compact editorial rows with square thumbnails instead of banner images. */
.home-news-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.home-news-card { display: grid; grid-template-columns: 124px minmax(0,1fr); align-items: stretch; direction: rtl; min-height: 124px; }
.home-news-cover { height: 124px; width: 124px; aspect-ratio: 1 / 1; align-self: start; }
.home-news-cover img { width: 100%; height: 100%; object-fit: cover; }
.home-news-body { padding: 12px 16px; min-width: 0; }
.home-news-body h3 { margin: 3px 0 5px; }
.home-news-body p { margin: 4px 0 8px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 560px) { .home-news-card { grid-template-columns: 92px minmax(0,1fr); min-height: 92px; } .home-news-cover { width: 92px; height: 92px; } .home-news-body { padding: 9px 11px; } .home-news-body p { -webkit-line-clamp: 2; font-size: .82rem; } }


/* Hooshyar v15 — shared, responsive user-management design */
.um-head{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.um-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr));gap:9px}
.um-check{display:flex;gap:9px;align-items:flex-start;padding:9px 11px;border:1px solid var(--line);border-radius:11px;background:var(--card)}
.um-check input{margin-top:5px}
.um-panel{padding:18px;border:1px solid var(--line);border-radius:16px;background:var(--card);margin:14px 0;box-shadow:var(--sh-1);min-width:0}
.um-panel h3{margin-top:0}
.um-muted{color:var(--muted);font-size:.9rem;line-height:1.9}
.um-formgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,185px),1fr));gap:12px}
.um-formgrid label,.um-student-tools label{display:flex;flex-direction:column;gap:5px;min-width:0}
.um-formgrid input,.um-formgrid select,.um-student-tools input,.um-student-tools select{width:100%;min-width:0;max-width:100%}
.um-user{border:1px solid var(--line);border-radius:14px;padding:13px;margin:10px 0;background:var(--card);overflow-wrap:anywhere}
.um-user summary{cursor:pointer;font-weight:700;line-height:2.2}
.um-tags{display:flex;gap:6px;flex-wrap:wrap}
.um-tag{background:var(--soft);border-radius:20px;padding:3px 9px;font-size:.82rem;display:inline-flex;align-items:center;gap:5px}
.um-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.um-table{width:100%;border-collapse:separate;border-spacing:0;min-width:900px}
.um-table th{background:var(--soft);font-weight:700;white-space:nowrap}
.um-table th,.um-table td{padding:10px 12px;border-bottom:1px solid var(--line);text-align:right;vertical-align:middle}
.um-table tbody tr:hover{background:var(--soft)}
.um-class{font-weight:700;color:var(--brand-2,var(--brand))}
.um-student-tools{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,175px),1fr));gap:10px;align-items:end;margin:12px 0}
.um-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:18px 0}
.um-tab{display:flex;align-items:center;justify-content:center;text-align:center;gap:8px;padding:12px 10px;border:1px solid var(--line);border-radius:13px;text-decoration:none;font-weight:750;background:var(--card);color:var(--ink);transition:background .16s,border-color .16s,transform .16s}
.um-tab:hover{transform:translateY(-1px)}
.um-tab.active{background:var(--brand);border-color:var(--brand);color:#fff}
.um-status{display:inline-block;border-radius:20px;padding:3px 9px;font-size:.8rem;background:var(--soft);white-space:nowrap}
.um-status.warn{background:#fff0df;color:#9a3412}
.um-account-tools{display:flex;gap:7px;flex-wrap:wrap;margin-top:12px}
.um-account-tools form{margin:0}
.um-mini{font-size:.82rem;padding:5px 8px}
.um-person{font-weight:750}
.um-actions .btn,.um-account-tools .btn{font-size:.85rem}
.um-container{min-width:0;display:flex;flex-direction:column;gap:8px}
.um-container .table-wrap{max-width:100%;overflow-x:auto;border-radius:12px}
.um-container button[disabled]{opacity:.65;cursor:wait}
.um-container .um-loading-spinner{width:13px;height:13px;border:2px solid currentColor;border-left-color:transparent;border-radius:50%;display:inline-block;vertical-align:middle;animation:umspin .7s linear infinite;margin-inline-end:7px}
@keyframes umspin{to{transform:rotate(360deg)}}
@media(max-width:700px){.um-tabs{grid-template-columns:1fr}.um-panel{padding:12px}.um-table{min-width:820px}.um-head h2{font-size:1.15rem}.um-account-tools .btn{min-height:36px}}

/* Hooshyar communication center refresh */
.msg-item{padding:16px 18px;margin:10px 0;border:1px solid var(--line,#e5e7eb);border-radius:16px;background:var(--surface,#fff);box-shadow:0 5px 18px rgba(30,41,59,.045)}
.msg-item .mh{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.msg-item .mh small,.msg-item>small{color:var(--muted,#64748b);font-size:.82rem}.form-stack{display:grid;gap:14px}.form-stack label,.card label{display:grid;gap:7px}.form-stack select[multiple]{border:1px solid var(--line,#dbe2ea);border-radius:13px;padding:10px;background:var(--surface,#fff)}.form-stack select[multiple] option{padding:8px;border-radius:8px}.inline-form{display:flex;align-items:center;gap:6px}.inline-form input[type=color]{width:34px;height:30px;border:0;background:transparent;padding:0}.study-data-tablist{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0 20px}.study-data-tablist a{text-decoration:none}.badge{display:inline-flex;align-items:center;justify-content:center;min-width:20px;padding:1px 7px;border-radius:99px;background:#e85d75;color:#fff;font-size:.75rem}

/* ============================================================
   Role-specific Hooshyar dashboards — version 20 workspace
   ============================================================ */
.dash-hero{position:relative;isolation:isolate;overflow:hidden;display:flex;align-items:center;justify-content:space-between;gap:24px;min-height:224px;padding:30px 34px;margin-bottom:26px;border-radius:26px;color:#fff;background:linear-gradient(115deg,#211b55 0%,#37318a 58%,#5b55bd 100%);box-shadow:0 18px 42px rgba(38,32,104,.2)}
.dash-hero:before{content:"";position:absolute;z-index:-1;width:440px;height:440px;border:1px solid rgba(255,255,255,.12);border-radius:50%;inset-inline-end:5%;top:-290px;box-shadow:0 0 0 35px rgba(255,255,255,.035),0 0 0 75px rgba(255,255,255,.025)}
.dash-hero-copy{position:relative;z-index:2}.dash-eyebrow,.dash-kicker{display:block;font-size:.65rem;font-weight:800;letter-spacing:1.8px;opacity:.72;direction:ltr;text-align:right}.dash-hero h1{font-size:1.9rem;color:#fff;margin:8px 0 3px}.dash-hero h1 span{color:#f7d982;font-size:1.25rem}.dash-hero p{margin:0;color:rgba(255,255,255,.8);font-size:.9rem}.dash-hero-meta{display:flex;align-items:center;gap:18px;flex-wrap:wrap;margin-top:19px;color:rgba(255,255,255,.8);font-size:.75rem}.dash-live-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:#75e4a5;margin-inline-end:6px;box-shadow:0 0 0 4px rgba(117,228,165,.13)}
.dash-hero-art{position:absolute;inset-inline-end:18%;top:50%;width:180px;height:180px;transform:translateY(-50%);display:grid;place-items:center;opacity:.92}.dash-hero-symbol{display:grid;place-items:center;width:96px;height:96px;border-radius:30px;background:linear-gradient(145deg,rgba(255,255,255,.24),rgba(255,255,255,.06));border:1px solid rgba(255,255,255,.28);font-size:3rem;color:#ffe8a6;box-shadow:0 18px 40px rgba(9,8,42,.2);transform:rotate(-8deg)}.dash-orbit{position:absolute;border:1px solid rgba(255,255,255,.2);border-radius:50%}.orbit-one{inset:8px}.orbit-two{inset:-13px;border-style:dashed;opacity:.55}.dash-spark{position:absolute;color:#ffdf8b;font-size:1.4rem}.spark-a{top:14px;inset-inline-end:24px}.spark-b{bottom:12px;inset-inline-start:22px}.dash-hero-action{position:absolute;z-index:3;left:24px;bottom:22px;display:flex;align-items:center;gap:8px;color:#fff!important;font-size:.76rem;padding:8px 13px;border:1px solid rgba(255,255,255,.22);border-radius:12px;background:rgba(255,255,255,.1);backdrop-filter:blur(8px)}.dash-hero-action b{display:inline-grid;place-items:center;min-width:21px;height:21px;padding:0 5px;border-radius:8px;background:#f5d889;color:#28204f}.dash-hero-action span{font-size:1rem}
.dash-hero-deputy{background:linear-gradient(115deg,#153d62,#176d91 60%,#3a9eaa)}.dash-hero-counselor{background:linear-gradient(115deg,#3d245f,#70418b 60%,#a66a9e)}.dash-hero-teacher{background:linear-gradient(115deg,#174b49,#19766e 60%,#4ba58a)}.dash-hero-student{background:linear-gradient(115deg,#243b72,#3f5ca6 58%,#718bd0)}.dash-hero-parent{background:linear-gradient(115deg,#3b4565,#596c91 60%,#8a9bb9)}
.dash-alert{margin-bottom:20px}.dash-message-banner{display:flex;align-items:center;gap:14px;padding:14px 18px;margin:0 0 25px;border:1px solid #cfe4f5;border-radius:16px;background:linear-gradient(100deg,#f1f8ff,#fff);color:var(--ink);box-shadow:var(--sh-1)}.dash-message-banner:hover{text-decoration:none;border-color:#80b8df}.dash-banner-icon{display:grid;place-items:center;width:42px;height:42px;flex:0 0 42px;border-radius:13px;background:#dcefff;color:#1768ac;font-size:1.25rem}.dash-message-banner b,.dash-message-banner small{display:block}.dash-message-banner b{font-size:.88rem}.dash-message-banner small{font-size:.73rem}.dash-message-banner strong{margin-inline-start:auto;color:#1768ac;font-size:.76rem;white-space:nowrap}
.dash-section{margin:0 0 27px}.dash-section-head{display:flex;align-items:end;justify-content:space-between;margin-bottom:13px}.dash-section-head h2{font-size:1.18rem;margin:2px 0 0}.dash-section-head p{font-size:.76rem;color:var(--muted);margin:1px 0 0}.dash-kicker{color:#8992a7;font-size:.59rem;letter-spacing:1.5px}.dash-metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(155px,1fr));gap:13px}.dash-metric{position:relative;overflow:hidden;min-height:132px;padding:15px 16px 13px;border:1px solid var(--line);border-radius:18px;background:#fff;box-shadow:var(--sh-1)}.dash-metric:after{content:"";position:absolute;width:100px;height:100px;border-radius:50%;inset-inline-end:-45px;bottom:-62px;background:var(--metric-soft);opacity:.85}.dash-metric-top{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--muted);font-size:.74rem}.dash-metric-top i{display:grid;place-items:center;width:30px;height:30px;border-radius:10px;background:var(--metric-soft);color:var(--metric-color);font-style:normal;font-size:1rem}.dash-metric>strong{position:relative;z-index:1;display:block;margin:8px 0 0;color:var(--ink);font-size:1.8rem;line-height:1.25;font-weight:800}.dash-metric>small{position:relative;z-index:1;font-size:.67rem}.dash-metric-line{position:absolute;bottom:0;inset-inline:0;height:3px;background:linear-gradient(90deg,transparent,var(--metric-color),transparent);opacity:.65}.metric-blue{--metric-color:#2876bb;--metric-soft:#e5f2ff}.metric-violet{--metric-color:#7653b8;--metric-soft:#f0eaff}.metric-gold{--metric-color:#b47a12;--metric-soft:#fff4dc}.metric-green{--metric-color:#16845b;--metric-soft:#e3f7ee}
.dash-shortcuts{display:grid;grid-template-columns:repeat(auto-fit,minmax(235px,1fr));gap:11px}.dash-shortcut{display:flex;align-items:center;gap:12px;min-width:0;padding:14px 15px;background:#fff;border:1px solid var(--line);border-radius:16px;color:var(--ink);box-shadow:var(--sh-1);transition:transform .18s,border-color .18s,box-shadow .18s}.dash-shortcut:hover{transform:translateY(-2px);border-color:#b9b8e8;box-shadow:var(--sh-2);text-decoration:none;color:var(--ink)}.dash-shortcut-icon{display:grid;place-items:center;width:43px;height:43px;flex:0 0 43px;border-radius:13px;font-size:1.2rem}.dash-shortcut-copy{min-width:0;flex:1}.dash-shortcut-copy b,.dash-shortcut-copy small{display:block}.dash-shortcut-copy b{font-size:.82rem}.dash-shortcut-copy small{font-size:.68rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dash-shortcut-arrow{color:#a1a8b7;font-size:1rem}.shortcut-blue .dash-shortcut-icon{background:#e6f2ff;color:#2876bb}.shortcut-violet .dash-shortcut-icon{background:#f0eaff;color:#7653b8}.shortcut-gold .dash-shortcut-icon{background:#fff4dc;color:#b47a12}.shortcut-green .dash-shortcut-icon{background:#e3f7ee;color:#16845b}
.dash-lower-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px;margin-bottom:22px}.dash-panel{min-width:0;padding:18px 19px;border:1px solid var(--line);border-radius:19px;background:#fff;box-shadow:var(--sh-1)}.dash-panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-bottom:12px;border-bottom:1px solid var(--line-2)}.dash-panel-head h2{font-size:1rem;margin:2px 0 0}.dash-panel-head>a{font-size:.7rem;white-space:nowrap}.dash-list{display:flex;flex-direction:column}.dash-list-row{display:flex;align-items:center;gap:10px;min-width:0;padding:10px 0;border-bottom:1px solid var(--line-2);color:var(--ink)}.dash-list-row:last-child{border-bottom:0;padding-bottom:0}.dash-list-row:hover{text-decoration:none;color:var(--brand-2)}.dash-list-icon{display:grid;place-items:center;width:34px;height:34px;flex:0 0 34px;border-radius:11px;background:#edf4ff;color:#3976b9}.study-list-icon{background:#e3f7ee;color:#16845b}.news-list-icon{background:#fff4dc;color:#b47a12}.message-list-icon{background:#f0eaff;color:#7653b8}.dash-list-main{min-width:0;flex:1}.dash-list-main b,.dash-list-main small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dash-list-main b{font-size:.76rem}.dash-list-main small{font-size:.65rem}.dash-list-arrow{color:#a1a8b7}.dash-list-value{font-size:.72rem;white-space:nowrap;color:#16845b}.dash-empty{color:var(--muted);font-size:.78rem;padding:12px 0}.dash-class-strip,.dash-footer-note{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px 18px;margin-bottom:17px;border:1px solid var(--line);border-radius:16px;background:#fff}.dash-class-strip>div:first-child b{display:block;font-size:.8rem}.dash-class-chips{display:flex;gap:7px;flex-wrap:wrap}.dash-class-chips span{padding:4px 10px;border-radius:9px;background:#f0efff;color:#5147a1;font-size:.7rem}.dash-footer-note{background:linear-gradient(100deg,#f8f7ff,#fff);border-color:#e2def7}.dash-footer-note>span{display:grid;place-items:center;width:40px;height:40px;flex:0 0 40px;border-radius:12px;background:#e9e5ff;color:#5147a1;font-size:1.2rem}.dash-footer-note>div{flex:1}.dash-footer-note b,.dash-footer-note small{display:block}.dash-footer-note b{font-size:.8rem}.dash-footer-note small{font-size:.68rem}.dash-footer-note>a{font-size:.72rem;white-space:nowrap}.student-note{background:linear-gradient(100deg,#effaf5,#fff);border-color:#d8eee4}.student-note>span{background:#ddf5e9;color:#16845b}
@media(max-width:900px){.dash-hero-art{inset-inline-end:5%;opacity:.45}.dash-hero-copy{max-width:75%}.dash-lower-grid{grid-template-columns:1fr}}
@media(max-width:600px){.dash-hero{min-height:210px;padding:23px 20px 54px;border-radius:20px}.dash-hero h1{font-size:1.45rem}.dash-hero p{max-width:88%;font-size:.78rem}.dash-hero-art{inset-inline-end:-25px;transform:translateY(-50%) scale(.78);opacity:.28}.dash-hero-action{left:15px;bottom:12px}.dash-hero-meta{gap:9px;font-size:.67rem}.dash-message-banner{align-items:flex-start;flex-wrap:wrap}.dash-message-banner strong{margin-inline-start:56px}.dash-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.dash-metric{min-height:122px;padding:12px}.dash-metric-top{font-size:.67rem}.dash-metric>strong{font-size:1.55rem}.dash-shortcuts{grid-template-columns:1fr;gap:8px}.dash-shortcut{padding:11px 12px}.dash-panel{padding:15px}.dash-class-strip,.dash-footer-note{align-items:flex-start;flex-wrap:wrap}.dash-class-chips{width:100%}.dash-footer-note>a{margin-inline-start:52px}}

.dash-sync-status{display:flex;align-items:center;gap:11px;padding:12px 16px;margin:-8px 0 22px;border:1px solid #cdebd9;border-radius:14px;background:#f1fbf5;color:#176b43}.dash-sync-status>span:nth-child(2){flex:1}.dash-sync-dot{width:9px;height:9px;border-radius:50%;background:#20a464;box-shadow:0 0 0 4px rgba(32,164,100,.12)}.dash-sync-status b,.dash-sync-status small{display:block}.dash-sync-status b{font-size:.78rem}.dash-sync-status small{font-size:.67rem}.dash-sync-status a{font-size:.7rem;color:#176b43}


/* نسخه ۲۲: نمودارهای تعاملی، تقویم و گزارش تصویری */
.dash-analytics-grid{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(300px,.85fr);gap:18px;margin:26px 0}
.dash-analytics-panel,.dash-calendar-panel{min-width:0;padding:22px}
.dash-subtle{margin:5px 0 0;color:var(--muted,#788397);font-size:12px}
.dash-analytics-mark,.dash-calendar-mark{display:grid;place-items:center;width:42px;height:42px;border-radius:14px;background:var(--surface-soft,#f2f5fb);color:var(--primary,#4968c8);font-size:22px}
.dash-chart-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:20px 0 14px}
.dash-chart-summary>div{padding:12px;border:1px solid var(--line,#e8ebf2);border-radius:13px;background:var(--surface-soft,#f8f9fc)}
.dash-chart-summary small,.dash-chart-summary b{display:block}
.dash-chart-summary small{font-size:11px;color:var(--muted,#788397);margin-bottom:7px}
.dash-chart-summary b{font-size:19px;font-weight:800;color:var(--text,#20283a);direction:rtl}
.dash-chart-summary i{font-size:10px;font-style:normal;font-weight:500;color:var(--muted,#788397)}
.dash-chart-controls,.dash-calendar-filters{display:flex;gap:7px;flex-wrap:wrap;margin:14px 0}
.dash-chart-controls button,.dash-calendar-filters button{border:1px solid var(--line,#e5e8ef);background:transparent;color:var(--muted,#788397);padding:7px 13px;border-radius:10px;font:inherit;font-size:12px;cursor:pointer}
.dash-chart-controls button.is-active,.dash-calendar-filters button.is-active{background:var(--primary-soft,#edf1ff);border-color:var(--primary,#647bd2);color:var(--primary,#4968c8);font-weight:700}
.dash-bar-chart{display:grid;gap:9px;margin-top:16px}
.dash-chart-row{display:grid;grid-template-columns:76px minmax(0,1fr) 42px;align-items:center;gap:10px}
.dash-chart-row time{font-size:10px;color:var(--muted,#788397);white-space:nowrap}
.dash-chart-track{height:11px;border-radius:20px;background:var(--surface-soft,#eef1f6);overflow:hidden}
.dash-chart-bar{display:block;width:var(--bar,0%);height:100%;min-width:0;border-radius:20px;background:linear-gradient(90deg,#8195ed,#536fcf);transition:width .35s ease}
.dash-chart-bar[data-series="videos"]{background:linear-gradient(90deg,#55c3b0,#249b88)}
.dash-chart-bar[data-series="tests"]{background:linear-gradient(90deg,#f2bd65,#d99332)}
.dash-chart-value{font-size:11px;text-align:left;color:var(--text,#20283a);font-variant-numeric:tabular-nums}
.dash-chart-footnote{font-size:11px;color:var(--muted,#788397);margin:15px 0 0}
.dash-event-list{display:grid;gap:3px;max-height:420px;overflow:auto}
.dash-event-item{display:grid;grid-template-columns:82px minmax(0,1fr) 18px;align-items:center;gap:12px;padding:12px 3px;border-bottom:1px solid var(--line,#edf0f5);color:inherit;text-decoration:none}
.dash-event-date{display:grid;gap:4px;padding:9px 6px;border-radius:11px;background:var(--surface-soft,#f2f5fb);text-align:center}
.dash-event-date b{font-size:11px;color:var(--primary,#4968c8)}
.dash-event-date small{font-size:10px;color:var(--muted,#788397)}
.dash-event-copy{min-width:0;display:grid;gap:5px}
.dash-event-copy b{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dash-event-copy small{font-size:10px;color:var(--muted,#788397)}
.dash-event-arrow{color:var(--muted,#9aa3b4)}
.dash-calendar-empty{display:grid;justify-items:center;gap:9px;text-align:center;padding:44px 12px;color:var(--muted,#788397)}
.dash-calendar-empty>span{font-size:30px;color:var(--primary,#647bd2)}
.dash-calendar-empty b{font-size:13px;color:var(--text,#20283a)}
.dash-calendar-empty small{font-size:11px;line-height:1.9;max-width:240px}
.dash-event-item[hidden],.dash-chart-bar[hidden]{display:none!important}
@media(max-width:850px){.dash-analytics-grid{grid-template-columns:1fr}.dash-analytics-panel,.dash-calendar-panel{padding:17px}}
@media(max-width:440px){.dash-chart-summary{gap:6px}.dash-chart-summary>div{padding:9px 7px}.dash-chart-summary b{font-size:16px}.dash-chart-row{grid-template-columns:66px minmax(0,1fr) 34px;gap:7px}.dash-event-item{grid-template-columns:72px minmax(0,1fr) 14px;gap:8px}}


/* نسخه ۲۳ — بازطراحی حرفه‌ای مرکز پیام‌ها */
.msg-workspace{display:grid;gap:20px;max-width:1280px;margin:0 auto}
.msg-hero{position:relative;display:flex;align-items:center;gap:22px;min-height:174px;padding:26px 30px;border-radius:24px;overflow:hidden;color:#fff;background:linear-gradient(120deg,#172a50 0%,#294c83 55%,#4267a7 100%);box-shadow:0 18px 40px rgba(25,48,88,.16)}
.msg-hero:after{content:"";position:absolute;width:340px;height:340px;border:1px solid rgba(255,255,255,.12);border-radius:50%;inset-inline-end:18%;top:-210px;box-shadow:0 0 0 32px rgba(255,255,255,.035),0 0 0 68px rgba(255,255,255,.025)}
.msg-hero-art{position:relative;z-index:1;display:grid;place-items:center;width:76px;height:76px;flex:0 0 76px;border-radius:23px;background:rgba(255,255,255,.13);border:1px solid rgba(255,255,255,.22);font-size:37px}
.msg-hero-art i,.msg-hero-art b{position:absolute;border-radius:50%;background:#8ce0d1}
.msg-hero-art i{width:9px;height:9px;top:9px;inset-inline-end:10px}
.msg-hero-art b{width:6px;height:6px;bottom:13px;inset-inline-start:12px;background:#f3c77d}
.msg-hero-copy{position:relative;z-index:1;flex:1;min-width:0}
.msg-eyebrow{display:block;font-size:10px;font-weight:800;letter-spacing:1.5px;color:#7e9de7}
.msg-hero .msg-eyebrow{color:#b9d2ff}
.msg-hero h1{font-size:27px;font-weight:850;margin:8px 0 6px;color:#fff}
.msg-hero p{margin:0;color:rgba(255,255,255,.76);font-size:13px}
.msg-hero-stats{z-index:1;display:flex;gap:10px}
.msg-hero-stats>div{min-width:94px;padding:13px 15px;border-radius:15px;background:rgba(255,255,255,.11);border:1px solid rgba(255,255,255,.13);text-align:center}
.msg-hero-stats b,.msg-hero-stats small{display:block}
.msg-hero-stats b{font-size:21px;color:#fff}
.msg-hero-stats small{font-size:10px;color:rgba(255,255,255,.72);margin-top:3px}
.msg-nav{display:flex;gap:7px;align-items:center;padding:7px;background:var(--surface,#fff);border:1px solid var(--line,#e5eaf2);border-radius:16px;box-shadow:0 5px 20px rgba(31,48,78,.035)}
.msg-nav a{display:flex;align-items:center;gap:9px;padding:11px 17px;border-radius:11px;text-decoration:none;color:var(--muted,#718096);font-size:13px;font-weight:700;transition:.2s}
.msg-nav a>span{font-size:16px}
.msg-nav a em{font-style:normal;font-size:10px;padding:2px 7px;border-radius:20px;background:var(--surface-soft,#eef2f8)}
.msg-nav a.is-active{background:#edf2ff;color:#3457a0}
.msg-panel{background:var(--surface,#fff);border:1px solid var(--line,#e5eaf2);border-radius:21px;padding:24px;box-shadow:0 8px 28px rgba(31,48,78,.045);min-width:0}
.msg-panel-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:23px}
.msg-panel-heading h2{font-size:20px;font-weight:850;margin:6px 0;color:var(--ink,#1f2937)}
.msg-panel-heading p{font-size:12px;color:var(--muted,#718096);margin:0}
.msg-heading-icon{display:grid;place-items:center;width:48px;height:48px;border-radius:15px;background:#edf2ff;color:#4969b5;font-size:24px}
.msg-compose-layout{display:grid;grid-template-columns:minmax(0,1fr) 275px;gap:18px;align-items:start}
.msg-compose-panel{padding:25px}
.msg-compose-form{display:grid;gap:21px}
.msg-field{display:grid;gap:9px;min-width:0}
.msg-field>label,.msg-field-head>label{font-size:13px;font-weight:800;color:var(--ink,#253047)}
.msg-field-head{display:flex;justify-content:space-between;align-items:center;gap:12px}
.msg-field-help{font-size:10px;color:var(--muted,#8792a4)}
.msg-recipient-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 15px;border:1px solid #dce5f4;border-radius:15px;background:linear-gradient(110deg,#f5f8ff,#fbfcff)}
.msg-select-all{display:flex;align-items:center;gap:11px;cursor:pointer}
.msg-select-all input,.msg-class-choice input,.msg-member-choice input{width:17px;height:17px;accent-color:#4568bd;flex:0 0 auto}
.msg-select-all span,.msg-class-title{display:grid;gap:4px}
.msg-select-all b,.msg-class-title b{font-size:13px;color:var(--ink,#253047)}
.msg-select-all small,.msg-class-title small{font-size:10px;color:var(--muted,#8490a3)}
.msg-selected-count{display:grid;justify-items:center;min-width:70px;padding-inline-start:12px;border-inline-start:1px solid #dce4f1}
.msg-selected-count b{font-size:20px;color:#3e61b0;line-height:1.1}
.msg-selected-count small{font-size:9px;color:var(--muted,#8490a3);margin-top:4px}
.msg-class-list{display:grid;gap:8px}
.msg-class-card{display:grid;grid-template-columns:minmax(0,1fr) 40px;align-items:center;border:1px solid var(--line,#e6eaf1);border-radius:14px;background:var(--surface,#fff);overflow:hidden;transition:border-color .2s,background .2s}
.msg-class-card.is-expanded{border-color:#b7c8ed;background:#fcfdff}
.msg-class-choice{display:flex;align-items:center;gap:12px;padding:14px 15px;cursor:pointer;min-width:0}
.msg-class-check{width:34px;height:34px;display:grid;place-items:center;border-radius:11px;background:#f0f3f9;color:#4969b5;font-size:16px}
.msg-class-choice input:checked~.msg-class-check{background:#e7efff}
.msg-class-choice input:disabled{opacity:.35}
.msg-expand-class{width:30px;height:30px;margin-inline-end:7px;border:0;border-radius:10px;background:#edf2ff;color:#385ca9;font-size:20px;line-height:1;cursor:pointer}
.msg-expand-class:disabled{opacity:.35;cursor:not-allowed}
.msg-class-members{grid-column:1/-1;padding:4px 14px 13px;border-top:1px solid var(--line,#edf0f5);background:#fbfcff}
.msg-class-members[hidden]{display:none}
.msg-member-toolbar{display:flex;align-items:center;justify-content:space-between;padding:8px 2px;color:var(--muted,#738096);font-size:10px}
.msg-member-toolbar button{border:0;background:transparent;color:#4567b4;font:inherit;font-weight:800;cursor:pointer}
.msg-member-choice{display:flex;align-items:center;gap:9px;padding:8px 4px;border-bottom:1px solid #edf0f5;cursor:pointer}
.msg-member-choice:last-child{border-bottom:0}
.msg-member-choice>span{font-size:12px;color:var(--ink,#2a3549);flex:1}
.msg-member-choice>small{font-size:10px;color:var(--muted,#8a94a5)}
.msg-other-contacts{border:1px dashed var(--line,#dce2ec);border-radius:13px;padding:12px 14px}
.msg-other-contacts summary{display:flex;justify-content:space-between;cursor:pointer;font-size:11px;font-weight:750;color:var(--ink,#39445a);list-style:none}
.msg-other-contacts summary::-webkit-details-marker{display:none}
.msg-other-contacts summary span{color:#5572b7;font-size:10px}
.msg-other-list{margin-top:10px;max-height:230px;overflow:auto}
.msg-field input:not([type=checkbox]),.msg-field textarea{width:100%;box-sizing:border-box;border:1px solid var(--line,#dce2eb);border-radius:12px;padding:12px 14px;background:var(--surface,#fff);color:var(--ink,#263247);font:inherit;font-size:13px;outline:none;transition:border-color .2s,box-shadow .2s}
.msg-field input:focus,.msg-field textarea:focus{border-color:#7f9bdb;box-shadow:0 0 0 3px rgba(79,112,190,.1)}
.msg-field textarea{resize:vertical;min-height:145px;line-height:1.9}
.msg-compose-foot{display:flex;justify-content:space-between;gap:10px;color:var(--muted,#8a94a5);font-size:10px}
.msg-submit-row{display:flex;justify-content:flex-end;align-items:center;gap:10px;padding-top:5px}
.msg-primary-btn,.msg-secondary-btn{display:inline-flex;align-items:center;justify-content:center;gap:13px;min-height:43px;padding:0 18px;border:0;border-radius:12px;text-decoration:none;font:inherit;font-size:12px;font-weight:800;cursor:pointer;transition:transform .15s,box-shadow .15s}
.msg-primary-btn{color:#fff;background:linear-gradient(120deg,#365ba9,#5579c5);box-shadow:0 7px 16px rgba(55,89,164,.18)}
.msg-primary-btn:hover{transform:translateY(-1px);box-shadow:0 10px 20px rgba(55,89,164,.23)}
.msg-primary-btn b{font-size:17px}
.msg-primary-btn:disabled{opacity:.65;cursor:wait;transform:none}
.msg-secondary-btn{color:var(--muted,#6f7a8c);background:var(--surface-soft,#f1f3f7)}
.msg-side-note{position:sticky;top:18px;padding:23px;border:1px solid #dfe7f5;border-radius:19px;background:linear-gradient(150deg,#f7f9ff,#fff)}
.msg-side-icon{display:grid;place-items:center;width:43px;height:43px;border-radius:14px;background:#e9efff;color:#4969b5;font-size:24px}
.msg-side-note h3{font-size:15px;margin:15px 0 8px;color:var(--ink,#263247)}
.msg-side-note>p{font-size:12px;line-height:2;color:var(--muted,#6f7d92);margin:0}
.msg-side-tip{display:grid;gap:6px;margin-top:20px;padding:13px;border-radius:12px;background:#edf3ff;color:#526b9f;font-size:11px;line-height:1.9}
.msg-side-tip b{color:#36599f}
.msg-archive-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:15px}
.msg-search{display:flex;align-items:center;gap:9px;min-width:0;max-width:520px;flex:1;padding:0 13px;border:1px solid var(--line,#e2e7ef);border-radius:12px;background:var(--surface,#fff);color:#8290a4}
.msg-search>span{font-size:21px}
.msg-search input{width:100%;min-width:0;height:42px;border:0;outline:0;background:transparent;color:var(--ink,#253047);font:inherit;font-size:12px}
.msg-archive-total{font-size:11px;color:var(--muted,#7b8799);white-space:nowrap}
.msg-archive-list{display:grid;gap:10px}
.msg-archive-item{position:relative;display:grid;grid-template-columns:4px minmax(0,1fr) 42px;gap:15px;padding:16px;border:1px solid var(--line,#e7ebf2);border-radius:15px;background:var(--surface,#fff);overflow:hidden;transition:box-shadow .2s,border-color .2s}
.msg-archive-item:hover{border-color:#cbd7ee;box-shadow:0 8px 22px rgba(31,48,78,.06)}
.msg-archive-accent{border-radius:8px;background:linear-gradient(#5478c6,#92a9e0)}
.msg-archive-main{min-width:0}
.msg-archive-top{display:flex;justify-content:space-between;gap:12px;align-items:center}
.msg-archive-title{display:flex;align-items:center;gap:9px;min-width:0}
.msg-status-dot{width:8px;height:8px;flex:0 0 auto;border-radius:50%;background:#55b99d}
.msg-archive-title h3{font-size:13px;margin:0;color:var(--ink,#273247);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.msg-archive-top time,.msg-inbox-top time{font-size:10px;color:var(--muted,#8993a3);white-space:nowrap}
.msg-archive-body{font-size:12px;line-height:1.9;color:var(--muted,#68768b);margin:9px 0 12px;white-space:pre-wrap;overflow-wrap:anywhere}
.msg-archive-meta{display:flex;align-items:center;gap:16px;flex-wrap:wrap;font-size:10px;color:var(--muted,#8792a4)}
.msg-archive-meta details summary{cursor:pointer;color:#4e6db2;font-weight:750}
.msg-archive-meta details p{max-width:700px;line-height:1.9;overflow-wrap:anywhere}
.msg-archive-id{margin-inline-start:auto}
.msg-archive-actions{display:flex;flex-direction:column;gap:7px;align-items:center}
.msg-archive-actions a,.msg-archive-actions button{display:grid;place-items:center;width:34px;height:34px;border:1px solid var(--line,#e5e9f0);border-radius:10px;background:var(--surface,#fff);color:#5875b5;text-decoration:none;font-size:16px;cursor:pointer}
.msg-archive-actions button{color:#c05c67}
.msg-archive-actions form{margin:0}
.msg-search-empty{padding:24px;text-align:center;color:var(--muted,#8290a4);font-size:12px}
.msg-inbox-search{margin-bottom:14px}
.msg-inbox-list{display:grid;gap:8px}
.msg-inbox-item{display:flex;gap:13px;padding:15px;border:1px solid var(--line,#e7ebf2);border-radius:14px}
.msg-avatar{display:grid;place-items:center;width:39px;height:39px;flex:0 0 39px;border-radius:13px;background:#edf2ff;color:#4768b2;font-size:16px;font-weight:850}
.msg-inbox-content{flex:1;min-width:0}
.msg-inbox-top{display:flex;justify-content:space-between;gap:10px;align-items:center}
.msg-inbox-top b{font-size:12px;color:var(--ink,#2b3548)}
.msg-inbox-content h3{font-size:13px;margin:7px 0 3px;color:var(--ink,#273247)}
.msg-inbox-content p{font-size:12px;line-height:1.9;color:var(--muted,#6f7c90);margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
.msg-empty-state{display:grid;justify-items:center;gap:9px;padding:38px 15px;text-align:center;color:var(--muted,#8490a2);font-size:12px}
.msg-empty-state>span{font-size:30px;color:#6b86c7}
.msg-empty-state>b{font-size:13px;color:var(--ink,#354158)}
.msg-empty-state a{color:#496bb6;font-weight:800;text-decoration:none}
@media(max-width:900px){.msg-compose-layout{grid-template-columns:1fr}.msg-side-note{position:static;order:-1}.msg-side-note p{max-width:720px}}
@media(max-width:620px){.msg-hero{padding:20px;gap:13px;flex-wrap:wrap}.msg-hero-art{width:55px;height:55px;flex-basis:55px;border-radius:17px;font-size:27px}.msg-hero h1{font-size:22px}.msg-hero-copy{flex-basis:calc(100% - 75px)}.msg-hero-stats{width:100%;margin-top:3px}.msg-hero-stats>div{flex:1}.msg-nav{gap:3px;padding:5px}.msg-nav a{flex:1;justify-content:center;padding:10px 5px;font-size:11px;gap:5px}.msg-nav a em{display:none}.msg-panel,.msg-compose-panel{padding:16px}.msg-panel-heading{align-items:flex-start}.msg-panel-heading h2{font-size:17px}.msg-panel-heading p{line-height:1.8}.msg-panel-heading>.msg-primary-btn{padding:0 11px;min-height:39px;font-size:10px}.msg-archive-item{grid-template-columns:3px minmax(0,1fr) 34px;gap:9px;padding:11px}.msg-archive-top{align-items:flex-start;flex-direction:column;gap:5px}.msg-archive-meta{gap:9px}.msg-archive-id{display:none}.msg-archive-toolbar{align-items:stretch;flex-direction:column}.msg-archive-total{align-self:flex-end}.msg-inbox-item{padding:11px;gap:9px}.msg-inbox-top{align-items:flex-start;flex-direction:column;gap:3px}}

.msg-edit-panel{max-width:850px;margin-inline:auto}.msg-edit-notice{display:flex;align-items:center;gap:12px;padding:13px 15px;margin-bottom:20px;border:1px solid #dce6f6;border-radius:13px;background:#f5f8ff;color:#62738f;font-size:12px}.msg-edit-notice b{font-size:20px;color:#4567b2}

/* v24: one archive row per class */
.msg-archive-class{display:inline-flex;align-items:center;padding:5px 10px;border-radius:9px;background:var(--primary-soft,#edf3ff);color:var(--primary,#3458a4);font-weight:850}

/* v27 — جدول هفتگی شبیه برگهٔ برنامه‌ریزی کلاسی */
.tt-hero{display:flex;align-items:center;gap:15px;flex-wrap:wrap;padding:18px 20px;margin:0 0 14px;border:1px solid #dfe4f0;border-radius:17px;background:linear-gradient(115deg,#f8faff,#fff 68%);box-shadow:var(--sh-1)}
.tt-hero-icon{width:53px;height:53px;display:grid;place-items:center;flex:0 0 53px;border-radius:14px;background:#eef0ff;color:#4338ca;font-size:1.75rem}
.tt-hero-copy{flex:1 1 350px;min-width:0}.tt-hero-copy>span{font-size:.72rem;font-weight:800;color:#6d5bd0}.tt-hero-copy h1{font-size:1.18rem;margin:2px 0 4px;color:#1e1b4b}.tt-hero-copy p{margin:0;color:var(--muted);font-size:.82rem;line-height:1.85}
.tt-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;padding:13px 15px;margin-bottom:12px}.tt-class-picker{display:flex;align-items:end;gap:8px;flex-wrap:wrap}.tt-class-picker label{display:flex;flex-direction:column;gap:5px;min-width:min(100%,280px);font-size:.79rem;font-weight:800}.tt-class-picker select{min-width:230px;max-width:100%}.tt-class-meta{display:flex;align-items:center;gap:9px;flex-wrap:wrap;color:var(--muted);font-size:.78rem}.tt-class-meta strong{color:#1e293b;font-size:.95rem}.tt-class-meta span{padding:4px 9px;border-radius:99px;background:#f1f5f9;color:#475569}
.tt-editor-form{min-width:0}.tt-savebar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:10px 13px;margin:10px 0;background:#f8fafc}.tt-bell-count{display:flex;align-items:center;gap:10px;font-size:.83rem;font-weight:800;color:#334155}.tt-bell-count input{width:76px;text-align:center;font-size:1rem;font-weight:800}.tt-save-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.tt-duration-legend{display:flex;gap:15px;align-items:center;flex-wrap:wrap;margin:8px 2px 12px;color:#64748b;font-size:.74rem}.tt-duration-legend span{display:inline-flex;align-items:center;gap:6px}.tt-duration-legend i{width:10px;height:10px;border-radius:3px;display:inline-block}.tt-legend-full{background:#dbeafe;border:1px solid #93c5fd}.tt-legend-half{background:#dcfce7;border:1px solid #86efac}
.tt-table-wrap{width:100%;overflow-x:auto;border:1px solid #dfe5ef;border-radius:13px;background:#fff;overscroll-behavior-inline:contain}.tt-grid{width:100%;min-width:1240px;table-layout:fixed;border-collapse:separate;border-spacing:0;direction:rtl}.tt-grid th,.tt-grid td{border-left:1px solid #e8edf5;border-bottom:1px solid #e8edf5;padding:5px;vertical-align:top}.tt-grid thead th{height:43px;vertical-align:middle;background:#f8fafc;color:#334155;font-size:.78rem;font-weight:900;text-align:center;position:sticky;top:0;z-index:2}.tt-grid thead th:first-child{width:76px}.tt-grid tbody tr:last-child th,.tt-grid tbody tr:last-child td{border-bottom:0}.tt-grid th:last-child,.tt-grid td:last-child{border-left:0}.tt-period-head{color:#1e293b!important}.tt-period-cell{width:76px;text-align:center;vertical-align:middle!important;background:#fbfcff;color:#334155;font-size:.8rem}.tt-period-cell span{display:block;font-weight:900}.tt-period-cell small{display:inline-flex;align-items:center;justify-content:center;min-width:25px;height:25px;margin-top:5px;border-radius:8px;background:#eef0ff;color:#4338ca;font-size:.72rem}.tt-grid td{width:calc((100% - 76px)/7)}.tt-cell{display:flex;flex-direction:column;gap:6px;min-height:135px;padding:7px;border:1px solid #dbe3ee;border-radius:10px;background:#f8fafc;transition:border-color .15s,box-shadow .15s}.tt-cell:focus-within{border-color:#a5b4fc;box-shadow:0 0 0 2px #c7d2fe55}.tt-split-toggle{display:flex;align-items:center;justify-content:space-between;gap:7px;min-height:24px;padding:0 1px;color:#475569;font-size:.7rem;font-weight:800;cursor:pointer}.tt-split-toggle input{width:18px;height:18px;margin:0;accent-color:#5145cd;cursor:pointer}.tt-mode-label{display:block;margin:0 0 4px;color:#64748b;font-size:.65rem;font-weight:800}.tt-field-label{display:flex;flex-direction:column;gap:3px;margin:0 0 5px;color:#64748b;font-size:.64rem;font-weight:800}.tt-field-label select{width:100%;min-width:0;min-height:32px;padding:4px 7px;border:1px solid #cbd5e1;border-radius:7px;background:#fff;color:#111827;font-family:inherit;font-size:.72rem;font-weight:700;line-height:1.45}.tt-field-label select:disabled{opacity:.55;background:#f1f5f9}.tt-subject-select{color:#111827!important}.tt-teacher-select{background:#fff!important;color:#334155!important;font-weight:500!important}.tt-halves{display:grid;gap:6px}.tt-half-card{padding:6px;border:1px dashed #cbd5e1;border-radius:8px;background:#fff}.tt-half-card>small{display:block;margin-bottom:4px;color:#64748b;font-size:.64rem;font-weight:900}.tt-bottom-save{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-top:12px;padding:10px 2px;color:#64748b;font-size:.75rem}.tt-bottom-save .btn{min-width:180px}
.tt-grid [hidden]{display:none!important}.tt-editor-form .btn{white-space:nowrap}
@media(max-width:850px){.tt-hero{padding:14px}.tt-savebar{align-items:flex-start}.tt-save-actions{width:100%}.tt-save-actions .btn{flex:1 1 auto;text-align:center}.tt-duration-legend{gap:8px}.tt-toolbar{align-items:flex-start}.tt-class-picker{width:100%}.tt-class-picker label{flex:1 1 220px}.tt-class-picker select{width:100%}}
@media(max-width:560px){.tt-hero-copy h1{font-size:1rem}.tt-hero-icon{width:44px;height:44px;flex-basis:44px}.tt-bell-count{width:100%;justify-content:space-between}.tt-bottom-save .btn{width:100%}.tt-duration-legend{display:grid}}
@media print{.tt-hero,.tt-toolbar,.tt-savebar,.tt-duration-legend,.tt-bottom-save,.sidebar,.topbar{display:none!important}}

/* Hooshyar v28 — album-first school gallery */
.gallery-hero{position:relative;display:flex;align-items:center;justify-content:space-between;gap:24px;min-height:218px;overflow:hidden;padding:30px 34px;margin:0 0 22px;border:1px solid #e3e8f5;border-radius:24px;background:radial-gradient(circle at 82% 16%,rgba(139,92,246,.16),transparent 30%),linear-gradient(120deg,#f7f8ff 0%,#eef2ff 52%,#f4f8ff 100%)}
.gallery-hero-copy{position:relative;z-index:1;max-width:650px}.gallery-eyebrow{display:block;margin-bottom:8px;color:#6b63bc;font-size:.68rem;font-weight:900;letter-spacing:.12em}.gallery-hero h1,.gallery-album-hero h1{margin:0;color:#25234f;font-size:clamp(1.4rem,3vw,2rem);font-weight:950}.gallery-hero p,.gallery-album-hero-copy>p{max-width:600px;margin:10px 0 16px;color:#6d7188;line-height:2}.gallery-hero-stats{display:flex;flex-wrap:wrap;gap:10px}.gallery-hero-stats span{display:inline-flex;align-items:center;gap:5px;padding:7px 12px;border:1px solid #e1e5f3;border-radius:999px;background:rgba(255,255,255,.75);color:#71758c;font-size:.78rem}.gallery-hero-stats b{color:#3d397f;font-size:.9rem}.gallery-hero-art{position:relative;flex:0 0 250px;height:160px}.gallery-art-frame{position:absolute;width:112px;height:136px;border:7px solid white;border-radius:15px;background:linear-gradient(135deg,#c6d4f7,#e7d7ff);box-shadow:0 12px 30px rgba(53,53,110,.16)}.gallery-art-one{right:15px;top:6px;transform:rotate(13deg);background:linear-gradient(135deg,#b8e0e5,#c8d5ff)}.gallery-art-two{right:92px;top:12px;transform:rotate(-12deg);background:linear-gradient(135deg,#ffdfc9,#e5d5ff)}.gallery-art-three{right:160px;top:22px;display:grid;place-items:center;color:#fff;font-size:2.5rem;background:linear-gradient(135deg,#8f7cf1,#b7a4ff)}
.gallery-create-card{padding:22px;margin-bottom:26px;border:1px solid #e6e8f5;border-radius:20px;background:linear-gradient(145deg,#fff,#fbfbff)}.gallery-section-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 16px}.gallery-section-head h2{margin:0;color:#2d2b58;font-size:1.2rem;font-weight:900}.gallery-section-head p{margin:5px 0 0;font-size:.82rem}.gallery-create-icon{display:grid;place-items:center;width:46px;height:46px;border-radius:15px;background:#eeeaff;color:#6c56c9;font-size:1.7rem}.gallery-create-form,.gallery-edit-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.gallery-create-form label,.gallery-edit-form label,.gallery-upload-form label{display:grid;gap:7px;color:#555a73;font-size:.82rem;font-weight:700}.gallery-create-form input,.gallery-create-form select,.gallery-create-form textarea,.gallery-edit-form input,.gallery-edit-form select,.gallery-edit-form textarea,.gallery-upload-form input{width:100%;min-width:0;border:1px solid #dfe3f0;border-radius:11px;padding:10px 12px;background:#fff;color:#30334c;font:inherit;outline:none}.gallery-create-form input:focus,.gallery-create-form select:focus,.gallery-create-form textarea:focus,.gallery-edit-form input:focus,.gallery-edit-form select:focus,.gallery-edit-form textarea:focus,.gallery-upload-form input:focus{border-color:#9888ed;box-shadow:0 0 0 3px rgba(139,124,230,.12)}.gallery-create-form small,.gallery-upload-form small,.gallery-edit-form small{color:#85899e;font-size:.72rem;font-weight:500;line-height:1.8}.gallery-file-field{grid-column:1/-1;padding:13px;border:1px dashed #c9c3ec;border-radius:14px;background:#faf9ff}.gallery-create-form>.btn{justify-self:start;min-width:145px}.gallery-albums-section,.gallery-photo-section{margin:24px 0}.gallery-total-pill{flex:none;padding:7px 12px;border:1px solid #e4e6f0;border-radius:999px;background:#fff;color:#777b91;font-size:.75rem}.gallery-album-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,250px),1fr));gap:18px}.gallery-album-card{display:block;overflow:hidden;border:1px solid #e6e8f1;border-radius:19px;background:#fff;box-shadow:0 5px 18px rgba(35,39,87,.045);color:inherit;text-decoration:none;transition:transform .22s,box-shadow .22s,border-color .22s}.gallery-album-card:hover{transform:translateY(-4px);border-color:#c9c2f5;box-shadow:0 14px 30px rgba(45,43,100,.11)}.gallery-album-cover{position:relative;height:190px;overflow:hidden;background:linear-gradient(135deg,#eeeaff,#e9f4ff)}.gallery-album-cover>img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .45s}.gallery-album-card:hover .gallery-album-cover>img{transform:scale(1.055)}.gallery-album-empty-cover{height:100%;display:grid;align-content:center;justify-items:center;gap:7px;color:#8c83c8}.gallery-album-empty-cover span{font-size:3rem}.gallery-album-empty-cover small{font-size:.72rem}.gallery-album-count{position:absolute;right:12px;bottom:12px;padding:6px 10px;border:1px solid rgba(255,255,255,.38);border-radius:999px;background:rgba(24,27,57,.68);color:#fff;font-size:.7rem;backdrop-filter:blur(8px)}.gallery-access-tag{display:inline-flex;align-items:center;gap:5px;padding:5px 9px;border-radius:999px;font-size:.67rem;font-weight:800}.gallery-access-tag.public{position:absolute;top:12px;left:12px;background:rgba(236,253,245,.94);color:#18764f}.gallery-access-tag.private{background:#fff1e8;color:#a34e21}.gallery-album-info{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 15px}.gallery-album-info h3{margin:0;color:#2b2b50;font-size:.98rem;font-weight:900}.gallery-album-info p{display:-webkit-box;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical;margin:6px 0 0;color:#83869a;font-size:.74rem;line-height:1.8}.gallery-album-arrow{flex:none;display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:#f0efff;color:#6859c6;font-size:1.1rem}.gallery-empty-state{grid-column:1/-1;display:grid;justify-items:center;padding:40px 15px;border:1px dashed #dcddec;border-radius:18px;background:#fafaff;text-align:center}.gallery-empty-state>span{display:grid;place-items:center;width:58px;height:58px;border-radius:18px;background:#eeedff;color:#786bc8;font-size:2rem}.gallery-empty-state h3{margin:12px 0 4px;color:#36335e}.gallery-empty-state p{margin:0;color:#86899d;font-size:.82rem}
.gallery-breadcrumb{display:flex;align-items:center;gap:10px;margin:2px 0 14px;color:#8b8da0;font-size:.8rem}.gallery-breadcrumb a{color:#6c61b8;text-decoration:none}.gallery-breadcrumb b{color:#3a3a5e}.gallery-album-hero{display:flex;align-items:center;gap:22px;overflow:hidden;padding:18px;margin-bottom:22px;border:1px solid #e6e8f2;border-radius:20px;background:linear-gradient(115deg,#fafaff,#f0f3ff)}.gallery-album-hero.is-private{background:linear-gradient(115deg,#fffaf6,#f6f0ff)}.gallery-album-hero-image{flex:0 0 190px;height:145px;overflow:hidden;border-radius:15px;background:#e9e8f6}.gallery-album-hero-image img{width:100%;height:100%;object-fit:cover}.gallery-album-hero-image>span{display:grid;place-items:center;height:100%;color:#8c83c8;font-size:3rem}.gallery-album-hero-copy{min-width:0;flex:1}.gallery-album-title-row{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.gallery-album-title-row .gallery-access-tag{position:static}.gallery-admin-tools{margin-bottom:24px;padding:16px 18px;border-radius:17px}.gallery-admin-details>summary{cursor:pointer;color:#514b88;font-weight:900}.gallery-edit-form{margin-top:15px;align-items:end}.gallery-edit-form>.btn{justify-self:start}.gallery-delete-album-form{margin-top:12px;padding-top:12px;border-top:1px solid #f0e6e6}.gallery-upload-existing{margin-top:18px;padding-top:17px;border-top:1px solid #ececf4}.gallery-upload-existing h3{margin:0;color:#38365f;font-size:.95rem}.gallery-upload-existing p{margin:4px 0 12px}.gallery-upload-form{display:flex;align-items:end;gap:12px;flex-wrap:wrap}.gallery-upload-form label{flex:1 1 220px}.gallery-upload-form .btn{flex:none}.gallery-photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,215px),1fr));gap:15px}.gallery-photo-card{overflow:hidden;margin:0;padding:7px;border:1px solid #e7e8f0;border-radius:15px;background:#fff;box-shadow:0 4px 14px rgba(35,39,87,.04)}.gallery-photo-card>a{display:block;overflow:hidden;border-radius:10px;background:#f0f1f7}.gallery-photo-card img{display:block;width:100%;height:175px;object-fit:cover;transition:transform .35s}.gallery-photo-card:hover img{transform:scale(1.04)}.gallery-photo-card figcaption{display:flex;align-items:center;justify-content:space-between;gap:7px;padding:9px 5px 6px;color:#474960;font-size:.79rem}.gallery-cover-mark{flex:none;color:#37815d;font-size:.67rem}.gallery-photo-actions{display:flex;flex-wrap:wrap;gap:7px;padding:0 4px 5px}.gallery-photo-actions form{margin:0}.home-album-preview-grid .home-album-preview{position:relative;overflow:hidden;border-radius:17px}.home-album-preview>img{height:170px}.home-album-preview>span{display:flex;align-items:center;justify-content:space-between;gap:10px}.home-album-preview>span small{font-size:.68rem;opacity:.85}.home-album-empty{display:grid;place-items:center;height:170px;color:#8278c8;font-size:3rem;background:linear-gradient(135deg,#eeeaff,#e7f2ff)}
@media(max-width:700px){.gallery-hero{min-height:190px;padding:22px}.gallery-hero-art{flex:0 0 120px;transform:scale(.75);transform-origin:center right;margin-inline-end:-25px}.gallery-create-form,.gallery-edit-form{grid-template-columns:1fr}.gallery-file-field{grid-column:auto}.gallery-album-cover{height:160px}.gallery-album-hero{align-items:flex-start;gap:13px;padding:12px}.gallery-album-hero-image{flex-basis:112px;height:110px}.gallery-album-hero h1{font-size:1.2rem}.gallery-upload-form{align-items:stretch}.gallery-upload-form label,.gallery-upload-form .btn{flex-basis:100%}.gallery-photo-card img{height:145px}}
@media(max-width:430px){.gallery-hero{padding:18px}.gallery-hero-art{display:none}.gallery-hero h1{font-size:1.35rem}.gallery-hero-stats{gap:6px}.gallery-hero-stats span{font-size:.7rem}.gallery-album-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.gallery-album-cover{height:126px}.gallery-album-info{padding:10px}.gallery-album-info h3{font-size:.82rem}.gallery-album-info p{font-size:.68rem}.gallery-album-arrow{width:26px;height:26px}.gallery-photo-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.gallery-photo-card img{height:120px}.gallery-photo-card{padding:5px}.gallery-photo-actions .btn{font-size:.68rem;padding:4px 7px}}

.home-gallery-tile .home-album-empty{position:static;inset:auto;display:grid;place-items:center;padding:0;color:#8278c8;background:linear-gradient(135deg,#eeeaff,#e7f2ff);}


/* v29 — مدیریت شفاف آلبوم‌ها و کلیدهای آیکونی نمایش تصویر */
.gallery-admin-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}
.gallery-admin-heading h2{margin:0;color:#2d2b58;font-size:1.2rem;font-weight:950}
.gallery-admin-heading p{margin:5px 0 0;font-size:.82rem;line-height:1.9}
.gallery-create-icon svg{width:25px;height:25px}
.gallery-create-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:0 0 13px}
.gallery-mode-button{position:relative;display:flex;align-items:center;gap:12px;min-width:0;padding:14px 15px;border:1px solid #e3e6f1;border-radius:16px;background:#fff;color:#333650;text-align:right;cursor:pointer;transition:border-color .18s,box-shadow .18s,background .18s,transform .18s}
.gallery-mode-button:hover{transform:translateY(-2px);border-color:#b7afea;box-shadow:0 8px 20px rgba(72,62,145,.08)}
.gallery-mode-button.is-active{border-color:#8a79e4;background:linear-gradient(135deg,#faf9ff,#f0efff);box-shadow:0 0 0 3px rgba(125,108,220,.1)}
.gallery-mode-icon{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;border-radius:13px}
.gallery-mode-icon svg{width:23px;height:23px}
.gallery-mode-icon.public-icon{background:#e7f8ef;color:#20805a}
.gallery-mode-icon.private-icon{background:#fff0e7;color:#ad5b2c}
.gallery-mode-copy{display:grid;gap:4px;min-width:0}
.gallery-mode-copy b{color:#343253;font-size:.89rem;font-weight:900}
.gallery-mode-copy small{color:#777b91;font-size:.72rem;line-height:1.7}
.gallery-mode-check{display:grid;place-items:center;width:23px;height:23px;margin-inline-start:auto;border:1px solid #d8dbea;border-radius:50%;color:transparent;font-size:.78rem;flex:none}
.gallery-mode-button.is-active .gallery-mode-check{border-color:#6f60ca;background:#6f60ca;color:#fff}
.gallery-mode-note{margin:0 0 15px;padding:10px 13px;border:1px solid #e7e8f5;border-radius:12px;background:#f8f8ff;color:#6d6d86;font-size:.75rem;line-height:1.9}
.gallery-create-form{align-items:start}
.gallery-create-form>label{min-width:0}
.gallery-create-form .gallery-file-field{grid-column:1/-1}
.gallery-selected-files{display:inline-flex;align-items:center;min-height:24px;color:#665db2;font-size:.74rem;font-weight:800}
.gallery-create-submit-row{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding-top:2px}
.gallery-create-submit-hint{color:#787b91;font-size:.76rem}
.gallery-create-submit{display:inline-flex;align-items:center;gap:8px}
.gallery-create-submit svg{width:17px;height:17px}
.lightbox-nav{gap:12px;min-height:52px}
.lightbox-arrow{display:grid;place-items:center;width:46px;height:46px;padding:0!important;border:1px solid rgba(255,255,255,.38)!important;border-radius:15px!important;background:rgba(255,255,255,.12)!important;color:#fff!important;box-shadow:0 8px 22px rgba(0,0,0,.2);backdrop-filter:blur(12px);transition:transform .16s,background .16s,border-color .16s}
.lightbox-arrow svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.lightbox-arrow:hover{transform:translateY(-2px);border-color:rgba(255,255,255,.7)!important;background:rgba(139,124,230,.88)!important;color:#fff!important}
.lightbox-arrow:focus-visible,.gallery-mode-button:focus-visible{outline:3px solid #c4b5fd;outline-offset:3px}
@media(max-width:650px){.gallery-create-actions{grid-template-columns:1fr}.gallery-admin-heading{align-items:flex-start}.gallery-create-submit-row{align-items:stretch}.gallery-create-submit-row .gallery-create-submit{justify-content:center;width:100%}.lightbox-arrow{width:42px;height:42px;border-radius:13px!important}.lightbox-title{max-width:30vw;font-size:.78rem}.lightbox-nav{gap:8px}}


/* v30: explicit album and photo editing controls */
.gallery-admin-title{margin:0 0 5px;color:#38365f;font-size:1.05rem;font-weight:950}
.gallery-admin-details{display:block}
.gallery-delete-album-form{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:14px;padding:13px 0 2px;border-top:1px solid #f0e6e6}
.gallery-delete-album-form small{color:#898b9e;font-size:.72rem}
.gallery-photo-edit{position:relative}
.gallery-photo-edit>summary{list-style:none;cursor:pointer}
.gallery-photo-edit>summary::-webkit-details-marker{display:none}
.gallery-photo-edit[open]{flex:1 1 100%;padding:10px;border:1px solid #e6e3f4;border-radius:11px;background:#faf9ff}
.gallery-photo-edit-form{display:grid;gap:9px;margin-top:9px}
.gallery-photo-edit-form label{display:grid;gap:5px;color:#555a73;font-size:.72rem;font-weight:700}
.gallery-photo-edit-form input{width:100%;min-width:0;padding:8px 9px;border:1px solid #dfe3f0;border-radius:9px;background:#fff;color:#30334c;font:inherit}
.gallery-photo-edit-form small{display:block;color:#85899e;font-size:.67rem;font-weight:500}
.gallery-photo-actions>form,.gallery-photo-actions>.gallery-photo-edit{margin:0}

/* تم تیرهٔ انتخابی برای هر حساب کاربری */
body[data-theme="dark"] {
  --ink: #e5eaf3;
  --ink-2: #cbd5e1;
  --muted: #9aa9bf;
  --line: #334155;
  --line-2: #273449;
  --bg: #0c1424;
  --card: #152238;
  --brand: #a5b4fc;
  --brand-2: #a5b4fc;
  --brand-3: #818cf8;
  --brand-soft: #273456;
  --gold: #f4cd70;
  --gold-2: #e6bd5d;
  --gold-soft: #3a321f;
  --ok: #4ade80;
  --ok-soft: #173c32;
  --warn: #fbbf24;
  --warn-soft: #453719;
  --bad: #fca5a5;
  --bad-soft: #482a35;
  --info: #7dd3fc;
  --info-soft: #18384f;
  color-scheme: dark;
  background-image: radial-gradient(1000px 460px at 100% -12%, #20264a 0%, rgba(32,38,74,0) 62%), radial-gradient(900px 420px at 0% 0%, #312b28 0%, rgba(49,43,40,0) 55%);
}
body[data-theme="dark"] .sidebar,
body[data-theme="dark"] .topbar,
body[data-theme="dark"] .mobile-nav,
body[data-theme="dark"] .card,
body[data-theme="dark"] .panel,
body[data-theme="dark"] .modal,
body[data-theme="dark"] .dropdown-menu {
  background-color: var(--card);
  color: var(--ink);
  border-color: var(--line);
}
body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] .form-control {
  color: var(--ink);
  background: #0e1a2d;
  border-color: #3a4b64;
}
body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder { color: #8494ad; }
body[data-theme="dark"] table th { background: #1d2b43; color: var(--ink); }
body[data-theme="dark"] table td { border-color: var(--line); }
body[data-theme="dark"] .sb-link { color: #cbd5e1; }
body[data-theme="dark"] .sb-link:hover,
body[data-theme="dark"] .sb-link.on { background: #273456; color: #fff; }
body[data-theme="dark"] .user-chip,
body[data-theme="dark"] .icon-btn { color: var(--ink); }
body[data-theme="dark"] .alert.info { background: var(--info-soft); color: var(--info); }
body[data-theme="dark"] .alert.ok { background: var(--ok-soft); color: var(--ok); }
body[data-theme="dark"] .alert.err { background: var(--bad-soft); color: var(--bad); }
.theme-toggle-form { margin: 0; display: inline-flex; }
.theme-toggle-form .icon-btn { cursor: pointer; font-size: 1.15rem; }

/* کنتراست کلیدها در پوسته تیره */
body[data-theme="dark"] .btn,
body[data-theme="dark"] button:not(.jalali-calendar-day):not(.jalali-calendar-nav):not(.jalali-calendar-toggle),
body[data-theme="dark"] input[type="submit"] {
  color: #ffffff;
}
body[data-theme="dark"] .btn:not(.ghost):not(.danger):not(.gold),
body[data-theme="dark"] button:not(.ghost):not(.danger):not(.gold):not(.jalali-calendar-day):not(.jalali-calendar-nav):not(.jalali-calendar-toggle),
body[data-theme="dark"] input[type="submit"] {
  background: linear-gradient(180deg, #596bd0, #394a9d);
  border-color: #6679df;
}
body[data-theme="dark"] .btn.ghost,
body[data-theme="dark"] button.ghost {
  background: #22334d;
  color: #f1f5ff;
  border-color: #52627b;
}
body[data-theme="dark"] .btn.ghost:hover,
body[data-theme="dark"] button.ghost:hover {
  background: #334765;
  color: #ffffff;
  border-color: #94a8ff;
}
body[data-theme="dark"] .btn.danger,
body[data-theme="dark"] button.danger {
  background: linear-gradient(180deg, #dc4c5e, #a82b40);
  border-color: #ee8290;
  color: #ffffff;
}
body[data-theme="dark"] .btn.gold { color: #211a0b; background: linear-gradient(180deg,#f4d47b,#d6a72f); border-color:#f4d47b; }
body[data-theme="dark"] .settings-tabs button,
body[data-theme="dark"] .exam-report-tabs button,
body[data-theme="dark"] .page-table-tabs button,
body[data-theme="dark"] .mobile-table-tabs button,
body[data-theme="dark"] .tb button,
body[data-theme="dark"] .tb label {
  background: #1d2d46;
  color: #dce6f5;
  border-color: #40536e;
}
body[data-theme="dark"] .settings-tabs button.on,
body[data-theme="dark"] .exam-report-tabs button.on,
body[data-theme="dark"] .page-table-tabs button.on,
body[data-theme="dark"] .mobile-table-tabs button.on {
  background: #4b5fc3;
  color: #ffffff;
  border-color: #8191ec;
}
body[data-theme="dark"] .btn:disabled,
body[data-theme="dark"] button:disabled { color: #aab7ca; opacity: .58; }

/* فیلد و تقویم هجری شمسی سراسری */
.jalali-field{position:relative;display:flex;align-items:stretch;gap:6px;width:100%;min-width:0}
.jalali-field .jalali-date-visible{flex:1 1 auto;min-width:0;direction:ltr;text-align:center;font-variant-numeric:tabular-nums}
.jalali-field .jalali-time-visible{flex:0 0 105px;min-width:95px;direction:ltr;text-align:center}
.jalali-calendar-toggle{flex:0 0 42px;min-width:42px;padding:5px!important;border:1px solid var(--line)!important;border-radius:10px!important;background:var(--card)!important;color:var(--ink)!important;box-shadow:none!important;font-size:1.15rem!important}
.jalali-calendar{position:absolute;z-index:1000;top:calc(100% + 7px);right:0;width:min(310px,calc(100vw - 44px));padding:12px;border:1px solid var(--line);border-radius:16px;background:var(--card);color:var(--ink);box-shadow:0 18px 45px rgba(0,0,0,.22)}
.jalali-calendar[hidden]{display:none}
.jalali-calendar-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.jalali-calendar-head b{font-size:.9rem}
.jalali-calendar-nav{width:34px;height:34px;padding:0!important;border:1px solid var(--line)!important;border-radius:9px!important;background:var(--bg)!important;color:var(--ink)!important;box-shadow:none!important;font-size:1.2rem!important}
.jalali-calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;text-align:center}
.jalali-calendar-weekday{padding:5px 0;color:var(--muted);font-size:.72rem;font-weight:800}
.jalali-calendar-day{min-width:0;padding:8px 2px!important;border:1px solid transparent!important;border-radius:9px!important;background:transparent!important;color:var(--ink)!important;box-shadow:none!important;font:inherit!important;font-size:.78rem!important}
.jalali-calendar-day:hover,.jalali-calendar-day.selected{background:#4b5fc3!important;color:#fff!important;border-color:#8191ec!important}
.jalali-calendar-empty{min-height:31px}
body[data-theme="dark"] .jalali-calendar-toggle{background:#22334d!important;color:#f1f5ff!important;border-color:#52627b!important}
body[data-theme="dark"] .jalali-calendar{background:#17263c;border-color:#52627b}
@media(max-width:520px){.jalali-field{flex-wrap:wrap}.jalali-field .jalali-time-visible{flex:1 1 100%}.jalali-calendar{right:auto;left:0}}
