:root {
  --bg: #f8fafc;
  --bg-2: #e2e8f0;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --card: rgba(255, 255, 255, 0.95);
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #818cf8;
  --accent: #f59e0b;
  --accent-light: #fbbf24;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 16px;
  font-family: "Noto Sans Arabic", "Noto Sans", Tahoma, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font: inherit;
}

.password-input-wrap {
  position: relative;
  display: block;
  flex: 1 1 190px;
  width: 100%;
  min-width: 0;
}
.password-input-wrap > input[type="password"],
.password-input-wrap > input[type="text"] {
  width: 100%;
  padding-inline-end: 48px;
}
.password-visibility-toggle {
  position: absolute;
  inset-inline-end: 7px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 6px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.password-visibility-toggle:hover { background: rgba(13, 148, 136, .1); color: var(--primary-dark); }
.password-visibility-toggle:focus-visible { outline: 3px solid rgba(13, 148, 136, .28); outline-offset: 1px; }
.password-visibility-toggle svg { width: 21px; height: 21px; fill: currentColor; }
.remember-login {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  margin: 12px 0 0;
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
}
.remember-login input[type="checkbox"] { width: 17px; min-height: 17px; margin: 0; accent-color: var(--primary); }
.remember-login-help { display: block; margin: 4px 0 16px; color: var(--muted); font-size: 12px; line-height: 1.5; }

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

.developer-credit {
  grid-column: 1 / -1;
  justify-self: center;
  align-self: end;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  width: min(560px, calc(100% - 40px));
  margin: 4px auto 22px;
  padding: 13px 12px 0;
  border-top: 1px solid rgba(255, 255, 255, .24);
  color: rgba(255, 255, 255, .74);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
}

.developer-credit strong {
  color: #f4c76f;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .025em;
}

.app-credit {
  margin: 38px auto 0;
  padding-top: 14px;
  border-color: var(--line);
  color: var(--muted);
}

.app-credit strong {
  color: var(--primary);
}

.plan-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 12px;
  margin-top: 18px;
}

.plan-images h3 {
  grid-column: 1 / -1;
}

.plan-images figure {
  min-width: 0;
  margin: 0;
}

.plan-images img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
}

.plan-images figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

/* Component display rules (for example .student-classification { display:grid })
   must never override the browser's hidden attribute. */
[hidden] {
  display: none !important;
}

/* Language switcher */
.lang-switch {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  justify-content: center;
}

.lang-btn {
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.lang-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.lang-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-hero {
  padding: 56px;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.95), rgba(124, 58, 237, 0.9));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backdrop-filter: blur(10px);
}

.mark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 700;
}

.logo {
  width: 140px;
  height: 140px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85));
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15), 0 0 0 4px rgba(245, 158, 11, 0.3);
  object-fit: contain;
  padding: 8px;
  backdrop-filter: blur(10px);
}

.logo-sm {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  padding: 6px;
}

.logo-lg {
  width: 200px;
  height: 200px;
  display: block;
  margin: 0 auto 20px;
  border-radius: 20px;
  padding: 10px;
}

.login-hero h1 {
  font-size: clamp(28px, 4.4vw, 48px);
  line-height: 1.25;
  margin: 48px 0 18px;
  max-width: 16ch;
  font-weight: 700;
}

.login-hero p {
  max-width: 42ch;
  color: #e8f1fb;
  font-size: 18px;
  line-height: 1.7;
}

.role-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.role-pills span {
  border: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.card {
  width: min(440px, 100%);
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  backdrop-filter: blur(10px);
}

.card h2 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 500;
}

.sub {
  color: var(--muted);
  margin: 0 0 22px;
}

label {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin: 14px 0 6px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--ink);
  outline: none;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
}

.btn.gold {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.btn.gold:hover {
  background: var(--accent-light);
  box-shadow: 0 4px 8px rgba(245, 158, 11, 0.4);
}

.btn.ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  box-shadow: none;
}

.btn.ghost:hover {
  background: rgba(79, 70, 229, 0.1);
}

.btn.danger {
  background: var(--danger);
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.btn.danger:hover {
  background: #dc2626;
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.4);
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

.actions-cell {
  white-space: nowrap;
}

.actions-cell .btn {
  margin-inline-start: 4px;
  margin-bottom: 4px;
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.full {
  width: 100%;
  margin-top: 18px;
}

.hint {
  margin-top: 18px;
  padding: 12px;
  background: rgba(79, 70, 229, 0.1);
  border-radius: 12px;
  font-size: 13px;
  color: var(--primary);
  border: 1px solid rgba(79, 70, 229, 0.2);
}

.error {
  color: var(--danger);
  font-size: 14px;
  white-space: pre-line;
  min-height: 20px;
  margin-top: 8px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
}

#nav {
  display: flex;
  flex-direction: column;
}

.nav-btn {
  text-align: right;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  border: 0;
  padding: 12px 12px;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 4px;
  width: 100%;
  transition: all 0.2s ease;
  font-weight: 500;
}

.nav-btn.active,
.nav-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  transform: translateX(-2px);
}

.sidebar .grow {
  flex: 1;
}

.user-box {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
}

.user-box small {
  display: block;
  color: var(--accent-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 4px;
  font-weight: 600;
}

.main {
  padding: 28px 32px 48px;
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 500;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat b {
  display: block;
  font-size: 28px;
  margin-top: 6px;
}

.search-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 200px) minmax(140px, 180px) auto;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
}

.table-wrap,
.form-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow-x: auto;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: start;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 14px;
}

td > .chip {
  margin-inline-start: 8px;
}

th {
  font-size: 13px;
  color: var(--muted);
  background: rgba(79, 70, 229, 0.05);
  font-weight: 600;
}

tr:hover td {
  background: #f4f8fd;
}

.chip {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--primary-light);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.chip.status-pending {
  background: var(--warning);
}

.chip.status-approved {
  background: var(--success);
}

.chip.status-rejected {
  background: var(--danger);
}

.chip.status-delayed {
  background: var(--info);
}

.chip.note-alert {
  margin-inline-start: 6px;
  background: #fff0d2;
  color: #8a4a00;
  border: 1px solid #f2bd65;
  font-weight: 700;
}

.plan-note-notification {
  margin: 0 0 16px;
  padding: 14px 18px;
  border: 1px solid #f2bd65;
  border-inline-start: 5px solid #d97706;
  border-radius: 12px;
  background: #fff8e8;
  color: #713f12;
  font-weight: 650;
}

.plan-note-notification span {
  color: #d97706;
  margin-inline-end: 8px;
}

.plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-card {
  padding: 28px;
}

.subject-entry {
  display: flex;
  gap: 10px;
  align-items: center;
}
.extra-role-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 14px; margin: 18px 0; padding: 16px; border: 1px solid #dce7e1; border-radius: 14px; background: #f7faf8; }
.extra-role-picker[hidden] { display: none !important; }
.extra-role-picker legend { padding: 0 8px; color: var(--primary-dark); font-weight: 700; }
.extra-role-picker p { grid-column: 1 / -1; margin: 0; }
.extra-role-picker > div { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 14px; }
.extra-role-picker label { display: flex; align-items: center; gap: 8px; margin: 0; }
.extra-role-picker input[type="checkbox"] { width: 18px; min-height: 18px; accent-color: var(--primary); }
.extra-role-picker > div label {
  display: inline-flex !important;
  flex-direction: row !important;
  justify-content: flex-start !important;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  text-align: start;
  white-space: normal;
}
.extra-role-picker > div input[type="checkbox"] {
  flex: 0 0 18px;
  width: 18px;
  min-height: 18px;
  margin: 0;
}
#teacher-extra-roles.extra-role-picker {
  display: block;
  padding: 22px;
  border-color: #cdded6;
  background: linear-gradient(145deg, #f7fbf9, #f0f7f4);
}
#teacher-extra-roles > .sub { max-width: 70ch; line-height: 1.55; }
#teacher-extra-roles .account-access-group { margin-top: 22px; }
#teacher-extra-roles .account-access-group h3 {
  margin: 0 0 12px;
  color: var(--primary-dark);
  font-size: 16px;
}
#teacher-extra-roles .account-access-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 10px;
}
#teacher-extra-roles .account-access-options label {
  display: flex !important;
  align-items: flex-start;
  gap: 11px;
  width: 100%;
  min-height: 58px;
  padding: 13px 14px;
  border: 1px solid #d8e4de;
  border-radius: 12px;
  background: #fff;
  line-height: 1.45;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
#teacher-extra-roles .account-access-options label:hover { border-color: #8abdb0; box-shadow: 0 3px 12px rgba(16, 91, 78, .08); }
#teacher-extra-roles .account-access-options label:has(input:checked) { border-color: var(--primary); background: #eaf7f2; box-shadow: inset 0 0 0 1px var(--primary); }
#teacher-extra-roles .account-access-options label:has(input:focus-visible) { outline: 3px solid rgba(13, 148, 136, .22); outline-offset: 2px; }
#teacher-extra-roles .account-access-options input[type="checkbox"] { flex: 0 0 18px; width: 18px; min-height: 18px; margin: 2px 0 0; }

.subject-entry input {
  flex: 1;
  min-width: 0;
}

.subject-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.subject-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--primary-light);
  color: #fff;
  font-size: 14px;
}

.subject-remove {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 20;
  backdrop-filter: blur(4px);
}

.modal {
  width: min(720px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #ffffff;
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
}

.detail p {
  white-space: pre-wrap;
  margin: 0 0 12px;
}

.detail h3 {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

@media (max-width: 720px) {
  .login-wrap,
  .app-shell,
  .stats,
  .search-bar,
  .plan-grid {
    grid-template-columns: 1fr;
  }

  .login-hero {
    display: none;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .sidebar .grow {
    display: none;
  }
}

/* Sardam visual identity: deep evergreen, jade, and warm marigold. */
/* Shift-scoped teacher topics and work uploads */
.topic-create { margin-bottom: 22px; }
.topic-create h2 { margin-top: 0; }
.topic-card { margin: 0 0 16px; padding: clamp(18px, 3vw, 26px); border: 1px solid var(--line, #dbe5e2); border-radius: 20px; background: var(--surface, #fff); box-shadow: 0 12px 32px rgba(25, 54, 50, .06); }
.topic-card.topic-unread { border-color: var(--accent, #0a887e); box-shadow: 0 0 0 3px rgba(10, 136, 126, .1); }
.topic-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.topic-card-head h2 { margin: 0 0 6px; }
.topic-description { line-height: 1.7; white-space: normal; overflow-wrap: anywhere; }
.topic-new-badge, .topic-nav-badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: #f1a32b; color: #1d302d; font-size: .78rem; font-weight: 700; padding: 5px 10px; }
.topic-nav-badge { min-width: 20px; padding: 2px 6px; margin-inline-start: 8px; }
.topic-files { border-top: 1px solid var(--line, #dbe5e2); margin-top: 18px; padding-top: 10px; }
.topic-files h3 { margin: 8px 0; }
.topic-file { display: inline-flex; margin: 4px 7px 4px 0; padding: 8px 12px; border: 1px solid var(--line, #dbe5e2); border-radius: 10px; background: #f3f8f6; color: var(--ink, #183a36); cursor: pointer; overflow-wrap: anywhere; }
.topic-upload { display: grid; gap: 10px; margin-top: 18px; padding: 16px; border-radius: 14px; background: #f3f8f6; }
.topic-upload small { color: var(--muted, #647c77); }

/* Persistent site-wide dark theme */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10191c;
  --bg-2: #1c2b2e;
  --ink: #e7f0ed;
  --muted: #a4b6b0;
  --line: #34494a;
  --card: #1a292c;
  --primary: #23a998;
  --primary-dark: #168477;
  --primary-light: #48c7b2;
  --accent: #f0aa39;
  --accent-light: #ffc45d;
  --success: #40c99b;
  --danger: #f07870;
  --warning: #efad50;
  --info: #72b6f1;
  --shadow: 0 4px 14px rgba(0, 0, 0, .2);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, .3);
}

html[data-theme="dark"] body { color: var(--ink); background: var(--bg); }
html[data-theme="dark"] .login-wrap { background: #10191c; }
html[data-theme="dark"] .login-hero { background: linear-gradient(145deg, #123d3e, #0d292e); }
html[data-theme="dark"] .login-panel { background: #111c1f; }
html[data-theme="dark"] .sidebar { background: linear-gradient(180deg, #102d30, #0d2226); }
html[data-theme="dark"] .main { background: radial-gradient(ellipse at 88% 0%, rgba(27, 103, 91, .2), transparent 34%), #10191c; }
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .form-card,
html[data-theme="dark"] .card,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .stat,
html[data-theme="dark"] .result-card,
html[data-theme="dark"] .topic-card { color: var(--ink); background: #1a292c; border-color: var(--line); }
html[data-theme="dark"] .result-card { background: linear-gradient(150deg, #1c2d30, #172427); }
html[data-theme="dark"] .form-card label,
html[data-theme="dark"] label,
html[data-theme="dark"] .teacher-assignment-grid label,
html[data-theme="dark"] .account-roles-form label { color: #c1d0cb; }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .form-card input,
html[data-theme="dark"] .form-card select,
html[data-theme="dark"] .form-card textarea { color: var(--ink); background: #122023; border-color: #405757; }
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #8fa39d; opacity: 1; }
html[data-theme="dark"] .password-visibility-toggle { color: #aec2bb; }
html[data-theme="dark"] .password-visibility-toggle:hover { color: #8de0cd; background: rgba(141, 224, 205, .12); }
html[data-theme="dark"] .remember-login { color: var(--ink); }
html[data-theme="dark"] select option { color: var(--ink); background: #172629; }
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(35, 169, 152, .2); }
html[data-theme="dark"] th { color: #c2d2cc; background: #203235; }
html[data-theme="dark"] td { color: var(--ink); border-color: #2c4143; }
html[data-theme="dark"] tr:hover td { background: #203336; }
html[data-theme="dark"] .nav-btn { color: #c3d3ce; }
html[data-theme="dark"] .nav-btn.active,
html[data-theme="dark"] .nav-btn:hover { color: #fff; background: rgba(255, 255, 255, .11); }
html[data-theme="dark"] .lang-btn { color: #d2e0db; background: #203235; border-color: #3d5354; }
html[data-theme="dark"] .lang-btn.active { color: #fff; background: var(--primary-dark); border-color: var(--primary-dark); }
html[data-theme="dark"] .theme-toggle { color: #f4d28e; background: #203235; border-color: #49605f; }
html[data-theme="dark"] .sub,
html[data-theme="dark"] .empty,
html[data-theme="dark"] .student-bill-audit,
html[data-theme="dark"] .report-card-footer { color: #a5b8b1; }
html[data-theme="dark"] .extra-role-picker,
html[data-theme="dark"] .teacher-assignment-grid,
html[data-theme="dark"] .topic-upload,
html[data-theme="dark"] .topic-reply,
html[data-theme="dark"] #topic-teacher-picker,
html[data-theme="dark"] .social-class-fields,
html[data-theme="dark"] .social-case-reply,
html[data-theme="dark"] .account-email-form,
html[data-theme="dark"] .account-roles-form,
html[data-theme="dark"] .account-filters,
html[data-theme="dark"] .student-edit-row > td,
html[data-theme="dark"] .topic-file { color: var(--ink); background: #1e3033; border-color: var(--line); }
html[data-theme="dark"] #teacher-extra-roles.extra-role-picker { background: linear-gradient(145deg, #1e3033, #19292b); }
html[data-theme="dark"] #teacher-extra-roles .account-access-group h3 { color: #8de0cd; }
html[data-theme="dark"] #teacher-extra-roles .account-access-options label { color: var(--ink); background: #172629; border-color: #405757; }
html[data-theme="dark"] #teacher-extra-roles .account-access-options label:has(input:checked) { background: #193b34; border-color: #53c8ae; }
html[data-theme="dark"] .result-subject-chip,
html[data-theme="dark"] .topic-reply { color: #d9e7e2; background: #223739; border-color: #405655; }
html[data-theme="dark"] .result-subject-chip button { color: #ff9b8e; background: #304548; }
html[data-theme="dark"] .result-marks > div { color: var(--ink); background: #203235; border-color: #34494a; }
html[data-theme="dark"] .result-marks .result-total,
html[data-theme="dark"] .report-table .report-total { background: #193b34; border-color: #2d6454; }
html[data-theme="dark"] .result-marks .result-total b { color: #75dbb4; }
html[data-theme="dark"] .report-table thead th { color: #c1d0cb; background: #203235; }
html[data-theme="dark"] .report-table th,
html[data-theme="dark"] .report-table td { color: var(--ink); border-color: #34494a; }
html[data-theme="dark"] .hint { color: #b2d5e8; background: #1e3541; border-color: #365568; }
html[data-theme="dark"] .btn.ghost { color: #63d0bd; border-color: #3f8e82; }
html[data-theme="dark"] .btn.ghost:hover { background: rgba(35, 169, 152, .16); }
html[data-theme="dark"] .btn.danger { color: #ffaaa2; background: #442927; border-color: #70413d; }
html[data-theme="dark"] .success-message { color: #71d7ae; }
html[data-theme="dark"] .error { color: #ff9b92; }
html[data-theme="dark"] .modal-back { background: rgba(0, 0, 0, .72); }
html[data-theme="dark"] .topic-card.topic-unread { border-color: var(--primary-light); }
html[data-theme="dark"] .result-access-table-wrap,
html[data-theme="dark"] .student-billing-table-wrap { scrollbar-color: #45625c transparent; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--bg-2);
  cursor: pointer;
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.theme-toggle:hover { border-color: var(--primary); transform: translateY(-1px); }
.sidebar .theme-toggle { flex: 1 1 0; min-width: 0; color: rgba(255,255,255,.86); background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.16); }
.sidebar .theme-toggle:hover { background: rgba(255,255,255,.15); }
.topic-audience { display: grid; gap: 8px; margin: 16px 0; padding: 16px; border: 1px solid #dce7e1; border-radius: 14px; }
.topic-audience > label { display: flex; align-items: center; justify-content: flex-start; gap: 9px; margin: 2px 0; }
.topic-audience input[type="radio"], .topic-teacher-option input[type="checkbox"] { width: 18px; min-height: 18px; margin: 0; flex: 0 0 18px; accent-color: var(--primary); }
#topic-teacher-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 6px 14px; max-height: 220px; overflow-y: auto; padding: 10px; border-radius: 10px; background: #f4f8f6; }
.topic-teacher-option { display: flex !important; align-items: center; justify-content: flex-start; gap: 8px; width: fit-content; margin: 0 !important; }
.topic-teacher-option[hidden] { display: none !important; }
.topic-audience-label { display: block; color: var(--muted, #647c77); margin: 8px 0; }
.topic-dates { margin: 14px 0; }
.topic-deadline { color: var(--muted, #647c77); font-size: .9rem; }
.topic-reply { margin: 8px 0; padding: 12px; border-radius: 10px; background: #f4f8f6; overflow-wrap: anywhere; }
.topic-reply p { margin: 6px 0; white-space: pre-wrap; }
.social-case-form { margin-bottom: 22px; }
.social-case-form h2 { margin-top: 0; }
.social-class-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 14px; margin: 10px 0 16px; padding: 16px; border: 1px solid var(--line, #dbe5e2); border-radius: 14px; }
.social-class-fields legend { padding: 0 8px; color: var(--primary-dark); font-weight: 700; }
.social-class-summary { margin: 6px 0; color: var(--muted, #647c77); }
.social-case-card > .topic-description { white-space: pre-wrap; }
.social-teacher-group { margin: 14px 0; border: 1px solid var(--line, #dbe5e2); border-radius: 16px; background: var(--surface, #fff); overflow: hidden; }
.social-teacher-group > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; cursor: pointer; list-style: none; }
.social-teacher-group > summary::-webkit-details-marker { display: none; }
.social-teacher-group > summary::after { content: '＋'; color: var(--accent, #0a887e); font-size: 1.2rem; }
.social-teacher-group[open] > summary::after { content: '−'; }
.social-teacher-group > summary > span:first-child { display: grid; gap: 5px; }
.social-teacher-group > summary strong { font-size: 1.05rem; }
.social-teacher-group > summary small { color: var(--muted, #647c77); }
.social-teacher-concerns { display: grid; gap: 12px; padding: 0 16px 16px; }
.social-case-reply { margin-top: 16px; padding: 16px; border-inline-start: 4px solid var(--accent, #0a887e); border-radius: 12px; background: #f1f8f5; }
.social-case-reply h3 { margin: 0 0 8px; }
.social-case-reply p { margin: 0 0 8px; white-space: pre-wrap; }
.social-case-reply-form { display: grid; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line, #dbe5e2); }
.result-access-panel { display: grid; gap: 16px; }
.result-access-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 12px; margin-bottom: 12px; }
.result-access-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.result-access-toggle { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.result-access-toggle input { width: 18px; min-height: 18px; accent-color: var(--primary); }
.result-access-table-wrap { width: 100%; min-width: 0; overflow-x: hidden; }
.result-access-table { width: 100%; min-width: 0; table-layout: fixed; }
.result-access-table th,
.result-access-table td { padding: 10px 7px; font-size: 12px; overflow-wrap: anywhere; word-break: break-word; }
.result-access-table th:nth-child(1) { width: 13%; }
.result-access-table th:nth-child(2) { width: 17%; }
.result-access-table th:nth-child(3) { width: 9%; }
.result-access-table th:nth-child(4) { width: 12%; }
.result-access-table th:nth-child(5) { width: 8%; }
.result-access-table th:nth-child(6) { width: 15%; }
.result-access-table th:nth-child(7) { width: 11%; }
.result-access-table th:nth-child(8) { width: 15%; }
.result-access-table code { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.result-access-select-all { white-space: normal; align-items: flex-start; }
.result-access-select-all input { flex: 0 0 16px; margin-top: 1px; }
.student-billing-panel { display: grid; gap: 14px; width: 100%; max-width: none; padding: clamp(14px, 2vw, 24px); }
.student-billing-count { margin: 0; }
.student-billing-table-wrap { min-width: 0; overflow-x: hidden; }
.student-billing-table { width: 100%; min-width: 0; table-layout: fixed; }
.student-billing-table th,
.student-billing-table td { padding: 10px 8px; font-size: 12px; overflow-wrap: anywhere; }
.student-billing-table th { padding: 10px 6px; font-size: 12px; overflow-wrap: anywhere; }
.student-billing-table th:first-child { width: 19%; }
.student-billing-table th:nth-child(2) { width: 24%; }
.student-billing-table th:nth-child(n+3) { width: 11.4%; }
.student-billing-table td:first-child small { display: block; margin-top: 4px; color: var(--muted); overflow-wrap: anywhere; }
.student-bill-toggle { display: inline-flex; align-items: center; gap: 6px; margin: 0 !important; white-space: nowrap; }
.student-bill-toggle input { width: 17px; min-height: 17px; accent-color: var(--primary); }
.student-bill-audit { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.4; }
@media (max-width: 720px) {
  .student-billing-table-wrap { overflow: visible; }
  .student-billing-table { display: block; }
  .student-billing-table thead { display: none; }
  .student-billing-table tbody { display: grid; gap: 12px; }
  .student-billing-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
  .student-billing-table tbody td { min-width: 0; padding: 10px; }
  .student-billing-table tbody td:nth-child(-n+2) { grid-column: 1 / -1; }
  .student-billing-table tbody td:nth-child(n+3)::before { content: attr(data-label); display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
  .student-billing-table .student-bill-toggle { white-space: normal; }
}
@media (max-width: 620px) { .topic-card-head { flex-direction: column; } .topic-new-badge { align-self: flex-start; } }

/* Institute mark and product wordmark */
.login-hero .mark {
  align-self: flex-start;
  gap: 16px;
  padding: 12px 20px 12px 12px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 22px;
  background: linear-gradient(110deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .045));
  box-shadow: 0 14px 34px rgba(4, 34, 32, .16), inset 0 1px rgba(255, 255, 255, .12);
  backdrop-filter: blur(12px);
}
.login-hero .mark .logo {
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  padding: 0;
  border: 3px solid #f4bd59;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .15), 0 8px 20px rgba(4, 34, 32, .3);
}
.brand-copy { display: grid; gap: 3px; }
.brand-copy strong { color: #fff; font-size: 17px; font-weight: 700; line-height: 1.35; }
.brand-copy small { color: #f4c76f; font-size: 11px; font-weight: 600; letter-spacing: .09em; }
.login-panel .logo-lg {
  width: 104px;
  height: 104px;
  padding: 0;
  border: 3px solid #f4bd59;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 0 0 5px #fff, 0 0 0 8px rgba(10, 136, 126, .15), 0 12px 28px rgba(19, 59, 55, .16);
}
.sidebar > .mark .logo-sm {
  border: 2px solid #f4bd59;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .12), 0 6px 16px rgba(0, 0, 0, .2);
}
@media (max-width: 720px) {
  .login-panel .logo-lg { width: 92px; height: 92px; }
}

:root {
  --bg: #f3f7f5;
  --bg-2: #e6efeb;
  --ink: #152c2c;
  --muted: #71827d;
  --line: #dce8e2;
  --card: rgba(255, 255, 255, 0.94);
  --primary: #087f72;
  --primary-dark: #06675e;
  --primary-light: #16a394;
  --accent: #e8a33a;
  --accent-light: #f3ba5d;
  --success: #15966f;
  --danger: #d9534f;
  --warning: #d99124;
  --info: #387eaa;
  --shadow: 0 8px 24px rgba(21, 60, 50, 0.07);
  --shadow-lg: 0 24px 64px rgba(18, 51, 45, 0.15);
  --radius: 20px;
}

body {
  background: radial-gradient(ellipse at 85% 0%, #e0efe8 0, transparent 36%), var(--bg);
}

.login-wrap {
  background: #102f32;
  grid-template-columns: minmax(0, 1.08fr) minmax(460px, .92fr);
}

.login-hero {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  padding: clamp(36px, 6vw, 88px);
  background: radial-gradient(ellipse at 15% 90%, rgba(28, 157, 128, .34), transparent 38%), linear-gradient(145deg, #10383a 0%, #12665c 100%);
}

.login-hero::before,
.login-hero::after {
  content: "";
  position: absolute;
  z-index: 0;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
  pointer-events: none;
}

.login-hero::before {
  width: min(38vw, 520px);
  aspect-ratio: 1;
  inset-inline-end: -15%;
  top: 13%;
  box-shadow: 0 0 0 38px rgba(255, 255, 255, .025), 0 0 0 82px rgba(255, 255, 255, .02);
}

.login-hero::after {
  width: 10px;
  height: 10px;
  top: 23%;
  inset-inline-end: 19%;
  background: var(--accent-light);
  box-shadow: 0 0 30px 12px rgba(243, 186, 93, .18);
}

.login-panel {
  position: relative;
  z-index: 1;
  padding: clamp(24px, 5vw, 72px);
  background: #f4f8f5;
  backdrop-filter: none;
}

.card {
  width: min(460px, 100%);
  padding: clamp(26px, 4vw, 42px);
  border: 1px solid #e3ece6;
  border-radius: 24px;
}

.logo-lg {
  width: 88px;
  height: 88px;
  margin: 0 auto 20px;
  border-radius: 22px;
}

.card h2 {
  margin-bottom: 8px;
  font-size: 27px;
  font-weight: 700;
}

.card .sub {
  line-height: 1.65;
}

.login-hero .mark .logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
}

.login-hero > div:nth-child(2) {
  position: relative;
  z-index: 1;
}

.login-hero h1 {
  max-width: 13ch;
  font-size: clamp(38px, 5vw, 64px);
  letter-spacing: -.035em;
  line-height: 1.22;
}

.login-hero > p {
  color: rgba(255, 255, 255, .72);
  font-size: 14px;
}
.institute-location {
  display: inline-flex;
  align-items: flex-start;
  gap: 7px;
}
.institute-location svg {
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  margin-top: 3px;
  fill: currentColor;
}

.role-pills span {
  padding: 9px 15px;
  border-radius: 999px;
}

.staff-strip { margin-top: clamp(20px, 3vw, 34px); max-width: 620px; }
.staff-strip h2 { margin: 0 0 12px; color: #fff; font-size: 15px; letter-spacing: .04em; }
.staff-strip ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.staff-strip li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 12px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 12px; background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .86); font-size: 12px; }
.staff-strip li strong { color: var(--accent-light); font-weight: 650; }
.login-hero a { color: #fff; text-underline-offset: 3px; }
.social-links {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.social-links a {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  text-decoration: none;
  transition: background .18s ease, transform .18s ease;
}
.social-links a:hover { background: rgba(255, 255, 255, .22); transform: translateY(-2px); }
.social-links a:focus-visible { outline: 3px solid var(--accent-light); outline-offset: 3px; }
.social-links svg { width: 21px; height: 21px; fill: currentColor; }

@media (max-width: 900px) {
  .staff-strip li { display: block; }
  .staff-strip li strong { display: block; margin-bottom: 3px; }
}

.login-panel .lang-btn {
  min-width: 92px;
  padding: 8px 14px;
  border-radius: 999px;
}

.login-panel .hint {
  line-height: 1.8;
}

.logo {
  background: linear-gradient(135deg, #fff, #e9f3ed);
  box-shadow: 0 10px 28px rgba(3, 31, 30, .2), 0 0 0 4px rgba(232, 163, 58, .3);
}

.role-pills span {
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .24);
  box-shadow: 0 8px 20px rgba(4, 40, 35, .12);
}

.card {
  border: 1px solid rgba(255, 255, 255, .75);
  box-shadow: 0 28px 80px rgba(13, 46, 41, .18);
}

input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 4px rgba(8, 127, 114, .13);
}

.btn.gold:hover {
  background: #d89128;
  box-shadow: 0 8px 18px rgba(180, 117, 26, .24);
}

.btn.ghost:hover,
.hint {
  background: #e5f3ee;
}

.hint {
  border-color: #cce5dc;
}

.sidebar {
  background: radial-gradient(ellipse at 20% 0%, rgba(25, 144, 122, .34), transparent 40%), linear-gradient(180deg, #123b3d 0%, #102e32 100%);
  box-shadow: 8px 0 32px rgba(13, 47, 43, .12);
}

.nav-btn.active,
.nav-btn:hover {
  background: rgba(255, 255, 255, .12);
  box-shadow: inset 3px 0 0 var(--accent-light);
}

.main {
  background: radial-gradient(ellipse at 88% 0%, rgba(212, 235, 222, .68), transparent 32%), linear-gradient(180deg, #f7faf8 0%, #f0f5f2 100%);
}

.topbar h1 {
  font-weight: 700;
  letter-spacing: -.025em;
}

.stat,
.table-wrap,
.form-card {
  border-radius: var(--radius);
}

.stat {
  border-top: 3px solid var(--primary-light);
}

th {
  background: #edf5f1;
}

tr:hover td {
  background: #f1f8f4;
}

.chip,
.subject-chip {
  background: var(--primary);
}

.modal {
  border: 1px solid var(--line);
}

@media (max-width: 720px) {
  .login-panel {
    padding: 22px 16px;
  }

  .card {
    padding: 26px 22px;
  }

  .login-wrap {
    grid-template-columns: 1fr;
  }

  .sidebar {
    background: linear-gradient(135deg, #123b3d, #10544d);
  }
}

/* Layout and component refresh */
.app-shell {
  grid-template-columns: 276px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 0;
  padding: 24px 18px 18px;
  gap: 8px;
  overflow: hidden;
}

.sidebar > .mark {
  min-height: 68px;
  padding: 0 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  font-size: 18px;
}

.logo-sm {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  padding: 4px;
}

.lang-switch.sidebar {
  display: flex;
  flex-direction: row;
  flex: 0 0 auto;
  position: static;
  top: auto;
  height: auto;
  min-height: 0;
  background: transparent;
  box-shadow: none;
  justify-content: flex-start;
  padding: 8px 2px 18px;
  margin: 0;
}

/* The sidebar itself is a vertical flex column; its language controls must
   stay in their own compact horizontal row above the navigation. */
.lang-switch.sidebar .lang-btn {
  flex: 1 1 0;
  min-width: 0;
}

.sidebar .lang-btn {
  flex: 1;
  border-color: rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .07);
  color: rgba(255, 255, 255, .82);
}

.sidebar .lang-btn.active {
  background: rgba(255, 255, 255, .17);
  border-color: rgba(255, 255, 255, .28);
  color: #fff;
}

#nav {
  gap: 5px;
  padding-top: 6px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .25) transparent;
}

.nav-btn {
  position: relative;
  min-height: 46px;
  padding: 12px 15px;
  text-align: start;
  font-size: 14px;
  letter-spacing: .01em;
}

.nav-btn.active {
  background: rgba(255, 255, 255, .14);
  box-shadow: inset 3px 0 0 var(--accent-light);
}

.sidebar .user-box {
  margin-top: 18px;
  padding: 16px 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  background: rgba(255, 255, 255, .06);
  flex-shrink: 0;
}

.sidebar #logout {
  flex-shrink: 0;
  min-height: 48px;
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 14px;
  background: #a9433e;
  color: #fff;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 6px 16px rgba(7, 27, 27, .2);
}

.sidebar #logout::before {
  content: "↪";
  display: inline-block;
  margin-inline-end: 8px;
  font-size: 17px;
  line-height: 0;
  vertical-align: -1px;
}

.sidebar #logout:hover,
.sidebar #logout:focus-visible {
  background: #883732;
  color: #fff;
  outline: 3px solid rgba(255, 255, 255, .35);
  outline-offset: 2px;
}

.main {
  padding: clamp(24px, 4vw, 52px) clamp(20px, 4vw, 58px) 64px;
}

.main > .topbar,
.main > #page {
  width: min(1180px, 100%);
  margin-inline: auto;
}

.topbar {
  position: relative;
  padding: 0 0 22px;
  margin-bottom: 26px;
  border-bottom: 1px solid rgba(183, 205, 194, .68);
}

.topbar::after {
  content: "";
  position: absolute;
  bottom: -2px;
  inset-inline-start: 0;
  width: 54px;
  height: 3px;
  border-radius: 5px;
  background: var(--accent);
}

.topbar h1 {
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.25;
}

.topbar .sub {
  margin: 8px 0 0;
  max-width: 70ch;
  line-height: 1.7;
}

.stats {
  gap: 16px;
  margin-bottom: 24px;
}

.stat {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  padding: 20px 22px;
  border: 1px solid #e2ebe5;
  border-top: 0;
  border-radius: 18px;
  background: linear-gradient(145deg, #fff, #fbfdfb);
}

.stat::after {
  content: "";
  position: absolute;
  inset-inline-end: -22px;
  bottom: -38px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(22, 163, 148, .08);
}

.stat b {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  font-size: clamp(25px, 3vw, 32px);
  line-height: 1.1;
}

.search-bar {
  padding: 14px;
  border: 1px solid #e2ebe5;
  border-radius: 18px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 4px 16px rgba(21, 60, 50, .035);
}

.table-wrap,
.form-card {
  border: 1px solid #e0e9e3;
  border-radius: 20px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 12px 36px rgba(21, 60, 50, .055);
}

.table-wrap {
  scrollbar-color: #b6cec2 transparent;
}

table {
  min-width: 680px;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 15px 18px;
  border-bottom: 1px solid #edf1ee;
  line-height: 1.55;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #5c726a;
  background: #f2f7f4;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .045em;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.form-card {
  max-width: 820px;
  padding: clamp(22px, 4vw, 38px);
  overflow: visible;
}

.form-card label {
  color: #405d54;
  font-weight: 600;
  margin: 18px 0 8px;
}

.form-card input,
.form-card select,
.form-card textarea {
  min-height: 48px;
  border-color: #dce7e1;
  background: #fcfdfc;
}

.form-card textarea {
  min-height: 112px;
}

.teacher-activities-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.teacher-activities-section {
  width: 100%;
  max-width: none;
}

.teacher-activities-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}

.teacher-activities-table th:nth-child(1) { width: 10%; }
.teacher-activities-table th:nth-child(2) { width: 8%; }
.teacher-activities-table th:nth-child(3) { width: 12%; }
.teacher-activities-table th:nth-child(4) { width: 9%; }
.teacher-activities-table th:nth-child(5) { width: 15%; }
.teacher-activities-table th:nth-child(6) { width: 12%; }
.teacher-activities-table th:nth-child(7) { width: 10%; }
.teacher-activities-table th:nth-child(8) { width: 10%; }
.teacher-activities-table th:nth-child(9) { width: 14%; }

.teacher-activities-table th,
.teacher-activities-table td {
  padding: 7px 6px;
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.teacher-activities-table .btn {
  min-height: 32px;
  margin: 2px;
  padding: 5px 7px;
  font-size: 10px;
  white-space: normal;
}

.teacher-activity-edit-form {
  width: 100%;
  min-width: 0;
  max-width: none;
  margin-inline: 0;
}

.teacher-activity-edit-form fieldset {
  min-width: 0;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.activity-new-files {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.activity-new-files:empty { display: none; }

.activity-new-file,
.activity-file-remove {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}

.activity-new-file > span,
.activity-file-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.activity-new-file .btn,
.activity-file-remove-label { flex: 0 0 auto; }

.teacher-activity-edit-form .activity-file-remove {
  justify-content: flex-start;
  cursor: pointer;
}

.teacher-activity-edit-form .activity-file-remove input[type="checkbox"] {
  flex: 0 0 18px;
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--danger);
}

.activity-file-remove.marked-for-removal {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, white);
}

.activity-file-remove-label {
  margin-inline-start: auto;
  color: var(--danger);
  font-size: 12px;
}

.teacher-activity-edit-form textarea {
  width: 100%;
  min-height: 140px;
}

.form-card .btn-row {
  margin-top: 24px;
}

.btn {
  min-height: 44px;
  border-radius: 13px;
  box-shadow: 0 5px 12px rgba(8, 127, 114, .14);
}

.btn.gold {
  color: #23332e;
  box-shadow: 0 5px 14px rgba(194, 128, 27, .2);
}

.btn.ghost {
  border-color: #b8d5ca;
}

.subject-entry {
  align-items: stretch;
}

.teacher-assignment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 12px 0 18px;
  padding: 16px;
  border: 1px solid #dce9e1;
  border-radius: 16px;
  background: #f7faf8;
}

.teacher-assignment-grid label {
  display: grid;
  gap: 7px;
  margin: 0;
  color: #42615a;
  font-size: 13px;
  font-weight: 650;
}

.teacher-assignment-grid select:disabled {
  cursor: not-allowed;
  opacity: .62;
}

.subject-chip {
  padding: 8px 12px;
  border: 1px solid #cce6db;
  background: #eaf5ef;
  color: #176c5f;
  font-weight: 600;
}

.subject-remove {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(8, 127, 114, .1);
}

.credential-card {
  max-width: 720px;
  border-top: 4px solid var(--success);
}

.credential-card dl {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px 18px;
  margin: 22px 0;
  padding: 18px;
  border-radius: 16px;
  background: #f1f7f3;
}

.credential-card dt {
  color: var(--muted);
  font-weight: 600;
}

.credential-card dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: ui-monospace, Consolas, monospace;
  font-weight: 700;
}

.result-import {
  max-width: none;
  margin-bottom: 20px;
}

.result-import .btn-row {
  align-items: center;
}

.result-import input[type="file"] {
  min-width: 220px;
  flex: 1;
}

.result-entry-panel {
  max-width: none;
  margin-bottom: 20px;
  border: 1px solid #dfeae3;
  background: linear-gradient(145deg, #fff, #f7fbf8);
}

.result-entry-panel h2 { margin-top: 0; }
.result-entry-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px 14px;
  align-items: end;
}
.result-entry-filters label { display: grid; gap: 6px; margin: 8px 0; }
.result-entry-filters label[hidden] { display: none !important; }
.result-entry-panel form > .btn { margin-top: 14px; }
.result-add-subject { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; max-width: 760px; margin: 6px 0 8px; }
.result-add-subject label { flex: 1 1 260px; display: grid; gap: 6px; margin: 8px 0; }
.result-add-subject .error { flex-basis: 100%; margin: 0; }
.result-class-subject-list { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
.result-subject-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 7px 5px 12px; border: 1px solid #d7e7df; border-radius: 999px; background: #eef6f1; color: #25483b; }
.result-subject-chip button { display: inline-grid; place-items: center; width: 25px; height: 25px; border: 0; border-radius: 50%; background: #fff; color: #a83228; font-size: 18px; cursor: pointer; }
.result-subject-chip button:disabled { opacity: .5; cursor: wait; }
.results-entry-table-wrap { width: 100%; overflow-x: auto; margin-top: 16px; border: 1px solid #e2ebe5; border-radius: 14px; }
.results-entry-table { width: 100%; border-collapse: collapse; }
.results-entry-table th, .results-entry-table td { padding: 10px 12px; text-align: start; border-bottom: 1px solid #edf1ee; }
.results-entry-table td input { width: 100px; min-height: 42px; padding: 8px 10px; }
.result-entry-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 14px; }
.result-entry-actions .error { flex-basis: 100%; margin: 0; }
#result-entry-notice:empty { display: none; }

@media (max-width: 820px) {
  .result-entry-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .result-entry-filters { grid-template-columns: 1fr; }
  .results-entry-table th, .results-entry-table td { padding: 8px; }
}

.result-table strong {
  color: var(--primary-dark);
}

.result-mark {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
  white-space: nowrap;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
  gap: 16px;
}

.result-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid #dfeae3;
  border-radius: 20px;
  background: linear-gradient(150deg, #fff, #f8fbf9);
  box-shadow: 0 10px 30px rgba(21, 60, 50, .05);
}

.result-card-heading,
.result-student {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.result-card-heading {
  padding-bottom: 14px;
  border-bottom: 1px solid #e7efea;
}

.result-card-heading h2 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 20px;
}

.result-card-heading > span {
  color: var(--muted);
  font-size: 13px;
}

.result-student {
  justify-content: flex-start;
  margin-bottom: 14px;
  color: var(--ink);
}

.result-student code {
  color: var(--muted);
  font-size: 12px;
}

.result-marks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.result-marks > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid #e8efeb;
  border-radius: 13px;
  background: #fff;
  font-size: 13px;
}

.result-marks > div > span {
  color: var(--muted);
}

.result-marks b {
  color: var(--ink);
}

.result-marks .result-total {
  border-color: #c8e5d7;
  background: #eaf6ef;
}

.result-marks .result-total b {
  color: #12684e;
  font-size: 17px;
}

.report-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.report-card-header .result-card-heading {
  border: 0;
  padding: 0;
}

.report-table-wrap { overflow-x: auto; }
.report-table { width: 100%; border-collapse: collapse; min-width: 660px; }
.report-table th, .report-table td { padding: 13px 12px; border-bottom: 1px solid #e7efea; text-align: start; }
.report-table thead th { color: var(--muted); background: #f4f8f6; font-size: 12px; white-space: nowrap; }
.report-table tbody th { color: var(--ink); font-weight: 650; }
.report-table td { color: var(--ink); }
.report-table td b { font-weight: 650; }
.report-table td .result-mark:only-child { color: var(--muted); font-size: 13px; }
.report-table .report-total { background: #f3faf6; }
.report-card-footer { margin-top: 16px; color: var(--muted); font-size: 12px; }
.result-card-formal {
  position: relative;
  isolation: isolate;
  grid-column: 1 / -1;
  width: 100%;
  max-width: 820px;
  margin-inline: auto;
  overflow: hidden;
  padding: 22px;
  border: 4px double #172d52;
  border-radius: 4px;
  color: #172d52;
  background: #fffefa;
  box-shadow: 0 12px 30px rgba(23, 45, 82, .1);
  font-family: Georgia, "Noto Sans Arabic", serif;
}
.result-card-tools { display: grid; gap: 10px; margin: 18px 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.result-card-filter-controls,
.result-card-bulk-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; }
.result-card-filter-controls > label:not(.result-select-filtered) { min-width: 180px; }
.result-card-select-row { display: flex; justify-content: flex-end; margin: -8px 0 8px; }
.result-card-select-row label,
.result-select-filtered { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.result-card-select-row input,
.result-select-filtered input { width: 17px; height: 17px; margin: 0; accent-color: var(--teal); }
.result-card-bulk-actions { align-items: center; }
.result-card-bulk-actions > span { margin-inline-end: auto; color: var(--muted); font-size: 13px; }
.result-card-action-message { margin: 0; }
.result-card-watermark {
  position: absolute;
  z-index: -1;
  width: min(72%, 760px);
  height: auto;
  left: 50%;
  top: 53%;
  transform: translate(-50%, -50%);
  opacity: .07;
  pointer-events: none;
}
.result-institute-header,
.result-card-title,
.result-student-details,
.result-formal-table-wrap,
.result-card-issue,
.result-card-formal > .print-report,
.result-card-formal > .download-result-card-pdf { position: relative; z-index: 1; }
.result-institute-header {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 8px 10px 22px;
  border-bottom: 4px double #172d52;
  text-align: center;
}
.result-institute-header > img { width: clamp(72px, 9vw, 118px); height: auto; object-fit: contain; }
.result-institute-title { display: grid; gap: 8px; }
.result-institute-title strong { color: #172d52; font-family: "Noto Sans Arabic", Tahoma, sans-serif; font-size: 20px; }
.result-institute-title b { font-size: 18px; letter-spacing: .1em; }
.result-institute-title span { color: #a9822e; font-size: 9px; letter-spacing: .16em; }
.result-card-title { padding: 10px 0 6px; text-align: center; }
.result-card-title h2 { margin: 0; color: #172d52; font-size: 27px; letter-spacing: .2em; }
.result-card-title strong { display: block; margin-top: 2px; color: #ad8730; font-family: "Noto Sans Arabic", Tahoma, sans-serif; font-size: 17px; }
.result-student-details { display: grid; grid-template-columns: 1.5fr 1fr 1.2fr 1fr; gap: 10px 16px; margin: 8px 0 14px; }
.result-detail { min-width: 0; padding-bottom: 7px; border-bottom: 2px solid #172d52; }
.result-detail-name { grid-column: span 2; }
.result-detail > span { display: flex; justify-content: space-between; gap: 8px; color: #536c89; font-size: 8px; letter-spacing: .12em; }
.result-detail > span small { color: #536c89; font-family: "Noto Sans Arabic", Tahoma, sans-serif; font-size: 10px; letter-spacing: 0; }
.result-detail > strong { display: block; margin-top: 4px; color: #172d52; font-size: 13px; overflow-wrap: anywhere; }
.result-formal-table-wrap { width: 100%; overflow: visible; }
.result-formal-table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; }
.result-formal-table th,
.result-formal-table td { padding: 6px 5px; border: 1px solid #c8d0dc; text-align: center; font-size: 10px; overflow-wrap: anywhere; }
.result-formal-table thead th { color: #fff; background: #172d52; font-size: 9px; letter-spacing: .06em; }
.result-formal-table thead th small { display: block; margin-top: 3px; color: #eac76c; font-family: "Noto Sans Arabic", Tahoma, sans-serif; font-size: 8px; letter-spacing: 0; }
.result-formal-table .result-row-number { width: 5%; color: #536c89; }
.result-formal-table .result-subject-column { width: 32%; text-align: start; }
.result-formal-table tbody th[scope="row"] { color: #172d52; text-align: start; }
.result-formal-table tbody tr:nth-child(even) { background: rgba(235, 240, 243, .75); }
.result-formal-table .report-total { color: #a3302e; background: rgba(249, 242, 231, .9); font-weight: 700; }
.result-formal-table .result-summary-row { color: #172d52; background: #f2ecdd; font-weight: 700; }
.result-formal-table .result-summary-row th { text-align: end; }
.result-formal-table .result-percentage-row { color: #172d52; background: #eee6d3; }
.result-card-issue { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 10px; border-top: 1px solid #c8d0dc; color: #536c89; font-size: 9px; letter-spacing: .08em; }
.result-card-formal > .print-report,
.result-card-formal > .download-result-card-pdf { display: block; margin: 18px auto 0; }
html[data-theme="dark"] .result-card-formal {
  color: #172d52;
  background: #fffefa;
  border-color: #172d52;
}
html[data-theme="dark"] .result-card-formal .result-formal-table th,
html[data-theme="dark"] .result-card-formal .result-formal-table td {
  color: #172d52;
  border-color: #c8d0dc;
}
html[data-theme="dark"] .result-card-formal .result-formal-table thead th {
  color: #fff;
  background: #172d52;
}
html[data-theme="dark"] .result-card-formal .result-formal-table thead th small { color: #eac76c; }
html[data-theme="dark"] .result-card-formal .result-formal-table .result-row-number { color: #536c89; }
html[data-theme="dark"] .result-card-formal .result-formal-table tbody th[scope="row"] { color: #172d52; }
html[data-theme="dark"] .result-card-formal .result-formal-table tbody th,
html[data-theme="dark"] .result-card-formal .result-formal-table tbody td { background: transparent; }
html[data-theme="dark"] .result-card-formal .result-formal-table tbody tr:nth-child(even) { background: rgba(235, 240, 243, .75); }
html[data-theme="dark"] .result-card-formal .result-formal-table .report-total {
  color: #a3302e;
  background: rgba(249, 242, 231, .9);
}
html[data-theme="dark"] .result-card-formal .result-formal-table .result-summary-row {
  color: #172d52;
  background: #f2ecdd;
}
html[data-theme="dark"] .result-card-formal .result-formal-table .result-percentage-row { background: #eee6d3; }
html[data-theme="dark"] .result-card-formal .result-formal-table tbody tr:hover td { background: transparent; }
@media (max-width: 700px) {
  .result-card-formal { padding: 16px 12px; }
  .result-student-details { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .result-detail-name { grid-column: 1 / -1; }
  .result-formal-table th,
  .result-formal-table td { padding: 6px 3px; font-size: 9px; }
  .result-formal-table thead th { font-size: 8px; letter-spacing: 0; }
  .result-formal-table thead th small { font-size: 8px; }
  .result-card-issue { flex-wrap: wrap; font-size: 8px; }
}
.student-classification { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; margin: 10px 0 16px; }
.student-classification-summary { margin: -8px 0 14px; color: var(--muted); font-size: 13px; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 230px; }
.account-bulk-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.account-bulk-actions label { display: flex; align-items: center; gap: 8px; margin: 0; }
.account-bulk-actions input[type="checkbox"], .account-student-select { width: 17px; height: 17px; accent-color: var(--primary); }
.account-password-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; }
.account-password-form input { flex: 1 1 190px; min-width: 170px; }
.account-password-form[hidden], .account-email-form[hidden], .account-roles-form[hidden] { display: none !important; }
.account-email-form, .account-roles-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #f8fbf9; }
.account-email-form label, .account-roles-form label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.account-roles-form .extra-role-picker { grid-column: 1 / -1; margin: 0; }
.account-roles-form .extra-role-picker > div { grid-column: 1 / -1; }
.account-filters { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(0, 2fr); gap: 12px; align-items: end; margin-bottom: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, .72); }
.account-filters label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.student-account-filters { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 10px; }
.student-account-filters[hidden] { display: none !important; }
.student-shift-filter { display: flex; align-items: center; gap: 10px; width: fit-content; margin: 0 0 14px; color: var(--muted); }
.student-shift-filter select { min-width: 180px; }
.btn.danger { background: #fff0ee; color: #a83228; border: 1px solid #f1c5c0; }
.btn.danger:hover { background: #ffe2de; }

@media (max-width: 820px) {
  .account-filters { grid-template-columns: 1fr; }
  .student-account-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .student-account-filters { grid-template-columns: 1fr; }
}
.student-edit-row > td { padding: 18px; background: #f7faf8; }
.student-edit-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; align-items: center; }
.student-edit-form .btn { justify-self: start; }
.student-edit-form .error { grid-column: 1 / -1; margin: 0; }

@media (max-width: 640px) {
  .student-classification, .student-edit-form { grid-template-columns: 1fr; }
}

@media print {
  body.printing-report * { visibility: hidden !important; }
  body.printing-report .result-card.print-target,
  body.printing-report .result-card.print-target * { visibility: visible !important; }
  body.printing-report .result-card.print-target {
    position: absolute;
    inset: 0;
    width: 100%;
    padding: 24px;
    border: 1px solid #9aa8a0;
    border-radius: 0;
    box-shadow: none;
    background: white;
  }
  body.printing-report .result-card-formal.print-target {
    box-sizing: border-box;
    width: 210mm;
    height: 297mm;
    min-height: 297mm;
    padding: 8mm;
    border: 4px double #172d52;
    background: #fffefa;
    color: #172d52;
    overflow: hidden;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  body.printing-report .result-card-formal .result-institute-header { gap: 6px; padding: 2px 6px 7px; }
  body.printing-report .result-card-formal .result-institute-header > img { width: 64px; }
  body.printing-report .result-card-formal .result-institute-title { gap: 3px; }
  body.printing-report .result-card-formal .result-institute-title strong { font-size: 17px; }
  body.printing-report .result-card-formal .result-institute-title b { font-size: 15px; }
  body.printing-report .result-card-formal .result-institute-title span { font-size: 8px; }
  body.printing-report .result-card-formal .result-card-title { padding: 5px 0 4px; }
  body.printing-report .result-card-formal .result-card-title h2 { font-size: 22px; }
  body.printing-report .result-card-formal .result-card-title strong { margin-top: 1px; font-size: 16px; }
  body.printing-report .result-card-formal .result-student-details { gap: 5px 12px; margin: 6px 0 8px; }
  body.printing-report .result-card-formal .result-detail { padding-bottom: 3px; }
  body.printing-report .result-card-formal .result-detail > span { font-size: 8px; }
  body.printing-report .result-card-formal .result-detail > span small { font-size: 9px; }
  body.printing-report .result-card-formal .result-detail > strong { margin-top: 3px; font-size: 11px; }
  body.printing-report .result-card-formal .result-formal-table th,
  body.printing-report .result-card-formal .result-formal-table td { padding: 3px 3px; font-size: 8px; }
  body.printing-report .result-card-formal .result-formal-table thead th { padding: 4px 3px; font-size: 8px; }
  body.printing-report .result-card-formal .result-formal-table thead th small { margin-top: 2px; font-size: 7px; }
  body.printing-report .result-card-formal .result-card-issue { gap: 6px; margin-top: 8px; padding-top: 5px; font-size: 7px; }
  body.printing-report .result-card.print-target .print-report,
  body.printing-report .result-card.print-target .download-result-card-pdf { display: none !important; }
  body.printing-report .result-card.print-target .result-card-select-row { display: none !important; }
  body.printing-report-multiple .results-grid { display: block !important; }
  body.printing-report-multiple .results-grid .result-card { display: none !important; }
  body.printing-report-multiple .result-card.print-target.multiple-print-target {
    position: relative !important;
    inset: auto !important;
    display: block !important;
    width: 210mm !important;
    max-width: none !important;
    height: 297mm !important;
    margin: 0 !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  body.printing-report-multiple .result-card.print-target.multiple-print-target:not(.final-print-target) {
    break-after: page;
    page-break-after: always;
  }
  body.printing-report .report-table { min-width: 0; }
  body.printing-report .report-table th,
  body.printing-report .report-table td { padding: 8px; }
  @page { size: A4 portrait; margin: 0; }
}

.success-message {
  margin-top: 10px;
  color: #147552;
  font-weight: 700;
}

.modal {
  border-radius: 22px;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 228px minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 14px;
  }

  .main {
    padding-inline: 24px;
  }

  .search-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .sidebar {
    position: relative;
    top: auto;
    height: auto;
    min-height: 0;
    padding: 12px 14px;
    gap: 4px;
    align-items: center;
  }

  .sidebar > .mark {
    width: 100%;
    min-height: 48px;
    padding: 0 2px 8px;
    margin-bottom: 4px !important;
  }

  .sidebar > .mark .logo-sm {
    width: 40px;
    height: 40px;
  }

  .lang-switch.sidebar {
    width: 100%;
    padding: 4px 0 8px;
  }

  #nav {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    flex: 0 0 auto;
    padding: 2px 0 8px;
    scrollbar-width: thin;
  }

  #nav .nav-btn {
    flex: 0 0 auto;
    width: auto;
    min-height: 40px;
    margin: 0 0 0 6px;
    white-space: nowrap;
    text-align: center;
  }

  .nav-btn.active {
    box-shadow: inset 0 -3px 0 var(--accent-light);
  }

  .sidebar .grow {
    display: none;
  }

  .sidebar .user-box {
    width: 100%;
    margin-top: 2px;
    padding: 8px 10px;
  }

  .sidebar #logout {
    width: 100%;
    margin: 0;
    text-align: center;
  }

  .main {
    padding: 22px 16px 40px;
  }

  .topbar {
    margin-bottom: 20px;
  }

  .stats {
    gap: 10px;
  }

  .stat {
    min-height: 90px;
    padding: 15px 16px;
  }

  .search-bar {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .subject-entry {
    flex-wrap: wrap;
  }

  .subject-entry .btn {
    flex: 0 0 auto;
  }

  .credential-card dl {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .credential-card dd {
    margin-bottom: 10px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .stat,
  .table-wrap,
  .form-card,
  .card {
    animation: surface-in .38s ease both;
  }

  @keyframes surface-in {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
/* Shift-scoped teacher topics and work uploads */
.topic-create { margin-bottom: 22px; }
.topic-create h2 { margin-top: 0; }
.topic-card { margin: 0 0 16px; padding: clamp(18px, 3vw, 26px); border: 1px solid var(--line, #dbe5e2); border-radius: 20px; background: var(--surface, #fff); box-shadow: 0 12px 32px rgba(25, 54, 50, .06); }
.topic-card.topic-unread { border-color: var(--accent, #0a887e); box-shadow: 0 0 0 3px rgba(10, 136, 126, .1); }
.topic-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.topic-card-head h2 { margin: 0 0 6px; }
.topic-description { line-height: 1.7; white-space: normal; overflow-wrap: anywhere; }
.topic-new-badge, .topic-nav-badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: #f1a32b; color: #1d302d; font-size: .78rem; font-weight: 700; padding: 5px 10px; }
.topic-nav-badge { min-width: 20px; padding: 2px 6px; margin-inline-start: 8px; }
.topic-files { border-top: 1px solid var(--line, #dbe5e2); margin-top: 18px; padding-top: 10px; }
.topic-files h3 { margin: 8px 0; }
.topic-file { display: inline-flex; margin: 4px 7px 4px 0; padding: 8px 12px; border: 1px solid var(--line, #dbe5e2); border-radius: 10px; background: #f3f8f6; color: var(--ink, #183a36); cursor: pointer; overflow-wrap: anywhere; }
.topic-upload { display: grid; gap: 10px; margin-top: 18px; padding: 16px; border-radius: 14px; background: #f3f8f6; }
.topic-upload small { color: var(--muted, #647c77); }
@media (max-width: 620px) { .topic-card-head { flex-direction: column; } .topic-new-badge { align-self: flex-start; } }

/* Comfortable tap targets for row actions on phones. */
@media (max-width: 720px) {
  .btn-sm { min-height: 40px; padding: 8px 12px; }
}

/* Kurdish (Sorani) script needs a little more size than Latin to stay readable,
   especially on phones. Only texts set below 13px are enlarged, by 2px. */
html[lang="ckb"] body { line-height: 1.65; }
html[lang="ckb"] .developer-credit { font-size: 13px; }
html[lang="ckb"] .developer-credit strong { font-size: 14px; }
html[lang="ckb"] .lang-btn { font-size: 14px; }
html[lang="ckb"] .btn-sm { font-size: 14px; }
html[lang="ckb"] .chip { font-size: 14px; }
html[lang="ckb"] .theme-toggle { font-size: 14px; }
html[lang="ckb"] .result-access-table th, html[lang="ckb"] .result-access-table td { font-size: 14px; }
html[lang="ckb"] .student-billing-table th, html[lang="ckb"] .student-billing-table td { font-size: 14px; }
html[lang="ckb"] .student-billing-table th { font-size: 14px; }
html[lang="ckb"] .student-bill-audit { font-size: 12px; }
@media (max-width: 720px) { html[lang="ckb"] .student-billing-table tbody td:nth-child(n+3)::before { font-size: 13px; } }
html[lang="ckb"] .brand-copy small { font-size: 13px; }
html[lang="ckb"] .staff-strip li { font-size: 14px; }
html[lang="ckb"] th { font-size: 14px; }
html[lang="ckb"] .result-student code { font-size: 14px; }
html[lang="ckb"] .report-table thead th { font-size: 14px; }
html[lang="ckb"] .report-card-footer { font-size: 14px; }

/* Three buttons do not fit one row of the narrow sidebar (the Kurdish label
   "دۆخی تاریک" was cut off): the theme toggle gets its own full-width row. */
.lang-switch.sidebar { flex-wrap: wrap; }
.lang-switch.sidebar [data-theme-toggle] { flex: 1 0 100%; }

/* Teacher topic submission browser */
.topic-teacher-search { display: grid; gap: 7px; max-width: 520px; margin: 0 0 18px; }
.topic-submissions { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.topic-submissions h3 { margin: 4px 0 10px; }
.topic-submission-row { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 8px 0; background: var(--surface, var(--card)); }
.topic-submission-row[hidden], .topic-card[hidden] { display: none !important; }

/* Exam clearance card dashboard */
body.exam-clearance-active .sidebar { background: linear-gradient(180deg, #0b2d52 0%, #071d37 100%); box-shadow: 8px 0 30px rgba(7, 29, 55, .2); }
body.exam-clearance-active .sidebar .nav-btn.active { background: linear-gradient(90deg, #079a91, #087e8b); box-shadow: none; }
body.exam-clearance-active .main { background: linear-gradient(180deg, #f8fafc 0%, #f0f4f8 100%); }
.exam-dashboard { display: grid; gap: 18px; }
.exam-dashboard-tabs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.exam-dashboard-tabs .nav-btn { width: auto; }
/* These tabs sit on the light page, not the dark sidebar, so they need dark text. */
.exam-dashboard-tabs .nav-btn { color: var(--ink); background: var(--card); border: 1px solid var(--line); }
.exam-dashboard-tabs .nav-btn.active, .exam-dashboard-tabs .nav-btn:hover { color: #fff; background: linear-gradient(90deg, #079a91, #087e8b); border-color: transparent; box-shadow: none; }
.exam-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.exam-stat { min-width: 0; display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.exam-stat > span { flex: 0 0 48px; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; color: white; font-size: 24px; font-weight: 800; background: #1785c2; }
.exam-stat.green > span { background: #099a76; }
.exam-stat.orange > span { background: #f28a23; }
.exam-stat.red > span { background: #e34843; }
.exam-stat > div { min-width: 0; display: grid; gap: 4px; }
.exam-stat small { color: var(--muted); font-weight: 600; }
.exam-stat strong { color: var(--primary-dark); font-size: 1.45rem; }
.exam-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; gap: 10px 14px; }
.exam-filters label, .exam-report-filters label { display: grid; gap: 5px; min-width: 0; }
.exam-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .9fr); align-items: start; gap: 16px; }
.exam-table-panel, .exam-control-panel { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.exam-panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.exam-panel-heading h2 { margin: 0; }
.exam-panel-heading > span { color: var(--muted); font-size: .85rem; }
.exam-select-page { display: flex !important; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--muted); }
.exam-select-page input, .exam-table input[type="checkbox"] { width: 17px; min-height: 17px; accent-color: var(--primary); }
.exam-table-scroll, .exam-report-table-wrap { width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.exam-table { width: 100%; min-width: 780px; border-collapse: collapse; text-align: start; }
.exam-table th, .exam-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 12px; }
.exam-table th { color: var(--primary-dark); background: color-mix(in srgb, var(--bg-2) 56%, white); font-weight: 700; white-space: nowrap; }
.exam-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--bg) 75%, white); }
.exam-table tbody tr:last-child td { border-bottom: 0; }
.exam-table td strong, .exam-table td small { display: block; }
.exam-table td small { margin-top: 4px; color: var(--muted); }
.exam-table td .btn { margin: 2px; padding: 6px 9px; font-size: 11px; }
.exam-status-pill { display: inline-flex; max-width: 160px; padding: 4px 8px; border-radius: 999px; font-size: 11px; line-height: 1.35; font-weight: 700; background: #edf0f4; color: #5c6a7a; }
.exam-status-pill.cleared, .exam-status-pill.generated { background: #daf6e9; color: #08744e; }
.exam-status-pill.awaiting { background: #d8f4f2; color: #087c77; }
.exam-status-pill.pending, .exam-status-pill.revoked { background: #fff0df; color: #a55c0b; }
.exam-pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.exam-pagination > div { display: flex; gap: 6px; }
.exam-pagination .btn { padding: 7px 10px; }
.exam-card-preview { --exam-primary: #0b3155; --exam-accent: #079a91; position: relative; min-height: 190px; overflow: hidden; display: grid; grid-template-rows: 70px 1fr; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(150deg, #fff 45%, #eef7f6); box-shadow: 0 7px 18px rgba(20, 50, 76, .13); }
.exam-card-preview::after { content: ''; position: absolute; z-index: 0; right: -30px; bottom: 18px; width: 55%; height: 52px; background: var(--exam-accent); transform: skewY(-10deg); opacity: .2; }
.exam-card-preview::before { content: ''; position: absolute; z-index: 2; inset: 6px; border: 1px solid transparent; pointer-events: none; }
.exam-card-preview-head, .exam-card-preview-body { position: relative; z-index: 1; }
.exam-card-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; color: #fff; background: var(--exam-primary); direction: rtl; }
.exam-card-preview-head img { width: 54px; height: 54px; object-fit: contain; padding: 3px; border: 2px solid var(--exam-accent); border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.exam-card-preview-head strong { flex: 1; font-size: 14px; font-weight: 400; line-height: 1.5; text-align: center; }
.exam-card-preview-body { display: grid; grid-template-columns: 72px minmax(0,1fr); align-items: center; gap: 12px; padding: 12px 16px; direction: ltr; }
.exam-card-preview-info { min-width: 0; display: grid; justify-items: end; gap: 7px; color: var(--exam-primary); text-align: right; direction: rtl; }
.exam-card-preview-info span { color: color-mix(in srgb, var(--exam-primary) 82%, #64748b); font-size: 13px; }
.exam-card-preview-info .exam-card-preview-shift { color: var(--exam-accent); font-size: 12px; font-weight: 600; }
.exam-card-preview-info .exam-card-student-name { max-width: 100%; overflow-wrap: anywhere; color: var(--exam-primary); font-size: 19px; font-weight: 400; line-height: 1.45; text-align: start; unicode-bidi: plaintext; }
.exam-department-art { width: 72px; height: 72px; display: grid; place-items: center; padding: 7px; border: 1px solid color-mix(in srgb,var(--exam-accent) 45%,white); border-radius: 16px; color: var(--exam-accent); background: color-mix(in srgb,var(--exam-accent) 11%,white); }
.exam-department-art svg { display: block; width: 100%; height: 100%; overflow: visible; }
.department-computer .exam-department-art { border-radius: 16px; color: var(--exam-primary); background: linear-gradient(145deg,color-mix(in srgb,var(--exam-accent) 16%,white),white); box-shadow: inset 0 0 0 3px color-mix(in srgb,var(--exam-accent) 14%,white); }
.department-computer .exam-department-art svg { color: var(--exam-primary); }
.department-accounting .exam-department-art { border-radius: 7px; color: var(--exam-accent); background: repeating-linear-gradient(to bottom,color-mix(in srgb,var(--exam-accent) 7%,white) 0 13px,white 14px 18px); box-shadow: 4px 4px 0 color-mix(in srgb,var(--exam-accent) 18%,white); }
.department-management .exam-department-art { border-radius: 18px 18px 6px 6px; color: var(--exam-primary); background: linear-gradient(145deg,color-mix(in srgb,var(--exam-primary) 12%,white),color-mix(in srgb,var(--exam-accent) 18%,white)); }
.department-ai .exam-department-art { border-radius: 50%; color: var(--exam-accent); background: radial-gradient(circle,color-mix(in srgb,var(--exam-accent) 18%,white),color-mix(in srgb,var(--exam-primary) 8%,white)); box-shadow: 0 0 0 4px color-mix(in srgb,var(--exam-accent) 12%,white), inset 0 0 0 1px color-mix(in srgb,var(--exam-primary) 25%,white); }
.department-general .exam-department-art { display: none; }
.exam-card-preview.vertical { width: min(100%, 250px); min-height: 350px; margin: 0 auto; grid-template-rows: 88px 1fr; }
.exam-card-preview.vertical .exam-card-preview-head { flex-wrap: wrap; }
.exam-card-preview.vertical .exam-card-preview-head strong { font-size: 12px; }
.exam-card-preview.vertical .exam-card-preview-head img { width: 58px; height: 58px; }
.exam-card-preview.vertical .exam-card-preview-body { grid-template-columns: 84px minmax(0,1fr); gap: 14px; padding: 20px 14px; }
.exam-card-preview.vertical .exam-department-art { width: 84px; height: 84px; }
.exam-card-preview.vertical .exam-card-preview-info .exam-card-student-name { font-size: 17px; }
.exam-card-preview.theme-orange_blue { background: linear-gradient(150deg,#fff 48%,#fff6ed 49%); }
.exam-card-preview.theme-orange_blue::after { right: -8%; bottom: auto; top: 39px; width: 116%; height: 11px; opacity: 1; transform: rotate(-5deg); }
.exam-card-preview.theme-emerald { border: 2px solid var(--exam-accent); background: linear-gradient(145deg,#fff 42%,#e6f5ec); }
.exam-card-preview.theme-emerald::before { inset: 5px; border-color: rgba(7,91,70,.28); border-radius: 9px; }
.exam-card-preview.theme-purple { background: linear-gradient(145deg,#fff 45%,#f4effa); }
.exam-card-preview.theme-purple::after { right: auto; left: -40px; bottom: -4px; width: 42%; height: 120%; transform: rotate(18deg); opacity: .13; }
.exam-card-preview.theme-monochrome { border-radius: 4px; box-shadow: none; background: linear-gradient(135deg,#fff 45%,#eceef0); }
.exam-card-preview.theme-monochrome::after { right: 0; bottom: 33px; width: 100%; height: 2px; transform: none; opacity: .7; }
.exam-card-preview.theme-classic_gold { border: 3px double var(--exam-accent); border-radius: 5px; background: linear-gradient(145deg,#fffdf7 45%,#f5efdf); }
.exam-card-preview.theme-classic_gold::before { inset: 5px; border: 1px solid rgba(200,162,74,.48); border-radius: 2px; }
.exam-card-preview.theme-classic_gold::after { right: 0; bottom: 0; width: 100%; height: 7px; transform: none; opacity: .9; }
.exam-card-preview.theme-classic_gold .exam-card-preview-head { background: linear-gradient(100deg,#19395b,#305579); }
.exam-card-preview.theme-academic_crest { border-radius: 7px 20px 7px 20px; background: linear-gradient(145deg,#fff 42%,#f8edf0); }
.exam-card-preview.theme-academic_crest::before { inset: 0 auto 0 0; width: 13px; border: 0; background: linear-gradient(90deg,var(--exam-primary) 0 70%,var(--exam-accent) 70%); }
.exam-card-preview.theme-academic_crest::after { right: -18px; top: 32px; bottom: auto; width: 42%; height: 13px; transform: rotate(38deg); opacity: .9; }
.exam-card-preview.theme-sky_modern { border: 0; border-radius: 22px; background: linear-gradient(135deg,#fff 35%,#e7f7fb 100%); }
.exam-card-preview.theme-sky_modern::before { inset: 7px; border: 1px solid rgba(18,97,138,.2); border-radius: 16px; }
.exam-card-preview.theme-sky_modern::after { right: 8%; bottom: 31px; width: 45%; height: 45%; border-radius: 50% 0 50% 0; transform: rotate(-18deg); opacity: .13; }
.exam-card-preview.theme-geometric { border-radius: 3px 18px 3px 18px; background: linear-gradient(135deg,#fff 48%,#f6eee9); }
.exam-card-preview.theme-geometric::after { right: 0; bottom: 0; width: 31%; height: 100%; clip-path: polygon(100% 0,100% 100%,0 100%); transform: none; opacity: .32; }
.exam-card-preview.theme-geometric::before { inset: auto auto 0 0; width: 16%; height: 34%; border: 0; background: var(--exam-primary); clip-path: polygon(0 0,100% 100%,0 100%); opacity: .16; }
.exam-card-preview-empty { display: grid; min-height: 210px; place-items: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; }
.exam-theme-picker { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.exam-theme-picker h3 { margin: 0 0 9px; font-size: 14px; }
.exam-theme-picker > div { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.exam-theme-option { min-width: 0; padding: 4px; border: 2px solid transparent; border-radius: 9px; color: var(--ink); background: transparent; cursor: pointer; }
.exam-theme-option.selected { border-color: var(--theme-accent, #079a91); }
.exam-theme-card { position: relative; isolation: isolate; display: flex; align-items: center; gap: 4px; height: 54px; overflow: hidden; padding: 6px; border: 1px solid color-mix(in srgb, var(--theme-primary) 35%, white); border-radius: 8px; background: linear-gradient(145deg,#fff 48%,color-mix(in srgb, var(--theme-accent) 18%,white)); }
.exam-theme-card::before { content: ''; position: absolute; z-index: -1; inset: 0 0 auto; height: 17px; background: var(--theme-primary); }
.exam-theme-card::after { content: ''; position: absolute; z-index: -1; right: -10%; bottom: 2px; width: 58%; height: 15px; background: var(--theme-accent); transform: skewY(-10deg); opacity: .75; }
.exam-theme-card i { width: 14px; height: 14px; border: 2px solid white; border-radius: 50%; background: var(--theme-accent); box-shadow: 0 0 0 1px var(--theme-primary); }
.exam-theme-card b { width: 40%; height: 4px; margin-top: -25px; border-radius: 4px; background: rgba(255,255,255,.9); }
.exam-theme-card em { position: absolute; bottom: 9px; left: 25px; width: 42%; height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--theme-primary) 25%, white); }
.exam-theme-card.theme-monochrome { border-radius: 2px; box-shadow: none; }
.exam-theme-card.theme-monochrome::after { right: 0; bottom: 5px; width: 100%; height: 2px; transform: none; opacity: .9; }
.exam-theme-card.theme-classic_gold { border: 3px double var(--theme-accent); border-radius: 3px; background: #fffdf7; }
.exam-theme-card.theme-classic_gold::before { height: 14px; background: linear-gradient(90deg,var(--theme-primary) 0 75%,var(--theme-accent) 75%); }
.exam-theme-card.theme-academic_crest { border-radius: 3px 12px 3px 12px; }
.exam-theme-card.theme-academic_crest::before { height: 100%; width: 11px; background: linear-gradient(90deg,var(--theme-primary) 0 70%,var(--theme-accent) 70%); }
.exam-theme-card.theme-academic_crest::after { top: 14px; right: -8px; bottom: auto; width: 50%; height: 7px; transform: rotate(35deg); opacity: 1; }
.exam-theme-card.theme-sky_modern { border: 0; border-radius: 12px; }
.exam-theme-card.theme-sky_modern::before { height: 13px; border-radius: 0 0 9px 9px; }
.exam-theme-card.theme-geometric { border-radius: 2px 10px 2px 10px; }
.exam-theme-card.theme-geometric::after { right: 0; bottom: 0; width: 29%; height: 100%; clip-path: polygon(100% 0,100% 100%,0 100%); transform: none; opacity: .9; }
.exam-theme-option small { display: block; margin-top: 5px; min-height: 2.4em; font-size: 10px; line-height: 1.2; }
.exam-controls { display: grid; gap: 10px; margin-top: 12px; }
.exam-controls > label { display: grid; gap: 5px; }
.exam-controls textarea { resize: vertical; }
.exam-controls .btn { width: 100%; }
.exam-generate-btn { background: #079a91; }
.exam-report-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; gap: 12px; }
.exam-report-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.exam-report-stats article { display: grid; gap: 8px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--card); box-shadow: var(--shadow); }
.exam-report-stats small { color: var(--muted); }
.exam-report-stats strong { color: var(--primary-dark); font-size: 1.4rem; }
.exam-report-lists { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.exam-report-lists article { margin: 0; }
.exam-report-lists h2 { margin-top: 0; font-size: 16px; }
.exam-report-lists ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.exam-report-lists li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.exam-action-message { padding: 10px; border-radius: 10px; background: color-mix(in srgb, var(--success) 10%, white); }
html[data-theme="dark"] .exam-stat, html[data-theme="dark"] .exam-table-panel, html[data-theme="dark"] .exam-control-panel,
html[data-theme="dark"] .exam-report-stats article, html[data-theme="dark"] .exam-theme-option { background: #1a292c; color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] .exam-table th, html[data-theme="dark"] .exam-table tbody tr:nth-child(even) { background: #203236; }
@media (max-width: 980px) { .exam-dashboard-grid { grid-template-columns: 1fr; } .exam-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 650px) { .exam-report-lists { grid-template-columns: 1fr; } .exam-stats { gap: 8px; } .exam-stat { padding: 10px; gap: 9px; } .exam-stat > span { flex-basis: 38px; width: 38px; height: 38px; font-size: 19px; } .exam-stat strong { font-size: 1.2rem; } .exam-dashboard-tabs { overflow-x: auto; flex-wrap: nowrap; } .exam-pagination { align-items: flex-start; flex-direction: column; } }
.topic-submission-toggle { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; width: 100%; min-height: 52px; padding: 10px 14px; border: 0; background: transparent; color: var(--ink); text-align: start; cursor: pointer; }
.topic-submission-toggle strong { overflow-wrap: anywhere; }
.topic-submission-toggle span:nth-child(2) { color: var(--muted); font-size: .88rem; }
.topic-submission-chevron { transition: transform .18s ease; }
.topic-submission-toggle[aria-expanded="true"] .topic-submission-chevron { transform: rotate(180deg); }
.topic-submission-details { padding: 0 14px 12px; border-top: 1px solid var(--line); }
.topic-submission-details[hidden] { display: none; }
.topic-submission-files { display: flex; flex-wrap: wrap; gap: 4px; }
.topic-existing-files { display: grid; gap: 6px; }
.topic-existing-file { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.topic-existing-file .topic-file { margin: 0; }
.topic-file-remove { color: var(--danger, #a54135); }
html[data-theme="dark"] .topic-submission-row { background: var(--card); }
.warning-compose,
.warning-item { margin-bottom: 18px; }
.warning-compose h2,
.warnings-list > h2,
.warning-item h2 { margin-top: 0; }
.warning-audience-toggle,
.warning-select-all { display: flex; align-items: center; gap: 9px; margin: 12px 0; }
.warning-audience-toggle input,
.warning-select-all input,
.warning-recipient input { width: auto; }
.warning-recipient-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 12px; margin: 12px 0; }
.warning-recipient-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; max-height: 360px; overflow: auto; padding: 10px; border: 1px solid var(--border, #c8d0dc); border-radius: 8px; }
.warning-recipient { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; gap: 2px 8px; padding: 8px; border-radius: 6px; background: rgba(128, 145, 160, .08); }
.warning-recipient[hidden] { display: none; }
.warning-recipient input { grid-row: 1 / 3; }
.warning-recipient small { opacity: .72; }
.warning-recipient-summary { overflow-wrap: anywhere; }
.warning-existing-files { display: grid; gap: 8px; margin: 12px 0; }
.warning-file-remove { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.warning-file-remove input { width: auto; }
.warning-file-remove.marked-for-removal { opacity: .55; text-decoration: line-through; }
.warning-attachments,
.warning-new-files { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.warning-new-file { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; }
.warning-new-file span { overflow-wrap: anywhere; }
.warning-item-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.warning-item-heading .btn-row { margin: 0; }
.warning-message { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.warning-notification-banner { position: sticky; top: 8px; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 14px; margin: 0 0 14px; padding: 12px 16px; border: 1px solid #d9a32d; border-radius: 10px; color: #49360c; background: #fff4d6; box-shadow: 0 4px 14px rgba(23, 45, 82, .14); }
html[data-theme="dark"] .warning-notification-banner { color: #ffebbd; background: #433818; border-color: #98742a; }
@media (max-width: 600px) {
  .warning-item-heading { flex-direction: column; }
  .warning-recipient-picker { grid-template-columns: 1fr; }
  .warning-recipient-filters { grid-template-columns: 1fr; }
}
