/* ===================== دفتر پیشرفت آموزشی — استایل ===================== */

:root {
  --ink: #232323;
  --ink-soft: #5b5648;
  --paper: #f7f2e7;
  --paper-2: #efe7d4;
  --card: #fffdf8;
  --navy: #16324f;
  --navy-2: #0e2338;
  --brass: #b08d57;
  --brass-2: #8c6d3f;
  --seal: #7a2e2e;
  --teal: #3f6659;
  --line: #ddd2b4;
  --danger: #a13d3d;
  --shadow-sm: 0 2px 8px rgba(22, 50, 79, 0.06);
  --shadow-md: 0 10px 30px rgba(22, 50, 79, 0.12);
  --radius: 14px;
  --radius-sm: 9px;
  --font-display: 'Noto Naskh Arabic', 'Vazirmatn', serif;
  --font-body: 'Vazirmatn', Tahoma, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  background-image: linear-gradient(180deg, rgba(176, 141, 87, 0.06), transparent 320px),
    repeating-linear-gradient(to bottom, transparent, transparent 34px, rgba(176, 141, 87, 0.055) 35px);
  min-height: 100vh;
  direction: rtl;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--navy-2);
  margin: 0;
}

p {
  margin: 0;
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

*:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

.muted {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.hint {
  color: var(--ink-soft);
  font-size: 0.82rem;
  margin-top: 8px;
  line-height: 1.7;
}

/* ---------- دکمه‌ها ---------- */
.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  background: var(--navy);
  color: #fff;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn.primary {
  background: var(--navy);
}
.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--navy-2);
}
.btn.ghost:hover {
  background: var(--paper-2);
}
.btn.small {
  padding: 6px 14px;
  font-size: 0.8rem;
}
.btn.full {
  width: 100%;
  margin-top: 6px;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--navy-2);
  font-size: 0.85rem;
}
.icon-btn:hover {
  background: var(--paper-2);
}
.icon-btn.danger {
  color: var(--danger);
  border-color: rgba(161, 61, 61, 0.35);
}

.link-btn {
  background: none;
  border: none;
  color: var(--brass-2);
  text-decoration: underline;
  cursor: pointer;
  padding: 4px 0;
  font-size: 0.85rem;
}

/* ---------- فرم‌ها ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.field span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy-2);
}
.field input,
.field select,
.field textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.94rem;
  background: var(--card);
  color: var(--ink);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brass);
}
.field textarea {
  resize: vertical;
  min-height: 56px;
  font-family: inherit;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}
.form-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}
.form-error {
  color: var(--danger);
  background: rgba(161, 61, 61, 0.08);
  border: 1px solid rgba(161, 61, 61, 0.25);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

/* ---------- صفحهٔ خانه / ورود ---------- */
.home-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
.home-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
  padding: 40px 36px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  animation: fadeUp 0.5s ease both;
}
.home-card.narrow {
  max-width: 380px;
  text-align: right;
}
.home-title {
  font-size: 1.7rem;
  margin-top: 18px;
}
.home-sub {
  color: var(--ink-soft);
  margin-top: 8px;
  font-size: 0.95rem;
}
.home-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 28px;
}
.role-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.role-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
  background: #fff;
}
.role-card .role-icon {
  font-size: 1.8rem;
}
.role-card strong {
  color: var(--navy-2);
  font-family: var(--font-display);
  font-size: 1.05rem;
}
.role-card small {
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.5;
}
.home-date {
  margin-top: 26px;
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.back-link {
  background: none;
  border: none;
  color: var(--brass-2);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 0 14px;
}
.login-title {
  font-size: 1.35rem;
  margin-bottom: 6px;
}

/* ---------- مهر (سیل) ---------- */
.seal {
  width: 108px;
  height: 108px;
  min-width: 108px;
  border-radius: 50%;
  border: 3px solid var(--seal);
  outline: 1px dashed var(--seal);
  outline-offset: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--seal);
  transform: rotate(-6deg);
  background: radial-gradient(circle at 50% 40%, rgba(122, 46, 46, 0.07), transparent 70%);
  margin: 0 auto;
  flex-shrink: 0;
}
.seal .num {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
}
.seal .lbl {
  font-size: 0.6rem;
  margin-top: 4px;
  max-width: 80px;
  text-align: center;
  line-height: 1.3;
}

/* ---------- چیدمان کلی برنامه ---------- */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 26px;
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: var(--shadow-sm);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--brass);
  color: var(--navy-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}
.brand h1 {
  font-size: 1.05rem;
  color: #fff;
}
.brand p {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
}
.topbar .btn.ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}
.topbar .btn.ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}

.teacher-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  padding: 20px;
  flex: 1;
  align-items: start;
}
.student-layout {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  width: 100%;
}

.sidebar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 84px;
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.sidebar-head h2 {
  font-size: 1rem;
}
.search-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  background: var(--paper);
}
.student-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 48vh;
  overflow-y: auto;
}
.student-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
}
.student-list li:hover {
  background: var(--paper-2);
}
.student-list li.active {
  background: var(--paper-2);
  border-color: var(--brass);
}
.student-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.student-item-main strong {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.student-item-main small {
  color: var(--ink-soft);
  font-size: 0.72rem;
}
.student-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.empty-mini {
  color: var(--ink-soft);
  font-size: 0.82rem;
  padding: 10px;
  text-align: center;
}
.settings-btn {
  width: 100%;
  margin-top: 14px;
}

.main-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.4s ease both;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.detail-head h2 {
  font-size: 1.4rem;
}

.welcome {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--navy-2);
  margin-bottom: 18px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--paper-2);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
  border: 1px solid var(--line);
}
.stat-value {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--navy-2);
  font-weight: 700;
}
.stat-label {
  font-size: 0.7rem;
  color: var(--ink-soft);
  margin-top: 4px;
  line-height: 1.4;
}
.trend {
  font-size: 1rem;
  font-weight: 700;
}
.trend.up {
  color: var(--teal);
}
.trend.down {
  color: var(--danger);
}
.trend.flat {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}
.chart-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: var(--paper);
}
.chart-card h3 {
  font-size: 0.9rem;
  margin-bottom: 10px;
  color: var(--navy-2);
}
.chart-wrap {
  height: 220px;
  position: relative;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}
.section-head h3 {
  font-size: 1.05rem;
}

/* ---------- خط زمانی جلسات ---------- */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.session-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  background: var(--paper);
  animation: fadeUp 0.35s ease both;
}
.session-card.absent {
  background: rgba(161, 61, 61, 0.05);
  border-color: rgba(161, 61, 61, 0.25);
}
.session-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.session-number {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--navy-2);
}
.session-date {
  color: var(--ink-soft);
  font-size: 0.85rem;
}
.session-actions {
  margin-inline-start: auto;
  display: flex;
  gap: 6px;
}
.badge {
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 0.72rem;
  font-weight: 700;
}
.badge-success {
  background: rgba(63, 102, 89, 0.14);
  color: var(--teal);
}
.badge-danger {
  background: rgba(161, 61, 61, 0.14);
  color: var(--danger);
}
.session-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 12px;
}
.session-field span {
  display: block;
  font-size: 0.72rem;
  color: var(--brass-2);
  font-weight: 700;
  margin-bottom: 3px;
}
.session-field p {
  font-size: 0.88rem;
  line-height: 1.7;
}
.score-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
}
.chip b {
  font-family: var(--font-display);
  font-size: 0.92rem;
  color: var(--navy-2);
}
.chip.brass b {
  color: var(--brass-2);
}
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-soft);
  background: var(--paper-2);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line);
  font-size: 0.9rem;
}
.empty-state.large {
  padding: 80px 20px;
}

/* ---------- مودال‌ها ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 25, 35, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
  animation: fadeIn 0.2s ease both;
}
.modal-card {
  background: var(--card);
  border-radius: var(--radius);
  max-width: 520px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-md);
  animation: fadeUp 0.25s ease both;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.modal-head h3 {
  font-size: 1.15rem;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

/* ---------- نوار پیام (توست) ---------- */
.toast-holder {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--navy-2);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast.error {
  background: var(--seal);
}

/* ---------- بارگذاری ---------- */
.loading-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--ink-soft);
}
.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--brass);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---------- چاپ کارنامه ---------- */
@media print {
  body {
    background: #fff;
  }
  .no-print {
    display: none !important;
  }
  .sidebar,
  .topbar {
    display: none !important;
  }
  .main-panel,
  #printArea {
    box-shadow: none !important;
    border: none !important;
  }
  .teacher-layout {
    display: block;
  }
}

/* ---------- واکنش‌گرایی ---------- */
@media (max-width: 900px) {
  .teacher-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .charts-row {
    grid-template-columns: 1fr;
  }
  .session-body {
    grid-template-columns: 1fr;
  }
  .home-actions {
    grid-template-columns: 1fr;
  }
  .form-grid,
  .form-grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ===================== افزوده‌های نسخهٔ چند دبیره (ادمین/معلم/کلاس) ===================== */

/* ---------- نقش سوم در صفحهٔ خانه ---------- */
.home-actions.roles-3 {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 700px) {
  .home-actions.roles-3 {
    grid-template-columns: 1fr;
  }
}
.home-card.wide {
  max-width: 640px;
}

/* ---------- تب‌های پنل ادمین ---------- */
.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 10px 6px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  margin-bottom: -1px;
}
.tab-btn:hover {
  color: var(--navy-2);
}
.tab-btn.active {
  color: var(--navy-2);
  border-bottom-color: var(--brass);
}

/* ---------- ردیف‌های فهرست مدیریتی (معلمان/کلاس‌ها/دانش‌آموزان) ---------- */
.manage-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.manage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  flex-wrap: wrap;
}
.manage-row-main {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 180px;
}
.manage-row-main strong {
  font-size: 0.98rem;
  color: var(--navy-2);
}
.manage-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.manage-row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-inline-start: auto;
}

/* ---------- نشان‌ها (پیل‌های موضوعی) ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--navy-2);
  white-space: nowrap;
}
.pill.brass {
  background: rgba(176, 141, 87, 0.14);
  color: var(--brass-2);
  border-color: rgba(176, 141, 87, 0.35);
}
.pill.teal {
  background: rgba(63, 102, 89, 0.14);
  color: var(--teal);
  border-color: rgba(63, 102, 89, 0.3);
}
.pill.ghost-pill {
  background: transparent;
}

/* ---------- چک‌باکس‌های چندگزینه‌ای (تخصیص دانش‌آموز/کلاس) ---------- */
.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px;
  background: var(--card);
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 7px;
  font-size: 0.88rem;
  cursor: pointer;
}
.checkbox-item:hover {
  background: var(--paper-2);
}
.checkbox-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--brass);
  flex-shrink: 0;
}
.checkbox-item span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- انتخابگر کلاس (پنل معلم/دانش‌آموز) ---------- */
.class-switch {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.class-chip {
  border: 1px solid var(--line);
  background: var(--paper-2);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy-2);
  cursor: pointer;
}
.class-chip.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

/* ---------- فهرست کلاس‌ها در سایدبار معلم ---------- */
.class-list {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.class-list li {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.class-list li:hover {
  background: var(--paper-2);
}
.class-list li.active {
  background: var(--paper-2);
  border-color: var(--brass);
}
.class-list li strong {
  font-size: 0.9rem;
}
.class-list li small {
  color: var(--ink-soft);
  font-size: 0.72rem;
}
.sidebar-section-title {
  font-size: 0.75rem;
  color: var(--ink-soft);
  font-weight: 700;
  margin: 14px 0 6px;
}

/* ---------- کارت‌ نقش/شمارنده در داشبورد ادمین ---------- */
.overview-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 700px) {
  .overview-cards {
    grid-template-columns: 1fr;
  }
}
.overview-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.overview-card .overview-icon {
  font-size: 1.6rem;
}
.overview-card .overview-num {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy-2);
}
.overview-card .overview-lbl {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

/* ---------- جدول ثبت جلسه گروهی (اطلاعات شخصی هر دانش‌آموز) ---------- */
.modal-card.wide {
  max-width: 880px;
}
.section-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy-2);
  margin: 18px 0 10px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.section-label:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.roster-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
table.roster-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  min-width: 720px;
}
table.roster-table th {
  background: var(--paper-2);
  color: var(--navy-2);
  font-size: 0.76rem;
  padding: 9px 8px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.roster-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.roster-table tr:last-child td {
  border-bottom: none;
}
table.roster-table tr.absent-row {
  background: rgba(161, 61, 61, 0.05);
}
table.roster-table .student-name-cell {
  font-weight: 700;
  color: var(--navy-2);
  white-space: nowrap;
}
table.roster-table input,
table.roster-table select {
  width: 100%;
  min-width: 64px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 6px;
  font-size: 0.82rem;
  background: var(--card);
}
table.roster-table input[type="number"] {
  min-width: 56px;
}
table.roster-table .note-cell input {
  min-width: 110px;
}

/* ---------- خلاصهٔ حضور در کارت جلسهٔ کلاس ---------- */
.attendance-summary {
  display: flex;
  gap: 8px;
  margin-inline-start: 6px;
  flex-wrap: wrap;
}

/* ---------- ردیف دانش‌آموزان داخل کارنامهٔ کلاس (نمای معلم) ---------- */
.roster-mini-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 22px;
}
.roster-mini-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  cursor: pointer;
}
.roster-mini-item:hover {
  background: var(--paper-2);
}
.roster-mini-item .mini-avg {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--navy-2);
  font-size: 0.95rem;
}

.crumb-back {
  background: none;
  border: none;
  color: var(--brass-2);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
  margin-bottom: 10px;
  display: inline-block;
}

.subtitle-line {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 4px;
}
