/* ============================================================================
   Misk Platform — Custom styles layered on top of Bootstrap 5.
   Color palette and design system mirrors the React reference app exactly.
   ============================================================================ */

/* Fonts (Inter, Tajawal, Amiri) are loaded by a <link> in each page's <head>, not an
   @import here - an @import only starts after this whole file downloads, which made
   Safari draw the page in the wrong font first and then jump. */

:root {
  --brand-primary: #7a3d76;
  --brand-secondary: #c297c3;
  --brand-neutral: #fbf5f2;
  --brand-warm: #96b4ab;
  --brand-dark: #3d1a3c;
  --brand-accent: #46acae;

  /* Soft tints (homepage level plan): lilac = done / beginner, blush = intermediate,
     teal = advanced, rose = exams; the path's dashed line and muted text. */
  --tint-lilac: #f3ecf7;
  --tint-lilac-border: #e2d2ea;
  --tint-blush: #fbeaf0;
  --tint-blush-border: #f1cbd9;
  --tint-teal: #e4f4f4;
  --tint-teal-border: #bfe3e3;
  --tint-rose: #fdecef;
  --tint-rose-border: #f6c9d3;
  --tint-rose-text: #b4234a;
  --path-line: #d8c3df;
  --text-soft: #8a7a88;

  /* Bootstrap overrides */
  --bs-primary: var(--brand-primary);
  --bs-primary-rgb: 122, 61, 118;
  --bs-link-color: var(--brand-primary);
  --bs-link-hover-color: var(--brand-dark);
  --bs-body-font-family:
    "Tajawal", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --bs-border-radius: 0.75rem;
  --bs-border-radius-lg: 1rem;
  --bs-border-radius-xl: 1.25rem;
}

/* ─── Base ─────────────────────────────────────────────────────────────────── */

body {
  background-color: var(--brand-neutral);
  background-image:
    radial-gradient(
      ellipse 900px 640px at 12% -8%,
      rgba(122, 61, 118, 0.07),
      transparent 62%
    ),
    radial-gradient(
      ellipse 900px 640px at 100% 105%,
      rgba(70, 172, 174, 0.06),
      transparent 62%
    );
  background-repeat: no-repeat;
  background-attachment: fixed;
  font-family: "Tajawal", "Inter", sans-serif;
  color: var(--brand-dark);
  min-height: 100vh;
}

@media (max-width: 767px) {
  body {
    background-attachment: scroll;
  }
}

[dir="rtl"] body {
  font-family: "Tajawal", sans-serif;
}
[dir="ltr"] body {
  font-family: "Inter", "Tajawal", sans-serif;
}

.font-serif {
  font-family: "Amiri", serif;
}

a {
  text-decoration: none;
}

/* ─── Animations ────────────────────────────────────────────────────────────── */

.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Scrollbar ─────────────────────────────────────────────────────────────── */

::-webkit-scrollbar {
  width: 8px;
  height: 10px; /* horizontal scrollbars too (wide tables), otherwise they are invisible */
}
::-webkit-scrollbar-track {
  background: var(--brand-neutral);
}
::-webkit-scrollbar-thumb {
  background: var(--brand-warm);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--brand-primary);
}

/* ─── Navbar ─────────────────────────────────────────────────────────────────
   Matches the React reference: fixed top, exactly 80px tall, white/95 with
   backdrop-blur, subtle bottom border.                                        */

.navbar-misk {
  height: 80px;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(122, 61, 118, 0.07);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

/* Mobile dropdown: absolutely positioned below navbar with solid background */
@media (max-width: 991px) {
  .navbar-misk {
    height: auto;
    min-height: 80px;
  }
  .navbar-misk > .container {
    min-height: 80px;
  }
  .navbar-misk .navbar-collapse {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 2px solid rgba(122, 61, 118, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    z-index: 1040;
    padding: 0.75rem 1rem 1.25rem;
  }
}

.navbar-misk .nav-link {
  font-weight: 700;
  color: #6b7280;
  font-size: 0.9rem;
  transition: color 0.15s;
}

.navbar-misk .nav-link:hover,
.navbar-misk .nav-link.active {
  color: var(--brand-primary) !important;
}

/* Default anonymous avatar for users without a photo */
.navbar-avatar-anon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(122, 61, 118, 0.1);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  border: 2px solid rgba(122, 61, 118, 0.15);
  flex-shrink: 0;
  transition: transform 0.2s;
  text-decoration: none;
}

/* ─── Default "unknown user" avatar fallback (used wherever avatar_path is empty) ─── */

.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(122, 61, 118, 0.08);
  color: var(--brand-primary);
  flex-shrink: 0;
}
.avatar-sm.avatar-fallback {
  font-size: 1.05rem;
}
.cp-list-avatar.avatar-fallback {
  font-size: 1.15rem;
}
.navbar-avatar-anon:hover {
  transform: scale(1.05);
}

/* Icon-only sign-out button: a soft circular target instead of a bare glyph */
.cp-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
  font-size: 1.05rem;
  flex-shrink: 0;
  transition:
    background-color 0.2s,
    color 0.2s,
    transform 0.2s;
}
.cp-logout-btn:hover,
.cp-logout-btn:focus {
  background: rgba(220, 38, 38, 0.16);
  color: #b91c1c;
  transform: translateY(-1px);
}

/* Drag-drop upload areas for register form */
.upload-drop-area {
  position: relative;
  border: 2px dashed rgba(122, 61, 118, 0.3);
  border-radius: 1rem;
  padding: 1.75rem 1rem;
  text-align: center;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}
.upload-clear-btn {
  position: absolute;
  top: 0.5rem;
  inset-inline-end: 0.5rem;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(122, 61, 118, 0.1);
  color: var(--brand-primary);
  font-size: 1rem;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.upload-clear-btn:hover {
  background: rgba(220, 53, 69, 0.15);
  color: #dc3545;
}
.upload-drop-area.has-file .upload-clear-btn {
  display: flex;
}
.upload-drop-area:hover {
  background: rgba(122, 61, 118, 0.04);
  border-color: rgba(122, 61, 118, 0.5);
}
.upload-drop-area .upload-icon {
  font-size: 2rem;
  color: var(--brand-primary);
  margin-bottom: 0.25rem;
}
.upload-drop-area .upload-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--brand-dark);
}
.upload-drop-area .upload-hint {
  font-size: 0.68rem;
  color: #9ca3af;
  font-weight: 600;
}
.upload-drop-area.has-file {
  border-style: solid;
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
}
.upload-drop-area.has-file .upload-icon {
  color: #10b981;
}
.upload-drop-area.has-file .upload-label {
  color: #10b981;
}
.upload-drop-area.is-busy {
  pointer-events: none;
  opacity: 0.75;
}
.upload-drop-area.is-busy .upload-clear-btn {
  display: none;
}

/* Student-type selector cards in register form */
.student-type-card {
  border: 2px solid #e5e7eb;
  border-radius: 0.875rem;
  padding: 0.65rem 1rem;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  -webkit-user-select: none;
  user-select: none;
}
.student-type-card.active {
  border-color: var(--brand-primary);
  background: rgba(122, 61, 118, 0.04);
}
.student-type-card:hover:not(.active) {
  border-color: rgba(122, 61, 118, 0.3);
}
.student-type-card h6 {
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--brand-dark);
  margin: 0 0 0.15rem;
}
.student-type-card small {
  font-size: 0.66rem;
  color: #9ca3af;
  font-weight: 600;
}

/* First-time toggle buttons */
.first-time-toggle {
  padding: 0.5rem 1.25rem;
  border-radius: 0.75rem;
  font-weight: 800;
  font-size: 0.875rem;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
}
.first-time-toggle.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}
.first-time-toggle:hover:not(.active) {
  background: #f9fafb;
}

.navbar-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  transition: transform 0.2s;
}

.navbar-logo:hover {
  transform: scale(1.05);
}

.navbar-brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 0.875rem;
  background: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.3rem;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.navbar-brand-icon:hover {
  transform: scale(1.05);
}

.navbar-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(122, 61, 118, 0.15);
  transition: transform 0.2s;
}

.navbar-avatar:hover {
  transform: scale(1.05);
}

/* ─── Buttons ────────────────────────────────────────────────────────────────
   Primary: filled burgundy with subtle shadow + hover lift
   Outline:  burgundy border/text, white fill                                  */

.btn-brand {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
  font-weight: 900;
  border-radius: 0.875rem;
  box-shadow: 0 4px 12px rgba(122, 61, 118, 0.14);
  transition:
    background-color 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
}

.btn-brand:hover,
.btn-brand:focus {
  background-color: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(122, 61, 118, 0.22);
}

.btn-brand:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(122, 61, 118, 0.14);
}

.btn-online {
  background-color: var(--brand-accent);
  border-color: var(--brand-accent);
  color: #fff;
  font-weight: 900;
  border-radius: 0.875rem;
  box-shadow: 0 4px 12px rgba(70, 172, 174, 0.25);
  transition:
    background-color 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
}

.btn-online:hover,
.btn-online:focus {
  background-color: #2f8688;
  border-color: #2f8688;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(70, 172, 174, 0.35);
}

.btn-online:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(70, 172, 174, 0.2);
}

/* Auto-Assignment Wizard CTA — soft brand-to-accent gradient, matches the
   info-modal header treatment instead of the old flat stock-violet button. */
.btn-wizard {
  background: linear-gradient(
    135deg,
    var(--brand-primary),
    var(--brand-accent)
  );
  border: none;
  color: #fff;
  font-weight: 800;
  border-radius: 0.75rem;
  box-shadow: 0 4px 12px rgba(122, 61, 118, 0.18);
  transition:
    transform 0.2s,
    box-shadow 0.2s,
    filter 0.2s;
}

.btn-wizard:hover,
.btn-wizard:focus {
  color: #fff;
  filter: brightness(1.06);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(122, 61, 118, 0.26);
}

.btn-wizard:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(122, 61, 118, 0.18);
}

.btn-outline-brand {
  border: 2px solid var(--brand-primary);
  color: var(--brand-primary);
  font-weight: 700;
  border-radius: 0.875rem;
  background: transparent;
  transition:
    background-color 0.2s,
    color 0.2s,
    transform 0.2s;
}

.btn-outline-brand:hover,
.btn-outline-brand:focus {
  background: rgba(122, 61, 118, 0.08);
  color: var(--brand-dark);
  border-color: var(--brand-dark);
  transform: translateY(-1px);
}

/* As a toggle (<input class="btn-check"> + label), e.g. announcement groups:
   filled when chosen, with a check mark. */
.btn-check + .btn-outline-brand {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}
.btn-check:checked + .btn-outline-brand {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}
.btn-check:checked + .btn-outline-brand::before {
  content: "\2713";
  margin-inline-end: 0.3rem;
}

/* ─── Cards ──────────────────────────────────────────────────────────────────
   Soft card: white bg, 16px radius (rounded-2xl), soft border + shadow       */

.card-soft {
  border-radius: 1rem;
  border: 1px solid rgba(122, 61, 118, 0.1);
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.04),
    0 4px 16px rgba(0, 0, 0, 0.03);
  background: rgba(255, 255, 255, 0.93);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.card-soft:hover {
  border-color: rgba(122, 61, 118, 0.2);
}

/* Welcome banner: the first thing a signed-in user sees, so it gets its own
   soft brand-tinted gradient and accent stripe instead of the plain white
   .card-soft treatment - a quiet "hero" moment rather than another generic
   card. The floral flourishes are scattered around it instead of just one in
   each corner. Colors nudge slightly toward the user's level (see the
   [data-level] overrides) while staying close to the original muted tones. */
.welcome-card {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid rgba(122, 61, 118, 0.14);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.04),
    0 12px 28px rgba(122, 61, 118, 0.09);
}
.welcome-card::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, var(--brand-primary), var(--brand-accent));
}
.welcome-flower {
  position: absolute;
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}
.welcome-flower-1 {
  top: -35px;
  inset-inline-end: -35px;
  width: 190px;
  height: 190px;
  opacity: 0.16;
}
.welcome-flower-2 {
  bottom: -45px;
  inset-inline-start: -20px;
  width: 110px;
  height: 110px;
  opacity: 0.14;
}
.welcome-flower-3 {
  top: -18px;
  inset-inline-start: 28%;
  width: 68px;
  height: 68px;
  opacity: 0.1;
}
.welcome-flower-4 {
  bottom: -22px;
  inset-inline-end: 22%;
  width: 82px;
  height: 82px;
  opacity: 0.11;
}
.welcome-butterfly {
  top: 50%;
  inset-inline-start: 46%;
  width: 54px;
  height: 54px;
  opacity: 0.16;
  transform: translateY(-50%) rotate(-8deg);
}

/* Default (no level set yet): the original two-tone purple/sage. */
.welcome-flower-1,
.welcome-flower-3 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg transform='translate(100,100)'%3E%3Cg fill='%23c297c3'%3E%3Cellipse rx='40' ry='24' transform='rotate(0)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(60)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(120)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(180)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(240)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(300)'/%3E%3C/g%3E%3Ccircle r='15' fill='%237a3d76'/%3E%3C/g%3E%3C/svg%3E");
}
.welcome-flower-2,
.welcome-flower-4 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg transform='translate(100,100)'%3E%3Cg fill='%2396b4ab'%3E%3Cellipse rx='40' ry='24' transform='rotate(0)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(60)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(120)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(180)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(240)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(300)'/%3E%3C/g%3E%3Ccircle r='15' fill='%237a3d76'/%3E%3C/g%3E%3C/svg%3E");
}
.welcome-butterfly {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='%23c297c3'%3E%3Cpath d='M50,32 C58,12 94,8 93,32 C92,52 66,53 50,44 Z'/%3E%3Cpath d='M50,47 C58,49 80,53 79,70 C78,85 58,84 50,60 Z'/%3E%3C/g%3E%3Cg fill='%23c297c3' transform='translate(100,0) scale(-1,1)'%3E%3Cpath d='M50,32 C58,12 94,8 93,32 C92,52 66,53 50,44 Z'/%3E%3Cpath d='M50,47 C58,49 80,53 79,70 C78,85 58,84 50,60 Z'/%3E%3C/g%3E%3Cellipse cx='50' cy='50' rx='2.3' ry='22' fill='%237a3d76'/%3E%3Ccircle cx='50' cy='26' r='3.4' fill='%237a3d76'/%3E%3Cpath d='M50,24 C46,18 40,16 37,18' stroke='%237a3d76' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3Cpath d='M50,24 C54,18 60,16 63,18' stroke='%237a3d76' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* Per-level nudge: same shape, colors shifted a little toward the level's hue. */
.welcome-card[data-level="BEGINNER"] .welcome-flower-1,
.welcome-card[data-level="BEGINNER"] .welcome-flower-3 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg transform='translate(100,100)'%3E%3Cg fill='%23d9a0bb'%3E%3Cellipse rx='40' ry='24' transform='rotate(0)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(60)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(120)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(180)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(240)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(300)'/%3E%3C/g%3E%3Ccircle r='15' fill='%237a3d76'/%3E%3C/g%3E%3C/svg%3E");
}
.welcome-card[data-level="BEGINNER"] .welcome-flower-2,
.welcome-card[data-level="BEGINNER"] .welcome-flower-4 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg transform='translate(100,100)'%3E%3Cg fill='%23e8c4d7'%3E%3Cellipse rx='40' ry='24' transform='rotate(0)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(60)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(120)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(180)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(240)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(300)'/%3E%3C/g%3E%3Ccircle r='15' fill='%237a3d76'/%3E%3C/g%3E%3C/svg%3E");
}
.welcome-card[data-level="BEGINNER"] .welcome-butterfly {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='%23d9a0bb'%3E%3Cpath d='M50,32 C58,12 94,8 93,32 C92,52 66,53 50,44 Z'/%3E%3Cpath d='M50,47 C58,49 80,53 79,70 C78,85 58,84 50,60 Z'/%3E%3C/g%3E%3Cg fill='%23d9a0bb' transform='translate(100,0) scale(-1,1)'%3E%3Cpath d='M50,32 C58,12 94,8 93,32 C92,52 66,53 50,44 Z'/%3E%3Cpath d='M50,47 C58,49 80,53 79,70 C78,85 58,84 50,60 Z'/%3E%3C/g%3E%3Cellipse cx='50' cy='50' rx='2.3' ry='22' fill='%237a3d76'/%3E%3Ccircle cx='50' cy='26' r='3.4' fill='%237a3d76'/%3E%3Cpath d='M50,24 C46,18 40,16 37,18' stroke='%237a3d76' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3Cpath d='M50,24 C54,18 60,16 63,18' stroke='%237a3d76' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

.welcome-card[data-level="INTERMEDIATE"] .welcome-flower-1,
.welcome-card[data-level="INTERMEDIATE"] .welcome-flower-3 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg transform='translate(100,100)'%3E%3Cg fill='%23d9b37a'%3E%3Cellipse rx='40' ry='24' transform='rotate(0)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(60)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(120)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(180)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(240)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(300)'/%3E%3C/g%3E%3Ccircle r='15' fill='%237a3d76'/%3E%3C/g%3E%3C/svg%3E");
}
.welcome-card[data-level="INTERMEDIATE"] .welcome-flower-2,
.welcome-card[data-level="INTERMEDIATE"] .welcome-flower-4 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg transform='translate(100,100)'%3E%3Cg fill='%23e8cfa8'%3E%3Cellipse rx='40' ry='24' transform='rotate(0)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(60)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(120)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(180)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(240)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(300)'/%3E%3C/g%3E%3Ccircle r='15' fill='%237a3d76'/%3E%3C/g%3E%3C/svg%3E");
}
.welcome-card[data-level="INTERMEDIATE"] .welcome-butterfly {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='%23d9b37a'%3E%3Cpath d='M50,32 C58,12 94,8 93,32 C92,52 66,53 50,44 Z'/%3E%3Cpath d='M50,47 C58,49 80,53 79,70 C78,85 58,84 50,60 Z'/%3E%3C/g%3E%3Cg fill='%23d9b37a' transform='translate(100,0) scale(-1,1)'%3E%3Cpath d='M50,32 C58,12 94,8 93,32 C92,52 66,53 50,44 Z'/%3E%3Cpath d='M50,47 C58,49 80,53 79,70 C78,85 58,84 50,60 Z'/%3E%3C/g%3E%3Cellipse cx='50' cy='50' rx='2.3' ry='22' fill='%237a3d76'/%3E%3Ccircle cx='50' cy='26' r='3.4' fill='%237a3d76'/%3E%3Cpath d='M50,24 C46,18 40,16 37,18' stroke='%237a3d76' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3Cpath d='M50,24 C54,18 60,16 63,18' stroke='%237a3d76' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

.welcome-card[data-level="ADVANCED"] .welcome-flower-1,
.welcome-card[data-level="ADVANCED"] .welcome-flower-3 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg transform='translate(100,100)'%3E%3Cg fill='%238fc0a0'%3E%3Cellipse rx='40' ry='24' transform='rotate(0)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(60)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(120)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(180)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(240)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(300)'/%3E%3C/g%3E%3Ccircle r='15' fill='%237a3d76'/%3E%3C/g%3E%3C/svg%3E");
}
.welcome-card[data-level="ADVANCED"] .welcome-flower-2,
.welcome-card[data-level="ADVANCED"] .welcome-flower-4 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg transform='translate(100,100)'%3E%3Cg fill='%23b8dcc5'%3E%3Cellipse rx='40' ry='24' transform='rotate(0)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(60)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(120)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(180)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(240)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(300)'/%3E%3C/g%3E%3Ccircle r='15' fill='%237a3d76'/%3E%3C/g%3E%3C/svg%3E");
}
.welcome-card[data-level="ADVANCED"] .welcome-butterfly {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='%238fc0a0'%3E%3Cpath d='M50,32 C58,12 94,8 93,32 C92,52 66,53 50,44 Z'/%3E%3Cpath d='M50,47 C58,49 80,53 79,70 C78,85 58,84 50,60 Z'/%3E%3C/g%3E%3Cg fill='%238fc0a0' transform='translate(100,0) scale(-1,1)'%3E%3Cpath d='M50,32 C58,12 94,8 93,32 C92,52 66,53 50,44 Z'/%3E%3Cpath d='M50,47 C58,49 80,53 79,70 C78,85 58,84 50,60 Z'/%3E%3C/g%3E%3Cellipse cx='50' cy='50' rx='2.3' ry='22' fill='%237a3d76'/%3E%3Ccircle cx='50' cy='26' r='3.4' fill='%237a3d76'/%3E%3Cpath d='M50,24 C46,18 40,16 37,18' stroke='%237a3d76' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3Cpath d='M50,24 C54,18 60,16 63,18' stroke='%237a3d76' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

.welcome-card[data-level="IQRAA"] .welcome-flower-1,
.welcome-card[data-level="IQRAA"] .welcome-flower-3 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg transform='translate(100,100)'%3E%3Cg fill='%238fabd9'%3E%3Cellipse rx='40' ry='24' transform='rotate(0)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(60)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(120)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(180)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(240)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(300)'/%3E%3C/g%3E%3Ccircle r='15' fill='%237a3d76'/%3E%3C/g%3E%3C/svg%3E");
}
.welcome-card[data-level="IQRAA"] .welcome-flower-2,
.welcome-card[data-level="IQRAA"] .welcome-flower-4 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg transform='translate(100,100)'%3E%3Cg fill='%23b8cbe8'%3E%3Cellipse rx='40' ry='24' transform='rotate(0)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(60)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(120)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(180)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(240)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(300)'/%3E%3C/g%3E%3Ccircle r='15' fill='%237a3d76'/%3E%3C/g%3E%3C/svg%3E");
}
.welcome-card[data-level="IQRAA"] .welcome-butterfly {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='%238fabd9'%3E%3Cpath d='M50,32 C58,12 94,8 93,32 C92,52 66,53 50,44 Z'/%3E%3Cpath d='M50,47 C58,49 80,53 79,70 C78,85 58,84 50,60 Z'/%3E%3C/g%3E%3Cg fill='%238fabd9' transform='translate(100,0) scale(-1,1)'%3E%3Cpath d='M50,32 C58,12 94,8 93,32 C92,52 66,53 50,44 Z'/%3E%3Cpath d='M50,47 C58,49 80,53 79,70 C78,85 58,84 50,60 Z'/%3E%3C/g%3E%3Cellipse cx='50' cy='50' rx='2.3' ry='22' fill='%237a3d76'/%3E%3Ccircle cx='50' cy='26' r='3.4' fill='%237a3d76'/%3E%3Cpath d='M50,24 C46,18 40,16 37,18' stroke='%237a3d76' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3Cpath d='M50,24 C54,18 60,16 63,18' stroke='%237a3d76' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

.welcome-card[data-level="MUJAZAH"] .welcome-flower-1,
.welcome-card[data-level="MUJAZAH"] .welcome-flower-3 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg transform='translate(100,100)'%3E%3Cg fill='%23a68fd9'%3E%3Cellipse rx='40' ry='24' transform='rotate(0)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(60)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(120)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(180)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(240)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(300)'/%3E%3C/g%3E%3Ccircle r='15' fill='%237a3d76'/%3E%3C/g%3E%3C/svg%3E");
}
.welcome-card[data-level="MUJAZAH"] .welcome-flower-2,
.welcome-card[data-level="MUJAZAH"] .welcome-flower-4 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg transform='translate(100,100)'%3E%3Cg fill='%23c7b8e8'%3E%3Cellipse rx='40' ry='24' transform='rotate(0)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(60)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(120)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(180)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(240)'/%3E%3Cellipse rx='40' ry='24' transform='rotate(300)'/%3E%3C/g%3E%3Ccircle r='15' fill='%237a3d76'/%3E%3C/g%3E%3C/svg%3E");
}
.welcome-card[data-level="MUJAZAH"] .welcome-butterfly {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='%23a68fd9'%3E%3Cpath d='M50,32 C58,12 94,8 93,32 C92,52 66,53 50,44 Z'/%3E%3Cpath d='M50,47 C58,49 80,53 79,70 C78,85 58,84 50,60 Z'/%3E%3C/g%3E%3Cg fill='%23a68fd9' transform='translate(100,0) scale(-1,1)'%3E%3Cpath d='M50,32 C58,12 94,8 93,32 C92,52 66,53 50,44 Z'/%3E%3Cpath d='M50,47 C58,49 80,53 79,70 C78,85 58,84 50,60 Z'/%3E%3C/g%3E%3Cellipse cx='50' cy='50' rx='2.3' ry='22' fill='%237a3d76'/%3E%3Ccircle cx='50' cy='26' r='3.4' fill='%237a3d76'/%3E%3Cpath d='M50,24 C46,18 40,16 37,18' stroke='%237a3d76' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3Cpath d='M50,24 C54,18 60,16 63,18' stroke='%237a3d76' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

.badge-level {
  background: var(--brand-neutral);
  color: var(--brand-primary);
  border: 1px solid rgba(122, 61, 118, 0.2);
  font-weight: 800;
  border-radius: 0.75rem;
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
  letter-spacing: 0.01em;
}

/* ─── Forms ──────────────────────────────────────────────────────────────────
   Matches the React inputs: slate-50 bg, subtle gray border, brand focus ring */

.form-label {
  font-weight: 900;
  font-size: 0.72rem;
  color: #9ca3af;
  margin-bottom: 0.4rem;
  text-transform: none;
  letter-spacing: 0.01em;
}

.form-control,
.form-select {
  border-radius: 0.75rem;
  border: 1.5px solid #e5e7eb;
  background-color: #f8fafc;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.65rem 0.9rem;
  color: var(--brand-dark);
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background-color 0.15s;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(122, 61, 118, 0.08);
  background-color: #fff;
  outline: none;
}

.form-control::placeholder {
  color: #c4c9d4;
  font-weight: 500;
}

/* ─── Demo shortcuts card (login page) ─────────────────────────────────────── */

/* ─── Enrollment format cards (index.php session picker) ─────────────────── */

.enroll-fmt-card {
  cursor: pointer;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    transform 0.15s;
}
.enroll-fmt-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}
.enroll-fmt-card:has(input:checked) {
  border-color: var(--brand-primary) !important;
  background: rgba(122, 61, 118, 0.03);
  box-shadow: 0 4px 14px rgba(122, 61, 118, 0.14);
}

/* Corner checkmark badge variant — teacher-format cards (hides the raw radio dot) */
.fmt-card-badge {
  position: relative;
}
.fmt-card-badge input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.fmt-card-badge .fmt-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  display: none;
  flex-shrink: 0;
  margin-inline-start: 0.15rem;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  box-shadow: 0 2px 8px rgba(122, 61, 118, 0.24);
}
.fmt-card-badge:has(input:checked) .fmt-check {
  display: flex;
}
.fmt-card-badge .fmt-icon-circle {
  transition:
    background 0.15s,
    transform 0.15s;
}
.fmt-card-badge:has(input:checked) .fmt-icon-circle {
  transform: scale(1.06);
}

/* ─── Yes/No pill toggle (index.php first-time-teaching question) ────────── */

.yesno-toggle {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #f4f1f6;
  border: 1px solid #e6dfe9;
  border-radius: 999px;
  width: fit-content;
}
.yesno-toggle label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 7px 18px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--brand-dark);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s,
    box-shadow 0.15s;
}
.yesno-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.yesno-toggle label:has(input:checked) {
  background: var(--brand-primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(122, 61, 118, 0.18);
}
.yesno-toggle label:hover:not(:has(input:checked)) {
  background: rgba(122, 61, 118, 0.08);
}

/* ─── Timetable grid ─────────────────────────────────────────────────────────
   Availability picker (Home page enrollment form)                             */

.timetable-wrapper {
  overflow-x: auto;
  border-radius: 0.9rem;
}

.timetable {
  border-collapse: collapse;
  width: 100%;
  min-width: 700px;
}

.timetable thead th {
  font-size: 0.78rem;
  font-weight: 800;
  color: #111827;
  text-align: center;
  padding: 0.85rem 0.6rem;
  background: #fff;
  border-bottom: 2px solid #eef0f3;
}

.timetable thead th:first-child {
  text-align: start;
}

.timetable tbody td,
.timetable tbody th {
  border: 1px solid #eef0f3;
  padding: 0;
}

/* The time column: a row header (th) since the grid is read by screen readers. */
.timetable tbody td:first-child,
.timetable tbody th:first-child {
  font-size: 0.8rem;
  font-weight: 800;
  color: #111827;
  padding: 0.9rem 1rem;
  white-space: nowrap;
  border-inline-start: none;
}

.timetable tbody tr:nth-child(even) {
  background: #fafafa;
}

.slot-cell {
  width: 100%;
  height: 100%;
  min-height: 58px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #c3c7ce;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background 0.25s ease,
    color 0.25s ease;
  padding: 0.4rem;
  text-align: center;
}
/* Open slots are buttons (keyboard / screen readers): no browser button look. */
button.slot-cell {
  border: 0;
  border-radius: 0;
  background-color: transparent;
  font-family: inherit;
}

.slot-cell:hover:not(.slot-disabled):not(.slot-selected):not(.slot-selected-online) {
  background: rgba(122, 61, 118, 0.06);
  color: var(--brand-primary);
}

.slot-cell.slot-selected {
  background: rgba(122, 61, 118, 0.1);
  color: var(--brand-primary);
  font-weight: 800;
}

.slot-cell.slot-selected:hover {
  background: rgba(122, 61, 118, 0.16);
}

.slot-cell.slot-selected-online {
  background: rgba(70, 172, 174, 0.14);
  color: #2f8688;
  font-weight: 800;
}

.slot-cell.slot-selected-online:hover {
  background: rgba(70, 172, 174, 0.22);
}

.slot-cell.slot-disabled {
  background: transparent;
  color: #e2e4e8;
  cursor: not-allowed;
}

/* ─── Master schedule grid (Home page, teachers/admins only) ────────────────── */

.master-schedule-wrapper {
  overflow-x: auto;
  border-radius: 0.9rem;
}

.master-schedule {
  border-collapse: collapse;
  width: 100%;
  min-width: 900px;
}

.master-schedule thead th {
  font-size: 0.78rem;
  font-weight: 800;
  color: #111827;
  text-align: center;
  padding: 0.7rem 0.5rem;
  background: #fff;
  border-bottom: 2px solid #eef0f3;
}

.master-schedule tbody td {
  border: 1px solid #eef0f3;
  padding: 0.3rem;
  vertical-align: top;
  min-width: 118px;
}

.master-schedule tbody td:first-child {
  font-size: 0.75rem;
  font-weight: 800;
  color: #111827;
  white-space: nowrap;
  padding: 0.7rem 0.6rem;
  vertical-align: middle;
}

.schedule-chip {
  border-radius: 0.5rem;
  padding: 0.3rem 0.45rem;
  margin-bottom: 0.3rem;
  border-inline-start: 3px solid;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}
.schedule-chip:last-child {
  margin-bottom: 0;
}

.schedule-chip-person {
  background: rgba(122, 61, 118, 0.07);
  border-color: var(--brand-primary);
}

/* Online = the soft blue used everywhere (#3f6fb0 on #e8f0fa). */
.schedule-chip-online {
  background: rgba(63, 111, 176, 0.08);
  border-color: #3f6fb0;
}

.schedule-chip-teacher {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--brand-dark);
}

.schedule-chip-meta {
  font-size: 0.64rem;
  font-weight: 700;
  color: #6b7280;
}

/* The phone number keeps dir="ltr" so its digits shape correctly, but in the
   Arabic UI it should still sit on the right like the rest of the chip. */
html[dir="rtl"] .schedule-chip-meta[dir="ltr"] {
  text-align: right;
}

/* The shared .badge-level-* pills are sized for normal use elsewhere (profile
   headers, tables); inside a compact schedule chip they overpower everything
   else, so shrink them down just in this context. */
.schedule-chip-meta .badge-level-beginner,
.schedule-chip-meta .badge-level-intermediate,
.schedule-chip-meta .badge-level-advanced,
.schedule-chip-meta .badge-level-unknown {
  padding: 0.05rem 0.35rem;
  font-size: 0.58rem;
  border-radius: 0.4rem;
}

/* ─── Tables ─────────────────────────────────────────────────────────────────*/

.table-misk {
  --bs-table-border-color: #eef0f3;
  border-collapse: separate;
  border-spacing: 0;
}
.table-misk thead th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  font-weight: 900;
  border-bottom: 1px solid #eef0f3;
  background: rgba(248, 250, 252, 0.8);
  white-space: nowrap;
}
.table-misk td {
  border-bottom: 1px solid #eef0f3;
  vertical-align: middle;
}
.table-misk tbody tr:last-child td {
  border-bottom: none;
}

/* Gives each row its own bordered/shadowed container (e.g. one per student)
   instead of a flat, edge-to-edge table - spacing plus rounded outer corners. */
.table-misk.table-boxed-rows {
  border-collapse: separate;
  border-spacing: 0 0.6rem;
}
.table-misk.table-boxed-rows tbody tr {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.table-misk.table-boxed-rows tbody td {
  border-top: 1px solid #eef0f3;
  border-bottom: 1px solid #eef0f3;
}
.table-misk.table-boxed-rows tbody td:first-child {
  border-inline-start: 1px solid #eef0f3;
  border-radius: 0.75rem 0 0 0.75rem;
}
.table-misk.table-boxed-rows tbody td:last-child {
  border-inline-end: 1px solid #eef0f3;
  border-radius: 0 0.75rem 0.75rem 0;
}

/* ─── Misc utilities ─────────────────────────────────────────────────────────*/

.avatar-sm {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #e5e7eb;
}

.session-cover {
  min-height: 180px;
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-radius: 1rem 0 0 1rem;
}

/* Photo mode (a teacher chose a cover photo): dark overlay for legible white text. */
.session-cover-photo {
  color: #fff;
}
/* The picture and its tint are two layers (session_cover_layers_html() in
   helpers.php) carrying the teacher's edits: position, zoom, filters, and the
   tint's color/strength. */
.session-cover-bg,
.session-cover-tint {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.session-cover-bg {
  background-size: cover;
  background-repeat: no-repeat;
}
.session-cover-photo .session-cover-meta {
  color: rgba(255, 255, 255, 0.85);
}
/* Theme modal: live preview of the cover picture with the teacher's edits. */
.cover-editor-preview {
  min-height: 170px;
  border-radius: 1rem;
  padding: 1rem;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.cover-editor-preview.is-dragging {
  cursor: grabbing;
}
.cover-editor-hint {
  position: absolute;
  bottom: 6px;
  inset-inline-start: 8px;
  z-index: 1;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
}
/* Teacher chose dark text (for a light picture / light tint). */
.session-cover-photo.cover-text-dark {
  color: #1f2937;
}
.session-cover-photo.cover-text-dark .session-cover-meta {
  color: rgba(31, 41, 55, 0.8);
}
/* Teacher's own text color (set as --cover-text on the cover). */
.session-cover-photo.cover-text-custom,
.session-cover-photo.cover-text-custom .session-cover-meta {
  color: var(--cover-text);
}
.session-cover-photo.cover-text-custom .session-cover-meta {
  opacity: 0.85;
}

/* Plain mode (no cover photo): an airy card echoing the homepage welcome
   banner - soft tint + decorative flowers - instead of a solid color block. */
.session-cover-plain {
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid rgba(122, 61, 118, 0.14);
  color: var(--brand-dark);
}
.session-cover-plain::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--session-theme, var(--brand-primary));
  opacity: 0.07;
  border-radius: inherit;
}
.session-cover-plain .session-cover-meta {
  color: #6b7280;
}

.session-format-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: inherit;
}
.session-cover-plain .session-format-badge {
  background: color-mix(in srgb, var(--session-theme, var(--brand-primary)) 10%, transparent);
  border-color: color-mix(in srgb, var(--session-theme, var(--brand-primary)) 25%, transparent);
  color: var(--session-theme, var(--brand-primary));
}

@media (max-width: 767px) {
  .session-cover {
    border-radius: 1rem 1rem 0 0;
  }
}

/* ─── Footer ─────────────────────────────────────────────────────────────────*/

/* Sticky footer: on pages with the site header/footer, main grows to fill a
   short page so the footer stays at the bottom (standalone export pages that
   also load this file are left alone). */
body:has(> .app-footer) {
  display: flex;
  flex-direction: column;
}
body:has(> .app-footer) > main {
  flex: 1 0 auto;
}

.app-footer {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1.75rem 0;
  margin-top: 3rem;
  font-size: 0.82rem;
  color: #9ca3af;
}

/* ─── Scroll-to-top button ──────────────────────────────────────────────────*/

#scrollTopBtn {
  position: fixed;
  bottom: 1.5rem;
  inset-inline-end: 1.5rem;
  z-index: 200;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(122, 61, 118, 0.22);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  /* Fades in place - no slide, so it never seems to move. */
  transition: opacity 0.25s, background-color 0.2s;
  font-size: 1.1rem;
}
/* Phones: the browser's address bar hides while scrolling down and the screen grows,
   which dragged a bottom-pinned button with it. Pinned from the top against the
   SMALL viewport height (bar shown) instead, it stays in one place either way. */
@supports (height: 100svh) {
  #scrollTopBtn {
    bottom: auto;
    top: calc(100svh - 40px - 1.5rem - env(safe-area-inset-bottom, 0px));
  }
}

#scrollTopBtn.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Only with a real mouse - on a phone a tap would leave it stuck "hovered" (raised). */
@media (hover: hover) {
  #scrollTopBtn:hover {
    background: var(--brand-dark);
    transform: translateY(-2px);
  }
}

/* ─── Global page-loading indicator ─────────────────────────────────────────*/

#miskPageProgress {
  position: fixed;
  top: 0;
  inset-inline-start: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--brand-accent), var(--brand-primary));
  box-shadow: 0 0 10px rgba(122, 61, 118, 0.55), 0 0 4px rgba(70, 172, 174, 0.55);
  border-radius: 0 3px 3px 0;
  z-index: 2000;
  opacity: 0;
  transition: width 0.35s ease-out, opacity 0.2s ease;
  pointer-events: none;
}

#miskPageProgress.is-active {
  opacity: 1;
}

/* ─── Toast notifications ───────────────────────────────────────────────────*/

#toastContainer {
  position: fixed;
  bottom: 1.5rem;
  inset-inline-end: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
  max-width: calc(100vw - 2rem);
}

.toast-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid;
  box-shadow:
    0 10px 25px -5px rgba(0, 0, 0, 0.1),
    0 4px 10px -5px rgba(0, 0, 0, 0.04);
  pointer-events: auto;
  max-width: 24rem;
  animation: fadeIn 0.35s ease-out forwards;
  font-weight: 600;
  font-size: 0.875rem;
}

.toast-item.toast-leaving {
  animation: toastLeave 0.25s ease-in forwards;
}

@keyframes toastLeave {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(6px);
  }
}

.toast-item.toast-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}
.toast-item.toast-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
.toast-item.toast-warning {
  background: #fefce8;
  border-color: #fef08a;
  color: #854d0e;
}
.toast-item.toast-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.toast-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.toast-success .toast-icon {
  color: #22c55e;
}
.toast-error .toast-icon {
  color: #ef4444;
}
.toast-warning .toast-icon {
  color: #eab308;
}
.toast-info .toast-icon {
  color: #3b82f6;
}

.toast-message {
  flex: 1;
}
.toast-close {
  background: transparent;
  border: none;
  padding: 0.25rem;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  color: inherit;
  opacity: 0.6;
  transition:
    background-color 0.15s,
    opacity 0.15s;
  cursor: pointer;
}
.toast-close:hover {
  background: rgba(0, 0, 0, 0.08);
  opacity: 1;
}

/* ─── Confirm modal ──────────────────────────────────────────────────────────*/

.confirm-modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.5rem;
}
.confirm-modal-icon.danger {
  background: #fef2f2;
  color: #ef4444;
}
.confirm-modal-icon.warning {
  background: #fefce8;
  color: #eab308;
}
.confirm-modal-icon.brand {
  background: rgba(122, 61, 118, 0.08);
  color: var(--brand-primary);
}
/* A choice inside the confirm window (e.g. بعذر / بدون عذر): two equal cards. */
.confirm-choice-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.65rem;
}
.confirm-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.9rem 0.75rem;
  border: 1.5px solid #e6dce5;
  border-radius: 14px;
  background: #fff;
  color: var(--bs-body-color);
  font-weight: 800;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}
.confirm-choice i {
  font-size: 1.45rem;
  line-height: 1;
  color: #a395a1;
  transition: color 0.15s ease;
}
.confirm-choice:hover {
  border-color: rgba(122, 61, 118, 0.45);
  background: rgba(122, 61, 118, 0.03);
}
.btn-check:checked + .confirm-choice {
  border-color: var(--brand-primary);
  background: rgba(122, 61, 118, 0.07);
  color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(122, 61, 118, 0.12);
}
.btn-check:checked + .confirm-choice i { color: var(--brand-primary); }
.btn-check:focus-visible + .confirm-choice { outline: 3px solid var(--brand-dark); outline-offset: 2px; }
/* Waiting for a choice: the confirm button keeps its usual soft tint, just faded. */
#miskConfirmOk.btn-brand:disabled {
  background: rgba(122, 61, 118, 0.12);
  border: 1.5px solid rgba(122, 61, 118, 0.3);
  color: var(--brand-primary);
  opacity: 0.45;
}
[data-bs-theme="dark"] .confirm-choice { background: var(--bs-body-bg); border-color: var(--misk-border); }
[data-bs-theme="dark"] .btn-check:checked + .confirm-choice { background: rgba(154, 82, 148, 0.18); border-color: #c48cbf; color: #f0d7ed; box-shadow: 0 0 0 3px rgba(196, 140, 191, 0.18); }
[data-bs-theme="dark"] .btn-check:checked + .confirm-choice i { color: #f0d7ed; }

/* ─── Decorative spinning SVG (background medallion) ────────────────────────*/

/* ─── Smart Session Allocator (Control Panel) ────────────────────────────────*/

/* Live Classrooms: "announce to teachers/students" status chips */
.cp-announce-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(122, 61, 118, 0.1);
  color: var(--brand-primary);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.cp-announce-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: #f3f4f6;
  border: 1px solid rgba(122, 61, 118, 0.12);
  color: #6b7280;
  font-weight: 800;
  font-size: 0.78rem;
  cursor: pointer;
  transition:
    background-color 0.2s,
    border-color 0.2s,
    color 0.2s;
}
.cp-announce-chip:hover {
  border-color: rgba(122, 61, 118, 0.3);
}
.cp-announce-chip.is-on {
  background: rgba(122, 61, 118, 0.1);
  border-color: rgba(122, 61, 118, 0.25);
  color: var(--brand-dark);
}
/* Toggled state applies instantly via JS while the save request is still in
   flight (see cp-assign-live.php) - this just signals "saving" during that gap. */
.cp-announce-chip:has(.form-check-input:disabled) {
  opacity: 0.7;
  cursor: wait;
}
.cp-announce-chip .form-check-input {
  margin: 0;
  width: 2.1em;
  height: 1.15em;
  cursor: pointer;
}
.cp-announce-chip.is-on .form-check-input:checked {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.cp-bento-tile {
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.cp-bento-tile:hover {
  transform: translateY(-3px);
}

.cp-stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
}
.cp-stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}
.cp-stat-value {
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1.1;
  color: var(--brand-dark);
}
.cp-stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #9ca3af;
  margin-top: 0.15rem;
}

/* My Session (student view): own absence tally as small inline pills instead
   of dashboard-style KPI cards - a quick glance, not a stat to dwell on. */
.absence-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}
.absence-pill-excused {
  background: color-mix(in srgb, var(--absence-excused, var(--session-theme, var(--brand-primary))) 12%, transparent);
  color: var(--absence-excused, var(--session-theme, var(--brand-primary)));
}
.absence-pill-unexcused {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  background: color-mix(in srgb, var(--absence-unexcused, #ef4444) 12%, transparent);
  color: var(--absence-unexcused, #ef4444);
}

/* My Session attendance counters: two companion colors of the session theme
   (--absence-excused / --absence-unexcused, worked out in theme_companion_colors()). */
.roster-attendance .stepper {
  background: color-mix(in srgb, var(--absence-excused, var(--brand-primary)) 9%, #fff);
  border-color: color-mix(in srgb, var(--absence-excused, var(--brand-primary)) 35%, #fff);
}
.roster-attendance .stepper .stepper-btn {
  color: var(--absence-excused, var(--brand-primary));
}
.roster-attendance .stepper .stepper-btn:hover:not(:disabled) {
  background: var(--absence-excused, var(--brand-primary));
  color: #fff;
}
.roster-attendance .stepper .stepper-value {
  color: var(--absence-excused, var(--brand-dark));
}
.roster-attendance .stepper.stepper-danger {
  background: color-mix(in srgb, var(--absence-unexcused, #ef4444) 9%, #fff);
  border-color: color-mix(in srgb, var(--absence-unexcused, #ef4444) 35%, #fff);
}
.roster-attendance .stepper.stepper-danger .stepper-btn {
  color: var(--absence-unexcused, #ef4444);
}
.roster-attendance .stepper.stepper-danger .stepper-btn:hover:not(:disabled) {
  background: var(--absence-unexcused, #ef4444);
  color: #fff;
}
.roster-attendance .stepper.stepper-danger .stepper-value {
  color: var(--absence-unexcused, #b91c1c);
}

.cp-split-card {
  padding: 1.1rem 1.25rem;
}
.cp-split-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 900;
  font-size: 0.85rem;
  color: var(--brand-dark);
  margin-bottom: 1rem;
}
.cp-split-bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #eef0f3;
  margin-bottom: 0.85rem;
}
.cp-split-bar-segment {
  height: 100%;
  transition: width 0.3s ease;
}
.cp-split-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--brand-dark);
}
.cp-split-legend .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  margin-inline-end: 0.35rem;
}

/* Timing heatmaps (semester overview): day x slot grid shaded by demand. */
.cp-heatmap-table {
  border-collapse: separate;
  border-spacing: 3px;
  width: 100%;
}
.cp-heatmap-table th {
  font-size: 0.66rem;
  font-weight: 800;
  color: #9ca3af;
  text-align: center;
  padding: 0.3rem 0.4rem;
  white-space: nowrap;
}
.cp-heatmap-table th:first-child {
  text-align: start;
}
.cp-heatmap-row-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--brand-dark);
  white-space: nowrap;
  padding-inline-end: 0.6rem;
}
.cp-heatmap-cell {
  min-width: 46px;
  height: 40px;
  text-align: center;
  vertical-align: middle;
  border-radius: 0.5rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--brand-dark);
  position: relative;
}
.cp-heatmap-cell.is-best {
  outline: 2px solid var(--brand-dark);
  outline-offset: -2px;
}
.cp-heatmap-cell .bi-star-fill {
  font-size: 0.6rem;
  vertical-align: super;
  margin-inline-start: 0.1rem;
}
.cp-heatmap-best-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--brand-dark);
  background: rgba(122, 61, 118, 0.06);
  border-radius: 0.6rem;
  padding: 0.55rem 0.85rem;
  margin-bottom: 0.85rem;
}

.cp-assign-tabs .nav-link {
  border-radius: 0.75rem;
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--brand-dark);
  background: #fff;
  border: 1px solid rgba(122, 61, 118, 0.12);
  white-space: nowrap;
}
.cp-assign-tabs .nav-link.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}
.cp-assign-tabs .nav-link:not(.active):hover {
  background: rgba(122, 61, 118, 0.06);
}
.cp-assign-tabs .badge-tabcount {
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 0.15rem 0.4rem;
  margin-inline-start: 0.25rem;
}

/* Registry tables (Students/Teachers Registry within Smart Allocator) */
.cp-row-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  color: #4338ca;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.72rem;
  flex-shrink: 0;
}

.cp-registry-table thead th {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9ca3af;
  font-weight: 900;
  border-bottom: 1px solid #f1f1f1;
  white-space: nowrap;
}
.cp-registry-table td {
  vertical-align: middle;
}

.badge-level-beginner,
.badge-level-intermediate,
.badge-level-advanced,
.badge-level-unknown {
  font-weight: 800;
  border-radius: 0.75rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.72rem;
  display: inline-block;
  white-space: nowrap;
}
.badge-level-beginner {
  background: #fce7f3;
  color: #be185d;
  border: 1px solid rgba(190, 24, 93, 0.2);
}
.badge-level-intermediate {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid rgba(180, 83, 9, 0.2);
}
.badge-level-advanced {
  background: #d1fae5;
  color: #047857;
  border: 1px solid rgba(4, 120, 87, 0.2);
}
.badge-level-unknown {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid rgba(109, 40, 217, 0.2);
}

.assignment-state-badge {
  background: #fef3c7;
  color: #b45309;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.68rem;
  font-weight: 900;
  white-space: nowrap;
  display: inline-block;
}
.assignment-state-badge.assigned {
  background: #d1fae5;
  color: #047857;
}

.badge-cert-mujazah,
.badge-cert-iqraa,
.badge-cert-preiqraa {
  font-weight: 800;
  border-radius: 0.75rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.72rem;
  display: inline-block;
  white-space: nowrap;
}
.badge-cert-mujazah {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid rgba(109, 40, 217, 0.2);
}
.badge-cert-iqraa {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid rgba(29, 78, 216, 0.2);
}
.badge-cert-preiqraa {
  background: #d7f2f0;
  color: #0f766e;
  border: 1px solid rgba(15, 118, 110, 0.25);
}

.badge-format-person,
.badge-format-online {
  font-weight: 800;
  border-radius: 0.75rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.72rem;
  display: inline-block;
  white-space: nowrap;
}
.badge-format-person {
  background: #d1fae5;
  color: #047857;
  border: 1px solid rgba(4, 120, 87, 0.2);
}
.badge-format-online {
  background: #e8f0fa;
  color: #3f6fb0;
  border: 1px solid rgba(63, 111, 176, 0.22);
}

/* Live Classrooms "Show Details": a student whose registered timings don't
   fit her session's timing(s) gets her whole entry boxed in light red. */
.live-details-on .live-student-block.live-misfit {
  background: #fdecec;
  border: 1px solid #f5c2c2;
  border-radius: 0.5rem;
  padding: 0 0.4rem;
  margin: 0.2rem 0;
}

.cp-time-filter-row select {
  max-width: 260px;
}

/* Info modal (registry "i" button) */
.cp-info-modal .modal-header {
  background: linear-gradient(
    135deg,
    var(--brand-primary),
    var(--brand-accent)
  );
  color: #fff;
  border-bottom: none;
}
.cp-info-modal .modal-header .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}
.cp-info-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.2);
}
.cp-info-section-label {
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--brand-dark);
  border-bottom: 1px solid #f1f1f1;
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}
.cp-info-field-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #9ca3af;
  margin-bottom: 0.15rem;
}
.cp-info-field-value {
  font-weight: 700;
  color: var(--brand-dark);
}
.cp-info-reg-box {
  background: rgba(150, 180, 171, 0.08);
  border: 1px solid rgba(150, 180, 171, 0.25);
  border-radius: 0.75rem;
  padding: 1rem;
}
.cp-info-timings-box {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
}

/* ─── Profile page ───────────────────────────────────────────────────────── */

.profile-avatar-wrap img {
  box-shadow:
    0 0 0 4px #fff,
    0 8px 20px rgba(61, 26, 60, 0.22);
  transition: box-shadow 0.2s;
}

.profile-avatar-wrap .btn-brand {
  box-shadow: 0 3px 10px rgba(122, 61, 118, 0.24);
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.profile-avatar-wrap .btn-brand:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(122, 61, 118, 0.32);
}

.profile-field {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 0.9rem;
  padding: 0.85rem 1rem;
  height: 100%;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    transform 0.15s;
}
.profile-field:hover {
  border-color: rgba(122, 61, 118, 0.18);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}
.profile-field-icon {
  width: 40px;
  height: 40px;
  border-radius: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  /* --session-theme is only defined on my-session.php (set by the teacher's
     chosen session color); everywhere else this falls back to the normal brand color. */
  background: color-mix(in srgb, var(--session-theme, var(--brand-primary)) 8%, transparent);
  color: var(--session-theme, var(--brand-primary));
  font-size: 1.05rem;
}
.profile-field-label {
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9ca3af;
  display: block;
  margin-bottom: 0.1rem;
}
.profile-field-value {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--brand-dark);
}

.profile-section-title {
  font-weight: 900;
  font-size: 0.95rem;
  color: var(--brand-dark);
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.profile-section-title .profile-field-icon {
  width: 32px;
  height: 32px;
  font-size: 0.9rem;
}

.profile-security-box {
  background: var(--brand-neutral);
  border: 1px solid rgba(122, 61, 118, 0.1);
  border-radius: 0.9rem;
  padding: 1.1rem;
}

.profile-quote-box {
  background: rgba(122, 61, 118, 0.03);
  border: 1px solid rgba(122, 61, 118, 0.1);
  border-radius: 0.9rem;
  position: relative;
}
.profile-quote-box i.bi-quote {
  color: rgba(122, 61, 118, 0.25);
  font-size: 1.5rem;
}

/* ─── My Session page ───────────────────────────────────────────────────── */

.field-edit-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-inline-start: auto;
  font-size: 0.8rem;
  transition:
    background 0.15s,
    color 0.15s;
}
.field-edit-btn:hover {
  background: color-mix(in srgb, var(--session-theme, var(--brand-primary)) 8%, transparent);
  color: var(--session-theme, var(--brand-primary));
}

.session-type-badge {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  background: color-mix(in srgb, var(--session-theme, var(--brand-primary)) 10%, transparent);
  color: var(--session-theme, var(--brand-primary));
}

.table-misk tbody tr {
  transition: background-color 0.15s;
}
.table-misk tbody tr:hover {
  background-color: rgba(122, 61, 118, 0.025);
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(122, 61, 118, 0.05);
  border: 1px solid rgba(122, 61, 118, 0.14);
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
}
.stepper.stepper-danger {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.18);
}
.stepper-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-primary);
  cursor: pointer;
  font-size: 0.7rem;
  line-height: 1;
  transition:
    background 0.15s,
    color 0.15s,
    transform 0.1s,
    opacity 0.15s;
}
.stepper-danger .stepper-btn {
  color: #ef4444;
}
.stepper-btn:hover:not(:disabled) {
  background: var(--brand-primary);
  color: #fff;
  transform: scale(1.1);
}
.stepper-danger .stepper-btn:hover:not(:disabled) {
  background: #ef4444;
  color: #fff;
}
.stepper-btn:active:not(:disabled) {
  transform: scale(0.92);
}
.stepper-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.stepper-value {
  min-width: 16px;
  text-align: center;
  font-weight: 900;
  font-size: 0.85rem;
  color: var(--brand-dark);
}
.stepper-danger .stepper-value {
  color: #b91c1c;
}

.classmate-row {
  transition:
    background-color 0.15s,
    transform 0.15s;
  border-radius: 0.75rem;
}
.classmate-row:hover {
  background-color: rgba(122, 61, 118, 0.025);
  transform: translateX(2px);
}
[dir="rtl"] .classmate-row:hover {
  transform: translateX(-2px);
}

/* ─── My Session: teacher's student list ─────────────────────────────────── */

.roster-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.roster-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  background: #fff;
  border: 1px solid rgba(122, 61, 118, 0.3);
  border: 1px solid color-mix(in srgb, var(--session-theme, var(--brand-primary)) 40%, #fff);
  transition:
    box-shadow 0.2s,
    border-color 0.2s,
    transform 0.2s;
}
.roster-row:hover {
  border-color: color-mix(in srgb, var(--session-theme, var(--brand-primary)) 80%, #000);
  box-shadow: 0 6px 18px rgba(61, 26, 60, 0.08);
  transform: translateY(-1px);
}
.roster-no {
  width: 26px;
  flex-shrink: 0;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 900;
  color: color-mix(in srgb, var(--session-theme, var(--brand-primary)) 70%, #9ca3af);
}
.roster-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #fff;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--session-theme, var(--brand-primary)) 75%, #000);
}
/* Same shape as the default profile picture (profile.php), tinted with the session's theme color. */
.roster-avatar.avatar-fallback {
  font-size: 1.45rem;
  color: var(--session-theme, var(--brand-primary));
  background: color-mix(in srgb, var(--session-theme, var(--brand-primary)) 14%, #fff);
}
/* Classmates list (student view) follows the theme too. */
.classmate-row .avatar-fallback {
  color: var(--session-theme, var(--brand-primary));
  background: color-mix(in srgb, var(--session-theme, var(--brand-primary)) 14%, #fff);
}
.roster-info {
  flex: 1;
  min-width: 0;
}
.roster-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-weight: 900;
  color: var(--brand-dark);
  margin-bottom: 0.25rem;
}
.roster-grad-badge {
  font-size: 0.68rem;
  font-weight: 800;
  color: #78350f;
  background: #fef3c7;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
}
.roster-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #6b7280;
}
.roster-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.roster-meta i {
  color: var(--session-theme, var(--brand-primary));
  opacity: 0.8;
}
.roster-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}
@media (min-width: 768px) {
  /* Buttons at the very end of the row (far left in Arabic), after the attendance counters. */
  .roster-row .roster-attendance {
    order: 4;
    border-inline-start: 0;
    padding-inline-start: 0;
  }
  .roster-row .roster-actions {
    order: 5;
    padding-inline-start: 0.85rem;
    border-inline-start: 1px solid rgba(122, 61, 118, 0.1);
  }
}
.roster-action {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--session-theme, var(--brand-primary));
  background: color-mix(in srgb, var(--session-theme, var(--brand-primary)) 9%, #fff);
  transition:
    background 0.15s,
    color 0.15s,
    transform 0.15s;
}
.roster-action:hover {
  color: #fff;
  background: var(--session-theme, var(--brand-primary));
  transform: scale(1.08);
}
.roster-action-wa {
  color: #128c7e;
  background: #e7f8ef;
}
.roster-action-wa:hover {
  background: #25d366;
}
.roster-attendance {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
  padding-inline-start: 0.85rem;
  border-inline-start: 1px solid rgba(122, 61, 118, 0.1);
}
/* A past semester's session (my-session.php): attendance + results as read-only values. */
.roster-past {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  flex-basis: 100%;
  padding-top: 0.5rem;
  margin-top: 0.25rem;
  border-top: 1px dashed rgba(122, 61, 118, 0.15);
  font-size: 0.8rem;
}
.roster-past small {
  color: #6b7280;
  font-weight: 700;
  margin-inline-end: 0.2rem;
}
.roster-past b {
  font-weight: 900;
}
[data-bs-theme="dark"] .roster-past { border-top-color: var(--misk-border); }
[data-bs-theme="dark"] .roster-past small { color: var(--bs-secondary-color); }
.roster-att-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.roster-att-item small {
  font-size: 0.68rem;
  font-weight: 700;
  color: #6b7280;
}
/* Counters grouped in boxes: "Absences" (excused + unexcused) and "Late/early leave". */
.att-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.2rem 0.45rem 0.25rem;
  border: 1px solid rgba(122, 61, 118, 0.1);
  border-radius: 10px;
  background: rgba(122, 61, 118, 0.02);
}
.att-group-title {
  font-size: 0.68rem;
  font-weight: 800;
  color: #4b5563;
  line-height: 1.2;
  text-align: center;
}
.att-group-items {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0.45rem;
}
.att-group .roster-att-item {
  gap: 0.1rem;
}
.roster-att-item small.att-sub {
  font-size: 0.58rem;
  font-weight: 600;
  color: #9ca3af;
  line-height: 1.1;
}
.att-group-late {
  border-color: rgba(217, 119, 6, 0.22);
  background: rgba(217, 119, 6, 0.035);
}
[data-bs-theme="dark"] .att-group {
  border-color: var(--misk-border);
  background: rgba(255, 255, 255, 0.02);
}
[data-bs-theme="dark"] .att-group-title {
  color: var(--bs-body-color);
}
@media (max-width: 767.98px) {
  .roster-row {
    flex-wrap: wrap;
  }
  .roster-info {
    flex-basis: calc(100% - 130px);
  }
  .roster-actions {
    order: 5;
  }
  .roster-attendance {
    order: 6;
    margin-inline-start: auto;
    border-inline-start: 0;
    padding-inline-start: 0;
  }
}
@media (max-width: 575.98px) {
  .roster-no {
    display: none;
  }
  .roster-actions {
    width: 100%;
    justify-content: center;
    padding-top: 0.55rem;
    border-top: 1px dashed rgba(122, 61, 118, 0.15);
  }
  .roster-attendance {
    width: 100%;
    justify-content: space-around;
    margin-inline-start: 0;
    /* Three counters (excused, unexcused, late) must fit inside the student's box. */
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .att-group {
    flex: 2 1 0;
    min-width: 0;
    padding-inline: 0.25rem;
  }
  .att-group-late {
    flex: 1 1 0;
  }
  .att-group-items {
    align-self: stretch;
    gap: 0.25rem;
  }
  .roster-att-item {
    flex: 1 1 0;
    min-width: 0;
  }
  .roster-attendance .stepper {
    gap: 0.2rem;
    padding: 0.2rem 0.25rem;
    max-width: 100%;
  }
  .roster-attendance .stepper .stepper-btn {
    width: 20px;
    height: 20px;
  }
  .roster-attendance .stepper .stepper-value {
    min-width: 14px;
  }
  .roster-att-item small {
    font-size: 0.64rem;
    text-align: center;
    line-height: 1.2;
  }
}
/* Very small phones: the late title may wrap - keep both group titles the same height. */
@media (max-width: 374.98px) {
  .att-group-title {
    min-height: 2.6em;
    display: flex;
    align-items: flex-end;
    justify-content: center;
  }
  .roster-attendance {
    gap: 0.25rem;
  }
  .roster-attendance .stepper {
    gap: 0.1rem;
    padding: 0.15rem;
  }
  .roster-attendance .stepper .stepper-btn {
    width: 18px;
    height: 18px;
  }
  .roster-attendance .stepper .stepper-value {
    min-width: 12px;
    font-size: 0.78rem;
  }
}

/* ─── My Session: theme modal presets ────────────────────────────────────── */

.theme-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.theme-swatch {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s, box-shadow 0.15s;
}
.theme-swatch:hover {
  transform: scale(1.1);
}
.theme-swatch.is-active {
  box-shadow: 0 0 0 2px var(--brand-dark);
}
.theme-swatch-custom {
  display: flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(#ef4444, #f59e0b, #10b981, #3b82f6, #8b5cf6, #ef4444);
  color: #fff;
  overflow: hidden;
  margin: 0;
}
.theme-swatch-custom i {
  font-size: 0.85rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.theme-swatch-custom input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.theme-covers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
  padding: 2px;
}
@media (max-width: 575.98px) {
  .theme-covers {
    grid-template-columns: repeat(3, 1fr);
  }
}
.theme-cover {
  position: relative;
  height: 58px;
  border-radius: 0.6rem;
  border: 2px solid transparent;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s, border-color 0.15s;
}
.theme-cover:hover {
  transform: scale(1.03);
}
.theme-cover i {
  position: absolute;
  top: 4px;
  inset-inline-end: 6px;
  color: #fff;
  font-size: 1rem;
  display: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
/* "Default" cover tile: a tiny version of the plain cover (theme tint + flowers). */
.theme-cover-default {
  overflow: hidden;
  background: color-mix(in srgb, var(--session-theme, var(--brand-primary)) 10%, #fff);
  border-color: rgba(122, 61, 118, 0.14);
}
.theme-cover-default .welcome-flower-1 {
  top: -14px;
  inset-inline-end: -14px;
  width: 58px;
  height: 58px;
  opacity: 0.45;
}
.theme-cover-default .welcome-flower-2 {
  bottom: -16px;
  inset-inline-start: -8px;
  width: 38px;
  height: 38px;
  opacity: 0.4;
}
.theme-cover-default i {
  color: var(--session-theme, var(--brand-primary));
  text-shadow: none;
}
.theme-cover-default .welcome-butterfly {
  top: 30%;
  inset-inline-start: 42%;
  width: 18px;
  height: 18px;
}
.theme-cover-caption {
  position: absolute;
  bottom: 3px;
  inset-inline-start: 6px;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0 0.35rem;
  border-radius: 999px;
  color: var(--brand-dark);
  background: rgba(255, 255, 255, 0.85);
}
.theme-cover input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.theme-cover:has(input:checked) {
  border-color: var(--brand-dark);
  box-shadow: 0 0 0 2px #fff inset;
}
.theme-cover:has(input:checked) i {
  display: block;
}
.theme-cover:has(input:focus-visible) {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* ─── Control panel polish ───────────────────────────────────────────────── */

.cp-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}
.cp-page-header h1,
.cp-page-header h2 {
  margin-bottom: 0.2rem;
}
.cp-page-header-sub {
  color: #9ca3af;
  font-weight: 600;
  font-size: 0.85rem;
  margin: 0;
}

/* Control panel's top-level dashboard title - a notch more prominent than
   the per-section .cp-page-header headings below it. */
.cp-main-title {
  font-weight: 900;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  color: var(--brand-dark);
  margin: 0 0 0.3rem;
}
.cp-main-subtitle {
  color: #6b7280;
  font-weight: 700;
  font-size: 0.92rem;
  margin: 0;
}

/* Per-section page titles (Students/Teachers list, Smart Allocator, etc.)
   read a size too large now that .fw-black actually applies its 900 weight -
   trim Bootstrap's fs-4/fs-2 utility back down a notch within this context. */
.cp-page-header h1 {
  font-size: 1.6rem !important;
}
.cp-page-header h2 {
  font-size: 1.3rem !important;
}

.cp-empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
}
.cp-empty-state .cp-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(122, 61, 118, 0.06);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  margin: 0 auto 1.1rem;
}
.cp-empty-state p {
  color: #9ca3af;
  font-weight: 700;
  margin: 0;
}

.cp-tile-action {
  border: none;
  border-radius: 0.75rem;
  font-weight: 900;
  font-size: 0.85rem;
  padding: 0.55rem 1rem;
  transition:
    transform 0.15s,
    box-shadow 0.15s,
    background-color 0.15s;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}
.cp-tile-action:hover {
  transform: translateY(-2px);
  color: #fff;
}
.cp-tile-action-purple {
  background: var(--brand-primary);
  color: #fff;
}
.cp-tile-action-purple:hover {
  background: var(--brand-dark);
}
.cp-tile-action-amber {
  background: #f59e0b;
  color: #fff;
}
.cp-tile-action-amber:hover {
  background: #b45309;
}
.cp-tile-action-green {
  background: #10b981;
  color: #fff;
}
.cp-tile-action-green:hover {
  background: #047857;
}
.cp-tile-badge {
  background: rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  font-size: 0.68rem;
  margin-inline-start: 0.35rem;
}

/* Control panel home: current semester card, "needs attention" chips, grouped tiles.
   Each tile sets its accent with --tile; its icon and buttons are tinted from it. */
/* A small leaf sprig, used as a mask so it takes any colour (background: the colour). */
:root {
  --misk-leaf: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 48'%3E%3Cpath d='M20 48V6' stroke='%23000' stroke-width='1.6' fill='none'/%3E%3Cpath d='M20 20C10 18 6 10 8 2c8 2 13 9 12 18zM20 30c10-2 15-10 13-19-8 2-13 10-13 19zM20 41c-9-1-14-8-14-16 8 1 14 7 14 16z'/%3E%3C/svg%3E");
}

/* Home banner: the title and a desk drawing at the far end, straight on the page - no box. */
.cp-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 140px;
}
.cp-hero .cp-main-title { font-size: 2rem; margin: 0; position: relative; }
.cp-hero-art {
  width: 220px;
  height: 140px;
  flex-shrink: 0;
  align-self: flex-end;
}

/* The semester card and this week's workplan, grouped (no outer box). */
.cp-home-panel { padding: 0; }

/* A white card: the semester at the start, the buttons at the end. */
.cp-current-sem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 1.1rem;
  background: #fff;
  border: 1px solid rgba(122, 61, 118, 0.1);
}
.cp-current-sem-main {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}
.cp-current-sem-info {
  min-width: 0;
}
.cp-current-sem-info .cp-current-sem-label {
  display: block;
}
.cp-current-sem-icon {
  width: 52px;
  height: 52px;
  border-radius: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.35rem;
  /* Flat soft tint, like the page's other icons and buttons (no gradient / shadow). */
  color: var(--brand-primary);
  background: rgba(122, 61, 118, 0.1);
  border: 1px solid rgba(122, 61, 118, 0.14);
}
.cp-current-sem-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #6b7280;
}
.cp-current-sem-title {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--brand-dark);
  line-height: 1.3;
}
.cp-current-sem-actions { padding-inline-end: 0.6rem; }
.cp-current-sem-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
}
.cp-current-sem-actions .cp-soft-btn { white-space: nowrap; }

.cp-attention {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.cp-attention-label {
  font-size: 0.8rem;
  font-weight: 800;
  color: #6b7280;
}
.cp-attention-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--brand-dark);
  background: rgba(122, 61, 118, 0.07);
  border: 1px solid rgba(122, 61, 118, 0.15);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  transition: background 0.15s;
}
a.cp-attention-chip:hover {
  background: rgba(122, 61, 118, 0.14);
  color: var(--brand-dark);
}
.cp-attention-chip b {
  font-weight: 900;
  color: var(--brand-primary);
}
.cp-attention-chip.is-warn {
  color: #92400e;
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
}

/* Group heading with a faint rule running on after it. */
.cp-group-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem !important;
  font-weight: 800;
  color: #6b7280;
  margin: 0 0 0.85rem;
}
.cp-group-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(122, 61, 118, 0.14);
}
/* Tile: coloured top edge, round icon above the title, a leaf in the corner. */
.cp-tile {
  --tile: var(--brand-primary);
  position: relative;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0.85rem 0.95rem;
  border-radius: 1rem;
  border-top: 3px solid var(--tile) !important;
}
.cp-tile::after {
  content: "";
  position: absolute;
  inset-inline-end: 8px;
  bottom: 4px;
  width: 24px;
  height: 30px;
  background: var(--tile);
  opacity: 0.18;
  -webkit-mask: var(--misk-leaf) center / contain no-repeat;
  mask: var(--misk-leaf) center / contain no-repeat;
  pointer-events: none;
}
.cp-tile > * { position: relative; z-index: 1; }
/* Icon beside the title, to keep the tiles short. */
.cp-tile-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.4rem;
}
.cp-tile-head h3 {
  font-size: 0.9rem;
  font-weight: 900;
  margin: 0;
}
.cp-tile-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
  color: var(--tile);
  background: color-mix(in srgb, var(--tile) 11%, transparent);
}
.cp-tile p {
  color: #6b7280;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.55;
  margin-bottom: 0.6rem;
}
.cp-tile-links > .cp-soft-btn { font-size: 0.74rem; padding: 0.3rem 0.6rem; }
.cp-tile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}
/* The tile's buttons share its full width - no empty space beside them. */
.cp-tile-links > .cp-soft-btn {
  flex: 1 1 0;
  justify-content: center;
  text-align: center;
}
/* Soft button: tinted from --tile (the tile's accent) or the brand colour. */
.cp-soft-btn {
  --tile-c: var(--tile, var(--brand-primary));
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--tile-c);
  background: color-mix(in srgb, var(--tile-c) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--tile-c) 22%, transparent);
  border-radius: 0.65rem;
  padding: 0.4rem 0.8rem;
  transition: background 0.15s, color 0.15s;
}
.cp-soft-btn:hover {
  color: #fff;
  background: var(--tile-c);
}
.cp-soft-btn-solid {
  color: #fff;
  background: var(--tile-c);
}
.cp-soft-btn-solid:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}
.cp-soft-badge {
  font-size: 0.68rem;
  font-weight: 900;
  color: #fff;
  background: var(--tile-c);
  border-radius: 999px;
  padding: 0.02rem 0.45rem;
}
.cp-soft-btn:hover .cp-soft-badge {
  color: var(--tile-c);
  background: #fff;
}
@media (max-width: 575.98px) {
  /* Phones: still one line - icon, name, buttons (left in Arabic) - all a little smaller. */
  .cp-hero { min-height: 0; }
  .cp-hero .cp-main-title { font-size: 1.35rem; }
  .cp-hero-art { width: 110px; height: 70px; }
  .cp-current-sem { gap: 0.5rem; padding: 0.6rem 0.65rem; }
  .cp-current-sem-main { flex: 1; gap: 0.6rem; }
  .cp-current-sem-actions { padding-inline-end: 0.2rem; }
  .cp-current-sem-info { text-align: start; min-width: 0; }
  .cp-current-sem-icon { width: 38px; height: 38px; font-size: 1.05rem; }
  .cp-current-sem-title { font-size: 0.95rem; }
  .cp-current-sem-actions { flex-wrap: nowrap; gap: 0.3rem; }
  .cp-current-sem-actions .cp-soft-btn { font-size: 0.72rem; padding: 0.32rem 0.55rem; gap: 0.25rem; white-space: nowrap; }
  .cp-current-sem-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
/* The smallest phones: no calendar box and no icons in the buttons, so the line still fits. */
@media (max-width: 419.98px) {
  .cp-current-sem-icon,
  .cp-current-sem-actions .cp-soft-btn i { display: none; }
}
[data-bs-theme="dark"] .cp-current-sem { background: var(--bs-body-bg); border-color: var(--misk-border); }
[data-bs-theme="dark"] .cp-current-sem-icon { background: rgba(196, 140, 191, 0.14); border-color: rgba(196, 140, 191, 0.25); color: #e9c9e5; }
[data-bs-theme="dark"] .cp-group-label { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .cp-group-label::after { background: var(--misk-border); }
[data-bs-theme="dark"] .cp-current-sem-title,
[data-bs-theme="dark"] .cp-attention-chip {
  color: var(--bs-body-color);
}
[data-bs-theme="dark"] .cp-tile p,
[data-bs-theme="dark"] .cp-current-sem-label,
[data-bs-theme="dark"] .cp-attention-label {
  color: var(--bs-secondary-color);
}
[data-bs-theme="dark"] .cp-attention-chip.is-warn {
  color: #fcd34d;
}

/* Header «الإعلانات» button (beside dark mode): a small dot when there's an announcement she hasn't opened yet. */
.ann-btn {
  position: relative;
}
.ann-dot {
  position: absolute;
  top: -3px;
  inset-inline-end: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e11d48;
  box-shadow: 0 0 0 2px var(--brand-neutral);
}

/* ─── Homepage «رحلة النجوم» (includes/home-plan.php, curriculum_sky_svg()) ───
   Three cards, then the level's weeks as a constellation on a soft lilac sky: lit pink stars
   behind, this week a plum planet, exams ringed planets, projects diamonds. Tints are the
   --tint-* variables (dark versions in the dark theme); the layout flips in English. */
.home-plan .hp-lvl-beginner,
.hp-level-tab.hp-lvl-beginner { --lvl: var(--tint-lilac); --lvl-border: var(--tint-lilac-border); }
.home-plan .hp-lvl-intermediate,
.hp-level-tab.hp-lvl-intermediate { --lvl: var(--tint-blush); --lvl-border: var(--tint-blush-border); }
.home-plan .hp-lvl-advanced,
.hp-level-tab.hp-lvl-advanced { --lvl: var(--tint-teal); --lvl-border: var(--tint-teal-border); }
.hp-level-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.hp-level-tab {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--brand-primary);
  background: var(--lvl);
  border: 1px solid var(--lvl-border);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
}
.hp-level-tab.is-active {
  box-shadow: 0 0 0 2px var(--brand-primary);
}
.hp-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-soft);
}
/* The three cards. */
.hp-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.hp-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border-radius: 1.25rem;
}
.hp-card-icon {
  width: 46px;
  height: 46px;
  border-radius: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.15rem;
}
.hp-card-icon.is-green { color: #15803d; background: rgba(22, 163, 74, 0.1); }
.hp-card-icon.is-lilac { color: var(--brand-primary); background: var(--tint-lilac); }
.hp-card-icon.is-rose { color: var(--tint-rose-text); background: var(--tint-rose); }
.hp-card-value {
  font-size: 1rem;
  font-weight: 900;
  color: var(--brand-dark);
  line-height: 1.45;
  margin-top: 0.1rem;
}
/* ─── Homepage «مواعيد الحلقات» (includes/home-calendar.php, assets/js/home-calendar.js) ───
   Dressed like «خطة الفصل» below it: the same head and count pill, the days on the same lilac
   sky with star dust, today a glowing plum star, recitation sessions in the lit-star pink,
   theory sessions in the diamond lilac with that week's lesson. Week view, or the whole month. */
.hcal {
  padding: 1.4rem 1.5rem 1.3rem;
  border-radius: 1.5rem;
}
.hcal-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}
.hcal-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; }
.hcal-title { font-size: 1.6rem; font-weight: 900; color: var(--brand-dark); margin: 0; }
.hcal-range { font-size: 0.85rem; font-weight: 600; color: var(--text-soft); }
.hcal-count {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--brand-primary);
  background: var(--tint-lilac);
  border-radius: 999px;
  padding: 0.4rem 1rem;
}
.hcal-count i { color: #e98aa6; margin-inline-end: 0.2rem; }

/* The sky panel, with faint star dust. */
.hcal-sky {
  border-radius: 1.25rem;
  padding: 0.85rem;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 1px, transparent 1.7px) 0 0 / 53px 47px,
    radial-gradient(circle, rgba(255, 255, 255, 0.7) 0.8px, transparent 1.5px) 21px 29px / 71px 61px,
    radial-gradient(ellipse 50% 70% at 50% 40%, rgba(255, 255, 255, 0.35), transparent 70%),
    linear-gradient(180deg, #e6d6ef, #eadcf0);
}
.hcal-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.hcal-nav { display: flex; align-items: center; gap: 0.25rem; }
.hcal-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.7);
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.hcal-icon-btn:hover { background: #fff; }
.hcal-today-btn {
  height: 34px;
  padding: 0 1rem;
  border-radius: 999px;
  border: 0;
  background: var(--brand-primary);
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
}
.hcal-today-btn:hover { filter: brightness(1.1); }
.hcal-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
}
.hcal-switch button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 0.3rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 800;
  color: #5e4a63;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.hcal-switch button.is-active { background: #fff; color: var(--brand-dark); box-shadow: 0 2px 6px -2px rgba(92, 40, 88, 0.3); }

.hcal-weekdays,
.hcal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.5rem;
}
.hcal-weekdays { margin-bottom: 0.45rem; }
.hcal-weekdays span {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #5e4a63;
}
.hcal-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  min-height: 120px;
  padding: 0.5rem;
  border-radius: 1rem;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.42);
  text-align: start;
  color: var(--brand-dark);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.hcal[data-view="month"] .hcal-day { min-height: 88px; }
.hcal-day:hover { background: rgba(255, 255, 255, 0.7); }
.hcal-day.has-session { background: rgba(255, 255, 255, 0.78); border-color: #fff; }
.hcal-day.is-picked { border-color: var(--brand-primary); background: #fff; box-shadow: 0 8px 20px -12px rgba(92, 40, 88, 0.55); }
.hcal-day.is-past:not(.is-picked) { background: rgba(255, 255, 255, 0.25); }
.hcal-day.is-past .hcal-num,
.hcal-day.is-past .hcal-items { opacity: 0.55; }
.hcal-day.is-other { opacity: 0.35; }
.hcal-day-top { display: flex; align-items: center; justify-content: space-between; gap: 0.25rem; }
.hcal-day.is-today .hcal-day-top { padding: 5px 5px 0; } /* room for the star */
.hcal-num {
  position: relative;
  z-index: 0;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 900;
  color: #5e4a63;
}
/* Today: a plum star, glowing like «هذا الأسبوع» in the sky. */
.hcal-day.is-today .hcal-num {
  color: #fff;
  opacity: 1;
  font-size: 0.85rem;
  filter: drop-shadow(0 0 6px rgba(233, 138, 166, 0.85)) drop-shadow(0 0 14px rgba(233, 138, 166, 0.4));
}
.hcal-day.is-today .hcal-num::before {
  content: "";
  position: absolute;
  inset: -9px;
  z-index: -1;
  background: var(--brand-primary);
  clip-path: polygon(50% 0%, 61.5% 34.5%, 98% 35%, 68.5% 57%, 79.5% 91%, 50% 70%, 20.5% 91%, 31.5% 57%, 2% 35%, 38.5% 34.5%);
}
.hcal-today-tag {
  font-size: 0.66rem;
  font-weight: 800;
  color: #fff;
  background: var(--brand-primary);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}
.hcal-items { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
/* Session pills, in the sky's colours. */
.hcal-chip {
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.35;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hcal-chip::before { font-family: "bootstrap-icons"; font-weight: normal; margin-inline-end: 0.3rem; font-size: 0.9em; vertical-align: -0.1em; }
/* Week view has room: a lesson name may take two lines. */
.hcal[data-view="week"] .hcal-chip {
  white-space: normal;
  border-radius: 0.8rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.hcal-chip.is-recite { color: #9c2149; background: #fde4ea; border-color: #f6c9d3; }
.hcal-chip.is-recite::before { content: "\F586"; color: #e98aa6; } /* bi-star-fill */
.hcal-chip.is-theory { color: #3d1a3c; background: #f3ecfa; border-color: #d9c6ea; }
.hcal-chip.is-theory::before { content: "\F194"; color: #8a63b8; } /* bi-book */
.hcal-more { font-size: 0.7rem; font-weight: 800; color: #5e4a63; padding-inline-start: 0.3rem; }
.hcal-dots { display: none; gap: 3px; justify-content: center; }
.hcal-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.hcal-dot.is-session { background: #e98aa6; box-shadow: 0 0 5px rgba(233, 138, 166, 0.8); }

/* The tapped day's details, like the picked week's lessons under the sky. */
.hcal-detail {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 1.1rem;
  background: var(--tint-lilac);
  border: 1px solid var(--tint-lilac-border);
}
.hcal-detail-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.65rem; }
.hcal-detail-title { font-size: 1.02rem; font-weight: 900; color: var(--brand-dark); display: flex; align-items: center; gap: 0.6rem; }
.hcal-detail-week { font-size: 0.75rem; font-weight: 800; color: #fff; background: var(--brand-primary); border-radius: 999px; padding: 0.12rem 0.65rem; }
.hcal-empty { margin: 0; font-size: 0.88rem; font-weight: 600; color: var(--text-soft); }
.hcal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.hcal-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 0.85rem;
  border-radius: 0.9rem;
  background: #fff;
}
.hcal-row::before {
  font-family: "bootstrap-icons";
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}
.hcal-row.is-recite::before { content: "\F586"; color: #e98aa6; background: #fde4ea; }
.hcal-row.is-theory::before { content: "\F194"; color: #8a63b8; background: #f3ecfa; }
.hcal-row-time { flex-shrink: 0; order: 2; margin-inline-start: auto; font-size: 0.8rem; font-weight: 800; color: var(--text-soft); }
.hcal-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hcal-row-body strong { font-size: 0.92rem; font-weight: 900; color: var(--brand-dark); }
/* «الحلقة النظرية»: that week's lesson under the session, linked to its page. */
.hcal-row-lessons {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 1.1rem;
  margin-top: 0.3rem;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--brand-dark);
}
.hcal-row-lessons .bi { display: none; }
.hcal-row-lessons .hp-lesson-link { text-underline-offset: 4px; }

/* Dark theme: the deep night sky of the plan. */
[data-bs-theme="dark"] .hcal-sky {
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.45) 1px, transparent 1.7px) 0 0 / 53px 47px,
    radial-gradient(circle, rgba(255, 255, 255, 0.3) 0.8px, transparent 1.5px) 21px 29px / 71px 61px,
    radial-gradient(ellipse 50% 70% at 50% 40%, rgba(192, 126, 187, 0.12), transparent 70%),
    #1d1424;
}
[data-bs-theme="dark"] .hcal-day { background: rgba(255, 255, 255, 0.03); border-color: rgba(255, 255, 255, 0.06); color: #f3e8f5; }
[data-bs-theme="dark"] .hcal-day.has-session { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.12); }
[data-bs-theme="dark"] .hcal-day.is-past:not(.is-picked) { background: rgba(255, 255, 255, 0.015); }
[data-bs-theme="dark"] .hcal-day.is-picked { background: #2a1f2c; border-color: var(--brand-primary); }
[data-bs-theme="dark"] .hcal-num,
[data-bs-theme="dark"] .hcal-weekdays span,
[data-bs-theme="dark"] .hcal-more,
[data-bs-theme="dark"] .hcal-switch button { color: #d9c8dd; }
[data-bs-theme="dark"] .hcal-day.is-today .hcal-num { color: #fff; }
[data-bs-theme="dark"] .hcal-icon-btn,
[data-bs-theme="dark"] .hcal-switch { background: rgba(255, 255, 255, 0.08); }
[data-bs-theme="dark"] .hcal-switch button.is-active { background: #2a1f2c; color: #f3e8f5; }
[data-bs-theme="dark"] .hcal-chip.is-recite { color: #f8b4c4; background: #4a1f2c; border-color: #6b2d40; }
[data-bs-theme="dark"] .hcal-chip.is-theory { color: #e4d3f5; background: #33244a; border-color: #4b3768; }
[data-bs-theme="dark"] .hcal-row { background: #1d1424; }
[data-bs-theme="dark"] .hcal-row.is-recite::before { background: #4a1f2c; }
[data-bs-theme="dark"] .hcal-row.is-theory::before { background: #33244a; }
[data-bs-theme="dark"] .hcal-title,
[data-bs-theme="dark"] .hcal-detail-title,
[data-bs-theme="dark"] .hcal-row-body strong,
[data-bs-theme="dark"] .hcal-row-lessons { color: #f3e8f5; }

@media (max-width: 767.98px) {
  .hcal { padding: 1rem 0.85rem; }
  .hcal-title { font-size: 1.25rem; }
  .hcal-count { font-size: 0.8rem; padding: 0.3rem 0.8rem; }
  .hcal-sky { padding: 0.6rem 0.45rem; }
  .hcal-weekdays, .hcal-grid { gap: 0.25rem; }
  .hcal-weekdays span { font-size: 0.68rem; }
  .hcal-day, .hcal[data-view="month"] .hcal-day { min-height: 60px; padding: 0.4rem 0.15rem; align-items: center; justify-content: center; border-radius: 0.75rem; }
  .hcal-day-top { justify-content: center; }
  .hcal-today-tag, .hcal-items { display: none; }
  .hcal-dots { display: flex; }
  .hcal-num { width: 26px; height: 26px; font-size: 0.85rem; }
  .hcal-day.is-today .hcal-num { font-size: 0.75rem; }
  .hcal-day.is-today .hcal-num::before { inset: -7px; }
  .hcal-detail { padding: 0.85rem 0.9rem; }
}
/* The journey card. */
.hp-journey {
  padding: 1.4rem 1.5rem 1.3rem;
  border-radius: 1.5rem;
}
.hp-journey-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}
.hp-journey-head > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
}
.hp-journey-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--brand-dark);
  margin: 0;
}
.hp-journey-sub {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
}
.hp-journey-count {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--brand-primary);
  background: var(--tint-lilac);
  border-radius: 999px;
  padding: 0.4rem 1rem;
}
.hp-journey-count i {
  color: #e98aa6;
  margin-inline-end: 0.2rem;
}
.hp-sky {
  border-radius: 1.25rem;
  background:
    radial-gradient(ellipse 50% 70% at 50% 40%, rgba(255, 255, 255, 0.35), transparent 70%),
    linear-gradient(180deg, #e6d6ef, #eadcf0);
  padding: 0.5rem;
}
.sky-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  font-family: inherit;
}
.hp-sky-tall { display: none; }
@media (max-width: 767.98px) {
  .hp-sky-wide { display: none; }
  .hp-sky-tall { display: block; }
  .hp-journey { padding: 1rem 0.85rem; }
  .hp-journey-title { font-size: 1.25rem; }
  .hp-journey-count { font-size: 0.8rem; padding: 0.3rem 0.8rem; }
  .hp-cards { gap: 0.6rem; margin-top: 0.9rem; }
  .hp-card { padding: 0.7rem 0.85rem; gap: 0.7rem; }
  .hp-card-icon { width: 38px; height: 38px; font-size: 1rem; }
  .hp-card-value { font-size: 0.92rem; }
  .hp-legend { gap: 0.35rem 1rem; font-size: 0.78rem; margin: 0.8rem 0; }
  .hp-sky-detail { padding: 0.75rem 0.9rem; }
  .hp-sky-detail-items { font-size: 0.95rem; }
}
.sky-dust { fill: #fff; opacity: 0.85; }
.sky-line { stroke: #cdb8d8; stroke-width: 2.2; stroke-dasharray: 3 6; stroke-linecap: round; }
.sky-line-lit { stroke: #e98aa6; stroke-width: 2.4; stroke-linecap: round; }
.sky-node { cursor: pointer; outline: none; }
.sky-star { fill: #fff; stroke: #cdb8d8; stroke-width: 2; stroke-linejoin: round; transition: transform 0.2s; transform-box: fill-box; transform-origin: center; }
.sky-node.is-past .sky-star { fill: #fbd3df; stroke: #e98aa6; }
/* A finished week's star (or planet / diamond) glows - a fixed glow, not animated: animating a
   filter repaints every past star on every frame for as long as the page stays open. */
.sky-node.is-past .sky-star,
.sky-node.is-past .sky-planet,
.sky-node.is-past .sky-diamond {
  filter: drop-shadow(0 0 5px rgba(233, 138, 166, 0.75)) drop-shadow(0 0 12px rgba(233, 138, 166, 0.35));
}
.sky-num { text-anchor: middle; font-size: 16px; font-weight: 800; fill: #5e4a63; }
.sky-node.is-past .sky-num { fill: #3d1a3c; }
.sky-planet { fill: #fff; stroke: #e98aa6; stroke-width: 2.4; }
.sky-node.is-past .sky-planet { fill: #fbd3df; }
.sky-ring { fill: none; stroke: #f0a9bd; stroke-width: 3.5; }
.sky-diamond { fill: #fff; stroke: #b79ad6; stroke-width: 2.2; }
.sky-node.is-past .sky-diamond { fill: #eadff5; }
/* This week: its own shape (star / diamond / ringed planet for an exam), in plum with a soft glow. */
/* Pulses three times on load (5 alternating halves, ending bright), then rests - no endless repaint. */
.sky-glow { fill: rgba(233, 138, 166, 0.22); filter: blur(10px); animation: sky-glow 1.6s ease-in-out 5 alternate forwards; transform-box: fill-box; transform-origin: center; }
.sky-planet-now { fill: var(--brand-primary); stroke: #fff; stroke-width: 4; stroke-linejoin: round; }
/* Phones draw this week at half size, where the soft glow above all but vanishes - a stronger, tighter one. */
.hp-sky-tall .sky-glow { fill: rgba(233, 138, 166, 0.5); filter: blur(5px); }
.hp-sky-tall .sky-planet-now { filter: drop-shadow(0 0 6px rgba(233, 138, 166, 0.9)); }
.sky-ring-now { fill: none; stroke: #c9a6d6; stroke-width: 6; stroke-linecap: round; }
.sky-num-now { text-anchor: middle; font-size: 28px; font-weight: 900; fill: #fff; }
.sky-tag { fill: var(--brand-primary); }
.sky-tag-text { text-anchor: middle; font-size: 15px; font-weight: 800; fill: #fff; }
.sky-pill { stroke-width: 1; }
.sky-pill-exam { fill: #fde4ea; stroke: #f6c9d3; }
.sky-pill-project { fill: #fff; stroke: #eadff2; }
.sky-pill-text { text-anchor: middle; font-size: 14.5px; font-weight: 800; }
.sky-pill-text-exam { fill: #b4234a; }
.sky-pill-text-project { fill: #3d1a3c; }
/* Hover / keyboard focus: a star grows; a planet grows and floats with a gentle orbit tilt. */
.sky-body {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sky-node:hover .sky-body,
.sky-node:focus-visible .sky-body { transform: scale(1.18); }
.sky-node:hover .sky-body.is-planet,
.sky-node:focus-visible .sky-body.is-planet {
  animation: sky-planet-float 1.8s ease-in-out infinite;
}
.sky-node:hover .sky-glow { fill: rgba(233, 138, 166, 0.34); }
@keyframes sky-planet-float {
  0%, 100% { transform: scale(1.18) translateY(0) rotate(0deg); }
  50% { transform: scale(1.24) translateY(-5px) rotate(-7deg); }
}
.sky-node.is-picked:not(.is-now) .sky-star,
.sky-node.is-picked .sky-planet,
.sky-node.is-picked .sky-diamond { stroke: var(--brand-primary); stroke-width: 3; }
@keyframes sky-glow { from { opacity: 0.55; transform: scale(0.9); } to { opacity: 1; transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) {
  .sky-glow,
  .sky-node:hover .sky-body.is-planet,
  .sky-node:focus-visible .sky-body.is-planet { animation: none; }
}
/* Legend and the picked week's lessons. */
.hp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.6rem;
  list-style: none;
  padding: 0;
  margin: 1.1rem 0 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
}
.hp-legend li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.lg { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.lg-lit { background: #fbd3df; border: 2px solid #e98aa6; }
.lg-now { background: var(--brand-primary); }
.lg-future { background: #fff; border: 2px solid #cdb8d8; }
.lg-project { width: 12px; height: 12px; border-radius: 3px; background: #eadff5; border: 2px solid #b79ad6; transform: rotate(45deg); }
.lg-exam { background: #fff; border: 2px solid #f0a9bd; box-shadow: 0 0 0 2px #fde4ea; }
.hp-sky-detail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.8rem;
  padding: 1rem 1.25rem;
  border-radius: 1.1rem;
  background: var(--tint-lilac);
  border: 1px solid var(--tint-lilac-border);
}
.hp-sky-detail-week {
  font-size: 1rem;
  font-weight: 900;
  color: var(--brand-primary);
}
.hp-sky-detail-items {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--brand-dark);
}
.hp-exam-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  color: #a61e45;
  background: #fbd5df;
  border: 1px solid #f3b3c3;
  border-radius: 999px;
  padding: 0.12rem 0.7rem;
}
.hp-exam-pill[hidden] { display: none; }
/* «مراجعة»: like «اختبار», in the calm teal of the brand's second colour. */
.hp-review-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  color: #0d6b64;
  background: #cdeeea;
  border: 1px solid #a7ddd7;
  border-radius: 999px;
  padding: 0.12rem 0.7rem;
}
.hp-review-pill[hidden] { display: none; }
[data-bs-theme="dark"] .hp-review-pill { color: #7ee8d9; background: #173c3a; border-color: #23524f; }
/* In the lessons panel the «اختبار» / «مراجعة» tags are pinned to the top far corner (top left in
   Arabic), even when the lessons wrap onto more lines; the panel keeps room for them. */
.hp-sky-detail {
  position: relative;
  padding-inline-end: 6.5rem;
}
.hp-sky-detail .hp-exam-pill,
.hp-sky-detail .hp-review-pill {
  position: absolute;
  top: 0.85rem;
  inset-inline-end: 1rem;
}
.hp-sky-detail .hp-exam-pill:not([hidden]) + .hp-review-pill { inset-inline-end: 5.2rem; }
/* Several lessons in a week: one per line, with a small plum dot. */
.hp-lesson-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.hp-lesson-list li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.hp-lesson-list li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-primary);
  flex-shrink: 0;
  transform: translateY(-0.15em);
}
.hp-sky-detail-items:has(.hp-lesson-list) {
  flex-basis: 100%; /* the list goes under «الأسبوع N» */
}
.hp-card-value .hp-lesson-list { gap: 0.15rem; font-size: 0.95em; }
/* A lesson that opens its page in «الدروس النظرية». */
.hp-lesson-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(122, 61, 118, 0.35);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  transition: color 0.15s, text-decoration-color 0.15s;
}
.hp-lesson-link::after {
  content: "←";
  font-size: 0.85em;
  margin-inline-start: 0.3em;
  color: var(--brand-primary);
  display: inline-block;
}
[dir="ltr"] .hp-lesson-link::after { content: "→"; }
.hp-lesson-link:hover {
  color: var(--brand-primary);
  text-decoration-color: var(--brand-primary);
}
/* Dark theme: a deep night sky, the same marks in softer light. */
[data-bs-theme="dark"] .hp-sky {
  background:
    radial-gradient(ellipse 50% 70% at 50% 40%, rgba(192, 126, 187, 0.12), transparent 70%),
    #1d1424;
}
[data-bs-theme="dark"] .sky-dust { opacity: 0.5; }
[data-bs-theme="dark"] .sky-star,
[data-bs-theme="dark"] .sky-planet,
[data-bs-theme="dark"] .sky-diamond { fill: #2a1f2c; }
[data-bs-theme="dark"] .sky-node.is-past .sky-star,
[data-bs-theme="dark"] .sky-node.is-past .sky-planet { fill: #6b3550; }
[data-bs-theme="dark"] .sky-num,
[data-bs-theme="dark"] .sky-node.is-past .sky-num { fill: #f1e6ef; }
[data-bs-theme="dark"] .sky-pill-exam { fill: #3a1c25; stroke: #5c2a38; }
[data-bs-theme="dark"] .sky-pill-project { fill: #2a1f2c; stroke: #45334a; }
[data-bs-theme="dark"] .sky-pill-text-exam { fill: #f4a3b6; }
[data-bs-theme="dark"] .sky-pill-text-project { fill: #f1e6ef; }
[data-bs-theme="dark"] .hp-card-icon.is-green { color: #86efac; background: rgba(134, 239, 172, 0.12); }
[data-bs-theme="dark"] .hp-exam-pill { color: #f8b4c4; background: #4a1f2c; border-color: #6b2d40; }
[data-bs-theme="dark"] .lg-future { background: #2a1f2c; }


/* The Arabic list icons (control-panel.php $listIcon): sit on the text line like a Bootstrap icon. */
.icon-list-rtl {
  vertical-align: -0.125em;
  flex-shrink: 0;
}

/* ─── WhatsApp messages (رسائل واتساب): the editable texts and their {placeholder} chips ─── */
.wa-tpl {
  padding: 1rem 1.15rem;
  scroll-margin-top: 6rem;
}
.wa-vars {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}
.wa-var {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: #166534;
  background: rgba(22, 163, 74, 0.08);
  border: 1px dashed rgba(22, 163, 74, 0.35);
  border-radius: 999px;
  padding: 0.12rem 0.6rem;
  cursor: pointer;
}
.wa-var:hover {
  background: rgba(22, 163, 74, 0.16);
}
.wa-var code {
  color: inherit;
  font-weight: 800;
  font-size: 0.74rem;
}
.wa-edited {
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
}
[data-bs-theme="dark"] .wa-var { color: #86efac; }
[data-bs-theme="dark"] .wa-edited { color: #fbbf24; }

/* ─── Semester workplan (خطة أعمال الفصل): control panel card + its page ─── */
.wp-home,
.wp-week,
.wp-tpl {
  padding: 1rem 1.15rem;
}
.wp-home-head,
.wp-week-head,
.wp-tpl-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.wp-week-num {
  min-width: 38px;
  height: 38px;
  padding: 0 0.4rem;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.95rem;
  color: #5b2b57;
  background: rgba(91, 43, 87, 0.09);
  flex-shrink: 0;
}
.wp-week-title,
.wp-tpl-title {
  font-size: 1rem;
  font-weight: 900;
  margin: 0;
}
.wp-now {
  color: #5b2b57;
}
.wp-now-badge {
  font-size: 0.7rem;
  font-weight: 800;
  color: #fff;
  background: #5b2b57;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
}
/* One dot per week: past ones filled softly, the current one solid. */
.wp-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.wp-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  text-decoration: none;
  color: #9ca3af;
  background: rgba(107, 114, 128, 0.1);
}
/* Finished weeks: a clear medium plum - between this week (solid) and the coming ones (light grey). */
.wp-dot.is-past {
  color: #fff;
  background: #b48ab0;
}
.wp-dot.is-now {
  color: #fff;
  background: #5b2b57;
  box-shadow: 0 0 0 3px rgba(91, 43, 87, 0.2);
}
.wp-dots-sm {
  gap: 0.25rem;
  margin-bottom: 0.85rem;
}
.wp-dots-sm .wp-dot {
  width: auto;
  flex: 1 1 0;
  height: 5px;
  border-radius: 999px;
  box-shadow: none;
}
.wp-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.75rem;
}
.wp-col {
  border-radius: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: rgba(107, 114, 128, 0.05);
}
.wp-col ul {
  margin: 0;
  padding-inline-start: 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.7;
}
/* Ticking an item: it's struck through and faded; hover shows who ticked it and when. */
.wp-checks {
  list-style: none;
  padding-inline-start: 0 !important;
}
.wp-check {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  cursor: pointer;
  padding: 0.1rem 0;
}
.wp-check .form-check-input {
  flex-shrink: 0;
  margin-top: 0.3em;
  cursor: pointer;
}
.wp-check .form-check-input:checked {
  background-color: #16a34a;
  border-color: #16a34a;
}
.wp-check.is-done span {
  text-decoration: line-through;
  color: #9ca3af;
}
.wp-count {
  font-size: 0.72rem;
  font-weight: 800;
  color: #6b7280;
  background: rgba(107, 114, 128, 0.1);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
}
.wp-count.is-complete {
  color: #15803d;
  background: rgba(22, 163, 74, 0.12);
}
.wp-behind {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #b45309;
  text-decoration: none;
  margin-bottom: 0.65rem;
}
.wp-behind:hover {
  color: #92400e;
  text-decoration: underline;
}
[data-bs-theme="dark"] .wp-count.is-complete { color: #86efac; }
[data-bs-theme="dark"] .wp-behind { color: #fbbf24; }
.wp-col-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  color: #6b7280;
  margin-bottom: 0.3rem;
}
.wp-col-tasks .wp-col-label { color: #5b2b57; }
.wp-col-events .wp-col-label { color: #b45309; }
.wp-col-messages .wp-col-label { color: #0f766e; }
.wp-notes {
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px dashed rgba(91, 43, 87, 0.2);
}
.wp-pre {
  white-space: pre-wrap;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.wp-next {
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px dashed rgba(91, 43, 87, 0.15);
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
}
.wp-week.is-now {
  border: 2px solid #5b2b57 !important;
}
.wp-week.is-past {
  opacity: 0.7;
}
.wp-week,
.wp-tpl {
  scroll-margin-top: 6rem;
}
.wp-tpl-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
}
.wp-tpl-chip,
.wp-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.74rem;
  font-weight: 700;
  text-decoration: none;
  color: #0f766e;
  background: rgba(15, 118, 110, 0.08);
  border-radius: 999px;
  padding: 0.12rem 0.6rem;
}
.wp-tag {
  color: #6b7280;
  background: rgba(107, 114, 128, 0.09);
}
.wp-tpl.is-now {
  border-inline-start: 4px solid #5b2b57 !important;
}
.wp-tpl-note {
  font-size: 0.78rem;
  font-weight: 700;
  color: #b45309;
  margin-bottom: 0.5rem;
}
.wp-tpl-text {
  background: rgba(107, 114, 128, 0.05);
  border-radius: 0.75rem;
  padding: 0.75rem 0.9rem;
  max-height: 340px;
  overflow-y: auto;
}
.wp-edit-form {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed rgba(91, 43, 87, 0.2);
}
.wp-btn-danger {
  --tile-c: #dc2626;
}
[data-bs-theme="dark"] .wp-col,
[data-bs-theme="dark"] .wp-tpl-text {
  background: rgba(255, 255, 255, 0.04);
}
[data-bs-theme="dark"] .wp-col-label,
[data-bs-theme="dark"] .wp-next {
  color: var(--bs-secondary-color);
}
[data-bs-theme="dark"] .wp-col-tasks .wp-col-label { color: #d8a6d4; }
[data-bs-theme="dark"] .wp-col-events .wp-col-label { color: #fbbf24; }
[data-bs-theme="dark"] .wp-col-messages .wp-col-label,
[data-bs-theme="dark"] .wp-tpl-chip { color: #5eead4; }
[data-bs-theme="dark"] .wp-week-num,
[data-bs-theme="dark"] .wp-now,
[data-bs-theme="dark"] .wp-dot.is-past { color: #fff; background: #7d5379; }
[data-bs-theme="dark"] .wp-tpl-note { color: #fbbf24; }
[data-bs-theme="dark"] .wp-week.is-now,
[data-bs-theme="dark"] .wp-tpl.is-now { border-color: #b77fb3 !important; }

.cp-list-row {
  transition:
    transform 0.15s,
    box-shadow 0.15s,
    border-color 0.15s;
}
.cp-list-row:hover {
  transform: translateY(-2px);
}
.cp-list-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #e5e7eb;
  flex-shrink: 0;
}

/* Phone number "chip" for the students/teachers account list row cards. */
.cp-phone-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  color: #6b7280;
  font-size: 0.72rem;
  font-weight: 800;
  margin-top: 0.15rem;
}
.cp-phone-chip i {
  font-size: 0.62rem;
}

.cp-detail-panel {
  background: var(--brand-neutral);
  border-top: 1px solid rgba(122, 61, 118, 0.1);
}

.cp-gateway-box {
  border: 1px solid #eef0f3;
  border-radius: 0.9rem;
  padding: 0.95rem 1.1rem;
  height: 100%;
  transition: border-color 0.15s;
}
.cp-gateway-box:hover {
  border-color: rgba(122, 61, 118, 0.2);
}
.cp-gateway-icon {
  width: 34px;
  height: 34px;
  border-radius: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  background: rgba(122, 61, 118, 0.08);
  color: var(--brand-primary);
  margin-inline-end: 0.5rem;
}

/* Registration form-count pill next to a gateway's label (Semesters page). */
.cp-form-count-badge {
  background: rgba(122, 61, 118, 0.08);
  color: var(--brand-primary);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.cp-semester-card {
  border-inline-start-width: 4px !important;
  border-inline-start-style: solid !important;
}
.cp-semester-card.is-live {
  border-inline-start-color: #10b981 !important;
}
.cp-semester-card.is-scheduled {
  border-inline-start-color: #eab308 !important;
}

.cp-account-switch {
  display: flex;
  gap: 2px;
  background: #fff;
  border: 1px solid rgba(122, 61, 118, 0.15);
  border-radius: 0.75rem;
  padding: 3px;
}
.cp-account-switch a {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 0.6rem;
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--brand-dark);
  transition:
    background-color 0.15s,
    color 0.15s;
}
.cp-account-switch a:hover:not(.active) {
  background: rgba(122, 61, 118, 0.06);
}
.cp-account-switch a.active {
  background: var(--brand-primary);
  color: #fff;
}

.cp-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  background: #fff;
  border: 1.5px solid rgba(122, 61, 118, 0.18);
  color: var(--brand-dark);
  font-weight: 800;
  font-size: 0.8rem;
  white-space: nowrap;
  transition:
    background-color 0.15s,
    border-color 0.15s;
}
.cp-back-btn i {
  color: var(--brand-primary);
  font-size: 1rem;
}
.cp-back-btn:hover {
  background: rgba(122, 61, 118, 0.08);
  border-color: var(--brand-primary);
}
/* The return arrow ↩ points the way «back» reads: mirrored in Arabic. */
[dir="rtl"] .cp-back-return { display: inline-block; transform: scaleX(-1); }
/* Phones: just the icon (its name stays as the tooltip / screen-reader label). */
@media (max-width: 575.98px) {
  .cp-back-btn:has(.cp-back-label) { padding: 0.5rem 0.7rem; }
  .cp-back-label { display: none; }
}

/* Bootstrap has no "fw-black" utility - the design system leans on 900-weight
   text everywhere (headers, badges, labels) under that name, so define it
   once here rather than falling back to the unstyled default. */
.fw-black {
  font-weight: 900 !important;
}

/* ─── Registration open/close toggle (Semesters page gateways) ──────────────
   Soft pill buttons instead of stock Bootstrap outline-success/-danger -
   color reflects the action on offer, not decoration. */
.btn-reg-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  font-weight: 800;
  padding: 0.45rem 1.1rem;
  border: 1.5px solid transparent;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    transform 0.15s,
    box-shadow 0.15s;
}
.btn-reg-toggle-stop {
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.22);
}
.btn-reg-toggle-stop:hover,
.btn-reg-toggle-stop:focus {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.35);
  color: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.12);
}
.btn-reg-toggle-reopen {
  background: rgba(16, 185, 129, 0.08);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.22);
}
.btn-reg-toggle-reopen:hover,
.btn-reg-toggle-reopen:focus {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.35);
  color: #047857;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.12);
}

/* ===== Semesters page (includes/cp-semesters.php) ===== */
.sem-current {
  padding: 1.6rem;
  border-top: 4px solid var(--brand-primary) !important;
}
.sem-form-title {
  font-size: 1rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--brand-dark);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(122, 61, 118, 0.1);
}
.sem-form-title i {
  color: var(--brand-primary);
}
.sem-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.sem-title {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--brand-dark);
  margin: 0.15rem 0 0.2rem;
}
.sem-date {
  font-size: 0.8rem;
  font-weight: 700;
  color: #6b7280;
}
.sem-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  border: 1px solid transparent;
}
.sem-pill-brand {
  background: color-mix(in srgb, var(--brand-primary) 10%, transparent);
  color: var(--brand-primary);
  border-color: color-mix(in srgb, var(--brand-primary) 22%, transparent);
}
.sem-pill-ok {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.25);
}
.sem-pill-warn {
  background: rgba(234, 179, 8, 0.12);
  color: #a16207;
  border-color: rgba(234, 179, 8, 0.3);
}

/* Description: clamped to a few lines until "show more". */
.sem-desc-wrap {
  margin-bottom: 1.25rem;
}
.sem-desc {
  max-height: 4.8em;
  overflow: hidden;
  font-size: 0.85rem;
  color: #6b7280;
  font-weight: 600;
  -webkit-mask-image: linear-gradient(#000 60%, transparent);
  mask-image: linear-gradient(#000 60%, transparent);
}
.sem-desc-wrap.is-open .sem-desc {
  max-height: none;
  -webkit-mask-image: none;
  mask-image: none;
}
.sem-desc-more {
  border: 0;
  background: none;
  padding: 0.2rem 0;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.sem-desc-more i {
  transition: transform 0.2s;
}
.sem-desc-more .less,
.sem-desc-wrap.is-open .sem-desc-more .more {
  display: none;
}
.sem-desc-wrap.is-open .sem-desc-more .less {
  display: inline;
}
.sem-desc-wrap.is-open .sem-desc-more i {
  transform: rotate(180deg);
}

/* Stage tracker: four columns on one line - each a dot with its name under
   it and its status under that; lines join the dots (green once done). */
.sem-steps {
  list-style: none;
  padding: 0.8rem 0.5rem 0.7rem;
  margin: 0 0 1rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-radius: 1rem;
  background: color-mix(in srgb, var(--brand-primary) 4%, transparent);
  border: 1px solid rgba(122, 61, 118, 0.08);
}
.sem-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.15rem;
  min-width: 0;
  padding: 0 0.2rem;
}
.sem-step + .sem-step::before {
  content: "";
  position: absolute;
  top: 10px;
  inset-inline-end: calc(50% + 15px);
  width: calc(100% - 30px);
  height: 2px;
  border-radius: 2px;
  background: rgba(122, 61, 118, 0.18);
}
.sem-step.is-done + .sem-step::before {
  background: #10b981;
}
.sem-step-dot {
  position: relative;
  z-index: 1;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.66rem;
  background: #fff;
  color: #9ca3af;
  border: 1.5px solid rgba(122, 61, 118, 0.2);
}
.sem-step.is-done .sem-step-dot {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}
.sem-step.is-current .sem-step-dot {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-primary) 18%, transparent);
}
.sem-step-label {
  margin-top: 0.25rem;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.3;
  color: var(--brand-dark);
}
.sem-step.is-todo .sem-step-label {
  color: #9ca3af;
}
.sem-step-hint {
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.3;
  color: #6b7280;
}

/* Number groups (registration / after allocation), side by side, each with a small caption. */
.sem-stat-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1rem;
}
.sem-stat-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.sem-stat-group + .sem-stat-group {
  padding-inline-start: 1.5rem;
  border-inline-start: 1px dashed rgba(122, 61, 118, 0.18);
}
.sem-stat-group-label {
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #9ca3af;
}
.sem-stat-group .sem-stats {
  margin-bottom: 0;
}
@media (max-width: 767px) {
  .sem-stat-group + .sem-stat-group {
    padding-inline-start: 0;
    border-inline-start: 0;
  }
}
[data-bs-theme="dark"] .sem-stat-group + .sem-stat-group {
  border-color: var(--misk-border);
}

/* Numbers: a row of small pills (icon, number, label), each a link into its tab. */
.sem-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.sem-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(122, 61, 118, 0.12);
  background: #fff;
  color: var(--brand-dark);
  text-decoration: none;
  transition:
    border-color 0.15s,
    background-color 0.15s;
}
.sem-stat:hover {
  border-color: color-mix(in srgb, var(--brand-primary) 45%, transparent);
  background: color-mix(in srgb, var(--brand-primary) 5%, transparent);
  color: var(--brand-dark);
}
.sem-stat-icon {
  font-size: 0.8rem;
  color: var(--brand-primary);
}
.sem-stat-num {
  font-size: 0.85rem;
  font-weight: 900;
}
.sem-stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #6b7280;
}
.sem-stat.is-warn {
  border-color: rgba(234, 179, 8, 0.4);
  background: rgba(234, 179, 8, 0.08);
}
.sem-stat.is-warn .sem-stat-icon {
  color: #b45309;
}
.sem-stat.is-ok .sem-stat-icon {
  color: #047857;
}

/* Registration gateways: state on the left, on/off switch on the right. */
.sem-gate {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  height: 100%;
  padding: 0.9rem 1.1rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(122, 61, 118, 0.1);
  border-inline-start: 4px solid #10b981;
  background: #fff;
}
.sem-gate.is-closed {
  border-inline-start-color: #ef4444;
}
.sem-gate-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 0.7rem;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--brand-primary) 9%, transparent);
  color: var(--brand-primary);
}
.sem-gate-name {
  font-weight: 900;
  font-size: 0.88rem;
  color: var(--brand-dark);
}
.sem-gate-state {
  font-size: 0.78rem;
  font-weight: 800;
  color: #047857;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.sem-gate.is-closed .sem-gate-state {
  color: #b91c1c;
}
.sem-gate-state small {
  color: #6b7280;
  font-weight: 700;
}
.sem-gate-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.sem-gate.is-open .sem-gate-dot {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}
.sem-switch .form-check-input {
  width: 2.8em;
  height: 1.5em;
  cursor: pointer;
  background-color: #fecaca;
  border-color: #fca5a5;
}
.sem-switch .form-check-input:checked {
  background-color: #10b981;
  border-color: #10b981;
}
.sem-switch .form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.2);
}

/* Shortcut buttons into the allocator. */
.sem-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(122, 61, 118, 0.1);
}
.sem-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.95rem;
  border-radius: 0.75rem;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--brand-dark);
  background: #fff;
  border: 1.5px solid rgba(122, 61, 118, 0.15);
  text-decoration: none;
  transition:
    background-color 0.15s,
    border-color 0.15s;
}
.sem-action i {
  color: var(--brand-primary);
}
.sem-action:hover {
  border-color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 6%, transparent);
  color: var(--brand-dark);
}
.sem-action-main {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}
.sem-action-main i {
  color: #fff;
}
.sem-action-main:hover {
  background: color-mix(in srgb, var(--brand-primary) 88%, #000);
  color: #fff;
}

/* Past semesters: compact rows that open into the full panel. */
.sem-section-title {
  font-size: 1rem;
  font-weight: 900;
  color: var(--brand-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.sem-section-title i {
  color: var(--brand-primary);
}
.sem-count {
  font-size: 0.72rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 10%, transparent);
  color: var(--brand-primary);
}
.sem-past-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.sem-past {
  overflow: hidden;
}
.sem-past summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.1rem;
  cursor: pointer;
}
.sem-past summary::-webkit-details-marker {
  display: none;
}
.sem-past-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 0.7rem;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--brand-primary) 8%, transparent);
  color: var(--brand-primary);
}
.sem-past-main {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}
.sem-past-title {
  font-weight: 900;
  color: var(--brand-dark);
}
.sem-past-date {
  font-size: 0.75rem;
  font-weight: 700;
  color: #6b7280;
}
.sem-past-chips {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.sem-past-chips span {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 6%, transparent);
  color: var(--brand-dark);
  white-space: nowrap;
}
.sem-past-chips i {
  color: var(--brand-primary);
}
.sem-past-chevron {
  color: #9ca3af;
  transition: transform 0.2s;
}
.sem-past[open] .sem-past-chevron {
  transform: rotate(180deg);
}
.sem-past-body {
  padding: 1.25rem 1.1rem 1.1rem;
  border-top: 1px solid rgba(122, 61, 118, 0.1);
}

@media (max-width: 767px) {
  .sem-current {
    padding: 1.1rem;
  }
  /* Phones: every step keeps its name under its dot (smaller); only the
     current step shows its status - the others are on their tap tooltip. */
  .sem-steps {
    padding: 0.7rem 0.25rem 0.6rem;
  }
  .sem-step-label {
    font-size: 0.66rem;
  }
  .sem-step-hint {
    display: none;
  }
  .sem-step.is-current .sem-step-hint {
    display: block;
    font-size: 0.6rem;
  }
  .sem-past-chips {
    display: none;
  }
}

[data-bs-theme="dark"] .sem-step-dot,
[data-bs-theme="dark"] .sem-stat,
[data-bs-theme="dark"] .sem-gate,
[data-bs-theme="dark"] .sem-action:not(.sem-action-main) {
  background: var(--misk-surface-2);
  border-color: var(--misk-border);
}
[data-bs-theme="dark"] .sem-gate {
  border-inline-start-color: #10b981;
}
[data-bs-theme="dark"] .sem-gate.is-closed {
  border-inline-start-color: #ef4444;
}
[data-bs-theme="dark"] .sem-step.is-done .sem-step-dot {
  background: #10b981;
  border-color: #10b981;
}
[data-bs-theme="dark"] .sem-step.is-current .sem-step-dot {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #140f15;
}
[data-bs-theme="dark"] .sem-action-main,
[data-bs-theme="dark"] .sem-action-main i {
  color: #140f15;
}
[data-bs-theme="dark"] .sem-date,
[data-bs-theme="dark"] .sem-desc,
[data-bs-theme="dark"] .sem-step-hint,
[data-bs-theme="dark"] .sem-stat-label,
[data-bs-theme="dark"] .sem-gate-state small,
[data-bs-theme="dark"] .sem-past-date {
  color: var(--bs-secondary-color);
}
[data-bs-theme="dark"] .sem-gate-state,
[data-bs-theme="dark"] .sem-pill-ok {
  color: #6ee7b7;
}
[data-bs-theme="dark"] .sem-gate.is-closed .sem-gate-state {
  color: #fca5a5;
}
[data-bs-theme="dark"] .sem-pill-warn {
  color: #fcd34d;
}
[data-bs-theme="dark"] .sem-stat.is-warn .sem-stat-icon {
  color: #fcd34d;
}
[data-bs-theme="dark"] .sem-stat.is-ok .sem-stat-icon {
  color: #6ee7b7;
}

/* ===== Results tab (includes/cp-assign-results.php) ===== */
.res-session {
  overflow: hidden;
}
.res-session-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(122, 61, 118, 0.1);
  background: color-mix(in srgb, var(--brand-primary) 3%, transparent);
}
.res-session-num {
  font-size: 0.75rem;
  font-weight: 900;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 10%, transparent);
  color: var(--brand-primary);
}
.res-progress {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: #6b7280;
}
.res-progress-bar {
  width: 70px;
  height: 6px;
  border-radius: 999px;
  background: rgba(122, 61, 118, 0.12);
  overflow: hidden;
}
.res-progress-bar span {
  display: block;
  height: 100%;
  background: #10b981;
  border-radius: inherit;
}
.res-table td {
  vertical-align: middle;
}
/* ===== Teachers' results page (results.php) ===== */
.res-pass {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
}
.res-pass.yes {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}
.res-pass.no {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}
.res-tester {
  max-width: 220px;
}
.res-notes-cell {
  min-width: 150px;
  max-width: 260px;
}
/* «لم تختبر» (missed the exam): an amber pill in the exam's cell. */
.res-absent {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
  background: rgba(234, 179, 8, 0.15);
  color: #a16207;
}
[data-bs-theme="dark"] .res-absent {
  background: rgba(234, 179, 8, 0.18);
  color: #fcd34d;
}
/* A student on the withdrawals list: her row struck through and faded. */
.res-table tr.res-withdrawn td {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  opacity: 0.55;
}
.res-table tr.res-withdrawn td:last-child,
.res-table tr.res-withdrawn td.res-col-result {
  text-decoration: none;
  opacity: 1;
}
/* Control panel results: a withdrawn student's row - soft grey tint with an edge strip,
   only her name struck through (in red), marks left readable. */
.res-name-withdrawn {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(185, 28, 28, 0.65);
  color: #6b7280;
}
.res-table tr.res-row-withdrawn > td {
  background: rgba(107, 114, 128, 0.05);
}
.res-table tr.res-row-withdrawn > td:first-child {
  box-shadow: inset 3px 0 0 rgba(185, 28, 28, 0.45);
}
[dir="rtl"] .res-table tr.res-row-withdrawn > td:first-child {
  box-shadow: inset -3px 0 0 rgba(185, 28, 28, 0.45);
}
.res-withdraw-reason {
  font-size: 0.68rem;
  font-weight: 700;
  color: #b45309;
}
.res-table tr.res-row-withdrawn .res-withdrawn-badge {
  background: rgba(185, 28, 28, 0.07);
  color: #b91c1c;
  border: 1px dashed rgba(185, 28, 28, 0.35);
}
[data-bs-theme="dark"] .res-table tr.res-row-withdrawn > td {
  background: rgba(255, 255, 255, 0.03);
}
[data-bs-theme="dark"] .res-name-withdrawn {
  color: var(--bs-secondary-color);
  text-decoration-color: rgba(248, 113, 113, 0.7);
}
[data-bs-theme="dark"] .res-withdraw-reason {
  color: #fbbf24;
}
[data-bs-theme="dark"] .res-table tr.res-row-withdrawn .res-withdrawn-badge {
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.4);
}
.res-withdrawn-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
  background: rgba(107, 114, 128, 0.14);
  color: #4b5563;
}
[data-bs-theme="dark"] .res-withdrawn-badge {
  background: rgba(255, 255, 255, 0.1);
  color: #d1d5db;
}
/* The «لم تختبر» ticks in the results entry form. */
.res-absent-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  border-radius: 0.6rem;
  border: 1px dashed rgba(234, 179, 8, 0.45);
  background: rgba(234, 179, 8, 0.06);
  cursor: pointer;
}
.res-absent-check .form-check-input {
  margin-top: 0.15rem;
  flex-shrink: 0;
}
.res-absent-check b {
  display: block;
  font-size: 0.82rem;
}
.res-absent-check small {
  font-size: 0.72rem;
  font-weight: 700;
  color: #a16207;
}
[data-bs-theme="dark"] .res-absent-check small {
  color: #fcd34d;
}
.res-notes {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.res-table th small {
  color: #9ca3af;
  font-weight: 700;
}
.res-table tr:target td {
  background: color-mix(in srgb, var(--brand-primary) 8%, transparent);
}
/* Page header: icon, title + semester, one-line hint, and the small stats row. */
.res-hero {
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.res-hero-main {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}
.res-hero-icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 0.9rem;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-primary), color-mix(in srgb, var(--brand-primary) 60%, var(--brand-accent)));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--brand-primary) 25%, transparent);
}
.res-hero-icon.sm {
  width: 32px;
  height: 32px;
  font-size: 0.95rem;
  border-radius: 0.65rem;
  box-shadow: none;
}
.res-hero-title {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--brand-dark);
  margin: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.res-hero-title span {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--brand-primary);
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 9%, transparent);
}
.res-hero-sub {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #6b7280;
}

/* Filter toolbar */
.res-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.res-toolbar .form-select {
  width: auto;
  min-width: 150px;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 0.75rem;
}
.res-search {
  position: relative;
  flex: 1 1 240px;
  max-width: 340px;
}
.res-search i {
  position: absolute;
  top: 50%;
  inset-inline-start: 0.85rem;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}
.res-search .form-control {
  padding-inline-start: 2.3rem;
  border-radius: 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
}

/* Session card head + table */
.res-session-teacher {
  font-weight: 900;
  color: var(--brand-dark);
}
.res-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(122, 61, 118, 0.15);
  color: var(--brand-dark);
}
.res-tag-warn {
  border-color: rgba(234, 179, 8, 0.45);
  background: rgba(234, 179, 8, 0.1);
  color: #a16207;
}
[data-bs-theme="dark"] .res-tag-warn {
  color: #fcd34d;
}
.res-table thead th {
  font-size: 0.75rem;
  font-weight: 900;
  color: #6b7280;
  white-space: nowrap;
  vertical-align: middle;
}
.res-table thead th small {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  color: #9ca3af;
}
.res-table thead th small::before {
  content: "/ ";
}
.res-table .res-group-row th.res-group {
  text-align: center;
  color: var(--brand-primary);
  border-bottom: 2px solid color-mix(in srgb, var(--brand-primary) 30%, transparent);
}
.res-table .res-group + .res-group {
  border-inline-start: 1px solid rgba(122, 61, 118, 0.12);
}
.res-table .res-num {
  text-align: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.res-table td.res-col-total {
  font-weight: 900;
  color: var(--brand-dark);
}
.res-table .res-col-no {
  width: 2.5rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #9ca3af;
}
.res-table .res-student {
  font-weight: 800;
  white-space: nowrap;
}
.res-table tbody tr:hover td {
  background: color-mix(in srgb, var(--brand-primary) 3%, transparent);
}
.res-empty {
  color: #d1d5db;
  font-weight: 700;
}
.res-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.2rem;
}
.res-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 8%, transparent);
  color: var(--brand-dark);
  white-space: nowrap;
}
.res-chip i {
  color: var(--brand-primary);
}
.res-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  border-radius: 0.6rem;
  border: 1.5px solid color-mix(in srgb, var(--brand-primary) 25%, transparent);
  background: transparent;
  color: var(--brand-primary);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  transition:
    background-color 0.15s,
    color 0.15s,
    border-color 0.15s;
}
.res-edit-btn:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}
.res-lock {
  color: #9ca3af;
  font-size: 0.85rem;
}
/* Dark mode for the shared tables: the light header band and bright row lines
   become the dark surfaces and borders. */
[data-bs-theme="dark"] .table-misk {
  --bs-table-bg: transparent;
  --bs-table-color: var(--bs-body-color);
  --bs-table-border-color: var(--misk-border);
}
[data-bs-theme="dark"] .table-misk thead th {
  background: var(--misk-surface-2);
  border-bottom-color: var(--misk-border);
}
[data-bs-theme="dark"] .table-misk td {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
[data-bs-theme="dark"] .table-misk tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.025);
}

/* Dark mode for the results tables (results.php + control panel النتائج). */
[data-bs-theme="dark"] .res-session-head {
  background: var(--misk-surface-2);
  border-bottom-color: var(--misk-border);
}
[data-bs-theme="dark"] .res-session-num {
  background: rgba(192, 126, 187, 0.16);
  color: #e3b7df;
}
[data-bs-theme="dark"] .res-table .res-group-row th.res-group {
  color: #e3b7df;
  border-bottom-color: rgba(192, 126, 187, 0.4);
}
[data-bs-theme="dark"] .res-table .res-group + .res-group {
  border-inline-start-color: var(--misk-border);
}
[data-bs-theme="dark"] .res-table .res-col-total {
  background: rgba(192, 126, 187, 0.07);
}
[data-bs-theme="dark"] .res-table td.res-col-total {
  color: #f1e6ef;
}
[data-bs-theme="dark"] .res-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}
[data-bs-theme="dark"] .res-table tr:target td {
  background: rgba(192, 126, 187, 0.12);
}
[data-bs-theme="dark"] .res-table .res-col-no,
[data-bs-theme="dark"] .res-table thead th small {
  color: #8f7d8d;
}
[data-bs-theme="dark"] .res-progress-bar {
  background: rgba(255, 255, 255, 0.1);
}
[data-bs-theme="dark"] .res-chip {
  background: rgba(192, 126, 187, 0.14);
  color: #ead6e8;
}
[data-bs-theme="dark"] .res-chip i {
  color: #d49ccf;
}
[data-bs-theme="dark"] .res-state-mark {
  color: #8f7d8d;
}
[data-bs-theme="dark"] .res-hero-sub,
[data-bs-theme="dark"] .res-table thead th {
  color: var(--bs-secondary-color);
}
[data-bs-theme="dark"] .res-empty {
  color: #4b4150;
}
[data-bs-theme="dark"] .res-tag {
  border-color: var(--misk-border);
}
[data-bs-theme="dark"] .res-edit-btn:hover {
  color: #140f15;
}

/* Totals (written /40, practical /60): a soft tint so they read apart from the parts. */
.res-table .res-col-total {
  background: color-mix(in srgb, var(--brand-primary) 5%, transparent);
}
.res-live-total {
  height: calc(1.5em + 0.75rem + 2px);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.75rem;
  border-radius: 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #6b7280;
  background: color-mix(in srgb, var(--brand-primary) 7%, transparent);
}
.res-live-total b {
  font-size: 1rem;
  font-weight: 900;
  color: var(--brand-dark);
}

/* Searchable teacher picker (practical testers) */
.tester-pick {
  position: relative;
}
.tester-pick .form-control {
  padding-inline-end: 2rem;
}
.tester-pick.has-value .form-control {
  font-weight: 800;
  border-color: color-mix(in srgb, var(--brand-primary) 40%, transparent);
  background: color-mix(in srgb, var(--brand-primary) 5%, transparent);
}
.tester-pick-clear {
  position: absolute;
  top: 50%;
  inset-inline-end: 0.4rem;
  transform: translateY(-50%);
  border: 0;
  background: none;
  color: #9ca3af;
  padding: 0 0.2rem;
  display: none;
}
.tester-pick.has-value .tester-pick-clear {
  display: block;
}
.tester-pick-list {
  display: none;
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  inset-inline: 0;
  max-height: 220px;
  overflow-y: auto;
  padding: 0.3rem;
  border-radius: 0.75rem;
  background: #fff;
  border: 1px solid rgba(122, 61, 118, 0.15);
  box-shadow: 0 10px 24px rgba(61, 26, 60, 0.14);
}
.tester-pick-list.show {
  display: block;
}
.tester-pick-opt {
  padding: 0.4rem 0.6rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.tester-pick-opt.is-active,
.tester-pick-opt:hover {
  background: color-mix(in srgb, var(--brand-primary) 9%, transparent);
}
.tester-pick-empty {
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #9ca3af;
}
[data-bs-theme="dark"] .tester-pick-list {
  background: var(--misk-surface-2);
  border-color: var(--misk-border);
}

.res-form-section {
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--brand-primary);
  margin-bottom: 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid rgba(122, 61, 118, 0.1);
}
[data-bs-theme="dark"] .res-pass.yes {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}
[data-bs-theme="dark"] .res-pass.no {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}
[data-bs-theme="dark"] .res-notes {
  color: var(--bs-secondary-color);
}

/* Exam state badges (control panel النتائج): the mark sits small under the badge. */
.res-state-mark {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.68rem;
  font-weight: 800;
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
}

/* Pass marks in the results settings: one small labelled box per level. */
.res-pass-mark {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 116px;
  cursor: default;
  min-width: 0 !important;
}
.res-pass-mark small {
  font-size: 0.7rem;
  font-weight: 800;
  color: #6b7280;
}
[data-bs-theme="dark"] .res-pass-mark small {
  color: var(--bs-secondary-color);
}

/* المتأهلات ranking: a student who withdrew from her qualification (اعتذرت)
   is struck through and faded; small round buttons to mark / undo it. */
.res-rank-row.is-declined {
  background: rgba(107, 114, 128, 0.06);
}
.res-rank-row.is-declined .res-rank-name,
.res-rank-row.is-declined .res-rank-score {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  opacity: 0.55;
}
.res-declined-tag {
  font-weight: 900;
  color: #8a3b4a;
}
/* المتأهلات: a student an admin moved to the other quota list. */
.res-moved-tag {
  font-weight: 900;
  color: #b45309;
}
.res-move-btn {
  border: 1px solid rgba(122, 61, 118, 0.2);
  background: transparent;
  color: var(--brand-primary);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 800;
}
.res-move-btn:hover { background: rgba(122, 61, 118, 0.06); }
.res-move-btn.res-move-btn-decline { color: #8a3b4a; border-color: rgba(138, 59, 74, 0.25); }
.res-move-btn.res-move-btn-decline:hover { background: rgba(138, 59, 74, 0.06); }
[data-bs-theme="dark"] .res-move-btn.res-move-btn-decline { color: #fda4af; }
[data-bs-theme="dark"] .res-moved-tag { color: #fcd34d; }
[data-bs-theme="dark"] .res-move-btn { border-color: var(--misk-border); }
.res-rank-btn {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  border: 1px solid rgba(122, 61, 118, 0.2);
  background: transparent;
  color: var(--brand-primary);
  transition: background-color 0.15s, color 0.15s;
}
.res-rank-btn:hover {
  background: var(--brand-primary);
  color: #fff;
}
.res-rank-btn.is-decline {
  color: #8a3b4a;
  border-color: rgba(138, 59, 74, 0.3);
}
.res-rank-btn.is-decline:hover {
  background: #8a3b4a;
  color: #fff;
}
.res-share-btn {
  background: #25d366;
  border-color: #25d366;
}
.res-share-btn:hover {
  background: #1ebe5b;
  border-color: #1ebe5b;
}
/* المتأهلات shared on the teachers' results page: two numbered name lists. */
.res-qualified-card {
  padding: 1.1rem 1.2rem 1.2rem;
  border-inline-start: 4px solid #d4a84a !important;
  background: radial-gradient(circle at 100% 0, rgba(240, 207, 122, 0.22), transparent 40%), radial-gradient(circle at 0 100%, rgba(194, 151, 195, 0.18), transparent 45%), var(--bs-card-bg, #fff);
}
.res-qualified-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.res-qualified-icon {
  flex: none;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.85rem;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  color: #fff;
  background: linear-gradient(135deg, #f0cf7a, #d4a84a 55%, #b8862b);
  box-shadow: 0 6px 14px -6px rgba(184, 134, 43, 0.6);
}
.res-qualified-title {
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--brand-dark);
  line-height: 1.3;
}
.res-qualified-sub {
  font-size: 0.8rem;
  font-weight: 700;
  color: #6b7280;
}
.res-qualified-total {
  flex: none;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #7a3d76;
  background: rgba(122, 61, 118, 0.1);
}
.res-qualified-total b {
  font-size: 1rem;
  font-weight: 900;
}
.res-qualified-lists {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.res-qualified-list {
  padding: 0.8rem 0.85rem 0.9rem;
  border-radius: 1rem;
  background: rgba(var(--brand-primary-rgb, 124, 58, 120), 0.04);
  border: 1px solid rgba(var(--brand-primary-rgb, 124, 58, 120), 0.1);
}
.res-qualified-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  font-size: 0.9rem;
  font-weight: 900;
  color: var(--brand-primary);
}
.res-qualified-count {
  min-width: 1.6rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 900;
  color: #fff;
  background: var(--brand-primary);
}
.res-qualified-names {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 0.5rem;
}
.res-qualified-names li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.4rem 0.6rem;
  border-radius: 0.8rem;
  background: var(--bs-card-bg, #fff);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.res-qualified-names li:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.12);
}
.res-qualified-no {
  flex: none;
  width: 1.4rem;
  font-size: 0.75rem;
  font-weight: 900;
  color: #9ca3af;
  text-align: center;
}
.res-qualified-avatar {
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px #f0cf7a;
}
.res-qualified-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--brand-dark);
}
.res-qualified-empty {
  font-size: 0.82rem;
  font-weight: 700;
  color: #9ca3af;
}
@media (max-width: 420px) {
  .res-qualified-names {
    grid-template-columns: 1fr;
  }
  .res-qualified-sub {
    display: none;
  }
}
[data-bs-theme="dark"] .res-qualified-card {
  background: radial-gradient(circle at 100% 0, rgba(240, 207, 122, 0.12), transparent 40%), radial-gradient(circle at 0 100%, rgba(192, 126, 187, 0.12), transparent 45%), var(--bs-card-bg);
}
[data-bs-theme="dark"] .res-qualified-total {
  color: #e7c9e5;
  background: rgba(192, 126, 187, 0.16);
}
.res-qualified-party {
  flex: none;
  width: 2.3rem;
  height: 2.3rem;
  border: 0;
  border-radius: 50%;
  font-size: 1.15rem;
  line-height: 1;
  background: linear-gradient(135deg, #fff4d6, #f0cf7a);
  box-shadow: 0 4px 12px -5px rgba(184, 134, 43, 0.7);
  cursor: pointer;
  transition: transform 0.2s ease;
}
.res-qualified-party:hover {
  transform: rotate(-12deg) scale(1.1);
}
.res-qualified-party:focus-visible,
.res-qualified-wa:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}
.res-qualified-wa {
  flex: none;
  margin-inline-start: auto;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  color: #1a9e55;
  background: rgba(37, 211, 102, 0.12);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.res-qualified-wa:hover {
  color: #fff;
  background: #25d366;
  transform: scale(1.08);
}
.res-fireworks {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 2001;
}
[data-bs-theme="dark"] .res-qualified-wa {
  color: #4ade80;
  background: rgba(37, 211, 102, 0.14);
}
[data-bs-theme="dark"] .res-qualified-list {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}
[data-bs-theme="dark"] .res-qualified-names li {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
}
[data-bs-theme="dark"] .res-qualified-sub {
  color: #9ca3af;
}
[data-bs-theme="dark"] .res-qualified-avatar {
  box-shadow: 0 0 0 2px rgba(240, 207, 122, 0.55);
}
[data-bs-theme="dark"] .res-declined-tag {
  color: #d49aa4;
}
[data-bs-theme="dark"] .res-rank-btn {
  border-color: var(--misk-border);
}
[data-bs-theme="dark"] .res-rank-btn.is-decline {
  color: #d49aa4;
}

/* Sending each level's results (control panel → النتائج → الإعدادات): one row per level. */
.res-send-card {
  padding: 0.9rem 1.1rem 1rem;
}
.res-send-card .bi-send-check {
  color: var(--brand-primary);
}
.res-send-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.res-send-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(122, 61, 118, 0.1);
}
.res-send-row.is-sent {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.05);
}
.res-send-level {
  min-width: 90px;
}
.res-send-info {
  flex: 1 1 200px;
  display: flex;
  flex-direction: column;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--brand-dark);
}
.res-send-state {
  font-size: 0.74rem;
  font-weight: 700;
  color: #6b7280;
}
.res-send-state.is-sent { color: #047857; }
.res-send-state.is-warn { color: #a16207; }
/* Once sent: a green "تم الإرسال" badge and a quiet undo link. */
.res-sent-done {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.res-sent-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 900;
  color: #047857;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.res-sent-badge i {
  font-size: 1rem;
}
.res-unsend-link {
  border: 0;
  background: none;
  padding: 0;
  font-size: 0.76rem;
  font-weight: 800;
  color: #9ca3af;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.res-unsend-link:hover {
  color: #b91c1c;
}
[data-bs-theme="dark"] .res-sent-badge {
  color: #6ee7b7;
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.35);
}
[data-bs-theme="dark"] .res-unsend-link:hover {
  color: #fca5a5;
}
[data-bs-theme="dark"] .res-send-row {
  border-color: var(--misk-border);
}
[data-bs-theme="dark"] .res-send-row.is-sent {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.06);
}
[data-bs-theme="dark"] .res-send-state { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .res-send-state.is-sent { color: #6ee7b7; }
[data-bs-theme="dark"] .res-send-state.is-warn { color: #fcd34d; }

/* Results settings (control panel overview): one card - a head row with the
   page switch, then the written pass marks and the advanced numbers side by side. */
.res-settings {
  padding: 0.9rem 1.1rem 1rem;
}
.res-settings-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid rgba(122, 61, 118, 0.08);
  color: var(--brand-dark);
}
.res-settings-head .bi-sliders {
  color: var(--brand-primary);
}
.res-settings-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.5rem;
}
.res-settings-grid fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-width: 0;
}
.res-settings-grid fieldset + fieldset {
  padding-inline-start: 1.5rem;
  border-inline-start: 1px dashed rgba(122, 61, 118, 0.18);
}
.res-settings-grid legend {
  width: 100%;
  float: none;
  margin-bottom: 0.1rem;
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--brand-primary);
}
.res-pass-mark.wide {
  width: 190px;
}
.res-settings-save {
  margin-inline-start: auto;
}
@media (max-width: 767px) {
  .res-settings-grid fieldset + fieldset {
    padding-inline-start: 0;
    border-inline-start: 0;
  }
}
[data-bs-theme="dark"] .res-settings-head {
  border-color: var(--misk-border);
}
[data-bs-theme="dark"] .res-settings-grid fieldset + fieldset {
  border-color: var(--misk-border);
}
/* «حاسبة درجة التأهل» (results settings) */
.res-calc .bi-calculator-fill { color: var(--brand-primary); }
.res-calc-opts { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; margin-bottom: 1rem; }
.res-calc-opt { display: flex; flex-direction: column; gap: 0.25rem; min-width: 150px; }
.res-calc-opt small { font-size: 0.72rem; font-weight: 900; color: var(--brand-primary); }
.res-calc-range { display: flex; align-items: center; gap: 0.6rem; }
.res-calc-range input[type="range"] { width: 150px; accent-color: var(--brand-primary); }
.res-calc-range .input-group { width: 92px; }
.res-calc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.res-calc-card { display: flex; flex-direction: column; gap: 0.45rem; padding: 0.85rem; border-radius: 1rem; background: #faf6fa; border: 1px solid rgba(122, 61, 118, 0.1); }
.res-calc-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.res-calc-top small { font-weight: 800; color: #8a7a89; font-size: 0.72rem; }
.res-calc-mark { display: flex; align-items: baseline; gap: 0.3rem; }
.res-calc-mark b { font-size: 2.1rem; font-weight: 900; line-height: 1; color: var(--brand-primary); }
.res-calc-mark small { font-weight: 800; color: #9a8d99; }
.res-calc-line { font-size: 0.8rem; font-weight: 800; color: #047857; }
.res-calc-bar { height: 7px; border-radius: 999px; background: #efe4ef; overflow: hidden; }
.res-calc-bar > span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #6ee7b7, #10b981); transition: width 0.25s; }
.res-calc-facts { list-style: none; margin: 0.15rem 0 0.2rem; padding: 0; display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.78rem; }
.res-calc-facts li { display: flex; justify-content: space-between; gap: 0.5rem; }
.res-calc-facts span { color: #6b5a6a; font-weight: 700; }
.res-calc-facts b { font-weight: 900; color: var(--brand-dark); }
.res-calc-note { display: block; margin-top: 0.75rem; font-weight: 700; color: #8a7a89; }
.res-calc-flash { box-shadow: 0 0 0 0.25rem rgba(16, 185, 129, 0.35) !important; border-color: #10b981 !important; transition: box-shadow 0.2s; }
@media (max-width: 767px) { .res-calc-grid { grid-template-columns: 1fr; } .res-calc-range input[type="range"] { flex: 1; width: auto; } .res-calc-opt { flex: 1 1 100%; } }
[data-bs-theme="dark"] .res-calc-card { background: rgba(255, 255, 255, 0.04); border-color: var(--misk-border); }
[data-bs-theme="dark"] .res-calc-bar { background: rgba(255, 255, 255, 0.08); }
[data-bs-theme="dark"] .res-calc-facts b { color: var(--bs-body-color); }
[data-bs-theme="dark"] .res-calc-facts span, [data-bs-theme="dark"] .res-calc-top small { color: var(--bs-secondary-color); }

/* Advanced ranking (control panel المتأهلات) */
.res-rank-list {
  max-height: 420px;
  overflow-y: auto;
  padding: 0 0.6rem 0.6rem;
}
.res-rank-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.5rem;
  border-radius: 0.6rem;
}
.res-rank-row.is-in {
  background: rgba(16, 185, 129, 0.08);
}
.res-rank-no {
  width: 1.6rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 900;
  color: #9ca3af;
}
.res-rank-score {
  font-weight: 900;
  font-size: 0.95rem;
  min-width: 2.2rem;
  text-align: center;
}
.res-rank-cut {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.3rem 0;
  font-size: 0.68rem;
  font-weight: 900;
  color: #b45309;
}
.res-rank-cut::before,
.res-rank-cut::after {
  content: "";
  flex: 1;
  border-top: 2px dashed rgba(234, 179, 8, 0.55);
}

/* Searchable dropdowns (miskSearchableSelect() in main.js): the real <select>
   stays underneath, invisible; a button shows the choice and opens a panel. */
.ss-wrap {
  position: relative;
  display: inline-block;
  min-width: 160px;
  flex: 1 1 auto;
}
.ss-wrap .ss-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}
.ss-display {
  width: 100%;
  text-align: start;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.ss-panel {
  position: fixed;
  z-index: 2000;
  max-width: min(420px, calc(100vw - 16px));
  padding: 0.4rem;
  border-radius: 0.8rem;
  background: #fff;
  border: 1px solid rgba(122, 61, 118, 0.15);
  box-shadow: 0 12px 30px rgba(61, 26, 60, 0.18);
}
.ss-search {
  margin-bottom: 0.35rem;
}
.ss-list {
  max-height: 260px;
  overflow-y: auto;
}
.ss-group {
  padding: 0.35rem 0.55rem 0.2rem;
  font-size: 0.7rem;
  font-weight: 900;
  color: var(--brand-primary);
}
.ss-option {
  padding: 0.38rem 0.6rem;
  border-radius: 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.ss-option.is-active,
.ss-option:hover {
  background: color-mix(in srgb, var(--brand-primary) 9%, transparent);
}
.ss-option.is-selected {
  font-weight: 900;
  color: var(--brand-primary);
}
.ss-empty {
  padding: 0.5rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #9ca3af;
}
[data-bs-theme="dark"] .ss-panel {
  background: var(--misk-surface-2);
  border-color: var(--misk-border);
}
[data-bs-theme="dark"] .ss-group {
  color: #d49ccf;
}

/* My sessions gallery: the two places of a teacher who was a student before. */
.my-sessions-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--brand-dark);
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(122, 61, 118, 0.12);
}
.my-sessions-group i {
  color: var(--brand-primary);
}
[data-bs-theme="dark"] .my-sessions-group {
  border-color: var(--misk-border);
}

/* A student's own result (my-session.php, once her level is sent): four lines
   - theory mark, practical, teacher's assessment - then the final result. */
.my-res {
  padding: 0;
  overflow: hidden;
}
.my-res-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(122, 61, 118, 0.08);
}
.my-res-head-icon {
  width: 40px;
  height: 40px;
  border-radius: 0.8rem;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  color: #fff;
  background: var(--session-theme, var(--brand-primary));
}
.my-res-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--brand-dark);
}
.my-res-sub {
  font-size: 0.75rem;
  font-weight: 700;
  color: #6b7280;
}
.my-res-lines {
  padding: 0.35rem 1.25rem;
}
/* Theory-only card: her mark big, then a bar with the qualifying mark as a tag pointing at its notch */
.my-res-value.is-pending { color: #9a8798; font-weight: 700; font-size: 0.9rem; }
.my-res-score { padding: 1.1rem 1.25rem 0.4rem; text-align: center; }
.my-res-score-num { font-size: 2.6rem; font-weight: 900; line-height: 1; color: var(--brand-primary); }
.my-res-score-num small { font-size: 1.1rem; font-weight: 800; color: #9a8798; }
.my-res-score-label { margin-top: 0.4rem; font-weight: 800; font-size: 0.9rem; color: #6b5a6a; }
.my-res-score-parts { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.7rem; }
.my-res-score-parts span { padding: 0.25rem 0.75rem; border-radius: 999px; background: rgba(122, 61, 118, 0.07); font-size: 0.82rem; font-weight: 700; color: #6b5a6a; }
.my-res-score-parts b { color: #3b2a3a; }
.my-res-bar { position: relative; margin-top: 1.1rem; padding-top: 2.1rem; text-align: start; }
.my-res-bar-track { position: relative; height: 12px; border-radius: 999px; background: rgba(122, 61, 118, 0.12); }
.my-res-bar-fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 999px; background: linear-gradient(90deg, #a85ba2, var(--brand-primary)); }
[dir="rtl"] .my-res-bar-fill { background: linear-gradient(270deg, #a85ba2, var(--brand-primary)); }
.my-res-bar-notch { position: absolute; top: -5px; bottom: -5px; width: 4px; margin-inline-start: -2px; border-radius: 2px; background: #3b2a3a; box-shadow: 0 0 0 2px #fff; }
/* the tag over the notch, with a small arrow under it */
.my-res-bar-pin { position: absolute; top: 0; transform: translateX(50%); white-space: nowrap; padding: 0.15rem 0.6rem; border-radius: 999px; background: #3b2a3a; color: #fff; font-size: 0.76rem; font-weight: 700; }
[dir="ltr"] .my-res-bar-pin { transform: translateX(-50%); }
.my-res-bar-pin::after { content: ''; position: absolute; top: 100%; inset-inline-start: 50%; margin-inline-start: -5px; border: 5px solid transparent; border-top-color: #3b2a3a; }
.my-res-bar-scale { display: flex; justify-content: space-between; margin-top: 0.3rem; font-size: 0.75rem; font-weight: 700; color: #9a8798; }
/* «تظهر النتيجة النهائية هنا...» under the theory-only card: inside the card's margins, icon beside the text */
.my-res-hint {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.25rem 1.25rem 1rem;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  background: rgba(122, 61, 118, 0.06);
  color: #6b5a6a;
  font-weight: 700;
  font-size: 0.85rem;
}
.my-res-hint .bi { color: var(--brand-primary); flex-shrink: 0; }
.my-res-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 0;
}
.my-res-line + .my-res-line {
  border-top: 1px dashed rgba(122, 61, 118, 0.14);
}
.my-res-label {
  font-size: 0.88rem;
  font-weight: 800;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.my-res-label i {
  color: var(--session-theme, var(--brand-primary));
}
.my-res-value {
  font-size: 1rem;
  font-weight: 900;
  color: var(--brand-dark);
  font-variant-numeric: tabular-nums;
}
.my-res-note {
  margin: 0 0 0.7rem;
  padding: 0.6rem 0.85rem;
  border-radius: 0.7rem;
  background: color-mix(in srgb, var(--session-theme, var(--brand-primary)) 6%, transparent);
}
.my-res-note-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--session-theme, var(--brand-primary));
}
.my-res-note p {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.8;
  color: var(--brand-dark);
}
[data-bs-theme="dark"] .my-res-note {
  background: rgba(192, 126, 187, 0.1);
}
[data-bs-theme="dark"] .my-res-note-label {
  color: #d49ccf;
}
.my-res-value.is-yes { color: #047857; }
.my-res-value.is-no { color: #be123c; }
.my-res-value.is-absent { color: #a16207; }
.my-res-final {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.95rem 1.25rem;
}
.my-res-final.is-yes { background: rgba(16, 185, 129, 0.1); }
/* المتأهلات: the team's congratulation to an advanced student who qualified */
.my-qual {
  position: relative;
  overflow: hidden;
  padding: 1.5rem 1.6rem 1.4rem;
  text-align: center;
  line-height: 2;
  font-size: 1.05rem;
  color: var(--brand-dark);
  background: radial-gradient(circle at 12% 0%, rgba(232, 191, 92, 0.22), transparent 45%),
              radial-gradient(circle at 90% 110%, rgba(70, 172, 174, 0.18), transparent 50%),
              linear-gradient(135deg, #FFF9F0, #F8EEF6);
  border: 1.5px solid rgba(232, 191, 92, 0.45);
}
.my-qual p { margin-bottom: 0.6rem; }
.my-qual-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
  padding: 0.3rem 0.95rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
  background: rgba(232, 191, 92, 0.22);
  color: #8a6312;
}
.my-qual-lead { font-weight: 800; font-size: 1.12rem; }
.my-qual-lead b { color: var(--brand-primary); }
.my-qual-rules {
  margin-top: 1.1rem;
  padding: 1rem 1.2rem 0.4rem;
  border-radius: 1rem;
  text-align: start;
  line-height: 1.8;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(122, 61, 118, 0.15);
}
.my-qual-rules h4 { font-size: 1rem; font-weight: 800; margin-bottom: 0.5rem; }
.my-qual-badge { align-self: center; }
.my-qual-rules ul { padding-inline-start: 1.2rem; margin-bottom: 0.8rem; }
.my-qual-rules li { margin-bottom: 0.35rem; }
.my-qual-rules li b { color: var(--brand-primary); }
/* Her answer to the rules */
.my-qual-answer { border-top: 1px dashed rgba(122, 61, 118, 0.25); padding: 0.85rem 0 0.7rem; text-align: center; }
.my-qual-ask { font-weight: 800; margin-bottom: 0.6rem; }
.my-qual-ask small { display: block; font-weight: 600; opacity: 0.7; margin-top: 0.15rem; }
.my-qual-ask.is-yes { color: #0f8a5f; }
.my-qual-ask.is-no { color: #b23a48; }
.my-qual-btns { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; margin: 0; }
.my-qual-btn {
  min-width: 8.5rem;
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  font-weight: 800;
  border: 1.5px solid;
  background: #fff;
  transition: background 0.15s, box-shadow 0.15s;
}
.my-qual-btn.is-yes { color: #0f8a5f; border-color: rgba(16, 185, 129, 0.45); }
.my-qual-btn.is-no { color: #b23a48; border-color: rgba(225, 29, 72, 0.35); }
.my-qual-btn.is-yes:hover, .my-qual-btn.is-yes.is-on { background: rgba(16, 185, 129, 0.14); }
.my-qual-btn.is-no:hover, .my-qual-btn.is-no.is-on { background: rgba(225, 29, 72, 0.1); }
.my-qual-btn.is-on { box-shadow: 0 0 0 3px rgba(122, 61, 118, 0.08); }
/* Questions -> customer service on WhatsApp */
.my-qual-help {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 1rem;
  text-align: start;
  line-height: 1.5;
  text-decoration: none;
  color: var(--brand-dark);
  background: rgba(37, 211, 102, 0.1);
  border: 1px solid rgba(37, 211, 102, 0.35);
  transition: background 0.15s;
}
.my-qual-help:hover { background: rgba(37, 211, 102, 0.16); color: var(--brand-dark); }
.my-qual-help b { display: block; font-size: 0.98rem; }
.my-qual-help small { font-size: 0.85rem; opacity: 0.8; }
.my-qual-help-icon { flex: 0 0 auto; width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.3rem; color: #fff; background: #25d366; }
.my-qual-help-go { margin-inline-start: auto; opacity: 0.6; }
[data-bs-theme="dark"] .my-qual-btn { background: transparent; }
[data-bs-theme="dark"] .my-qual-help { color: #f1e6ef; }
[data-bs-theme="dark"] .my-qual-rules li b { color: #e3b4de; }
[data-bs-theme="dark"] .my-qual {
  color: #f1e6ef;
  background: radial-gradient(circle at 12% 0%, rgba(232, 191, 92, 0.16), transparent 45%), linear-gradient(135deg, #2b2130, #241a26);
}
[data-bs-theme="dark"] .my-qual-badge { color: #f0cf7e; }
[data-bs-theme="dark"] .my-qual-lead b { color: #e3b4de; }
[data-bs-theme="dark"] .my-qual-rules { background: rgba(255, 255, 255, 0.05); }
.my-res-final.is-no { background: rgba(225, 29, 72, 0.08); }
.my-res-final .my-res-label { color: var(--brand-dark); }
.my-res-final.is-yes .my-res-label i { color: #10b981; }
.my-res-final.is-no .my-res-label i { color: #e11d48; }
.my-res-final-value {
  font-size: 1.05rem;
  font-weight: 900;
}
.my-res-final.is-yes .my-res-final-value { color: #047857; }
.my-res-final.is-no .my-res-final-value { color: #be123c; }
[data-bs-theme="dark"] .my-res-head,
[data-bs-theme="dark"] .my-res-line + .my-res-line {
  border-color: var(--misk-border);
}
[data-bs-theme="dark"] .my-res-head-icon { color: #140f15; }
[data-bs-theme="dark"] .my-res-sub,
[data-bs-theme="dark"] .my-res-label { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .my-res-final .my-res-label { color: var(--brand-dark); }
[data-bs-theme="dark"] .my-res-value.is-yes,
[data-bs-theme="dark"] .my-res-final.is-yes .my-res-final-value { color: #6ee7b7; }
[data-bs-theme="dark"] .my-res-value.is-no,
[data-bs-theme="dark"] .my-res-final.is-no .my-res-final-value { color: #fda4af; }
[data-bs-theme="dark"] .my-res-value.is-absent { color: #fcd34d; }
[data-bs-theme="dark"] .my-res-final.is-yes { background: rgba(52, 211, 153, 0.1); }
[data-bs-theme="dark"] .my-res-final.is-no { background: rgba(251, 113, 133, 0.1); }

/* ===== Results overview tab (includes/cp-results-overview.php) ===== */
.res-ov-title {
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--brand-dark);
  margin-bottom: 0.6rem;
}
.res-ov-meter {
  padding: 1rem 1.1rem;
}
.res-ov-meter-head {
  font-size: 0.78rem;
  font-weight: 800;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.res-ov-meter-head i {
  color: var(--brand-primary);
}
.res-ov-meter-num {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--brand-dark);
  line-height: 1.2;
  margin: 0.3rem 0 0.45rem;
}
.res-ov-meter-num span {
  font-size: 0.9rem;
  margin-inline-start: 0.1rem;
  color: #6b7280;
}
.res-ov-track {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: rgba(122, 61, 118, 0.1);
  overflow: hidden;
}
.res-ov-track > span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--brand-primary);
}
.res-ov-track.sm {
  display: inline-block;
  width: 64px;
  height: 6px;
  vertical-align: middle;
}
.res-ov-meter-caption {
  font-size: 0.72rem;
  font-weight: 700;
  color: #6b7280;
  margin-top: 0.4rem;
}
/* Outcome split: segments separated by a 2px surface gap. */
.res-ov-split {
  display: flex;
  gap: 2px;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
}
.res-ov-split span {
  min-width: 4px;
}
.res-ov-split .seg-yes,
.res-ov-legend .lg-yes {
  background: #10b981;
  color: #10b981;
}
.res-ov-split .seg-no,
.res-ov-legend .lg-no {
  background: #ef4444;
  color: #ef4444;
}
.res-ov-split .seg-missing,
.res-ov-legend .lg-missing {
  background: #d1d5db;
  color: #9ca3af;
}
.res-ov-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  margin-top: 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-dark);
}
.res-ov-legend i {
  background: none !important;
}
.res-ov-legend small {
  color: #6b7280;
  font-weight: 700;
}
.res-ov-table td {
  vertical-align: middle;
}
.res-ov-rate {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 800;
}
/* «حلقات لم تكتمل تقييماتها» filters: what's missing (full width), then format and level side by side. */
.res-ov-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.res-ov-filters .res-ov-filter-exam { grid-column: 1 / -1; font-weight: 700; }
.res-ov-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 340px;
  overflow-y: auto;
}
.res-ov-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(122, 61, 118, 0.1);
}
/* المتأهلات: her answer to the intensive course rules, editable by admins. */
.res-agree-select {
  width: auto;
  min-width: 8.5rem;
  font-size: 0.78rem;
  padding-block: 0.2rem;
}
.res-agree-select.res-agree-none { color: #6b7280; }
.res-agree-select.res-agree-yes { color: #047857; border-color: rgba(4, 120, 87, 0.35); }
.res-agree-select.res-agree-no { color: #b91c1c; border-color: rgba(185, 28, 28, 0.35); }
[data-bs-theme="dark"] .res-agree-select.res-agree-none { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .res-agree-select.res-agree-yes { color: #6ee7b7; }
[data-bs-theme="dark"] .res-agree-select.res-agree-no { color: #fca5a5; }
.res-ov-done {
  font-size: 0.85rem;
  font-weight: 800;
  color: #047857;
}
[data-bs-theme="dark"] .res-ov-meter-head,
[data-bs-theme="dark"] .res-ov-meter-num span,
[data-bs-theme="dark"] .res-ov-meter-caption,
[data-bs-theme="dark"] .res-ov-legend small {
  color: var(--bs-secondary-color);
}
[data-bs-theme="dark"] .res-ov-split .seg-missing {
  background: #4b4150;
}
[data-bs-theme="dark"] .res-ov-item {
  border-color: var(--misk-border);
}
[data-bs-theme="dark"] .res-ov-done {
  color: #6ee7b7;
}

/* ===== Statistics page (includes/cp-stats.php) ===== */
.stat-bars {
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 180px;
  padding-top: 0.25rem;
  border-bottom: 1px solid #e5e7eb;
}
.stat-bar-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  position: relative;
  padding-bottom: 1.6rem;
  cursor: default;
}
.stat-bar {
  display: block;
  width: min(48px, 70%);
  border-radius: 4px 4px 0 0;
  transition: opacity 0.15s;
}
.stat-bar-primary { background: var(--brand-primary); }
.stat-bar-accent { background: #46acae; }
.stat-bar-col:hover .stat-bar { opacity: 0.8; }
.stat-bar-val {
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--brand-dark);
  margin-bottom: 0.2rem;
}
.stat-bar-label {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  font-size: 0.68rem;
  font-weight: 700;
  color: #6b7280;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-delta {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: #6b7280;
}
.stat-trend-table td,
.stat-trend-table th {
  white-space: nowrap;
}
.stat-group-row td {
  background: rgba(122, 61, 118, 0.05);
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--brand-primary);
}
.stat-detail-cell { background: rgba(122, 61, 118, 0.03); }
.stat-ci {
  font-size: 0.68rem;
  font-weight: 700;
  color: #6b7280;
  white-space: nowrap;
}
.stat-n {
  font-size: 0.66rem;
  font-weight: 700;
  color: #9ca3af;
}
.stat-sig,
.stat-nsig {
  display: inline-block;
  font-size: 0.64rem;
  font-weight: 800;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
}
.stat-sig { background: rgba(122, 61, 118, 0.12); color: var(--brand-primary); }
.stat-nsig { background: #f3f4f6; color: #6b7280; }
/* Box plot: whisker min-max, box Q1-Q3, median bar, mean dot (always left-to-right). */
.stat-box {
  position: relative;
  height: 18px;
  margin-top: 2px;
}
.stat-box > span { position: absolute; top: 50%; transform: translateY(-50%); }
.stat-box-whisker { height: 2px; background: #9ca3af; }
.stat-box-iqr {
  height: 14px;
  border-radius: 3px;
  background: rgba(122, 61, 118, 0.28);
  border: 1px solid var(--brand-primary);
}
.stat-box-median { width: 2px; height: 16px; margin-left: -1px; background: var(--brand-dark); }
.stat-box-mean {
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: #46acae;
  box-shadow: 0 0 0 2px #fff;
}
.stat-box-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.6rem;
  font-weight: 700;
  color: #9ca3af;
  border-top: 1px solid #eef0f3;
}
/* Horizontal bars with a 95% interval line (absences vs pass rate). */
.stat-hbar-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
}
.stat-hbar-label { width: 70px; font-size: 0.78rem; font-weight: 800; flex-shrink: 0; }
.stat-hbar-val { width: 90px; font-size: 0.78rem; font-weight: 900; flex-shrink: 0; }
.stat-hbar-track {
  position: relative;
  flex-grow: 1;
  height: 16px;
  border-radius: 4px;
  background: rgba(122, 61, 118, 0.08);
}
.stat-hbar-fill {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  border-radius: 4px;
  background: var(--brand-primary);
}
.stat-hbar-ci {
  position: absolute;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: var(--brand-dark);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7);
}
/* Where qualified students were placed next semester. */
.res-ov-split .seg-prog-up, .res-ov-legend .lg-prog-up { background: var(--brand-primary); color: var(--brand-primary); }
.res-ov-split .seg-prog-same, .res-ov-legend .lg-prog-same { background: #c297c3; color: #c297c3; }
.res-ov-split .seg-prog-down, .res-ov-legend .lg-prog-down { background: #d97706; color: #d97706; }
.res-ov-split .seg-prog-none, .res-ov-legend .lg-prog-none { background: #d1d5db; color: #9ca3af; }
.stat-method summary { cursor: pointer; color: var(--brand-dark); }
.stat-method li { margin-bottom: 0.3rem; }
[data-bs-theme="dark"] .stat-detail-cell { background: rgba(255, 255, 255, 0.03); }
[data-bs-theme="dark"] .stat-ci,
[data-bs-theme="dark"] .stat-n,
[data-bs-theme="dark"] .stat-box-axis { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .stat-nsig { background: rgba(255, 255, 255, 0.06); color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .stat-box-axis { border-top-color: var(--misk-border); }
[data-bs-theme="dark"] .stat-box-iqr { background: rgba(192, 126, 187, 0.3); }
[data-bs-theme="dark"] .stat-box-mean { box-shadow: 0 0 0 2px var(--misk-surface, #1d161e); }
[data-bs-theme="dark"] .stat-hbar-track { background: rgba(255, 255, 255, 0.06); }
[data-bs-theme="dark"] .stat-hbar-ci { background: #f3e8f2; box-shadow: none; }
[data-bs-theme="dark"] .res-ov-split .seg-prog-none { background: #4b4150; }
[data-bs-theme="dark"] .stat-bars { border-bottom-color: var(--misk-border); }
[data-bs-theme="dark"] .stat-bar-accent { background: #5cc4c6; }
[data-bs-theme="dark"] .stat-bar-label,
[data-bs-theme="dark"] .stat-delta { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .stat-group-row td { background: rgba(255, 255, 255, 0.04); }

/* Roster result button (my-session.php, links to results.php): plain award
   icon until a verdict exists, then green ✓ / red ✕. */
.roster-action-verdict.is-yes {
  color: #047857;
  background: rgba(16, 185, 129, 0.14);
}
.roster-action-verdict.is-no {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.12);
}
.roster-action-verdict.is-yes:hover {
  color: #fff;
  background: #10b981;
}
.roster-action-verdict.is-no:hover {
  color: #fff;
  background: #ef4444;
}
.roster-action-verdict:disabled {
  opacity: 0.75;
  cursor: default;
  transform: none;
}
[data-bs-theme="dark"] .roster-action-verdict.is-yes {
  color: #6ee7b7;
}
[data-bs-theme="dark"] .roster-action-verdict.is-no {
  color: #fca5a5;
}

/* تتأهل / لا تتأهل toggle (results page + teacher's session page): a soft
   pill track; the chosen option fills green / red / white. */
.verdict-seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 5%, transparent);
  border: 1px solid rgba(122, 61, 118, 0.12);
}
.verdict-seg label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.8rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #6b7280;
  cursor: pointer;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
  transition:
    background-color 0.15s,
    color 0.15s,
    box-shadow 0.15s;
}
.verdict-seg label.v-none {
  padding-inline: 0.55rem;
}
.verdict-seg label:hover {
  background: color-mix(in srgb, var(--brand-primary) 8%, transparent);
  color: var(--brand-dark);
}
.verdict-seg .btn-check:checked + .v-yes {
  background: #10b981;
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.verdict-seg .btn-check:checked + .v-no {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.28);
}
.verdict-seg .btn-check:checked + .v-none {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}
.verdict-seg .btn-check:focus-visible + label {
  outline: 2px solid var(--brand-primary);
  outline-offset: 1px;
}
.verdict-seg .btn-check:disabled + label {
  cursor: default;
  opacity: 0.6;
}
.verdict-seg .btn-check:disabled:checked + label {
  opacity: 1;
}
.verdict-seg .btn-check:disabled + label:not(.v-yes, .v-no):hover,
.verdict-seg .btn-check:disabled:not(:checked) + label:hover {
  background: transparent;
  color: #6b7280;
}
[data-bs-theme="dark"] .verdict-seg {
  border-color: var(--misk-border);
}
[data-bs-theme="dark"] .verdict-seg label {
  color: var(--bs-secondary-color);
}
[data-bs-theme="dark"] .verdict-seg .btn-check:checked + .v-yes,
[data-bs-theme="dark"] .verdict-seg .btn-check:checked + .v-no {
  color: #fff;
}
[data-bs-theme="dark"] .verdict-seg .btn-check:checked + .v-none {
  background: var(--misk-surface-2);
  color: var(--brand-dark);
}
.res-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.res-st-missing {
  background: rgba(234, 179, 8, 0.12);
  color: #a16207;
}
.res-st-ready {
  background: color-mix(in srgb, var(--brand-primary) 10%, transparent);
  color: var(--brand-primary);
}
.res-st-approved {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}
.sem-stat.res-stat-no .sem-stat-icon {
  color: #b91c1c;
}
[data-bs-theme="dark"] .res-progress {
  color: var(--bs-secondary-color);
}
[data-bs-theme="dark"] .res-st-missing {
  color: #fcd34d;
}
[data-bs-theme="dark"] .res-st-approved {
  color: #6ee7b7;
}
[data-bs-theme="dark"] .sem-stat.res-stat-no .sem-stat-icon {
  color: #fca5a5;
}

/* ===== Rich-text rules editor (control panel) + its read-only display ===== */
.rules-editor-toolbar .btn.active {
  background: rgba(122, 61, 118, 0.12);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}
.rules-editor-toolbar .rules-editor-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.15);
}
.rules-editor-content {
  min-height: 140px;
  white-space: normal;
}
.rules-editor-content:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 0.2rem rgba(122, 61, 118, 0.15);
}
.rules-content,
.rules-editor-content {
  line-height: 1.9;
  font-family: var(--bs-body-font-family);
  /* Normal weight on purpose: the editor sits in a .form-control (weight 600),
     and on already-heavy text the browser's Bold button "un-bolds" instead of
     adding <b> - so Bold appeared to do nothing. */
  font-weight: 400;
}
.rules-content b,
.rules-content strong,
.rules-editor-content b,
.rules-editor-content strong {
  font-weight: 700;
}
.rules-content p,
.rules-editor-content p {
  margin-bottom: 0.75rem;
}
.rules-content ul,
.rules-content ol,
.rules-editor-content ul,
.rules-editor-content ol {
  margin-bottom: 0.75rem;
  padding-inline-start: 1.5rem;
}
.rules-content li,
.rules-editor-content li {
  margin-bottom: 0.35rem;
}

/* Cover editor: the small color swatch inside the "other color" text button. */
.cover-text-color,
.btn .cover-text-color {
  width: 22px;
  min-width: 22px;
  flex: 0 0 22px;
  inline-size: 22px;
  block-size: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  background: none;
  cursor: pointer;
  overflow: hidden;
}
.cover-text-color::-webkit-color-swatch-wrapper {
  padding: 0;
}
.cover-text-color::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}
.cover-text-color::-moz-color-swatch {
  border: none;
  border-radius: 50%;
}

/* Phone field with a country code picker (render_phone_input() in helpers.php):
   drawn as ONE box shaped like the other fields - the picker and the number
   sit inside it, split by a thin line. */
.phone-input-group {
  flex-wrap: nowrap;
  border: 1.5px solid #e5e7eb;
  border-radius: 0.75rem;
  background-color: #f8fafc;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background-color 0.15s;
}
.phone-input-group:focus-within {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(122, 61, 118, 0.08);
  background-color: #fff;
}
.phone-input-group.is-invalid-group {
  border-color: var(--bs-form-invalid-border-color, #dc3545);
}
.phone-input-group > .form-control,
.phone-input-group > .form-select {
  border: 0;
  border-radius: 0 !important;
  background-color: transparent;
  box-shadow: none !important;
}
.phone-input-group .phone-code-select {
  flex: 0 0 auto;
  width: auto;
  max-width: 48%;
  border-inline-end: 1px solid #e5e7eb;
}
.phone-input-group .phone-code-other {
  flex: 0 0 70px;
  max-width: 70px;
  border-inline-end: 1px solid #e5e7eb;
}
.input-group-sm.phone-input-group {
  border-radius: 0.5rem;
}

/* My Session: the late counter (amber), its hints, the teacher-only notes
   panel and the تتأهل / لا تتأهل badges. */
.roster-attendance .stepper.stepper-late {
  background: #fffbeb;
  border-color: #fcd34d;
}
.roster-attendance .stepper.stepper-late .stepper-btn {
  color: #d97706;
}
.roster-attendance .stepper.stepper-late .stepper-btn:hover:not(:disabled) {
  background: #d97706;
  color: #fff;
}
.roster-attendance .stepper.stepper-late .stepper-value {
  color: #b45309;
}
.roster-att-item small.late-hint {
  font-size: 0.62rem;
  font-weight: 600;
  color: #9ca3af;
}
.roster-att-item small.late-extra {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--absence-unexcused, #b91c1c);
}
button.roster-action {
  border: 0;
  padding: 0;
}
.roster-notes {
  flex-basis: 100%;
  order: 10;
}
.roster-notes-form {
  margin-top: 0.25rem;
  padding: 0.75rem;
  border-radius: 0.85rem;
  background: color-mix(in srgb, var(--session-theme, var(--brand-primary)) 5%, #fff);
  border: 1px dashed color-mix(in srgb, var(--session-theme, var(--brand-primary)) 35%, #fff);
}
.roster-qualify-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
}
.roster-qualify-badge[hidden] {
  display: none;
}
.roster-qualify-yes {
  color: #065f46;
  background: #d1fae5;
}
.roster-qualify-no {
  color: #991b1b;
  background: #fee2e2;
}
.absence-pill-late {
  background: #fef3c7;
  color: #b45309;
}
/* Lets the notes panel take its own line under the student's row. */
.roster-row {
  flex-wrap: wrap;
}

/* «الدروس النظرية» (library.php): the lessons fill the whole screen under the site
   header - a slim strip with the lesson menu, then the lesson itself. */
.library-shell {
  position: fixed;
  top: 80px; /* set from the header's real height in library.php */
  inset-inline: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  background: #fefbfa; /* same light tint as the lessons' page */
}
.library-bar {
  position: relative;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(122, 61, 118, 0.12);
}
/* A thin line of light gliding along the strip's bottom edge. */
.library-bar::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(122, 61, 118, 0.7) 35%, rgba(70, 172, 174, 0.9) 50%, rgba(122, 61, 118, 0.7) 65%, transparent 100%);
  background-size: 200% 100%;
  box-shadow: 0 0 10px rgba(122, 61, 118, 0.35);
  animation: libraryGlowLine 6s linear infinite;
  pointer-events: none;
}
@keyframes libraryGlowLine {
  from { background-position: 200% 0; }
  to { background-position: 0 0; }
}
.library-bar-title i {
  filter: drop-shadow(0 0 6px rgba(122, 61, 118, 0.45));
}
@media (prefers-reduced-motion: reduce) {
  .library-bar::after { animation: none; }
}
.library-bar-inner {
  max-width: 1280px;
  margin-inline: auto;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.library-bar-title {
  font-weight: 900;
  color: var(--brand-dark);
  white-space: nowrap;
}
.library-bar-title i {
  color: var(--brand-primary);
}
.library-bar-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1 1 0;
  min-width: 0;
}
/* The lessons, as a row of numbered chips that scrolls sideways (edges fade out). */
.library-chips {
  display: flex;
  gap: 0.45rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0.45rem 0.6rem;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
}
.library-chips::-webkit-scrollbar {
  display: none;
}
.library-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem 0.35rem 0.4rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(122, 61, 118, 0.16);
  color: var(--brand-dark);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  transition:
    background-color 0.25s,
    border-color 0.25s,
    box-shadow 0.25s,
    transform 0.2s,
    color 0.25s;
}
[dir="rtl"] .library-chip {
  padding: 0.35rem 0.4rem 0.35rem 0.85rem;
}
.library-chip-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background: rgba(122, 61, 118, 0.09);
  color: var(--brand-primary);
  font-size: 0.75rem;
  font-weight: 900;
}
.library-chip:hover {
  color: var(--brand-primary);
  border-color: rgba(122, 61, 118, 0.4);
  box-shadow: 0 0 14px rgba(122, 61, 118, 0.22);
  transform: translateY(-1px);
}
/* The lesson being read: filled, glowing softly. */
.library-chip.active {
  background: linear-gradient(135deg, #7a3d76 0%, #8f4d8a 55%, #46acae 130%);
  border-color: transparent;
  color: #fff;
  box-shadow:
    0 0 0 3px rgba(122, 61, 118, 0.12),
    0 4px 18px rgba(122, 61, 118, 0.35),
    0 0 22px rgba(70, 172, 174, 0.25);
}
.library-chip.active .library-chip-n {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
/* Previous / next: round buttons at both ends. */
.library-step {
  flex: 0 0 auto;
  width: 2.1rem;
  height: 2.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(122, 61, 118, 0.18);
  background: #fff;
  color: var(--brand-primary);
  transition:
    box-shadow 0.25s,
    background-color 0.25s,
    color 0.25s;
}
.library-step:hover:not(:disabled) {
  background: var(--brand-primary);
  color: #fff;
  box-shadow: 0 0 16px rgba(122, 61, 118, 0.4);
}
.library-step:disabled {
  opacity: 0.35;
}
/* «قاعة الأبواب» button: filled like the active chip while the hall is showing. */
.library-step.library-doors.active {
  background: linear-gradient(135deg, #7a3d76 0%, #8f4d8a 55%, #46acae 130%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(122, 61, 118, 0.35);
}
/* Level plan: only that level's lessons show, in plan order. */
.library-chip[hidden],
.library-step[hidden] {
  display: none;
}
.library-level {
  flex: 0 0 auto;
  width: auto;
  border-radius: 999px;
  border-color: rgba(122, 61, 118, 0.18);
  color: var(--brand-primary);
  font-weight: 700;
}
.library-frame {
  flex: 1 1 auto;
  display: block;
  width: 100%;
  border: 0;
  background: #fefbfa;
}
/* One page: no footer / scroll-to-top under the lessons. */
body:has(.library-shell) .app-footer,
body:has(.library-shell) #scrollTopBtn {
  display: none !important;
}
@media (max-width: 575.98px) {
  .library-bar-title {
    display: none;
  }
  .library-bar-inner {
    padding-inline: 0.5rem;
  }
  /* Phones: the row is for the lessons only; the level is chosen in the hall of doors. */
  .library-level {
    display: none;
  }
}

/* Library "bigger screen": the site header and lessons bar slide away; a small
   floating button (or Esc) brings them back. */
.library-unfocus-btn {
  display: none;
  position: absolute;
  top: 0.6rem;
  inset-inline-end: 0.9rem;
  z-index: 5;
  width: 2.4rem;
  height: 2.4rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(122, 61, 118, 0.2);
  background: rgba(255, 255, 255, 0.92);
  color: var(--brand-primary);
  box-shadow: 0 0 16px rgba(122, 61, 118, 0.3);
  transition: background-color 0.25s, color 0.25s;
}
.library-unfocus-btn:hover {
  background: var(--brand-primary);
  color: #fff;
}
.library-shell {
  transition: top 0.3s ease;
}
/* The hall of doors (lessons home) shows no lesson bar; the frame takes its space. */
.library-shell.library-home .library-bar {
  display: none;
}
/* Past exams (library.php#exams): shown in the frame's place, scrolling on their own; the bar stays. */
.library-exams {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.library-exams[hidden],
.library-shell.library-exams-on .library-frame {
  display: none;
}
.library-shell.library-exams-on .library-bar {
  display: block;
}
body.library-focus nav.navbar-misk,
body.library-focus .library-bar {
  display: none !important;
}
body.library-focus .library-unfocus-btn {
  display: inline-flex;
}

/* ═══ Dark mode ═══════════════════════════════════════════════════════════════
   Turned on by the moon/sun button (render_theme_toggle_button(), main.js),
   which sets data-bs-theme="dark" on <html> - Bootstrap's own dark mode covers
   its components; this layer covers the site's own colours: deep plum
   surfaces, lighter purple accents, light text. */
.theme-toggle-sun {
  display: none;
}
[data-bs-theme="dark"] .theme-toggle-sun {
  display: inline;
}
[data-bs-theme="dark"] .theme-toggle-moon {
  display: none;
}

[data-bs-theme="dark"] {
  --brand-primary: #c07ebb;
  --brand-secondary: #8f5f8d;
  --brand-neutral: #140f15;
  --brand-dark: #f1e6ef;
  --brand-accent: #5cc6c8;
  --bs-primary: #c07ebb;
  --bs-primary-rgb: 192, 126, 187;
  --bs-body-bg: #140f15;
  --bs-body-color: #e9dde7;
  --bs-secondary-color: #b5a3b3;
  --bs-tertiary-bg: #1f1720;
  --bs-border-color: #3a2c3a;
  --bs-link-color: #d49ccf;
  --bs-link-hover-color: #f1e6ef;
  --misk-surface: #1e1620;
  --misk-surface-2: #271d28;
  --misk-border: #3a2c3a;
  --tint-lilac: #2a1f2c;
  --tint-lilac-border: #45334a;
  --tint-blush: #34202a;
  --tint-blush-border: #553142;
  --tint-teal: #183032;
  --tint-teal-border: #24494b;
  --tint-rose: #3a1c25;
  --tint-rose-border: #5c2a38;
  --tint-rose-text: #f4a3b6;
  --path-line: #5a4560;
  --text-soft: #b5a3b3;
  color-scheme: dark;
}
[data-bs-theme="dark"] body {
  background-color: #140f15;
  background-image:
    radial-gradient(ellipse 900px 640px at 12% -8%, rgba(192, 126, 187, 0.12), transparent 62%),
    radial-gradient(ellipse 900px 640px at 100% 105%, rgba(92, 198, 200, 0.08), transparent 62%);
  color: var(--bs-body-color);
}
[data-bs-theme="dark"] .text-muted {
  color: #b5a3b3 !important;
}

/* Header, footer and other glassy bars. */
[data-bs-theme="dark"] .navbar-misk,
[data-bs-theme="dark"] .navbar-misk .navbar-collapse,
[data-bs-theme="dark"] .app-footer,
[data-bs-theme="dark"] .library-bar,
[data-bs-theme="dark"] .library-unfocus-btn,
[data-bs-theme="dark"] .session-cover-plain,
[data-bs-theme="dark"] .session-format-badge,
[data-bs-theme="dark"] .theme-cover-caption,
[data-bs-theme="dark"] .cp-info-avatar {
  background: rgba(24, 17, 25, 0.9);
  border-color: var(--misk-border);
}

/* Cards and white boxes. */
[data-bs-theme="dark"] .card-soft,
[data-bs-theme="dark"] .welcome-card,
[data-bs-theme="dark"] .student-type-card,
[data-bs-theme="dark"] .first-time-toggle,
[data-bs-theme="dark"] .profile-field,
[data-bs-theme="dark"] .roster-row,
[data-bs-theme="dark"] .roster-action,
[data-bs-theme="dark"] .roster-avatar,
[data-bs-theme="dark"] .roster-notes-form,
[data-bs-theme="dark"] .stepper-btn,
[data-bs-theme="dark"] .cp-info-timings-box,
[data-bs-theme="dark"] .cp-account-switch,
[data-bs-theme="dark"] .cp-back-btn,
[data-bs-theme="dark"] .cp-assign-tabs .nav-link,
[data-bs-theme="dark"] .table-misk.table-boxed-rows tbody tr,
[data-bs-theme="dark"] .theme-cover-default,
[data-bs-theme="dark"] .library-chip,
[data-bs-theme="dark"] .library-step,
[data-bs-theme="dark"] .timetable thead th,
[data-bs-theme="dark"] .master-schedule thead th,
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .dropdown-menu,
[data-bs-theme="dark"] .bg-white,
[data-bs-theme="dark"] .bg-light {
  background-color: var(--misk-surface) !important;
  border-color: var(--misk-border) !important;
  color: var(--bs-body-color);
}
[data-bs-theme="dark"] .card-soft,
[data-bs-theme="dark"] .welcome-card {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
[data-bs-theme="dark"] .first-time-toggle:hover:not(.active),
[data-bs-theme="dark"] .timetable tbody tr:nth-child(even) {
  background-color: #1a131b;
}
[data-bs-theme="dark"] .timetable thead th,
[data-bs-theme="dark"] .timetable tbody td:first-child,
[data-bs-theme="dark"] .timetable tbody th:first-child,
[data-bs-theme="dark"] .master-schedule thead th,
[data-bs-theme="dark"] .master-schedule tbody td:first-child,
[data-bs-theme="dark"] .text-dark {
  color: var(--brand-dark) !important;
}

/* Form fields. */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .phone-input-group,
[data-bs-theme="dark"] .yesno-toggle,
[data-bs-theme="dark"] .cp-phone-chip,
[data-bs-theme="dark"] .cp-announce-chip,
[data-bs-theme="dark"] .rules-editor-content {
  background-color: var(--misk-surface-2);
  border-color: var(--misk-border);
  color: var(--brand-dark);
}
[data-bs-theme="dark"] .phone-input-group > .form-control,
[data-bs-theme="dark"] .phone-input-group > .form-select {
  background-color: transparent;
}
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus,
[data-bs-theme="dark"] .phone-input-group:focus-within {
  background-color: #2e2230;
  border-color: var(--brand-primary);
  color: var(--brand-dark);
}
[data-bs-theme="dark"] .form-control::placeholder {
  color: #7d6b7b;
}
[data-bs-theme="dark"] .btn-light {
  background-color: var(--misk-surface-2);
  border-color: var(--misk-border);
  color: var(--brand-dark);
}
[data-bs-theme="dark"] .btn-light:hover {
  background-color: #33263a;
  color: #fff;
}

/* Purple buttons: hover goes deeper (the light-mode hover uses the plum, now a text colour). */
[data-bs-theme="dark"] .btn-brand {
  background-color: #9a5294;
  border-color: #9a5294;
}
[data-bs-theme="dark"] .btn-brand:hover,
[data-bs-theme="dark"] .btn-brand:focus,
[data-bs-theme="dark"] #scrollTopBtn:hover {
  background-color: #7a3d76;
  border-color: #7a3d76;
  color: #fff;
}
[data-bs-theme="dark"] .btn-outline-brand:hover,
[data-bs-theme="dark"] .btn-outline-brand:focus {
  background: rgba(192, 126, 187, 0.14);
  color: #fff;
}

/* Soft coloured badges and notices: dark tints with light text. */
[data-bs-theme="dark"] .badge-level-beginner {
  background: rgba(236, 72, 153, 0.16);
  color: #f9a8d4;
}
[data-bs-theme="dark"] .badge-level-intermediate,
[data-bs-theme="dark"] .assignment-state-badge,
[data-bs-theme="dark"] .roster-grad-badge,
[data-bs-theme="dark"] .absence-pill-late {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
}
[data-bs-theme="dark"] .roster-qualify-yes {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
}
[data-bs-theme="dark"] .roster-qualify-no,
[data-bs-theme="dark"] .live-details-on .live-student-block.live-misfit,
[data-bs-theme="dark"] .confirm-modal-icon.danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}
[data-bs-theme="dark"] .confirm-modal-icon.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}
[data-bs-theme="dark"] .toast-item.toast-success {
  background: #14261c;
  color: #a7f3d0;
}
[data-bs-theme="dark"] .toast-item.toast-error {
  background: #2a1517;
  color: #fecaca;
}
[data-bs-theme="dark"] .toast-item.toast-warning {
  background: #2a2413;
  color: #fde68a;
}

/* Attendance counters. */
[data-bs-theme="dark"] .roster-attendance .stepper {
  background: color-mix(in srgb, var(--absence-excused, #c07ebb) 14%, #1e1620);
}
[data-bs-theme="dark"] .roster-attendance .stepper.stepper-danger {
  background: color-mix(in srgb, var(--absence-unexcused, #ef4444) 14%, #1e1620);
}
[data-bs-theme="dark"] .roster-attendance .stepper.stepper-late {
  background: rgba(217, 119, 6, 0.14);
  border-color: rgba(252, 211, 77, 0.35);
}
[data-bs-theme="dark"] .roster-attendance .stepper .stepper-value {
  color: var(--brand-dark);
}

/* Library: the lessons follow the theme (see tajweed-lessons.html). */
[data-bs-theme="dark"] .library-shell,
[data-bs-theme="dark"] .library-frame {
  background: #140f15;
}
[data-bs-theme="dark"] .library-chip-n {
  background: rgba(192, 126, 187, 0.16);
  color: #e3b6df;
}
/* Level / certification badges: dark tints with light text. */
[data-bs-theme="dark"] .badge-level-beginner {
  border-color: rgba(249, 168, 212, 0.25);
}
[data-bs-theme="dark"] .badge-level-intermediate {
  border-color: rgba(252, 211, 77, 0.25);
}
[data-bs-theme="dark"] .badge-level-advanced {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.25);
}
[data-bs-theme="dark"] .badge-level-unknown,
[data-bs-theme="dark"] .badge-cert-mujazah {
  background: rgba(139, 92, 246, 0.18);
  color: #d8a6d4;
  border-color: rgba(196, 181, 253, 0.25);
}
[data-bs-theme="dark"] .badge-cert-iqraa {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.25);
}
[data-bs-theme="dark"] .badge-cert-preiqraa {
  background: rgba(20, 184, 166, 0.18);
  color: #5eead4;
  border-color: rgba(94, 234, 212, 0.25);
}
[data-bs-theme="dark"] .badge-level {
  background: var(--misk-surface-2);
  border-color: var(--misk-border);
}

/* Photo covers keep legible badges in dark mode: the faint dark-mode level
   badges and near-black pills vanish on a light picture, so the level badge
   keeps its light-mode look and the pills follow the cover's text color. */
/* My Session: a dark theme color (navy, black...) vanishes on dark surfaces,
   so dark mode swaps in a lightened copy (theme_color_for_dark() in helpers.php). */
[data-bs-theme="dark"] .session-theme-scope {
  --session-theme: var(--session-theme-dark) !important;
}
[data-bs-theme="dark"] .session-theme-scope[style*="--absence-excused-dark"] {
  --absence-excused: var(--absence-excused-dark) !important;
  --absence-unexcused: var(--absence-unexcused-dark) !important;
}

[data-bs-theme="dark"] .session-cover-photo .badge-level-beginner {
  background: #fce7f3;
  color: #be185d;
  border-color: rgba(190, 24, 93, 0.2);
}
[data-bs-theme="dark"] .session-cover-photo .badge-level-intermediate {
  background: #fef3c7;
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.2);
}
[data-bs-theme="dark"] .session-cover-photo .badge-level-advanced {
  background: #d1fae5;
  color: #047857;
  border-color: rgba(4, 120, 87, 0.2);
}
[data-bs-theme="dark"] .session-cover-photo .badge-level-unknown {
  background: #ede9fe;
  color: #6d28d9;
  border-color: rgba(109, 40, 217, 0.2);
}
[data-bs-theme="dark"] .session-cover-photo .session-format-badge {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.35);
}
[data-bs-theme="dark"] .session-cover-photo.cover-text-dark .session-format-badge {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(31, 41, 55, 0.2);
}

/* ===== قائمة المنسحبات (withdrawals list): a pale maroon page (a deep muted
   maroon in dark mode), so the list stands apart from the rest of the panel.
   body.misk-black-page is set via $blackPage in control-panel.php. ===== */
body.misk-black-page,
.misk-blacklist-banner,
.misk-blacklist-table {
    --wd-page: #f3e4e6;
    --wd-surface: #fbf4f5;
    --wd-hover: #f6e7ea;
    --wd-border: #e3c6cb;
    --wd-accent: #8a3b4a;
    --wd-on-accent: #fff;
    --wd-text: #4a1f27;
    --wd-muted: #8b6a70;
}
[data-bs-theme="dark"] body.misk-black-page,
[data-bs-theme="dark"] .misk-blacklist-banner,
[data-bs-theme="dark"] .misk-blacklist-table {
    --wd-page: #1d1214;
    --wd-surface: #2a181c;
    --wd-hover: #341e23;
    --wd-border: #4a2b31;
    --wd-accent: #d49aa4;
    --wd-on-accent: #1d1214;
    --wd-text: #f3e4e6;
    --wd-muted: #b9979d;
}
body.misk-black-page,
[data-bs-theme="dark"] body.misk-black-page {
    background: var(--wd-page) !important;
}
/* The whole page turns maroon while the list is open: the brand colors that
   buttons, links, tabs and icons use, plus the bars and cards. */
body.misk-black-page {
    --brand-primary: #8a3b4a;
    --brand-secondary: #c9939c;
    --brand-dark: #4a1f27;
    --brand-neutral: var(--wd-page);
    --bs-primary: #8a3b4a;
    --bs-primary-rgb: 138, 59, 74;
    --bs-link-color: #8a3b4a;
    --bs-link-hover-color: #4a1f27;
}
[data-bs-theme="dark"] body.misk-black-page {
    --brand-primary: #d49aa4;
    --brand-secondary: #9a5f69;
    --brand-dark: #f3e4e6;
    --bs-primary: #d49aa4;
    --bs-primary-rgb: 212, 154, 164;
    --bs-link-color: #d49aa4;
    --bs-link-hover-color: #f3e4e6;
    --misk-surface: var(--wd-surface);
    --misk-surface-2: var(--wd-hover);
    --misk-border: var(--wd-border);
}
body.misk-black-page .navbar-misk,
body.misk-black-page .navbar-misk .navbar-collapse,
body.misk-black-page .app-footer {
    background: color-mix(in srgb, var(--wd-surface) 92%, transparent) !important;
    border-color: var(--wd-border);
}
body.misk-black-page .card-soft {
    background: var(--wd-surface) !important;
    border-color: var(--wd-border);
}
/* Whatever sits straight on the page background takes the maroon accent. */
body.misk-black-page .cp-page-header h2 {
    color: var(--wd-accent);
}
body.misk-black-page .cp-registry-topbar .nav-link:not(.active) {
    color: var(--wd-accent);
    background: color-mix(in srgb, var(--wd-accent) 8%, transparent);
}
body.misk-black-page .cp-registry-topbar .btn-outline-brand {
    color: var(--wd-accent);
    border-color: color-mix(in srgb, var(--wd-accent) 50%, transparent);
}
/* Warning banner: pale maroon with a maroon/pale stripe along its top. */
.misk-blacklist-banner {
    position: relative;
    background: var(--wd-surface);
    color: var(--wd-muted);
    border: 1px solid var(--wd-border);
    border-radius: 0.9rem;
    padding: 1.6rem 1.25rem 1.1rem;
    overflow: hidden;
    font-size: 0.85rem;
    font-weight: 700;
}
.misk-blacklist-banner::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 8px;
    background: repeating-linear-gradient(-45deg, var(--wd-accent) 0 10px, var(--wd-surface) 10px 20px);
}
.misk-blacklist-title {
    color: var(--wd-accent);
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    margin-bottom: 0.4rem;
}
.misk-blacklist-count {
    display: inline-block;
    background: var(--wd-accent);
    color: var(--wd-on-accent);
    border-radius: 999px;
    font-size: 0.8rem;
    padding: 0.1rem 0.6rem;
    vertical-align: middle;
}
/* The list itself: maroon header row and a soft maroon frame. */
.misk-blacklist-table,
[data-bs-theme="dark"] .misk-blacklist-table {
    border: 2px solid var(--wd-border) !important;
    background: var(--wd-surface) !important;
}
.misk-blacklist-table .table-misk {
    --bs-table-bg: var(--wd-surface);
    --bs-table-color: var(--wd-text);
    --bs-table-border-color: var(--wd-border);
    --bs-table-hover-bg: var(--wd-hover);
}
.misk-blacklist-table .table-misk thead th {
    background: var(--wd-accent);
    color: var(--wd-on-accent);
    border-bottom-color: var(--wd-border);
}
.misk-blacklist-table .table-misk td {
    background: var(--wd-surface);
    color: var(--wd-text);
    border-bottom-color: var(--wd-border);
}
.misk-blacklist-table .table-misk tbody tr:hover td {
    background: var(--wd-hover);
}
.misk-blacklist-table .text-muted {
    color: var(--wd-muted) !important;
}
.misk-blacklist-table .cp-row-num {
    background: var(--wd-border);
    color: var(--wd-text);
}
/* «بعذر / بدون عذر»: one pill that shows the status and opens the change window. */
.wd-excuse {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.75rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.8rem;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.wd-excuse.is-excused {
    background: #e8f6ee;
    border-color: #b7e2c8;
    color: #1f7a4a;
}
.wd-excuse.is-unexcused {
    background: #fdf3e2;
    border-color: #f1d6a6;
    color: #9a5b12;
}
.wd-excuse .wd-excuse-edit {
    font-size: 0.72rem;
    opacity: 0.55;
    padding-inline-start: 0.4rem;
    border-inline-start: 1px solid currentColor;
}
.wd-excuse:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}
.wd-excuse:hover .wd-excuse-edit { opacity: 1; }
.wd-excuse:focus-visible { outline: 3px solid var(--brand-primary); outline-offset: 2px; }
[data-bs-theme="dark"] .wd-excuse.is-excused { background: rgba(46, 160, 98, 0.15); border-color: rgba(46, 160, 98, 0.4); color: #7fd6a6; }
[data-bs-theme="dark"] .wd-excuse.is-unexcused { background: rgba(214, 140, 40, 0.14); border-color: rgba(214, 140, 40, 0.4); color: #f0b866; }
/* ===== Students Registry row actions: one coherent button style ===== */
.reg-actions {
    flex-wrap: nowrap;
}
.reg-act {
    --reg-act-color: var(--brand-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    height: 32px;
    min-width: 32px;
    padding: 0 0.5rem;
    border-radius: 0.6rem;
    border: 1.5px solid color-mix(in srgb, var(--reg-act-color) 35%, transparent);
    background: color-mix(in srgb, var(--reg-act-color) 9%, transparent);
    color: var(--reg-act-color);
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.reg-act i {
    font-size: 0.95rem;
}
.reg-act:hover,
.reg-act:focus-visible {
    background: var(--reg-act-color);
    border-color: var(--reg-act-color);
    color: #fff;
}
/* The main action (place student / return to list): filled, with its label. */
.reg-act-main {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
    padding: 0 0.75rem;
}
.reg-act-main:hover,
.reg-act-main:focus-visible {
    background: var(--brand-dark, #3b1422);
    border-color: var(--brand-dark, #3b1422);
}
.reg-act-edit     { --reg-act-color: var(--brand-primary); }
.reg-act-info     { --reg-act-color: #475569; }
.reg-act-reserve  { --reg-act-color: #b45309; }
/* Withdraw: pale maroon, the same colour as the withdrawals list page. */
.reg-act-withdraw { --reg-act-color: #8a3b4a; }
[data-bs-theme="dark"] .reg-act-info { --reg-act-color: #94a3b8; }
[data-bs-theme="dark"] .reg-act-reserve { --reg-act-color: #f59e0b; }
[data-bs-theme="dark"] .reg-act-withdraw { --reg-act-color: #d49aa4; }
[data-bs-theme="dark"] .reg-act-withdraw:hover { color: #1d1214; }
/* Registry lists (students, teachers, withdrawals): every column centred except the first (name). */
.cp-registry-table th:not(:first-child),
.cp-registry-table td:not(:first-child) {
    text-align: center;
}
.cp-registry-table td:not(:first-child) .reg-actions {
    justify-content: center;
}

/* ═══ Past exams (exams.php) ═════════════════════════════════════════════════
   Old final exams as practice tests: a list of exam cards, then one exam as a
   paper; after handing in, right/wrong marks, model answers and a result card. */
.xm-page {
  --xm-surface: #fff;
  --xm-line: rgba(122, 61, 118, 0.14);
  --xm-soft: #f5ecf3;
  --xm-ok: #2e8657;
  --xm-ok-soft: #e0f3e8;
  --xm-err: #b23a48;
  --xm-err-soft: #fbe5e8;
  --xm-part: #a86f12;
  --xm-part-soft: #fbf0dc;
  max-width: 920px;
  padding-bottom: 6rem !important;
}
[data-bs-theme="dark"] .xm-page {
  --xm-surface: #1e1620;
  --xm-line: #3a2c3a;
  --xm-soft: #2a1f2b;
  --xm-ok: #6fcf97;
  --xm-ok-soft: rgba(111, 207, 151, 0.12);
  --xm-err: #f08a96;
  --xm-err-soft: rgba(240, 138, 150, 0.12);
  --xm-part: #e5b45a;
  --xm-part-soft: rgba(229, 180, 90, 0.12);
}
.xm-q {
  font-family: "Amiri Quran", "Amiri", serif;
  font-size: 1.15em;
  line-height: 2.1;
}
.xm-hero, .xm-paper-h {
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  padding: 1rem 0 1.75rem;
}
.xm-hero h1, .xm-paper-h h1 {
  font-weight: 900;
  color: var(--brand-dark);
  margin: 0;
}
.xm-hero h1 { font-size: clamp(2rem, 6vw, 2.8rem); }
.xm-hero h1 span { color: var(--brand-accent); }
.xm-paper-h h1 { font-size: clamp(1.4rem, 4vw, 1.9rem); }
.xm-hero p { color: var(--bs-secondary-color); max-width: 52ch; margin: 0; }
.xm-eye {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--brand-primary);
  background: var(--xm-soft);
  border-radius: 999px;
  padding: 0.2rem 0.9rem;
}
.xm-levels {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  margin-top: 0.4rem;
  border-radius: 999px;
  background: var(--xm-surface);
  border: 1px solid var(--xm-line);
}
.xm-levels button {
  border: 0;
  border-radius: 999px;
  padding: 0.4rem 1.1rem;
  font-weight: 700;
  color: var(--bs-secondary-color);
  background: none;
  transition: color 0.2s, background-color 0.2s;
}
.xm-levels button:hover { color: var(--brand-primary); }
.xm-levels button[aria-pressed="true"] {
  color: var(--brand-primary);
  background: var(--xm-soft);
  box-shadow: inset 0 0 0 1px rgba(122, 61, 118, 0.25);
}
.xm-back {
  justify-self: start;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--brand-primary);
}
.xm-hero .xm-back { justify-self: center; margin-top: 0.25rem; }
.xm-motto { margin: 0; color: var(--brand-primary); font-size: 1.35rem; }
.xm-term-big {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #7a3d76, #8f4d8a 60%, #46acae 140%);
  border-radius: 999px;
  padding: 0.25rem 1.2rem;
}
.xm-meta { margin: 0; color: var(--bs-secondary-color); font-size: 0.9rem; }
.xm-warn {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
  color: var(--xm-part);
  background: var(--xm-part-soft);
  border-radius: 0.75rem;
  padding: 0.35rem 0.9rem;
}
.xm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}
.xm-card {
  display: grid;
  gap: 0.45rem;
  align-content: start;
  padding: 1.1rem 1.2rem;
  border-radius: 1.25rem;
  background: var(--xm-surface);
  border: 1px solid var(--xm-line);
  box-shadow: 0 10px 26px -20px rgba(61, 26, 60, 0.45);
  transition: transform 0.2s, box-shadow 0.2s;
}
.xm-card:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -18px rgba(122, 61, 118, 0.45); }
.xm-card-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.xm-term { font-size: 1.35rem; font-weight: 900; color: var(--brand-dark); }
.xm-badge {
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  color: var(--xm-part);
  background: var(--xm-part-soft);
}
.xm-badge.ok { color: var(--xm-ok); background: var(--xm-ok-soft); }
.xm-last { margin: 0; font-size: 0.88rem; }
.xm-last.muted { color: var(--bs-secondary-color); }
.xm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-weight: 700;
  border: 0;
  border-radius: 999px;
  padding: 0.5rem 1.2rem;
  color: #fff;
  background: linear-gradient(135deg, #7a3d76, #8f4d8a);
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.2s;
}
.xm-btn:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 8px 18px -8px rgba(122, 61, 118, 0.7); }
.xm-btn.ghost { color: var(--brand-primary); background: var(--xm-soft); }
.xm-btn.ghost:hover { color: var(--brand-primary); }
.xm-card .xm-btn { justify-self: start; margin-top: 0.3rem; }
/* «الاختبارات النهائية» / «اختبارات المنتصف» headings in a level's list */
.xm-kind-h {
  margin: 1.75rem 0 0.85rem;
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--brand-dark);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.xm-kind-h::after {
  content: "";
  flex: 1;
  height: 2px;
  background: var(--xm-line);
}

/* The paper */
.xm-sec { margin-bottom: 2rem; }
.xm-sec h2 {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--brand-dark);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--xm-line);
  margin-bottom: 1rem;
}
.xm-sec h2 span { color: var(--brand-primary); }
.xm-sec h2 small { font-size: 0.8rem; font-weight: 700; color: var(--bs-secondary-color); }
.xm-verse {
  margin: 0 0 1rem;
  padding: 0.9rem 1.2rem;
  border-radius: 1rem;
  background: var(--xm-soft);
  text-align: center;
}
.xm-verse p, p.xm-verse { margin: 0; color: var(--brand-dark); }
.xm-verse cite { display: block; font-style: normal; font-size: 0.82rem; color: var(--bs-secondary-color); margin-top: 0.3rem; }
.xm-item {
  margin: 0 0 0.85rem;
  padding: 0.9rem 1.1rem;
  border-radius: 1rem;
  background: var(--xm-surface);
  border: 1px solid var(--xm-line);
  border-inline-start-width: 4px;
}
.xm-item.is-right { border-inline-start-color: var(--xm-ok); }
.xm-item.is-wrong { border-inline-start-color: var(--xm-err); }
.xm-item.is-part { border-inline-start-color: var(--xm-part); }
.xm-item.xm-missing { border-color: var(--xm-part); animation: xm-missing 0.6s ease 2; }
@keyframes xm-missing { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--xm-part) 35%, transparent); } }
.xm-item legend {
  width: 100%;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  line-height: 1.8;
}
.xm-n {
  display: inline-grid;
  place-items: center;
  min-width: 1.7rem;
  height: 1.7rem;
  margin-inline-end: 0.45rem;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 900;
  color: var(--brand-primary);
  background: var(--xm-soft);
}
.xm-pts { font-size: 0.75rem; font-weight: 500; color: var(--bs-secondary-color); white-space: nowrap; }
.xm-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 0.5rem; }
.xm-tf { grid-template-columns: repeat(2, minmax(0, 140px)); }
.xm-opt {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.5rem 0.8rem;
  border-radius: 0.8rem;
  border: 1px solid var(--xm-line);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.xm-opt:hover { border-color: rgba(122, 61, 118, 0.4); }
.xm-opt input { accent-color: var(--brand-primary); flex: none; }
.xm-opt:has(input:checked) { border-color: var(--brand-primary); background: var(--xm-soft); }
.xm-l { font-weight: 900; color: var(--brand-primary); }
.xm-opt .xm-q { font-size: 1.6em; line-height: 1.7; }
.xm-opt.right { border-color: var(--xm-ok); background: var(--xm-ok-soft); }
.xm-opt.wrong { border-color: var(--xm-err); background: var(--xm-err-soft); }
.xm-opt.right::after, .xm-opt.wrong::after {
  font-family: "bootstrap-icons";
  margin-inline-start: auto;
  content: "\F26E";
  color: var(--xm-ok);
}
.xm-opt.wrong::after { content: "\F62A"; color: var(--xm-err); }
fieldset:disabled .xm-opt { cursor: default; }
.xm-text { margin-top: 0.5rem; border-radius: 0.8rem; }
.xm-text[hidden] { display: none; }
.xm-match { display: grid; gap: 0.5rem; }
.xm-mrow {
  display: grid;
  grid-template-columns: 1fr minmax(150px, 220px);
  align-items: center;
  gap: 0.4rem 0.75rem;
  padding: 0.4rem 0.6rem;
  border-radius: 0.8rem;
  border: 1px solid transparent;
}
.xm-mrow.right { border-color: var(--xm-ok); background: var(--xm-ok-soft); }
.xm-mrow.wrong { border-color: var(--xm-err); background: var(--xm-err-soft); }
.xm-fixr { grid-column: 2; font-size: 0.85rem; font-weight: 700; color: var(--xm-ok); }
.xm-fixr::before { content: "الصحيح: "; font-weight: 500; }
@media (max-width: 575.98px) {
  .xm-mrow { grid-template-columns: 1fr; }
  .xm-fixr { grid-column: 1; }
}
.xm-fb { display: grid; gap: 0.5rem; margin-top: 0.75rem; }
.xm-fb[hidden] { display: none; }
.xm-model, .xm-mine {
  padding: 0.6rem 0.9rem;
  border-radius: 0.8rem;
  background: var(--xm-ok-soft);
  line-height: 1.9;
}
.xm-model b { color: var(--xm-ok); }
.xm-mine { background: var(--xm-soft); }
.xm-note { margin: 0; font-size: 0.85rem; color: var(--bs-secondary-color); }
.xm-miss { margin: 0; font-size: 0.88rem; font-weight: 700; color: var(--xm-err); }
.xm-self { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; font-size: 0.88rem; font-weight: 700; }
.xm-self button {
  border-radius: 999px;
  border: 1px solid var(--xm-line);
  background: var(--xm-surface);
  color: inherit;
  padding: 0.25rem 0.85rem;
  font-weight: 700;
  font-size: 0.85rem;
  transition: background-color 0.2s, border-color 0.2s;
}
.xm-self button[data-m="1"].on { background: var(--xm-ok-soft); border-color: var(--xm-ok); color: var(--xm-ok); }
.xm-self button[data-m="0.5"].on { background: var(--xm-part-soft); border-color: var(--xm-part); color: var(--xm-part); }
.xm-self button[data-m="0"].on { background: var(--xm-err-soft); border-color: var(--xm-err); color: var(--xm-err); }

/* Progress + hand-in bar, along the bottom while solving */
.xm-bar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 1020;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--xm-line);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
[data-bs-theme="dark"] .xm-bar { background: rgba(24, 17, 25, 0.94); }
.xm-bar-msg { font-size: 0.85rem; font-weight: 700; color: var(--xm-part); }

/* «We kept your answers» note after a refresh */
.xm-restored {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem 0.75rem;
  margin: 0 0 1.25rem;
  padding: 0.6rem 1rem;
  border-radius: 1rem;
  font-weight: 700;
  color: var(--xm-ok);
  background: var(--xm-ok-soft);
}
.xm-restored button {
  border: 1px solid var(--xm-line);
  border-radius: 999px;
  padding: 0.2rem 0.9rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--brand-primary);
  background: var(--xm-surface);
}

/* Result card */
.xm-result {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1.25rem 1.4rem;
  border-radius: 1.25rem;
  background: var(--xm-surface);
  border: 1px solid var(--xm-line);
  box-shadow: 0 14px 32px -22px rgba(122, 61, 118, 0.6);
  scroll-margin-top: 90px;
}
@media (max-width: 575.98px) { .xm-result { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.xm-ring {
  --pct: 0;
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--brand-primary) calc(var(--pct) * 1%), var(--xm-soft) 0);
}
.xm-ring b {
  width: 5.9rem;
  height: 5.9rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--xm-surface);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--brand-dark);
}
.xm-res-body { width: 100%; }
.xm-res-body h2 { font-size: 1.35rem; font-weight: 900; color: var(--brand-dark); margin: 0 0 0.3rem; }
.xm-verdict { margin: 0 0 0.6rem; font-weight: 700; color: var(--brand-primary); }
.xm-pending { margin: 0 0 0.6rem; font-weight: 700; color: var(--xm-part); }
.xm-secs { list-style: none; margin: 0 0 0.8rem; padding: 0; display: grid; gap: 0.3rem; }
.xm-secs li { display: grid; grid-template-columns: 7.5rem 1fr 4.5rem; align-items: center; gap: 0.6rem; font-size: 0.85rem; }
.xm-secs i { height: 0.5rem; border-radius: 999px; background: var(--xm-soft); overflow: hidden; }
.xm-secs em { display: block; height: 100%; border-radius: 999px; background: linear-gradient(270deg, var(--brand-accent), var(--brand-primary)); }
.xm-secs b { text-align: end; }
.xm-res-btns { display: flex; flex-wrap: wrap; gap: 0.5rem; }
@media (max-width: 575.98px) { .xm-res-btns { justify-content: center; } }
/* ═══ Softer buttons ════════════════════════════════════════════════════════
   Every strongly coloured button across the site gets the same gentle look: a
   light tint of its colour with coloured text and a thin border; the colour
   deepens a little on hover. (Kept last so it wins over the rules above.) */
.btn-brand,
.btn-check:checked + .btn-outline-brand,
.xm-btn,
.library-chip.active,
.library-step.library-doors.active {
  background: rgba(122, 61, 118, 0.12);
  border: 1.5px solid rgba(122, 61, 118, 0.3);
  color: var(--brand-primary);
  box-shadow: none;
}
.btn-brand:hover,
.btn-brand:focus,
.xm-btn:hover {
  background: rgba(122, 61, 118, 0.2);
  border-color: rgba(122, 61, 118, 0.45);
  color: var(--brand-dark);
  box-shadow: 0 6px 14px -10px rgba(122, 61, 118, 0.6);
}
.btn-brand:active {
  background: rgba(122, 61, 118, 0.26);
}
/* A button sitting on top of an input (the search fields): the same tint, but solid,
   so nothing under it shows through. */
.position-relative > .btn-brand.position-absolute {
  background: linear-gradient(rgba(122, 61, 118, 0.12), rgba(122, 61, 118, 0.12)), #fff;
}
.position-relative > .btn-brand.position-absolute:hover,
.position-relative > .btn-brand.position-absolute:focus {
  background: linear-gradient(rgba(122, 61, 118, 0.2), rgba(122, 61, 118, 0.2)), #fff;
}
.library-chip.active .library-chip-n {
  background: rgba(122, 61, 118, 0.16);
  color: var(--brand-primary);
}
.btn-online {
  background: rgba(70, 172, 174, 0.14);
  border: 1.5px solid rgba(70, 172, 174, 0.4);
  color: #23797b;
  box-shadow: none;
}
.btn-online:hover,
.btn-online:focus {
  background: rgba(70, 172, 174, 0.24);
  border-color: rgba(70, 172, 174, 0.55);
  color: #1b6062;
  box-shadow: 0 6px 14px -10px rgba(70, 172, 174, 0.7);
}
.btn-wizard {
  background: linear-gradient(135deg, rgba(122, 61, 118, 0.13), rgba(70, 172, 174, 0.15));
  border: 1.5px solid rgba(122, 61, 118, 0.28);
  color: var(--brand-primary);
  box-shadow: none;
}
.btn-wizard:hover,
.btn-wizard:focus {
  color: var(--brand-dark);
  filter: none;
  background: linear-gradient(135deg, rgba(122, 61, 118, 0.2), rgba(70, 172, 174, 0.22));
}
.xm-term-big {
  color: var(--brand-primary);
  background: rgba(122, 61, 118, 0.12);
  border: 1.5px solid rgba(122, 61, 118, 0.28);
}
[data-bs-theme="dark"] .btn-brand,
[data-bs-theme="dark"] .btn-check:checked + .btn-outline-brand,
[data-bs-theme="dark"] .xm-btn,
[data-bs-theme="dark"] .xm-term-big,
[data-bs-theme="dark"] .btn-wizard,
[data-bs-theme="dark"] .library-chip.active,
[data-bs-theme="dark"] .library-step.library-doors.active {
  background: rgba(192, 126, 187, 0.18) !important;
  border-color: rgba(192, 126, 187, 0.4) !important;
  color: #f1e6ef;
}
[data-bs-theme="dark"] .btn-brand:hover,
[data-bs-theme="dark"] .btn-brand:focus,
[data-bs-theme="dark"] .xm-btn:hover {
  background: rgba(192, 126, 187, 0.3) !important;
  border-color: rgba(192, 126, 187, 0.55) !important;
  color: #fff;
}
[data-bs-theme="dark"] .btn-online {
  background: rgba(92, 198, 200, 0.16);
  border-color: rgba(92, 198, 200, 0.4);
  color: #bfeeef;
}

/* Results tab (control panel): the session tables carry every detail as columns. */
.res-flags { font-size: 0.72rem; font-weight: 700; color: #b23a48; }
[data-bs-theme="dark"] .res-flags { color: #f08a96; }

/* ═══ Guest buttons (home hero «ابدأ الآن», header «دخول») ══════════════════════
   Keep the original strong filled look - they're outside the soft-buttons change. */
.btn-brand.btn-strong {
  background: var(--brand-primary);
  border: 1px solid var(--brand-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(122, 61, 118, 0.14);
}
.btn-brand.btn-strong:hover,
.btn-brand.btn-strong:focus {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
  box-shadow: 0 6px 16px rgba(122, 61, 118, 0.22);
}
[data-bs-theme="dark"] .btn-brand.btn-strong {
  background: #9a5294 !important;
  border-color: #9a5294 !important;
  color: #fff;
}
[data-bs-theme="dark"] .btn-brand.btn-strong:hover,
[data-bs-theme="dark"] .btn-brand.btn-strong:focus {
  background: #7a3d76 !important;
  border-color: #7a3d76 !important;
  color: #fff;
}

/* ═══ Live Classrooms: each session card wears its teacher's design ═══════════
   The cover on top is the same one as «حلقاتي» (colour, picture and its edits);
   the card's data is grouped under small labels below it. */
.live-card-cover {
  position: relative;
  min-height: 128px;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.7rem 0.85rem 0.75rem;
  border-radius: 0;
  text-align: start;
}
.live-card-cover > *:not(.session-cover-bg):not(.session-cover-tint):not(.welcome-flower) { position: relative; z-index: 1; }
/* Default look (no picture): smaller flowers than on the big session page. */
.live-card-cover .welcome-flower { opacity: 0.38; }
.live-card-cover .welcome-flower-1 { top: -40px; inset-inline-end: -36px; width: 170px; height: 170px; }
.live-card-cover .welcome-flower-2 { bottom: -46px; inset-inline-start: -30px; width: 140px; height: 140px; }
.live-card-cover .welcome-flower-3 { top: 18%; inset-inline-start: 24%; width: 64px; height: 64px; }
.live-card-cover .welcome-flower-4 { bottom: 4%; inset-inline-end: 26%; width: 76px; height: 76px; }
.live-card-cover-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.live-card-num { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; font-weight: 900; cursor: pointer; margin: 0; }
.live-card-title { font-size: 1.05rem; font-weight: 900; line-height: 1.35; text-align: center; }
.live-card-title .btn-link { color: inherit; opacity: 0.8; }
.live-card-cover .session-format-badge { font-size: 0.72rem; }
.session-cover-photo.live-card-cover .session-format-badge { background: rgba(255, 255, 255, 0.22); border-color: rgba(255, 255, 255, 0.4); color: inherit; }
.live-card-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.2px;
  color: var(--session-theme, var(--brand-primary));
  margin-bottom: 0.15rem;
  padding-bottom: 0.15rem;
  border-bottom: 1px dashed color-mix(in srgb, var(--session-theme, var(--brand-primary)) 25%, transparent);
}
.live-card-count {
  margin-inline-start: auto;
  min-width: 1.4rem;
  text-align: center;
  border-radius: 999px;
  padding: 0 0.45rem;
  background: color-mix(in srgb, var(--session-theme, var(--brand-primary)) 12%, transparent);
}
.live-card-teacher { color: var(--brand-dark); }
[data-bs-theme="dark"] .live-card-label { color: var(--session-theme-dark, #e3b4de); }
[data-bs-theme="dark"] .live-card-teacher { color: #f1e6ef; }

/* Live Classrooms: the delete button is a small corner button, not a full-width bar. */
.live-card-delete { width: 30px; height: 30px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.85rem; }

/* ═══ Announcements: «يظهر لـ» - one card per group with a pill switch ═════════ */
.aud-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}
@media (min-width: 992px) { .aud-grid { grid-template-columns: repeat(2, 1fr); } }
/* The group's name and its switch side by side; the switch drops below on narrow cards. */
.aud-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  border: 1.5px solid rgba(122, 61, 118, 0.22);
  border-radius: 1rem;
  padding: 0.75rem 0.85rem;
  background: color-mix(in srgb, var(--brand-primary) 4%, transparent);
  transition: opacity 0.2s, border-color 0.2s, background 0.2s;
}
/* Not shown to this group: the card steps back. */
.aud-card:has(.aud-seg input[value=""]:checked) {
  opacity: 0.62;
  border-style: dashed;
  border-color: rgba(122, 61, 118, 0.18);
  background: transparent;
}
.aud-card-head { display: flex; align-items: center; gap: 0.55rem; }
.aud-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.95rem;
  color: var(--brand-primary);
  background: rgba(122, 61, 118, 0.12);
}
.aud-title { font-weight: 900; font-size: 0.88rem; color: var(--brand-dark); }
.aud-seg {
  display: flex;
  max-width: 100%;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 6%, transparent);
  border: 1px solid rgba(122, 61, 118, 0.12);
}
.aud-seg label {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.3rem 0.5rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  color: #6b7280;
  cursor: pointer;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
  transition: background 0.15s, color 0.15s;
}
.aud-seg label:hover { background: color-mix(in srgb, var(--brand-primary) 9%, transparent); color: var(--brand-dark); }
.aud-seg .btn-check:checked + label {
  background: var(--brand-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(122, 61, 118, 0.28);
}
.aud-seg .btn-check:checked + label.aud-none {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}
.aud-seg .btn-check:focus-visible + label { outline: 3px solid var(--brand-dark); outline-offset: 1px; }
.aud-card, .aud-seg label { min-width: 0; }
/* Phones: the switch takes the card's full width, options share it evenly, no icons. */
@media (max-width: 575.98px) {
  .aud-seg { width: 100%; }
  .aud-seg label { flex: 1 1 0; padding: 0.32rem 0.2rem; font-size: 0.72rem; }
  .aud-seg label .bi { display: none; }
}
[data-bs-theme="dark"] .aud-card { border-color: var(--misk-border); }
[data-bs-theme="dark"] .aud-seg { border-color: var(--misk-border); }
[data-bs-theme="dark"] .aud-seg label { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .aud-seg .btn-check:checked + label { background: #9a5294; color: #fff; }
[data-bs-theme="dark"] .aud-seg .btn-check:checked + label.aud-none { background: var(--misk-surface-2); color: var(--brand-dark); }
[data-bs-theme="dark"] .aud-seg .btn-check:focus-visible + label { outline-color: #f2c94c; }

/* ═══ Accessibility (keyboard, screen readers, low vision) ═══════════════════
   Kept last so nothing above can hide the focus ring. */
/* «تخطي إلى المحتوى الرئيسي»: hidden until it gets keyboard focus (the first Tab). */
.skip-link {
  position: fixed;
  top: 0.5rem;
  inset-inline-start: 0.5rem;
  z-index: 2000;
  padding: 0.6rem 1.1rem;
  border-radius: 0.6rem;
  background: var(--brand-dark);
  color: #fff;
  font-weight: 900;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 0.15s;
}
.skip-link:focus { transform: translateY(0); color: #fff; outline: 3px solid #f2c94c; outline-offset: 2px; }
/* A clear ring on whatever the keyboard is on (not shown on mouse clicks). */
:where(a, button, input, select, textarea, summary, [tabindex], [role="button"], [contenteditable="true"]):focus-visible {
  outline: 3px solid var(--brand-dark, #3d1a3c) !important;
  outline-offset: 2px !important;
}
[data-bs-theme="dark"] :where(a, button, input, select, textarea, summary, [tabindex], [role="button"], [contenteditable="true"]):focus-visible {
  outline-color: #f2c94c !important;
}
/* Text fields count as keyboard-focused even on a click: no extra ring around them - their
   own border (in the brand colour, see .form-control:focus) is the single focus line. */
:where(textarea, select, [contenteditable="true"], input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="button"], [type="submit"], [type="reset"], [type="color"])):focus-visible {
  outline: none !important;
}
.form-control:focus,
.form-select:focus,
.phone-input-group:focus-within {
  box-shadow: none;
}
/* The page area the skip link jumps to: no ring around the whole page. */
#main-content:focus, #main-content:focus-visible { outline: none !important; }
/* Choices drawn as cards / yes-no buttons / upload boxes hide their real field: the ring
   goes on the visible part when the keyboard is on that field. */
.yesno-toggle label:has(input:focus-visible),
.fmt-card-badge:has(input:focus-visible),
.theme-cover:has(input:focus-visible),
.upload-drop-area:has(input:focus-visible) {
  outline: 3px solid var(--brand-dark, #3d1a3c);
  outline-offset: 2px;
}
[data-bs-theme="dark"] .yesno-toggle label:has(input:focus-visible),
[data-bs-theme="dark"] .fmt-card-badge:has(input:focus-visible),
[data-bs-theme="dark"] .theme-cover:has(input:focus-visible),
[data-bs-theme="dark"] .upload-drop-area:has(input:focus-visible) {
  outline-color: #f2c94c;
}
/* Searchable dropdown: the option the arrow keys are on is easy to see. */
.ss-option.is-active { outline: 2px solid var(--brand-primary); outline-offset: -2px; }

/* Page to page: a quick cross-fade instead of a white flash (cross-document view transitions -
   Chrome / Edge / Safari 18.2+; other browsers just load as before). The navbar and footer are
   named so they stay put while only the content fades. Off for "reduce motion". */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .navbar-misk { view-transition-name: site-nav; }
  .app-footer { view-transition-name: site-footer; }
  ::view-transition-old(root),
  ::view-transition-new(root) { animation-duration: 0.18s; animation-timing-function: ease-out; }
  ::view-transition-group(site-nav),
  ::view-transition-group(site-footer) { animation-duration: 0s; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ============================================================================
   Developers page (developers.php) - the team, the one-tap thanks, the message
   form and the message wall. Category tones: .dev-tone--<category>.
   ============================================================================ */
.dev-page {
  --dev-surface: rgba(255, 255, 255, 0.94);
  --dev-surface-2: #fbf7fa;
  --dev-border: rgba(122, 61, 118, 0.12);
  --dev-muted: #7d6c7b;
  --dev-gold: #e0a526;
}
[data-bs-theme="dark"] .dev-page {
  --dev-surface: var(--misk-surface, #1e1620);
  --dev-surface-2: var(--misk-surface-2, #271d28);
  --dev-border: var(--misk-border, #3a2c3a);
  --dev-muted: #b5a3b3;
  --dev-gold: #f0bd4f;
}
.dev-tone--all        { --tone: var(--brand-primary); --tone-bg: rgba(122, 61, 118, 0.1); }
.dev-tone--review     { --tone: #b07a0c; --tone-bg: #fdf3dc; }
.dev-tone--suggestion { --tone: #23898b; --tone-bg: #e2f4f4; }
.dev-tone--complaint  { --tone: #b8433d; --tone-bg: #fdeceb; }
.dev-tone--other      { --tone: #7a3d76; --tone-bg: #f3ecf7; }
[data-bs-theme="dark"] .dev-tone--all        { --tone: #c07ebb; --tone-bg: rgba(192, 126, 187, 0.14); }
[data-bs-theme="dark"] .dev-tone--review     { --tone: #f0bd4f; --tone-bg: #35290f; }
[data-bs-theme="dark"] .dev-tone--suggestion { --tone: #6fd0d2; --tone-bg: #173234; }
[data-bs-theme="dark"] .dev-tone--complaint  { --tone: #f08f89; --tone-bg: #3a1c1b; }
[data-bs-theme="dark"] .dev-tone--other      { --tone: #d3a3cf; --tone-bg: #2a1f2c; }

/* ─── Hero ─── */
.dev-hero {
  position: relative;
  overflow: hidden;
  border-radius: 1.75rem;
  padding: clamp(2rem, 4vw, 2.75rem) clamp(1.25rem, 4vw, 2.5rem) clamp(2.75rem, 5vw, 3.5rem);
  max-width: 920px; margin-inline: auto;
  text-align: center;
  color: #fff;
  background:
    radial-gradient(ellipse 60% 80% at 85% 10%, rgba(70, 172, 174, 0.55), transparent 60%),
    radial-gradient(ellipse 50% 70% at 10% 100%, rgba(194, 151, 195, 0.5), transparent 60%),
    linear-gradient(135deg, #7a3d76 0%, #5a2a57 55%, #3d1a3c 100%);
  box-shadow: 0 24px 60px -28px rgba(61, 26, 60, 0.75);
}
.dev-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 85%);
  pointer-events: none;
}
.dev-hero-inner { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; }
.dev-hero-title { font-weight: 900; font-size: clamp(1.8rem, 4vw, 2.5rem); margin: 0 0 0.6rem; line-height: 1.25; }
/* text-wrap: balance - each paragraph splits into lines of even length instead of a full
   line and a short leftover (browsers without it simply wrap as before) */
.dev-hero-sub { font-size: clamp(0.92rem, 1.5vw, 1.02rem); line-height: 1.85; opacity: 0.92; margin: 0 auto 0.5rem; max-width: 640px; text-wrap: balance; }
.dev-hero-sub:last-of-type { margin-bottom: 1.3rem; }
.dev-hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.dev-btn-light { background: #fff; color: #5a2a57; font-weight: 800; border-radius: 999px; padding: 0.55rem 1.4rem; border: 0; font-size: 0.95rem; }
.dev-btn-light:hover, .dev-btn-light:focus-visible { background: #f6ecf5; color: #3d1a3c; }
.dev-hero-spark { position: absolute; color: rgba(255, 255, 255, 0.55); z-index: 1; animation: dev-twinkle 4s ease-in-out infinite; }
.dev-hero-spark--1 { top: 14%; inset-inline-start: 9%; font-size: 1.6rem; }
.dev-hero-spark--2 { top: 22%; inset-inline-end: 12%; font-size: 1.1rem; animation-delay: 1.2s; }
.dev-hero-spark--3 { bottom: 16%; inset-inline-end: 18%; font-size: 1.9rem; animation-delay: 2.1s; }
.dev-hero-spark--4 { bottom: 24%; inset-inline-start: 16%; font-size: 1rem; animation-delay: 0.6s; }
@keyframes dev-twinkle { 0%, 100% { opacity: 0.25; transform: scale(0.85); } 50% { opacity: 0.9; transform: scale(1.1); } }

/* ─── Impact numbers ─── */
.dev-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 240px)); justify-content: center; gap: 1rem;
  margin: -1.75rem auto 0; max-width: 920px; padding-inline: clamp(0.5rem, 3vw, 2.5rem); position: relative; z-index: 2;
}
.dev-stat {
  background: var(--dev-surface); border: 1px solid var(--dev-border); border-radius: 1.25rem;
  padding: 1.15rem 0.75rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  box-shadow: 0 12px 30px -20px rgba(61, 26, 60, 0.45);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.dev-stat-icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 0.3rem;
  background: rgba(122, 61, 118, 0.1); color: var(--brand-primary); font-size: 1.15rem;
}
/* Each tile names its colour (developers.php), so removing a tile never shuffles them. Purple is the default above. */
.dev-stat--teal .dev-stat-icon { background: rgba(70, 172, 174, 0.14); color: var(--brand-accent); }
/* The average rating tile: gold, with five stars under the number */
.dev-stat--gold .dev-stat-icon { background: rgba(224, 165, 38, 0.15); color: var(--dev-gold); }
.dev-stat-num small { font-size: 0.5em; font-weight: 700; color: var(--dev-muted); }
.dev-stat-stars { display: inline-flex; gap: 2px; color: var(--dev-gold); font-size: 0.85rem; direction: ltr; margin: 0.1rem 0; }
.dev-stat-num { font-weight: 900; font-size: clamp(1.4rem, 3.4vw, 2rem); color: var(--brand-dark); font-variant-numeric: tabular-nums; line-height: 1.1; }
.dev-stat-label { font-size: 0.82rem; color: var(--dev-muted); font-weight: 700; }

/* ─── Sections ─── */
.dev-section { margin-top: clamp(3rem, 7vw, 4.75rem); scroll-margin-top: 6.5rem; }
#thanks, #write, #team { scroll-margin-top: 6.5rem; }
.dev-section-head { text-align: center; max-width: 640px; margin: 0 auto 2rem; }
.dev-section-head h2 { font-weight: 900; font-size: clamp(1.6rem, 4vw, 2.2rem); color: var(--brand-dark); margin-bottom: 0.5rem; position: relative; display: inline-block; }
.dev-section-head h2::after {
  content: ""; display: block; width: 56px; height: 4px; border-radius: 4px; margin: 0.6rem auto 0;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
}
.dev-section-head p { color: var(--dev-muted); font-weight: 600; margin-bottom: 0; }
.dev-team-note {
  margin-top: 0.9rem !important; display: inline-flex; gap: 0.4rem; align-items: center;
  padding: 0.45rem 0.9rem; border-radius: 0.75rem; font-size: 0.85rem;
  background: rgba(70, 172, 174, 0.12); color: var(--brand-dark) !important;
}

/* Avatars */
.dev-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex-shrink: 0; display: inline-grid; place-items: center; }
.dev-avatar--xs { width: 24px; height: 24px; font-size: 0.6rem !important; }
.dev-avatar.avatar-fallback { font-size: 1.1rem; }
.dev-avatar--xs.avatar-fallback { font-size: 0.75rem !important; }
.dev-avatar--anon { background: var(--dev-surface-2); color: var(--dev-muted); border: 1px dashed var(--dev-border); font-size: 1.15rem; }

/* Role chip - student / teacher */
.dev-role-chip {
  display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.6rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 800; white-space: nowrap;
}
.dev-role-chip--student { background: rgba(70, 172, 174, 0.15); color: #217f81; }
.dev-role-chip--teacher { background: rgba(122, 61, 118, 0.12); color: #7a3d76; }
[data-bs-theme="dark"] .dev-role-chip--student { background: rgba(92, 198, 200, 0.16); color: #7fd6d8; }
[data-bs-theme="dark"] .dev-role-chip--teacher { background: rgba(192, 126, 187, 0.18); color: #dcaad8; }

/* ─── One-tap thanks: a heart and a counter ─── */
/* No box: just the heart and its counter on the page */
.dev-thanks {
  margin-top: clamp(2.5rem, 6vw, 3.75rem); padding: 0 1rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.85rem;
}
/* ───── ✦ ♥ ✦ ───── : thin lines fading out from the heart, with a small gold sparkle each side */
.dev-thanks-row { display: flex; align-items: center; justify-content: center; gap: 0.9rem; width: 100%; max-width: 560px; }
.dev-thanks-row form { margin: 0; }
.dev-thanks-line { flex: 1; height: 1.5px; border-radius: 2px; background: linear-gradient(to left, rgba(176, 63, 124, 0.45), transparent); }
.dev-thanks-row > .dev-thanks-line:last-child { background: linear-gradient(to right, rgba(176, 63, 124, 0.45), transparent); }
.dev-thanks-spark { color: #e0a526; font-size: 1.05rem; line-height: 1; opacity: 0.85; }
[data-bs-theme="dark"] .dev-thanks-line { background: linear-gradient(to left, rgba(236, 143, 191, 0.4), transparent); }
[data-bs-theme="dark"] .dev-thanks-row > .dev-thanks-line:last-child { background: linear-gradient(to right, rgba(236, 143, 191, 0.4), transparent); }
[data-bs-theme="dark"] .dev-thanks-spark { color: #f0bd4f; }
/* Arabic: the first line is on the right, so each line still fades away from the heart */
[dir="rtl"] .dev-thanks-line { background: linear-gradient(to right, rgba(176, 63, 124, 0.45), transparent); }
[dir="rtl"] .dev-thanks-row > .dev-thanks-line:last-child { background: linear-gradient(to left, rgba(176, 63, 124, 0.45), transparent); }
[dir="rtl"][data-bs-theme="dark"] .dev-thanks-line { background: linear-gradient(to right, rgba(236, 143, 191, 0.4), transparent); }
[dir="rtl"][data-bs-theme="dark"] .dev-thanks-row > .dev-thanks-line:last-child { background: linear-gradient(to left, rgba(236, 143, 191, 0.4), transparent); }
.dev-thank-btn {
  position: relative; width: 96px; height: 96px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: #fff; font-size: 2.6rem; text-decoration: none;
  background: linear-gradient(135deg, #d0559a, #7a3d76);
  box-shadow: 0 16px 34px -14px rgba(176, 63, 124, 0.85);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
/* top: the icon font draws the heart ~4px above its box's centre - nudged down to sit in the middle of the circle */
.dev-thank-btn i { display: block; line-height: 1; position: relative; top: 0.1em; animation: dev-beat 1.6s ease-in-out infinite; }
.dev-thank-btn:hover, .dev-thank-btn:focus-visible { transform: scale(1.07); color: #fff; box-shadow: 0 20px 40px -14px rgba(176, 63, 124, 0.95); }
.dev-thank-btn:focus-visible { outline: 3px solid rgba(176, 63, 124, 0.45); outline-offset: 4px; }
@keyframes dev-beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.16); } 30% { transform: scale(1); } 45% { transform: scale(1.1); } }
.dev-thank-btn:active { transform: scale(0.94); }
.dev-thanks-count.is-bump { animation: dev-bump 0.3s ease; }
@keyframes dev-bump { 40% { transform: scale(1.25); } }
.dev-thanks-count { display: inline-block; font-weight: 900; font-size: 1.9rem; color: var(--brand-primary); font-variant-numeric: tabular-nums; line-height: 1; }
.dev-burst {
  position: absolute; top: 50%; left: 50%; pointer-events: none; font-size: 1.1rem;
  animation: dev-burst 1s ease-out forwards;
}
@keyframes dev-burst {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.2); opacity: 0; }
}
/* ─── Write to the team: one small message box; pressing it grows it and shows the rest ─── */
.dev-write { max-width: 820px; margin-inline: auto; }
.dev-compose .dev-textarea { transition: min-height 0.25s ease, box-shadow 0.2s ease; }
.dev-compose:not(.is-open) { padding: 0.6rem; border-radius: 1.25rem; cursor: text; }
.dev-compose:not(.is-open) .dev-textarea { min-height: 52px; height: 52px; resize: none; overflow: hidden; border-color: transparent; background: var(--dev-surface-2); }
.dev-compose.is-open .dev-textarea { min-height: 150px; }
.dev-compose-more { margin-top: 0.25rem; animation: dev-more-in 0.25s ease; }
.dev-compose-more .dev-counter { margin-bottom: 1rem; }
.dev-compose-top fieldset { margin-bottom: 0.9rem !important; }
.dev-compose:not(.is-open) .dev-compose-top { padding: 0.5rem 0.5rem 0; }
.dev-compose:not(.is-open) .dev-compose-top .dev-label { margin-bottom: 0.45rem; }
@keyframes dev-more-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
/* ─── Compose ─── */
.dev-compose { max-width: 820px; margin: 0 auto; padding: clamp(1.25rem, 4vw, 2.25rem); border-radius: 1.5rem; }
.dev-compose fieldset { border: 0; padding: 0; min-width: 0; }
.dev-label { display: block; font-weight: 800; font-size: 0.92rem; color: var(--brand-dark); margin-bottom: 0.6rem; float: none; width: auto; }
.dev-cat-picker { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.dev-cat-pill {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1rem; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--dev-border); background: var(--dev-surface); color: var(--dev-muted); font-weight: 800; font-size: 0.9rem;
  transition: all 0.15s ease;
}
.dev-cat-pill i { color: var(--tone); }
.dev-cat-pill:hover { border-color: var(--tone); color: var(--tone); }
.btn-check:checked + .dev-cat-pill { background: var(--tone-bg); border-color: var(--tone); color: var(--tone); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 18%, transparent); }
.btn-check:focus-visible + .dev-cat-pill { outline: 2px solid var(--tone); outline-offset: 2px; }
.dev-stars-input { display: inline-flex; flex-direction: row-reverse; gap: 0.2rem; }
.dev-stars-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dev-stars-input label { font-size: 2rem; color: #ddd2db; cursor: pointer; transition: transform 0.12s ease, color 0.12s ease; line-height: 1; }
[data-bs-theme="dark"] .dev-stars-input label { color: #4a3c49; }
.dev-stars-input input:checked ~ label,
.dev-stars-input label:hover,
.dev-stars-input label:hover ~ label { color: var(--dev-gold) !important; }
.dev-stars-input:hover label { color: #ddd2db; }
.dev-stars-input label:hover { transform: scale(1.15); }
.dev-stars-input input:focus-visible + label { outline: 2px solid var(--dev-gold); outline-offset: 2px; border-radius: 4px; }
.dev-stars-field.is-shake { animation: dev-shake 0.4s ease; }
@keyframes dev-shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
.dev-textarea { border-radius: 1rem; padding: 0.9rem 1rem; line-height: 1.9; resize: vertical; min-height: 130px; }
.dev-counter { text-align: end; font-size: 0.78rem; color: var(--dev-muted); margin-top: 0.3rem; font-variant-numeric: tabular-nums; }
.dev-counter.is-near { color: #b8433d; font-weight: 800; }
.dev-segment { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--dev-surface-2); border: 1px solid var(--dev-border); }
.dev-segment label { padding: 0.45rem 1rem; border-radius: 999px; cursor: pointer; font-weight: 800; font-size: 0.88rem; color: var(--dev-muted); transition: all 0.15s ease; }
.dev-segment .btn-check:checked + label { background: var(--brand-primary); color: #fff; box-shadow: 0 4px 12px -6px rgba(122, 61, 118, 0.7); }
.dev-segment .btn-check:focus-visible + label { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.dev-sign-preview { display: flex; align-items: center; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.75rem; font-size: 0.85rem; color: var(--dev-muted); }
.dev-sign-preview strong { color: var(--brand-dark); }
.dev-hint { font-size: 0.78rem; color: var(--dev-muted); margin: 0.45rem 0 0; }
.dev-send-btn { border-radius: 999px; font-weight: 900; }
.dev-send-btn i { margin-inline-end: 0.35rem; }
[dir="rtl"] .dev-send-btn i { display: inline-block; transform: scaleX(-1); }

/* ─── Filter chips ─── */
.dev-filter { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-bottom: 1.75rem; }
.dev-chip {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.9rem; border-radius: 999px; text-decoration: none;
  background: var(--dev-surface); border: 1px solid var(--dev-border); color: var(--dev-muted); font-weight: 800; font-size: 0.85rem;
  transition: all 0.15s ease;
}
.dev-chip i { color: var(--tone); }
.dev-chip:hover { color: var(--tone); border-color: var(--tone); }
.dev-chip.active { background: var(--tone); border-color: var(--tone); color: #fff; }
.dev-chip.active i { color: #fff; }
[data-bs-theme="dark"] .dev-chip.active { color: #140f15; }
[data-bs-theme="dark"] .dev-chip.active i { color: #140f15; }
.dev-chip-count { font-size: 0.72rem; padding: 0 0.45rem; border-radius: 999px; background: rgba(0, 0, 0, 0.06); }
.dev-chip.active .dev-chip-count { background: rgba(255, 255, 255, 0.25); }
.dev-avg-rating { color: var(--dev-gold); font-weight: 900; font-size: 1.1rem; margin-inline-end: 0.35rem; }

/* ─── Messages (masonry): writer first, then the kind, then the message ─── */
.dev-wall { columns: 4 240px; column-gap: 1rem; }
.dev-msg {
  break-inside: avoid; margin-bottom: 1rem; position: relative; scroll-margin-top: 7rem; overflow: hidden;
  background:
    radial-gradient(120% 70% at 100% 0%, color-mix(in srgb, var(--tone-bg) 85%, transparent), transparent 60%),
    var(--dev-surface);
  border: 1px solid var(--dev-border); border-radius: 1rem;
  padding: 0.85rem 0.95rem 0.6rem;
  box-shadow: 0 8px 22px -20px rgba(61, 26, 60, 0.55);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
[dir="ltr"] .dev-msg { background: radial-gradient(120% 70% at 0% 0%, color-mix(in srgb, var(--tone-bg) 85%, transparent), transparent 60%), var(--dev-surface); }
.dev-msg::before { content: ""; position: absolute; inset-block: 0.9rem; inset-inline-start: 0; width: 3px; border-radius: 0 3px 3px 0; background: var(--tone); }
[dir="rtl"] .dev-msg::before { border-radius: 3px 0 0 3px; }
.dev-msg:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -20px rgba(61, 26, 60, 0.7); }
.dev-msg:target { box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 40%, transparent), 0 14px 30px -20px rgba(61, 26, 60, 0.7); }
.dev-msg.is-pinned { border-color: color-mix(in srgb, var(--tone) 45%, transparent); }

/* 1) The writer */
.dev-msg-author { display: flex; align-items: center; gap: 0.55rem; margin-bottom: 0.6rem; }
.dev-msg-author .dev-avatar { width: 36px; height: 36px; box-shadow: 0 0 0 2px var(--dev-surface), 0 0 0 3.5px color-mix(in srgb, var(--tone) 55%, transparent); }
.dev-msg-author .dev-avatar.avatar-fallback { font-size: 1.1rem; }
.dev-avatar--xs.avatar-fallback { font-size: 0.75rem !important; }
.dev-avatar--anon { font-size: 1rem; }
.dev-msg-author-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; flex: 1; }
.dev-msg-name { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem; font-weight: 900; font-size: 0.86rem; color: var(--brand-dark); line-height: 1.3; }
.dev-msg-name .dev-role-chip { font-size: 0.66rem; padding: 0.05rem 0.45rem; }
.dev-msg-time { font-size: 0.7rem; color: var(--dev-muted); }
.dev-msg-flags { display: inline-flex; gap: 0.3rem; align-self: flex-start; flex-wrap: wrap; }
.dev-flag { font-size: 0.66rem; font-weight: 800; color: var(--dev-muted); background: var(--dev-surface-2); padding: 0.1rem 0.45rem; border-radius: 999px; }
.dev-flag--pin { color: var(--tone); background: transparent; font-size: 0.9rem; padding: 0; }
.dev-flag--mine { color: var(--brand-primary); background: rgba(122, 61, 118, 0.1); }

/* 2) The kind (and stars) */
.dev-msg-head { display: flex; align-items: center; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.45rem; }
.dev-msg-cat {
  display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.12rem 0.55rem; border-radius: 999px;
  background: var(--tone-bg); color: var(--tone); font-weight: 900; font-size: 0.7rem;
}
.dev-msg-stars { color: var(--dev-gold); font-size: 0.75rem; letter-spacing: 1px; direction: ltr; }

/* 3) The message */
.dev-msg-body { font-size: 0.9rem; line-height: 1.8; color: var(--bs-body-color); margin: 0 0 0.6rem; overflow-wrap: anywhere; }

.dev-reply {
  margin-bottom: 0.5rem; padding: 0.55rem 0.7rem; border-radius: 0.8rem; font-size: 0.82rem; line-height: 1.75;
  background: linear-gradient(135deg, rgba(122, 61, 118, 0.07), rgba(70, 172, 174, 0.08));
  border-inline-start: 2px solid var(--brand-accent);
}
.dev-reply-head { display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.25rem; font-size: 0.72rem; color: var(--dev-muted); }
.dev-reply-head strong { color: var(--brand-accent); }
.dev-msg-actions { display: flex; align-items: center; gap: 0.15rem; padding-top: 0.35rem; border-top: 1px dashed var(--dev-border); }
.dev-msg-actions form { margin: 0; }
.dev-act {
  width: 28px; height: 28px; border-radius: 50%; border: 0; display: grid; place-items: center; font-size: 0.85rem;
  background: transparent; color: var(--dev-muted); transition: all 0.15s ease;
}
.dev-act:hover { background: var(--dev-surface-2); color: var(--brand-primary); }
.dev-act.is-on { color: #c0498a; }
.dev-heart-form { display: inline-flex; align-items: center; }
.dev-act:disabled { opacity: 1; }
.dev-act i { transition: transform 0.15s ease; }
.dev-act:active i { transform: scale(0.85); }
.dev-act.is-pop i { animation: dev-pop 0.45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes dev-pop { 0% { transform: scale(0.6); } 50% { transform: scale(1.35); } 100% { transform: scale(1); } }
.dev-heart-count { font-size: 0.75rem; font-weight: 800; color: #c0498a; margin-inline-start: -0.1rem; }
[data-bs-theme="dark"] .dev-heart-count { color: #ec8fbf; }
.dev-act--danger:hover { color: #b8433d; background: rgba(184, 67, 61, 0.1); }
.dev-reply-form { margin-top: 0.5rem; }
.dev-optional { font-weight: 600; font-size: 0.8rem; color: var(--dev-muted); margin-inline-start: 0.3rem; }.dev-empty { text-align: center; padding: 3rem 1rem; color: var(--dev-muted); }
.dev-empty i { font-size: 3rem; color: var(--brand-secondary); display: block; margin-bottom: 0.75rem; }

/* Reveal on scroll (developers.js adds .is-waiting; reduce-motion skips it) */
.dev-reveal { transition: opacity 0.5s ease, transform 0.5s ease; transition-delay: calc(var(--i, 0) * 60ms); }
.dev-reveal.is-waiting { opacity: 0; transform: translateY(16px); }

/* Footer credit link */
.footer-dev-credit { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.35rem; margin-top: 0.9rem; font-size: 0.85rem; font-weight: 700; color: var(--text-soft, #8a7a88); }
.footer-dev-credit i { color: #c0498a; }
.footer-dev-link { color: var(--brand-primary); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.footer-dev-link:hover { color: var(--brand-accent, #46acae); }

@media (max-width: 767.98px) {
  .dev-stats { margin-inline: 0; gap: 0.5rem; }
  .dev-stat { padding: 0.9rem 0.4rem; }
  .dev-stat-label { font-size: 0.72rem; }
  .dev-hero { border-radius: 1.25rem; padding-bottom: 3.75rem; }
  .dev-segment label { padding: 0.45rem 0.8rem; }
}

/* ============================================================================
   Default profile picture, dressed up (includes/avatar.php): an SVG person with
   optional hat / glasses / extra and a colour. .mav-wrap is the round container.
   ============================================================================ */
.mav-wrap { background: transparent !important; overflow: hidden; border-radius: 50%; padding: 0 !important; }
.mav { display: block; width: 100%; height: 100%; }
.mav .mav-bg { fill: rgba(122, 61, 118, 0.1); }
.mav .mav-person { fill: var(--brand-primary); }
.mav--teal .mav-bg { fill: #e2f4f4; }   .mav--teal .mav-person { fill: #2f8f91; }
.mav--rose .mav-bg { fill: #fbe4ef; }   .mav--rose .mav-person { fill: #b03f7c; }
.mav--gold .mav-bg { fill: #fdf0d2; }   .mav--gold .mav-person { fill: #b07a0c; }
.mav--sky .mav-bg  { fill: #e3edfb; }   .mav--sky .mav-person  { fill: #3d6fb8; }
[data-bs-theme="dark"] .mav .mav-bg { fill: rgba(192, 126, 187, 0.16); }
[data-bs-theme="dark"] .mav--teal .mav-bg { fill: #173234; } [data-bs-theme="dark"] .mav--teal .mav-person { fill: #6fd0d2; }
[data-bs-theme="dark"] .mav--rose .mav-bg { fill: #3a1d2c; } [data-bs-theme="dark"] .mav--rose .mav-person { fill: #ec8fbf; }
[data-bs-theme="dark"] .mav--gold .mav-bg { fill: #35290f; } [data-bs-theme="dark"] .mav--gold .mav-person { fill: #f0bd4f; }
[data-bs-theme="dark"] .mav--sky .mav-bg  { fill: #172438; } [data-bs-theme="dark"] .mav--sky .mav-person  { fill: #8fb5ec; }
/* 👑 royal (one account only - AVATAR_EXCLUSIVE in includes/avatar.php): velvet purple + a golden person, same in both themes */
.mav--royal .mav-bg, [data-bs-theme="dark"] .mav--royal .mav-bg { fill: url(#mav-royal-bg); }
.mav--royal .mav-person, [data-bs-theme="dark"] .mav--royal .mav-person { fill: url(#mav-royal-person); }
/* 💎 sapphire («الملكة» only): night-navy velvet + a champagne person, same in both themes */
.mav--sapphire .mav-bg, [data-bs-theme="dark"] .mav--sapphire .mav-bg { fill: url(#mav-sapphire-bg); }
.mav--sapphire .mav-person, [data-bs-theme="dark"] .mav--sapphire .mav-person { fill: url(#mav-sapphire-person); }
/* each special colour's soft lights show only with that colour (the profile preview draws them all) */
.mav .mav-lights { display: none; }
.mav--royal .mav-lights-royal, .mav--sapphire .mav-lights-sapphire { display: inline; }

/* Profile page: the magic-wand button opposite the camera, and the dress-up window */
.avatar-dress-btn {
  width: 34px; height: 34px; padding: 0; background: #fff; color: var(--brand-primary);
  border: 1.5px solid rgba(122, 61, 118, 0.25); box-shadow: 0 4px 12px -6px rgba(61, 26, 60, 0.5); font-size: 0.85rem;
}
.avatar-dress-btn:hover, .avatar-dress-btn:focus-visible { background: var(--brand-primary); color: #fff; }
[data-bs-theme="dark"] .avatar-dress-btn { background: var(--misk-surface, #1e1620); }
.avatar-dress .modal-content, .avatar-dress { border-radius: 1.25rem; }
.avatar-dress-preview { display: flex; justify-content: center; margin: 0.25rem 0 1rem; }
.avatar-dress-preview .mav-wrap { width: 128px; height: 128px; box-shadow: 0 0 0 5px rgba(122, 61, 118, 0.08), 0 14px 30px -18px rgba(61, 26, 60, 0.6); }
.avatar-dress-note {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 1rem; padding: 0.6rem 0.8rem;
  border-radius: 0.8rem; background: rgba(70, 172, 174, 0.1); font-size: 0.82rem;
}
.avatar-dress-part { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
.avatar-dress-part legend { float: none; width: auto; font-size: 0.88rem; font-weight: 900; margin-bottom: 0.5rem; }
.avatar-dress-options { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.avatar-dress-option {
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem; width: 74px; padding: 0.45rem 0.25rem 0.4rem;
  border-radius: 0.9rem; border: 1.5px solid transparent; cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease;
}
.avatar-dress-option:hover { background: rgba(122, 61, 118, 0.06); }
.btn-check:checked + .avatar-dress-option { border-color: var(--brand-primary); background: rgba(122, 61, 118, 0.08); }
.btn-check:focus-visible + .avatar-dress-option { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.avatar-dress-mini { width: 48px; height: 48px; }
.avatar-dress-label { font-size: 0.72rem; font-weight: 800; text-align: center; line-height: 1.3; color: var(--bs-body-color); }

/* "مطوّرة" badge next to a development-team member's name (developer_badge_html() in includes/developers.php) */
.dev-badge {
  display: inline-flex; align-items: center; gap: 0.25rem; vertical-align: middle; white-space: nowrap;
  padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.68rem; font-weight: 800; line-height: 1.5;
  color: #fff; background: linear-gradient(135deg, #7a3d76, #46acae);
  box-shadow: 0 2px 8px -3px rgba(122, 61, 118, 0.55);
}
.dev-badge i { font-size: 0.75rem; }
h1 .dev-badge, h2 .dev-badge, h3 .dev-badge { font-size: 0.72rem; margin-inline-start: 0.35rem; }
/* «الملكة 👑» (QUEEN_USERNAMES in includes/developers.php): no pill - a small castle with the crown on it after
   her name (on her left in Arabic), a large one in her profile card's far corner, and the crown on her
   navbar picture. Still - no shine or glow. */
.queen-castle-mini {
  display: inline-block; vertical-align: -0.2em; margin-inline-start: 0.2rem;
  width: 1.35em; height: 1.46em; line-height: 0;
}
.queen-castle-mini svg { width: 100%; height: 100%; display: block; }
h1 .queen-castle-mini, h2 .queen-castle-mini, h3 .queen-castle-mini { width: 1.1em; height: 1.19em; }
.queen-castle {
  position: absolute; top: 0.6rem; inset-inline-end: 1.1rem; z-index: 2;
  width: 78px; height: 92px; display: block;
  filter: drop-shadow(0 3px 6px rgba(61, 26, 60, 0.18));
}
.queen-castle--beside-shield { inset-inline-end: 4.9rem; } /* she also has the «مطوّرة» shield */
/* home page: her sapphire tiara in a 28px circle, like the badges after her name */
.queen-tiara-circle { width: 28px; height: 28px; background: rgba(31, 58, 168, 0.12); }
.queen-tiara-circle svg { width: 22px; height: 18px; display: block; }
[data-bs-theme="dark"] .queen-tiara-circle { background: rgba(111, 143, 240, 0.18); }
.queen-castle svg { position: absolute; top: 0; inset-inline: 0; width: 100%; height: 84px; }
.queen-castle-name {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); white-space: nowrap;
  padding: 0.12rem 0.6rem; border-radius: 0.35rem;
  font-size: 0.62rem; font-weight: 900; line-height: 1.3; color: #f6d27a;
  background: linear-gradient(135deg, #1f2a6e, #0b1030); border: 1px solid #d9a845; /* the castle's sapphire banners */
}
@media (max-width: 575.98px) {
  .queen-castle { width: 64px; height: 76px; top: 0.4rem; inset-inline-end: 0.8rem; }
  .queen-castle svg { height: 69px; }
  .queen-castle--beside-shield { inset-inline-end: 4.2rem; }
}
.queen-crown-dot {
  position: absolute; top: 1px; left: -2px; width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center; pointer-events: none;
  background: radial-gradient(circle at 35% 30%, #2b3466, #0b1030); /* her sapphire night */
  box-shadow: 0 0 0 1.5px var(--bs-body-bg, #fff);
}
.queen-crown-dot svg { width: 10px; height: 8px; display: block; }
/* Icon-only mark on the navbar picture */
.dev-badge-dot {
  position: absolute; bottom: 6px; inset-inline-end: -2px; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.6rem; color: #fff;
  background: linear-gradient(135deg, #7a3d76, #46acae); border: 2px solid var(--bs-body-bg, #fff);
}

/* Reviews page: switch between the developers' and the admins' messages (someone who reads both),
   and the "إلى ..." tag on a writer's own messages */
.dev-inbox-switch {
  display: flex; justify-content: center; gap: 4px; width: fit-content; max-width: 100%; margin: 0 auto 1.25rem;
  padding: 4px; border-radius: 999px; background: var(--dev-surface-2); border: 1px solid var(--dev-border);
}
.dev-inbox-switch a {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1.1rem; border-radius: 999px;
  font-weight: 800; font-size: 0.9rem; color: var(--dev-muted); text-decoration: none; transition: background 0.15s ease, color 0.15s ease;
}
.dev-inbox-switch a:hover { color: var(--brand-primary); }
.dev-inbox-switch a.active { background: var(--brand-primary); color: #fff; box-shadow: 0 4px 12px -6px rgba(122, 61, 118, 0.7); }
.dev-inbox-switch a.active .dev-chip-count { background: rgba(255, 255, 255, 0.25); }
[data-bs-theme="dark"] .dev-inbox-switch a.active { color: #140f15; }
.dev-msg-to { margin-inline-start: auto; font-size: 0.68rem; font-weight: 800; color: var(--dev-muted); background: var(--dev-surface-2); padding: 0.1rem 0.5rem; border-radius: 999px; }

/* Reviews page: while a smooth action / filter loads (developers.js), the messages dim a little */
#wallSlot, #write { transition: opacity 0.2s ease; }
body.dev-busy #wallSlot, body.dev-busy #write { opacity: 0.55; pointer-events: none; }
body.dev-busy { cursor: progress; }

/* Reviews form, step 1: "إلى من رسالتك؟" - two centred cards: icon, name, one line, three example topics.
   Each card has its own colour (--to): teal for the developers, purple for the admins. */
.dev-to-step { border: 0; padding: 0; margin: 0 0 1.25rem; min-width: 0; }
.dev-to-q { text-align: center; font-size: 1.05rem; margin-bottom: 0.85rem; }
.dev-to-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 575.98px) { .dev-to-cards { gap: 0.5rem; } }
.dev-to-card--developers { --to: #2f8f91; --to-soft: rgba(70, 172, 174, 0.12); }
.dev-to-card--admins { --to: #7a3d76; --to-soft: rgba(122, 61, 118, 0.1); }
[data-bs-theme="dark"] .dev-to-card--developers { --to: #6fd0d2; --to-soft: rgba(92, 198, 200, 0.14); }
[data-bs-theme="dark"] .dev-to-card--admins { --to: #d3a3cf; --to-soft: rgba(192, 126, 187, 0.14); }
.dev-to-card {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.35rem;
  margin: 0; height: 100%; cursor: pointer; padding: 1.1rem 0.75rem 1rem; border-radius: 1.1rem;
  border: 1.5px solid var(--dev-border); background: var(--dev-surface);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.dev-to-card:hover { border-color: var(--to); transform: translateY(-2px); }
.dev-to-icon {
  width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-size: 1.35rem; margin-bottom: 0.2rem;
  background: var(--to-soft); color: var(--to); transition: background 0.15s ease, color 0.15s ease;
}
.dev-to-name { font-weight: 900; font-size: 1.05rem; color: var(--brand-dark); }
.dev-to-about { font-size: 0.8rem; color: var(--dev-muted); font-weight: 600; }
.dev-to-topics { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem; margin-top: 0.35rem; }
.dev-to-topics span { font-size: 0.7rem; font-weight: 700; padding: 0.15rem 0.55rem; border-radius: 999px; background: var(--dev-surface-2); color: var(--dev-muted); white-space: nowrap; }
.dev-to-topics .dev-to-word { color: var(--to); background: var(--to-soft); }
.dev-to-topics .dev-to-word i { font-size: 0.72rem; margin-inline-end: 0.15rem; }
.dev-to-check { position: absolute; top: 0.6rem; inset-inline-end: 0.65rem; color: var(--to); font-size: 1.15rem; opacity: 0; transform: scale(0.5); transition: opacity 0.15s ease, transform 0.2s ease; }
.btn-check:checked + .dev-to-card { border-color: var(--to); background: var(--to-soft); box-shadow: 0 8px 22px -16px var(--to); }
.btn-check:checked + .dev-to-card .dev-to-icon { background: var(--to); color: #fff; }
[data-bs-theme="dark"] .btn-check:checked + .dev-to-card .dev-to-icon { color: #140f15; }
.btn-check:checked + .dev-to-card .dev-to-topics span { background: var(--dev-surface); color: var(--to); }
.btn-check:checked + .dev-to-card .dev-to-check { opacity: 1; transform: none; }
.btn-check:focus-visible + .dev-to-card { outline: 2px solid var(--to); outline-offset: 2px; }.dev-compose-rest.is-appearing { animation: dev-more-in 0.25s ease; }

/* Profile photo editor (assets/js/avatar-crop.js): the photo moves / zooms / rotates under a
   circle - everything outside the circle is dimmed, so she sees exactly what will be kept. */
.avatar-crop { border-radius: 1.25rem; }
.avatar-crop-hint { font-size: 0.85rem; color: var(--bs-secondary-color); text-align: center; margin-bottom: 0.9rem; }
.avatar-crop-stage {
  position: relative; width: min(300px, 100%); aspect-ratio: 1; margin: 0 auto; overflow: hidden;
  border-radius: 1rem; background: #1d1620; cursor: grab; touch-action: none; user-select: none;
}
.avatar-crop-stage.is-dragging { cursor: grabbing; }
.avatar-crop-stage img {
  position: absolute; top: 50%; left: 50%; max-width: none; transform-origin: center;
  pointer-events: none; user-select: none; -webkit-user-drag: none;
}
.avatar-crop-ring {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  border: 2px solid rgba(255, 255, 255, 0.9); box-shadow: 0 0 0 999px rgba(20, 12, 22, 0.6);
}
.avatar-crop-tools { display: flex; align-items: center; justify-content: center; gap: 0.75rem; margin-top: 1rem; }
.avatar-crop-tool {
  width: 40px; height: 40px; border-radius: 50%; padding: 0; display: grid; place-items: center; font-size: 1.1rem;
  background: rgba(122, 61, 118, 0.1); color: var(--brand-primary); border: 0;
}
.avatar-crop-tool:hover, .avatar-crop-tool:focus-visible { background: var(--brand-primary); color: #fff; }
.avatar-crop-zoom { display: flex; align-items: center; gap: 0.5rem; flex: 1; max-width: 200px; margin: 0; color: var(--bs-secondary-color); }
.avatar-crop-zoom .form-range { flex: 1; }
.avatar-crop-zoom .form-range::-webkit-slider-thumb { background: var(--brand-primary); }
.avatar-crop-zoom .form-range::-moz-range-thumb { background: var(--brand-primary); }
.avatar-crop-zoom .form-range:focus::-webkit-slider-thumb { box-shadow: 0 0 0 0.25rem rgba(122, 61, 118, 0.25); }
/* The camera button when she has a photo: a small window - her photo, then adjust / change / remove */
.avatar-photo { border-radius: 1.25rem; }
.avatar-photo-current { display: block; width: 110px; height: 110px; margin: 0 auto 1rem; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 4px rgba(122, 61, 118, 0.1); }
.avatar-photo-actions { display: grid; gap: 0.45rem; }
.avatar-photo-act {
  display: flex; align-items: center; gap: 0.6rem; width: 100%; margin: 0; padding: 0.65rem 0.9rem; border-radius: 0.85rem; cursor: pointer;
  border: 1px solid var(--bs-border-color); background: transparent; color: var(--bs-body-color); font-weight: 800; font-size: 0.92rem; text-align: start;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.avatar-photo-act i { font-size: 1.05rem; color: var(--brand-primary); }
.avatar-photo-act:hover, .avatar-photo-act:focus-visible { background: rgba(122, 61, 118, 0.07); border-color: rgba(122, 61, 118, 0.3); }
.avatar-photo-act--danger, .avatar-photo-act--danger i { color: #b8433d; }
.avatar-photo-act--danger:hover, .avatar-photo-act--danger:focus-visible { background: rgba(184, 67, 61, 0.08); border-color: rgba(184, 67, 61, 0.35); }
[data-bs-theme="dark"] .avatar-photo-act--danger, [data-bs-theme="dark"] .avatar-photo-act--danger i { color: #f08f89; }
/* ===== Membership card (includes/credentials-card.php + assets/js/credentials-card.js) ===== */
.cred-modal .modal-content { border: 0; border-radius: 1.6rem; overflow: hidden; }
.cred-hero { position: relative; text-align: center; padding: 2.2rem 1.5rem 1.4rem; color: #fff;
    background: radial-gradient(circle at 50% -20%, rgba(240, 207, 122, 0.45), transparent 60%), linear-gradient(135deg, #8d4a88 0%, #5a2756 55%, #2b1029 100%); }
.cred-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.12;
    background-image: radial-gradient(#fff 1.2px, transparent 1.3px); background-size: 22px 22px; }
.cred-hero-seal { position: relative; z-index: 1; display: inline-flex; width: 74px; height: 74px; border-radius: 50%; background: #fff; padding: 4px;
    box-shadow: 0 0 0 4px #f0cf7a, 0 10px 30px rgba(0, 0, 0, 0.3); animation: credSeal 0.9s cubic-bezier(.2, 1.4, .4, 1) both; }
.cred-hero-seal img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.cred-hero-title { position: relative; z-index: 1; font-weight: 900; font-size: 1.6rem; margin: 0.9rem 0 0.35rem; }
.cred-hero-lead { position: relative; z-index: 1; font-weight: 700; font-size: 0.92rem; opacity: 0.85; max-width: 520px; margin: 0 auto; }
@keyframes credSeal { from { transform: scale(0.3) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }

.cred-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 767.98px) { .cred-layout { grid-template-columns: 1fr; } }
.cred-preview { position: relative; }
.cred-preview canvas { display: block; width: 100%; height: auto; border-radius: 1.2rem; box-shadow: 0 18px 45px rgba(61, 26, 60, 0.28); background: #f3eaf2; }
.cred-preview-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--brand-primary); }

.cred-opt-title { font-weight: 900; font-size: 0.9rem; color: var(--brand-dark); margin-bottom: 0.6rem; }
.cred-themes { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.cred-theme { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; background: none; border: 0; padding: 0; font-weight: 700; font-size: 0.75rem; color: inherit; }
.cred-theme-swatch { width: 46px; height: 46px; border-radius: 50%; border: 3px solid transparent; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); transition: transform .15s ease, border-color .15s ease; }
.cred-theme:hover .cred-theme-swatch { transform: translateY(-2px); }
.cred-theme.active .cred-theme-swatch { border-color: #f0cf7a; box-shadow: 0 0 0 3px var(--brand-primary); }
.cred-theme:focus-visible { outline: none; }
.cred-theme:focus-visible .cred-theme-swatch { box-shadow: 0 0 0 3px var(--brand-accent, #46acae); }
.cred-theme--royal .cred-theme-swatch { background: linear-gradient(135deg, #8d4a88, #2b1029); }
.cred-theme--teal .cred-theme-swatch { background: linear-gradient(135deg, #55c0c2, #103d42); }
.cred-theme--night .cred-theme-swatch { background: linear-gradient(135deg, #2f1d34, #09060a); box-shadow: inset 0 0 0 2px #d9b45b; }
.cred-theme--pearl .cred-theme-swatch { background: linear-gradient(135deg, #ffffff, #efdfec); }
.cred-theme--rose .cred-theme-swatch { background: linear-gradient(135deg, #f0b7cf, #7a3d76); }

.cred-switch { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 0.88rem; margin-bottom: 0.5rem; cursor: pointer; }
.cred-switch input { position: absolute; opacity: 0; pointer-events: none; }
.cred-switch-track { position: relative; width: 40px; height: 22px; border-radius: 11px; background: #d9cfd8; transition: background .2s; flex-shrink: 0; }
.cred-switch-track::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: inset-inline-start .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.cred-switch input:checked + .cred-switch-track { background: var(--brand-primary); }
.cred-switch input:checked + .cred-switch-track::after { inset-inline-start: 21px; }
.cred-switch input:focus-visible + .cred-switch-track { box-shadow: 0 0 0 3px rgba(122, 61, 118, 0.3); }

.cred-password-box { margin-top: 0.9rem; padding: 0.7rem 0.9rem; border-radius: 0.9rem; border: 1px dashed rgba(122, 61, 118, 0.35); background: rgba(122, 61, 118, 0.05); }
.cred-password-box small { font-weight: 700; color: #8a7a89; }
.cred-password-box code { font-size: 1.05rem; font-weight: 800; color: var(--brand-dark); word-break: break-all; }
.cred-actions { display: grid; gap: 0.5rem; margin-top: 1rem; }
.cred-note { margin: 0.8rem 0 0; font-size: 0.78rem; font-weight: 700; color: #8a7a89; }
.cred-note i { color: var(--brand-primary); }

.cred-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 2000; overflow: hidden; }
.cred-confetti i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px; animation-name: credFall; animation-timing-function: cubic-bezier(.25, .6, .5, 1); animation-fill-mode: forwards; }
@keyframes credFall { to { top: 105%; transform: translateX(60px) rotate(720deg); opacity: 0.2; } }

[data-bs-theme="dark"] .cred-opt-title, [data-bs-theme="dark"] .cred-password-box code { color: #f1e4ef; }
[data-bs-theme="dark"] .cred-password-box { background: rgba(192, 126, 187, 0.08); border-color: rgba(192, 126, 187, 0.35); }
[data-bs-theme="dark"] .cred-switch-track { background: #4a3a4b; }
[data-bs-theme="dark"] .cred-switch input:checked + .cred-switch-track { background: #c07ebb; }

/* Profile: "my card" row */
.profile-card-cta { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.1rem; border-radius: 1.1rem; color: #fff; text-decoration: none;
    background: linear-gradient(135deg, #8d4a88 0%, #5a2756 60%, #2b1029 100%); box-shadow: 0 10px 25px rgba(90, 39, 86, 0.25); border: 0; width: 100%; text-align: start; }
.profile-card-cta:hover { color: #fff; transform: translateY(-1px); }
.profile-card-cta-icon { width: 46px; height: 46px; border-radius: 50%; background: #f0cf7a; color: #3d1a3c; display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.profile-card-cta strong { display: block; font-weight: 900; }
.profile-card-cta small { opacity: 0.8; font-weight: 700; }

/* ===== Theory exam rooms (exam-rooms.php, includes/cp-exam-rooms.php) ===== */
.xr-hero { position: relative; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1.6rem; border-radius: 1.5rem; color: #fff; overflow: hidden;
    background: radial-gradient(circle at 85% -30%, rgba(240, 207, 122, 0.4), transparent 55%), linear-gradient(135deg, #8d4a88 0%, #5a2756 60%, #2b1029 100%); box-shadow: 0 14px 34px rgba(90, 39, 86, 0.25); }
.xr-hero::after { content: ""; position: absolute; inset: 0; opacity: 0.1; pointer-events: none; background-image: radial-gradient(#fff 1.2px, transparent 1.3px); background-size: 20px 20px; }
.xr-hero > * { position: relative; z-index: 1; }
.xr-hero-icon { width: 64px; height: 64px; border-radius: 1.2rem; background: #f0cf7a; color: #3d1a3c; display: flex; align-items: center; justify-content: center; font-size: 1.9rem; flex-shrink: 0; transform: rotate(-6deg); }
.xr-hero-text { flex: 1 1 260px; }
.xr-hero-text h1 { font-size: 1.45rem; font-weight: 900; margin: 0 0 0.25rem; }
.xr-hero-text p { margin: 0; font-weight: 700; opacity: 0.85; font-size: 0.92rem; }
.xr-status { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.9rem; border-radius: 999px; font-weight: 900; font-size: 0.82rem; background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3); }
.xr-status.is-open { background: #d1fae5; color: #065f46; border-color: transparent; }
.xr-hero-admin { color: #fff; font-weight: 800; font-size: 0.82rem; text-decoration: none; opacity: 0.9; }
.xr-hero-admin:hover { color: #f0cf7a; }

.xr-empty { text-align: center; padding: 2.6rem 1.5rem; }
.xr-empty > i { font-size: 2.6rem; color: var(--brand-primary); opacity: 0.7; }
.xr-empty h2 { font-size: 1.15rem; font-weight: 900; margin: 0.7rem 0 0.35rem; color: var(--brand-dark); }
.xr-empty p { color: #8a7a89; font-weight: 700; margin-bottom: 1rem; }
.xr-notice { padding: 0.9rem 1.1rem; border-radius: 1rem; background: #fff7e6; color: #8a5a00; font-weight: 800; border: 1px solid #f5deb0; }

.xr-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.xr-steps div { display: flex; align-items: center; gap: 0.55rem; padding: 0.7rem 0.9rem; border-radius: 1rem; background: rgba(122, 61, 118, 0.06); font-weight: 800; font-size: 0.86rem; color: var(--brand-dark); }
.xr-steps span { width: 28px; height: 28px; border-radius: 50%; background: var(--brand-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; flex-shrink: 0; }
@media (max-width: 575.98px) { .xr-steps { grid-template-columns: 1fr; } }

/* Her ticket */
.xr-ticket { display: flex; border-radius: 1.4rem; overflow: hidden; background: #fff; box-shadow: 0 14px 36px rgba(61, 26, 60, 0.16); border: 1px solid rgba(122, 61, 118, 0.12); }
.xr-ticket.is-new { animation: xrPop 0.7s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes xrPop { from { transform: scale(0.92); opacity: 0; } to { transform: none; opacity: 1; } }
.xr-ticket-stub { position: relative; flex: 0 0 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem; padding: 1.2rem 0.8rem; color: #3d1a3c;
    background: linear-gradient(160deg, #f6dc97, #f0cf7a 55%, #e2b75a); border-inline-end: 3px dashed rgba(61, 26, 60, 0.25); }
.xr-ticket-stub small { font-weight: 800; font-size: 0.78rem; opacity: 0.8; }
.xr-ticket-stub strong { font-size: 3.4rem; line-height: 1; font-weight: 900; }
.xr-ticket-stub span { font-weight: 800; font-size: 0.85rem; }
.xr-ticket-body { flex: 1; padding: 1.2rem 1.4rem; min-width: 0; }
.xr-ticket-title { font-weight: 900; font-size: 1.1rem; color: var(--brand-dark); margin-bottom: 0.8rem; }
.xr-ticket-title i { color: #10b981; }
.xr-ticket-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem 1.2rem; }
.xr-ticket-grid small { display: block; font-weight: 700; color: #8a7a89; font-size: 0.75rem; }
.xr-ticket-grid b { font-weight: 900; color: var(--brand-dark); }
/* The room's note («ملاحظة للطالبات» in the control panel) on the students' and teachers' room cards. */
.xr-room-note { margin: 0.6rem 0; padding: 0.5rem 0.75rem; border-radius: 0.8rem; background: rgba(70, 172, 174, 0.1); color: #1f6f71; font-weight: 800; font-size: 0.85rem; display: flex; gap: 0.45rem; align-items: flex-start; line-height: 1.5; white-space: pre-line; }
.xr-pcard .xr-room-note { margin: 0.8rem 1.2rem 0; }
.xr-sup-main .xr-room-note { margin: 0.5rem 0 0; }
[data-bs-theme="dark"] .xr-room-note { background: rgba(70, 172, 174, 0.14); color: #7dd3d5; }
.xr-ticket-note { margin-top: 0.8rem; padding: 0.55rem 0.8rem; border-radius: 0.8rem; background: rgba(70, 172, 174, 0.1); color: #1f6f71; font-weight: 800; font-size: 0.85rem; }
.xr-ticket-actions { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.9rem; flex-wrap: wrap; }
/* «حفظ صورة التذكرة» + its modal (assets/js/exam-ticket.js draws the picture) */
.xr-kind-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.xr-kind-bar .xr-ticket-save { margin-inline-start: auto; } /* the end side (left in Arabic), even without the tabs */
.xr-ticket-save { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.65rem 1.4rem; border: 0; border-radius: 999px; font-weight: 900; font-size: 0.9rem; color: #fff;
    background: linear-gradient(135deg, #7a3d76, #46acae); box-shadow: 0 8px 20px rgba(122, 61, 118, 0.28); transition: transform .15s ease, box-shadow .15s ease; }
.xr-ticket-save:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(122, 61, 118, 0.36); }
.xr-ticket-save i { font-size: 1.05rem; }
.xr-tmodal .modal-content { border-radius: 1.4rem; border: 0; }
.xr-tmodal-hint { font-weight: 700; font-size: 0.88rem; color: #6b5a6a; background: rgba(70, 172, 174, 0.1); border-radius: 0.9rem; padding: 0.6rem 0.8rem; }
.xr-tmodal-hint i { color: #2f8f91; }
.xr-tmodal-frame { display: flex; justify-content: center; align-items: center; min-height: 220px; border-radius: 1rem; background: #f6eff5; padding: 0.6rem; }
.xr-tmodal-frame img { display: block; max-width: 100%; max-height: 62vh; border-radius: 0.8rem; box-shadow: 0 10px 28px rgba(61, 26, 60, 0.25); -webkit-touch-callout: default; }
.xr-tmodal-loading { font-weight: 800; color: #7a3d76; display: flex; align-items: center; gap: 0.5rem; }
[data-bs-theme="dark"] .xr-tmodal-hint { color: var(--bs-body-color); }
[data-bs-theme="dark"] .xr-tmodal-frame { background: rgba(255, 255, 255, 0.05); }
@media (max-width: 575.98px) {
    .xr-ticket { flex-direction: column; }
    .xr-ticket-stub { flex-basis: auto; flex-direction: row; gap: 0.8rem; border-inline-end: 0; border-bottom: 3px dashed rgba(61, 26, 60, 0.25); }
    .xr-ticket-stub strong { font-size: 2.4rem; }
}

/* Days + rooms */
.xr-rooms-head { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 1rem; scroll-margin-top: 6rem; }
.xr-rooms-head h2 { font-size: 1.15rem; font-weight: 900; margin: 0; color: var(--brand-dark); }
.xr-day-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.xr-chip { border: 1px solid rgba(122, 61, 118, 0.25); background: #fff; color: var(--brand-dark); border-radius: 999px; padding: 0.35rem 0.9rem; font-weight: 800; font-size: 0.82rem; }
.xr-chip small { opacity: 0.7; }
.xr-chip.active { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.xr-day { margin-bottom: 1.8rem; }
.xr-day-head { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.8rem; }
.xr-day-cal { width: 52px; border-radius: 0.8rem; overflow: hidden; text-align: center; background: #fff; box-shadow: 0 3px 10px rgba(61, 26, 60, 0.12); flex-shrink: 0; }
.xr-day-cal b { display: block; font-size: 1.35rem; font-weight: 900; color: var(--brand-dark); padding-top: 0.15rem; }
.xr-day-cal small { display: block; background: var(--brand-primary); color: #fff; font-weight: 800; font-size: 0.68rem; padding: 0.1rem 0; }
.xr-day-name { font-weight: 900; font-size: 1.1rem; color: var(--brand-dark); }

.xr-room { position: relative; height: 100%; display: flex; flex-direction: column; gap: 0.7rem; padding: 1.1rem 1.2rem; border-radius: 1.2rem; background: #fff;
    border: 1px solid rgba(122, 61, 118, 0.12); box-shadow: 0 6px 20px rgba(61, 26, 60, 0.07); transition: transform .15s ease, box-shadow .15s ease; }
.xr-room:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(61, 26, 60, 0.12); }
.xr-room.is-mine { border: 2px solid #f0cf7a; background: linear-gradient(180deg, #fffaf0, #fff 60%); }
.xr-room.is-full { opacity: 0.65; }
.xr-room.is-past { opacity: 0.6; }
.xr-room-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.xr-room-time { font-weight: 900; font-size: 1.08rem; color: var(--brand-primary); }
/* control panel cards: «الأحد، الأسبوع ١٢», the time on the line under it */
.xr-room--admin .xr-room-time { display: flex; flex-direction: column; gap: 0.1rem; }
.xr-room-day { color: #3d1a3c; }
[data-bs-theme="dark"] .xr-room-day { color: #f2e8f1; }
.xr-room-badge { font-weight: 900; font-size: 0.75rem; background: #f0cf7a; color: #3d1a3c; padding: 0.25rem 0.6rem; border-radius: 999px; }
.xr-room-info { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; font-weight: 700; font-size: 0.9rem; color: #5b4a5a; }
.xr-room-info i { color: var(--brand-primary); opacity: 0.75; margin-inline-end: 0.3rem; }
.xr-meter-bar { height: 8px; border-radius: 999px; background: rgba(122, 61, 118, 0.1); overflow: hidden; }
.xr-meter-bar span { display: block; height: 100%; border-radius: inherit; background: #10b981; transition: width .5s ease; }
.xr-meter--low .xr-meter-bar span { background: #f59e0b; }
.xr-meter--full .xr-meter-bar span { background: #ef4444; }
.xr-meter-label { margin-top: 0.35rem; font-weight: 800; font-size: 0.8rem; color: #059669; }
.xr-meter--low .xr-meter-label { color: #b45309; }
.xr-meter--full .xr-meter-label { color: #dc2626; }
.xr-room > form { margin-top: auto; }
.xr-book-btn { margin-top: auto; background: var(--brand-primary); color: #fff; font-weight: 900; border-radius: 0.9rem; padding: 0.6rem; }
.xr-book-btn:hover, .xr-book-btn:focus-visible { background: #5a2756; color: #fff; }
.xr-book-btn:disabled { background: #e5dbe4; color: #8a7a89; }

/* Supervisors / tables */
.xr-sup { padding: 0; overflow: hidden; }
.xr-sup-head { display: flex; align-items: center; gap: 0.9rem; padding: 1rem 1.2rem; border-bottom: 1px solid rgba(122, 61, 118, 0.1); }
.xr-sup-head > div { flex: 1; min-width: 0; }
.xr-sup-count { font-weight: 900; font-size: 1.05rem; color: var(--brand-primary); background: rgba(122, 61, 118, 0.08); padding: 0.3rem 0.8rem; border-radius: 999px; }
.xr-table td, .xr-table th { padding: 0.5rem 0.8rem; }
.xr-seat-no { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; border-radius: 0.6rem; background: rgba(240, 207, 122, 0.35); color: #3d1a3c; font-weight: 900; }

/* Admin */
.xr-admin-top { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1rem; }
@media (max-width: 991.98px) { .xr-admin-top { grid-template-columns: 1fr; } }
.xr-switch-card { display: flex; align-items: center; gap: 0.9rem; padding: 1rem 1.2rem; border-radius: 1.2rem; background: #f6f1f6; border: 1px solid rgba(122, 61, 118, 0.15); margin: 0; }
.xr-switch-card small { color: #8a7a89; }
.xr-switch-card.is-open { background: #ecfdf5; border-color: #a7f3d0; }
.xr-switch-icon { width: 46px; height: 46px; border-radius: 50%; background: #e5dbe4; color: #5b4a5a; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.xr-switch-card.is-open .xr-switch-icon { background: #10b981; color: #fff; }
.xr-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.xr-stats > * { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 0.7rem; border-radius: 1.1rem; background: #fff; border: 1px solid rgba(122, 61, 118, 0.12); text-decoration: none; color: var(--brand-dark); }
.xr-stats b { font-size: 1.5rem; font-weight: 900; line-height: 1.1; }
.xr-stats b span { font-size: 0.95rem; opacity: 0.55; }
.xr-stats small { font-weight: 800; color: #8a7a89; font-size: 0.78rem; }
.xr-stats .is-warn { background: #fff7e6; border-color: #f5deb0; color: #8a5a00; }
.xr-stats .is-good { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.xr-nos { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.xr-nos-item { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.65rem; border-radius: 999px; background: rgba(122, 61, 118, 0.06); font-weight: 700; font-size: 0.82rem; }
.xr-nos-special { border: 1px solid rgba(122, 61, 118, 0.3); background: #fff; color: var(--brand-primary); border-radius: 999px; padding: 0.05rem 0.5rem; font-size: 0.72rem; font-weight: 800; }
.xr-nos-special:hover { background: var(--brand-primary); color: #fff; }
.xr-nos-special.is-on { color: #b02a37; border-color: rgba(176, 42, 55, 0.3); }
.xr-icon-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(122, 61, 118, 0.2); background: #fff; color: var(--brand-primary); display: inline-flex; align-items: center; justify-content: center; font-size: 0.85rem; }
.xr-icon-btn:hover { background: rgba(122, 61, 118, 0.08); }
.xr-icon-btn.is-danger { color: #dc2626; border-color: rgba(220, 38, 38, 0.25); }
.xr-students-toggle { display: flex; align-items: center; gap: 0.4rem; width: 100%; border: 0; border-radius: 0.8rem; padding: 0.5rem 0.8rem; background: rgba(122, 61, 118, 0.06); color: var(--brand-dark); font-weight: 800; font-size: 0.86rem; }
.xr-students-toggle:disabled { opacity: 0.55; }
.xr-students-toggle .bi-chevron-down { transition: transform .2s; }
.xr-students-toggle:not(.collapsed) .bi-chevron-down { transform: rotate(180deg); }
.xr-stepper .btn { font-weight: 900; width: 42px; }
.xr-picker { border: 1px solid var(--bs-border-color, #dee2e6); border-radius: 0.9rem; padding: 0.6rem; }
.xr-picker-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.5rem; }
.xr-picker-chips:empty { display: none; }
.xr-chip-sup { border: 0; border-radius: 999px; background: var(--brand-primary); color: #fff; font-weight: 800; font-size: 0.8rem; padding: 0.25rem 0.6rem; }
.xr-picker-list { max-height: 220px; overflow: auto; margin-top: 0.5rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.3rem; }
.xr-picker-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.55rem; border-radius: 0.7rem; cursor: pointer; font-weight: 700; font-size: 0.88rem; border: 1px solid transparent; margin: 0; }
.xr-picker-item[hidden] { display: none; }
.xr-picker-item:hover { background: rgba(122, 61, 118, 0.05); }
.xr-picker-item.is-on { background: rgba(122, 61, 118, 0.09); border-color: rgba(122, 61, 118, 0.3); }
.xr-picker-item input { accent-color: var(--brand-primary); }
.xr-picker-avatar { width: 28px; height: 28px; border-radius: 50%; background: #f0cf7a; color: #3d1a3c; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 0.85rem; flex-shrink: 0; }
.xr-sup-chosen { color: var(--brand-primary); }

/* Homepage card - the same white card as the welcome banner above it (thin brand edge, soft shadow) */
.xr-home-card { --xr-tone: var(--brand-primary); --xr-tint: rgba(122, 61, 118, 0.1);
    position: relative; overflow: hidden; display: flex; align-items: center; gap: 0.9rem; padding: 1rem 1.3rem; border-radius: 1rem; text-decoration: none;
    color: var(--brand-dark); background: rgba(255, 255, 255, 0.93); border: 1px solid rgba(122, 61, 118, 0.14);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04), 0 12px 28px rgba(122, 61, 118, 0.09); transition: transform .15s ease, box-shadow .15s ease; }
.xr-home-card::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(180deg, var(--brand-primary), var(--brand-accent)); }
.xr-home-card:hover { color: var(--brand-dark); transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05), 0 16px 34px rgba(122, 61, 118, 0.13); }
.xr-home-card:focus-visible { outline: 3px solid rgba(122, 61, 118, 0.35); outline-offset: 2px; }
.xr-home-card strong { display: block; font-weight: 900; font-size: 1.02rem; }
.xr-home-card small { display: block; color: #8a7a89; font-weight: 700; margin-top: 0.1rem; }
.xr-home-card > .bi { color: var(--xr-tone); font-size: 1.1rem; }
.xr-home-icon { width: 48px; height: 48px; border-radius: 0.9rem; background: var(--xr-tint); color: var(--xr-tone); display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; flex-shrink: 0; }
.xr-home-card.is-booked { --xr-tone: #2f8f91; --xr-tint: rgba(70, 172, 174, 0.13); }
[data-bs-theme="dark"] .xr-home-card { background: var(--misk-surface); border-color: var(--misk-border); color: #f1e4ef; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35); }
[data-bs-theme="dark"] .xr-home-card:hover { color: #f1e4ef; }
[data-bs-theme="dark"] .xr-home-card { --xr-tone: #d9a6d5; --xr-tint: rgba(192, 126, 187, 0.14); }
[data-bs-theme="dark"] .xr-home-card.is-booked { --xr-tone: #6fd0d2; --xr-tint: rgba(70, 172, 174, 0.16); }
[data-bs-theme="dark"] .xr-home-card small { color: #b9a6b7; }

/* Dark mode */
[data-bs-theme="dark"] .xr-ticket, [data-bs-theme="dark"] .xr-room, [data-bs-theme="dark"] .xr-stats > *, [data-bs-theme="dark"] .xr-icon-btn, [data-bs-theme="dark"] .xr-chip, [data-bs-theme="dark"] .xr-day-cal { background: #211823; border-color: rgba(192, 126, 187, 0.22); color: #f1e4ef; }
[data-bs-theme="dark"] .xr-room.is-mine { background: linear-gradient(180deg, #2c2416, #211823 60%); }
[data-bs-theme="dark"] .xr-ticket-title, [data-bs-theme="dark"] .xr-ticket-grid b, [data-bs-theme="dark"] .xr-day-name, [data-bs-theme="dark"] .xr-rooms-head h2, [data-bs-theme="dark"] .xr-day-cal b, [data-bs-theme="dark"] .xr-empty h2, [data-bs-theme="dark"] .xr-steps div, [data-bs-theme="dark"] .xr-students-toggle { color: #f1e4ef; }
[data-bs-theme="dark"] .xr-room-info { color: #d8c6d6; }
[data-bs-theme="dark"] .xr-room-time { color: #d9a6d5; }
[data-bs-theme="dark"] .xr-chip.active { background: #c07ebb; border-color: #c07ebb; color: #140f15; }
[data-bs-theme="dark"] .xr-switch-card { background: #211823; border-color: rgba(192, 126, 187, 0.22); }
[data-bs-theme="dark"] .xr-switch-card.is-open { background: #10291f; border-color: #1f6f4f; }
[data-bs-theme="dark"] .xr-notice { background: #2a2110; color: #f5d58a; border-color: #5a4720; }
[data-bs-theme="dark"] .xr-book-btn:disabled { background: #2e2430; color: #8a7a89; }
@media print { .navbar, .xr-hero-admin, .xr-ticket-actions { display: none !important; } }
/* Exam rooms: supervisors' phone numbers for students */
.xr-contacts { margin-top: 0.9rem; display: grid; gap: 0.45rem; }
.xr-contacts > small { font-weight: 700; color: #8a7a89; font-size: 0.75rem; }
.xr-contact { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; padding: 0.5rem 0.75rem; border-radius: 0.9rem; background: rgba(122, 61, 118, 0.05); border: 1px solid rgba(122, 61, 118, 0.1); }
.xr-contact-name { font-weight: 900; color: var(--brand-dark); flex: 1 1 auto; }
.xr-contact-phone { font-weight: 800; color: var(--brand-primary); text-decoration: none; white-space: nowrap; }
.xr-contact-phone:hover { text-decoration: underline; }
.xr-contact-wa { width: 34px; height: 34px; border-radius: 50%; background: #25D366; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; text-decoration: none; flex-shrink: 0; }
.xr-contact-wa:hover { color: #fff; background: #1ebe5a; }
.xr-phone-row { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; }
.xr-phone-link { color: var(--brand-primary); font-weight: 800; text-decoration: none; white-space: nowrap; }
.xr-phone-link i { opacity: 0.75; }
[data-bs-theme="dark"] .xr-contact { background: rgba(192, 126, 187, 0.08); border-color: rgba(192, 126, 187, 0.2); }
[data-bs-theme="dark"] .xr-contact-name { color: #f1e4ef; }
[data-bs-theme="dark"] .xr-contact-phone, [data-bs-theme="dark"] .xr-phone-link { color: #d9a6d5; }
.xr-room-info .xr-phone-link { margin-inline-start: 0.4rem; font-size: 0.85rem; }
/* Exam rooms: lock seat changes + admin adds a student */
.xr-switches { display: flex; flex-direction: column; gap: 0.6rem; }
.xr-switch-card.is-locked { background: #fff7e6; border-color: #f5deb0; }
.xr-switch-card.is-locked .xr-switch-icon { background: #f59e0b; color: #fff; }
.xr-add-student { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px dashed rgba(122, 61, 118, 0.2); }
.xr-add-student > i { color: var(--brand-primary); font-size: 1.1rem; }
.xr-add-student .form-control { flex: 1; min-width: 0; border-radius: 999px; }
.xr-add-student .btn { border-radius: 999px; padding-inline: 1rem; }
[data-bs-theme="dark"] .xr-switch-card.is-locked { background: #2a2110; border-color: #5a4720; }
/* Exam rooms: switch-card buttons take the card's colour (green open, amber locked, brand otherwise) */
.xr-switch-btn { --xr-btn: var(--brand-primary); display: inline-flex; align-items: center; gap: 0.35rem; flex-shrink: 0; padding: 0.45rem 1.1rem; border-radius: 999px; font-weight: 900; background: #fff; color: var(--xr-btn); border: 1.5px solid var(--xr-btn); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); transition: background 0.15s, color 0.15s, transform 0.15s; }
.xr-switch-btn:hover, .xr-switch-btn:focus-visible { background: var(--xr-btn); color: #fff; border-color: var(--xr-btn); transform: translateY(-1px); }
.xr-switch-btn.is-primary { background: var(--xr-btn); color: #fff; }
.xr-switch-btn.is-primary:hover { filter: brightness(1.08); }
.xr-switch-btn:disabled { opacity: 0.5; transform: none; }
.xr-switch-card.is-open .xr-switch-btn { --xr-btn: #059669; }
.xr-switch-card.is-locked .xr-switch-btn { --xr-btn: #d97706; }
[data-bs-theme="dark"] .xr-switch-btn:not(.is-primary):not(:hover) { background: transparent; }
/* Homepage calendar: the theory final exam day (student's seat / supervisor's rooms) */
.hcal-day.has-exam { background: #fff8e6; border-color: #f2c66d; box-shadow: 0 0 0 2px rgba(242, 198, 109, 0.35); }
.hcal-chip.is-exam { color: #7a4a00; background: #ffefc7; border-color: #f2c66d; font-weight: 900; }
.hcal-chip.is-exam::before { content: "\F4CA"; color: #d97706; } /* bi-pencil-square */
.hcal-dot.is-exam { background: #f59e0b; box-shadow: 0 0 5px rgba(245, 158, 11, 0.8); }
.hcal-row.is-exam::before { content: "\F4CA"; color: #d97706; background: #ffefc7; }
[data-bs-theme="dark"] .hcal-day.has-exam { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.45); }
[data-bs-theme="dark"] .hcal-chip.is-exam { color: #f8d78a; background: #3a2c10; border-color: #6b5320; }
[data-bs-theme="dark"] .hcal-row.is-exam::before { background: #3a2c10; }
/* Exam rooms: supervisors take attendance + WhatsApp the student / her teacher */
.xr-att-bar { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0.5rem 1rem; padding: 0.75rem 1.2rem 0.85rem; background: rgba(122, 61, 118, 0.035); border-bottom: 1px solid rgba(122, 61, 118, 0.08); font-weight: 800; font-size: 0.88rem; }
.xr-att-state { display: inline-flex; align-items: center; gap: 0.4rem; color: #8a7a89; }
.xr-att-bar.is-live .xr-att-state { color: #b42318; }
.xr-att-bar.is-ended .xr-att-state { color: #5b4a5a; }
.xr-live-dot { width: 9px; height: 9px; border-radius: 50%; background: #ef4444; animation: xrLive 1.6s infinite; }
@keyframes xrLive { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); } 70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
.xr-att-count { color: #5b4a5a; }
.xr-att-count b { color: #059669; font-size: 1.1rem; font-weight: 900; margin-inline-start: 0.2rem; }
.xr-att-count span { opacity: 0.6; }
.xr-att-progress { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: rgba(122, 61, 118, 0.1); overflow: hidden; }
.xr-att-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #34d399, #059669); transition: width 0.35s ease; }
.xr-att-list { list-style: none; margin: 0; padding: 0.35rem 0; }
.xr-att-row { display: flex; align-items: center; gap: 0.85rem; margin: 0.35rem 0.8rem; padding: 0.65rem 0.8rem; border-radius: 1rem; border: 1px solid rgba(122, 61, 118, 0.1); background: #fff; transition: background 0.25s, border-color 0.25s; }
.xr-att-row.is-present { background: #f0fdf7; border-color: #a7f3d0; }
.xr-att-row .xr-seat-no { flex-shrink: 0; transition: background 0.25s, color 0.25s; }
.xr-att-row.is-present .xr-seat-no { background: #10b981; color: #fff; }
.xr-att-who { flex: 1; min-width: 0; }
.xr-att-name { font-weight: 800; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; line-height: 1.4; }
.xr-att-name .badge, .xr-att-name [class*="badge"] { font-size: 0.7rem; }
.xr-att-teacher { margin-top: 0.15rem; font-size: 0.8rem; font-weight: 700; color: #8a7a89; display: flex; align-items: center; gap: 0.3rem; }
.xr-att-actions { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.xr-wa-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem; height: 36px; padding: 0 0.75rem; border-radius: 999px; background: #e9f9ef; color: #128c4b; border: 1px solid #c3eed3; font-weight: 800; font-size: 0.8rem; text-decoration: none; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.xr-wa-btn:hover { background: #25d366; color: #fff; border-color: #25d366; }
.xr-wa-btn.is-teacher { background: #f5effa; color: #6b3f8f; border-color: #e2d4ee; }
.xr-wa-btn.is-teacher:hover { background: #7a3d76; color: #fff; border-color: #7a3d76; }
.xr-wa-btn.is-off { opacity: 0.4; pointer-events: none; }
.xr-att-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; height: 36px; min-width: 96px; padding: 0 0.9rem; border-radius: 999px; border: 1.5px solid #cfd8d3; background: #fff; color: #5b6b63; font-weight: 900; font-size: 0.85rem; transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.1s; }
.xr-att-btn:hover { border-color: #10b981; color: #059669; }
.xr-att-btn:active { transform: scale(0.96); }
.xr-att-btn[aria-pressed="true"] { background: #10b981; border-color: #10b981; color: #fff; }
.xr-att-row.is-saving .xr-att-btn { opacity: 0.75; }
@media (max-width: 575.98px) {
  .xr-att-bar { padding: 0.7rem 1rem; }
  .xr-att-row { flex-wrap: wrap; margin: 0.35rem 0.6rem; }
  .xr-att-actions { width: 100%; }
  .xr-att-actions > * { flex: 1; }
}
[data-bs-theme="dark"] .xr-att-bar { background: rgba(255, 255, 255, 0.03); border-color: rgba(255, 255, 255, 0.06); }
[data-bs-theme="dark"] .xr-att-count { color: #d8c6d6; }
[data-bs-theme="dark"] .xr-att-row { background: #211823; border-color: rgba(192, 126, 187, 0.18); }
[data-bs-theme="dark"] .xr-att-row.is-present { background: #10291f; border-color: #1f6f4f; }
[data-bs-theme="dark"] .xr-att-btn { background: transparent; color: #c9d6cf; border-color: #4a5a52; }
[data-bs-theme="dark"] .xr-att-btn[aria-pressed="true"] { background: #10b981; color: #fff; border-color: #10b981; }
[data-bs-theme="dark"] .xr-wa-btn { background: #10291f; color: #7ee2a8; border-color: #1f6f4f; }
[data-bs-theme="dark"] .xr-wa-btn.is-teacher { background: #33244a; color: #e4d3f5; border-color: #4b3768; }
/* ===== Control panel home: tidier «تفاصيل الأيام», next week, and settings rows ===== */
.wp-days { margin-top: 0.85rem; }
.wp-days-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.6rem; }
.wp-day-card { padding: 0.65rem 0.85rem; border-radius: 0.85rem; background: #faf6fa; border: 1px solid rgba(91, 43, 87, 0.1); }
.wp-day-title { font-weight: 900; font-size: 0.85rem; color: #5b2b57; margin-bottom: 0.3rem; display: flex; align-items: center; gap: 0.35rem; }
.wp-day-title::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #c07ebb; }
.wp-day-card ul { list-style: none; margin: 0; padding: 0; }
.wp-day-card li { position: relative; padding-inline-start: 0.9rem; font-size: 0.82rem; font-weight: 600; line-height: 1.7; color: #3f3340; overflow-wrap: anywhere; }
.wp-day-card li::before { content: ""; position: absolute; inset-inline-start: 0.1rem; top: 0.72em; width: 5px; height: 2px; border-radius: 2px; background: rgba(91, 43, 87, 0.35); }
.wp-next { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.wp-next-label { font-weight: 900; color: #5b2b57; display: inline-flex; align-items: center; gap: 0.3rem; margin-inline-end: 0.2rem; }
.wp-next-chip { font-size: 0.76rem; font-weight: 700; color: #5b4a5a; background: rgba(91, 43, 87, 0.06); border-radius: 999px; padding: 0.2rem 0.65rem; }

/* Management tiles: no leaf, quieter edge, even heights */
.cp-tile::after { display: none; }
.cp-tile { border-top-width: 0 !important; box-shadow: inset 0 3px 0 var(--tile); padding: 1rem 1.05rem; }
.cp-tile-icon { border-radius: 0.7rem; width: 36px; height: 36px; font-size: 1rem; }
.cp-tile-head h3 { font-size: 0.95rem; }
.cp-tile p { font-size: 0.78rem; margin-bottom: 0.75rem; }

/* Settings & data: compact rows */
.cp-set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.6rem; }
.cp-set-item { display: flex; align-items: center; gap: 0.75rem; margin: 0; padding: 0.75rem 0.9rem; border-radius: 1rem; background: #fff; border: 1px solid rgba(122, 61, 118, 0.1); box-shadow: 0 2px 10px rgba(91, 43, 87, 0.04); color: inherit; text-decoration: none; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
a.cp-set-item:hover { border-color: color-mix(in srgb, var(--tile) 45%, transparent); box-shadow: 0 6px 18px rgba(91, 43, 87, 0.08); transform: translateY(-2px); color: inherit; }
.cp-set-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cp-set-text b { font-weight: 900; font-size: 0.9rem; color: var(--brand-dark); }
.cp-set-text small { font-size: 0.75rem; font-weight: 600; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-set-arrow { color: #b8a9b6; transition: transform 0.15s, color 0.15s; }
a.cp-set-item:hover .cp-set-arrow { color: var(--tile); transform: translateX(-3px); }
[dir="ltr"] a.cp-set-item:hover .cp-set-arrow { transform: translateX(3px); }
.cp-set-item.is-backup .cp-soft-btn { flex-shrink: 0; font-size: 0.78rem; padding: 0.35rem 0.75rem; }
.cp-set-item.is-backup.is-warn small { color: #b45309; }
[data-bs-theme="dark"] .wp-day-card { background: rgba(255, 255, 255, 0.03); border-color: var(--misk-border); }
[data-bs-theme="dark"] .wp-day-title, [data-bs-theme="dark"] .wp-next-label { color: #e9c9e5; }
[data-bs-theme="dark"] .wp-day-card li { color: var(--bs-body-color); }
[data-bs-theme="dark"] .wp-next-chip { background: rgba(255, 255, 255, 0.06); color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .cp-set-item { background: var(--bs-body-bg); border-color: var(--misk-border); }
[data-bs-theme="dark"] .cp-set-text b { color: var(--bs-body-color); }
[data-bs-theme="dark"] .cp-set-text small { color: var(--bs-secondary-color); }
.cp-set-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1199.98px) { .cp-set-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .cp-set-grid { grid-template-columns: 1fr; } }
.cp-set-text small { white-space: normal; overflow: visible; line-height: 1.5; }
/* ===== Control panel home: one header card (greeting, title, semester + today, main pages, alerts) ===== */
.cp-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; padding: 1.4rem 1.6rem; border-radius: 1.4rem; background: linear-gradient(135deg, #ffffff 0%, #fbf6fb 55%, #f4eaf3 100%); border: 1px solid rgba(122, 61, 118, 0.12); box-shadow: 0 6px 24px rgba(91, 43, 87, 0.06); overflow: hidden; }
.cp-top-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.cp-top-hello { font-size: 0.85rem; font-weight: 800; color: #9a7f98; }
.cp-top .cp-main-title { font-size: 1.85rem; margin: -0.2rem 0 0; line-height: 1.25; }
.cp-top-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cp-top-meta span { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; font-weight: 800; color: #5b2b57; background: rgba(122, 61, 118, 0.07); border-radius: 999px; padding: 0.25rem 0.75rem; }
.cp-top-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.25rem; }
.cp-top-actions .cp-soft-btn { white-space: nowrap; padding: 0.45rem 0.9rem; }
.cp-top .cp-attention { padding-top: 0.6rem; margin-top: 0.2rem; border-top: 1px dashed rgba(122, 61, 118, 0.15); }
.cp-top .cp-hero-art { width: 200px; height: 128px; align-self: flex-end; margin-bottom: -0.4rem; }
@media (max-width: 767.98px) {
  .cp-top { padding: 1.1rem 1.1rem; }
  .cp-top .cp-main-title { font-size: 1.4rem; }
  .cp-top .cp-hero-art { position: absolute; inset-inline-end: 0.6rem; top: 0.8rem; width: 96px; height: 62px; opacity: 0.9; }
  .cp-top-hello, .cp-top .cp-main-title { padding-inline-end: 100px; }
  .cp-top-actions .cp-soft-btn { flex: 1 1 auto; justify-content: center; font-size: 0.76rem; padding: 0.4rem 0.6rem; }
}
/* This week's workplan card: same rounding as the header, a bit more air */
.cp-home-panel .wp-home { border-radius: 1.4rem; padding: 1.15rem 1.35rem; }
.wp-home-head { align-items: center; }
[data-bs-theme="dark"] .cp-top { background: linear-gradient(135deg, #1d1520, #251a28); border-color: var(--misk-border); }
[data-bs-theme="dark"] .cp-top-hello { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .cp-top-meta span { color: #e9c9e5; background: rgba(255, 255, 255, 0.06); }
@media (max-width: 575.98px) { .cp-home-panel .wp-cols { grid-template-columns: 1fr; display: grid; } }
/* Membership card: flat swatches matching the minimal card themes */
.cred-theme--royal .cred-theme-swatch { background: #4a1f47; box-shadow: inset 0 0 0 4px #4a1f47, inset 0 0 0 6px #f0cf7a; }
.cred-theme--teal .cred-theme-swatch { background: #1f6467; box-shadow: inset 0 0 0 4px #1f6467, inset 0 0 0 6px #ffe7ad; }
.cred-theme--night .cred-theme-swatch { background: #161117; box-shadow: inset 0 0 0 4px #161117, inset 0 0 0 6px #d9b45b; }
.cred-theme--pearl .cred-theme-swatch { background: #fbf8f6; box-shadow: inset 0 0 0 4px #fbf8f6, inset 0 0 0 6px #7a3d76, 0 0 0 1px rgba(0,0,0,0.1); }
.cred-theme--rose .cred-theme-swatch { background: #a8547b; box-shadow: inset 0 0 0 4px #a8547b, inset 0 0 0 6px #fff2d8; }
/* Membership card window: the card is horizontal now - preview on top, password + buttons below it */
.cred-layout.cred-layout--wide { grid-template-columns: 1fr; gap: 1rem; }
.cred-layout--wide .cred-preview canvas { box-shadow: 0 14px 34px rgba(61, 26, 60, 0.16); background: #fbf8f6; aspect-ratio: 16 / 10; }
.cred-layout--wide .cred-options { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.6rem 1rem; align-items: start; }
.cred-layout--wide .cred-password-box, .cred-layout--wide .cred-actions { margin-top: 0; }
.cred-layout--wide .cred-note { grid-column: 1 / -1; margin: 0; }
@media (max-width: 575.98px) { .cred-layout--wide .cred-options { grid-template-columns: 1fr; } }

/* Profile: «بطاقة عضويتي» as a light row like the profile fields - brand-tinted icon, purple title */
.profile-card-cta { background: #fff; color: var(--brand-dark); border: 1px solid rgba(122, 61, 118, 0.14); box-shadow: 0 4px 16px rgba(91, 43, 87, 0.06); padding: 0.85rem 1rem; border-radius: 1rem; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.profile-card-cta:hover { color: var(--brand-dark); border-color: rgba(122, 61, 118, 0.3); box-shadow: 0 8px 22px rgba(91, 43, 87, 0.1); transform: translateY(-1px); }
.profile-card-cta-icon { width: 44px; height: 44px; border-radius: 0.8rem; background: rgba(122, 61, 118, 0.09); color: var(--brand-primary); font-size: 1.2rem; }
.profile-card-cta strong { color: var(--brand-primary); }
.profile-card-cta small { opacity: 1; color: #8a7a89; font-weight: 700; }
.profile-card-cta > .bi-chevron-left, .profile-card-cta > .bi-chevron-right { color: #b8a9b6; }
[data-bs-theme="dark"] .profile-card-cta { background: var(--bs-body-bg); border-color: var(--misk-border); color: var(--bs-body-color); }
[data-bs-theme="dark"] .profile-card-cta strong { color: #e9c9e5; }
[data-bs-theme="dark"] .profile-card-cta small { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .profile-card-cta-icon { background: rgba(196, 140, 191, 0.14); color: #e9c9e5; }
/* ===== Practical exam rooms (لجان العملي) ===== */
.xr-kind-tabs { display: inline-flex; gap: 0.3rem; padding: 0.3rem; border-radius: 999px; background: rgba(122, 61, 118, 0.07); border: 1px solid rgba(122, 61, 118, 0.12); }
.xr-kind-tabs a { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.45rem 1.2rem; border-radius: 999px; font-weight: 900; font-size: 0.9rem; color: #6b5a6a; text-decoration: none; transition: background 0.15s, color 0.15s; }
.xr-kind-tabs a:hover { color: var(--brand-primary); }
.xr-kind-tabs a.active { background: var(--brand-primary); color: #fff; box-shadow: 0 4px 12px rgba(122, 61, 118, 0.25); }
.xr-track { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; font-weight: 800; border-radius: 999px; padding: 0.15rem 0.65rem; }
.xr-track--basic { background: #e6f6f6; color: #1f6f71; }
.xr-track--advanced { background: #f3ecfa; color: #6b3f8f; }
.xr-slot-pill { display: inline-block; white-space: nowrap; font-weight: 900; font-size: 0.78rem; padding: 0.25rem 0.6rem; border-radius: 0.6rem; background: rgba(240, 207, 122, 0.35); color: #3d1a3c; }
.xr-att-row.is-present .xr-slot-pill { background: #10b981; color: #fff; }
.xr-slots { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
.xr-slot { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.4rem 0.75rem; border-radius: 0.75rem; border: 1.5px solid rgba(122, 61, 118, 0.25); background: #fff; color: var(--brand-primary); font-weight: 900; font-size: 0.82rem; white-space: nowrap; transition: background 0.15s, color 0.15s, transform 0.1s; }
button.xr-slot:hover { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
button.xr-slot:active { transform: scale(0.96); }
.xr-slot.is-taken { border-style: dashed; color: #b8a9b6; background: transparent; text-decoration: line-through; }
.xr-slot.is-mine { background: #f0cf7a; border-color: #e0b85a; color: #3d1a3c; }
.xr-ticket-stub strong.is-time { font-size: 2.1rem; }
/* add / edit form: room type cards + the live «how many students» line */
.xr-track-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.xr-track-opt { position: relative; display: block; margin: 0; cursor: pointer; }
.xr-track-opt input { position: absolute; opacity: 0; }
.xr-track-opt span { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.75rem 0.9rem; border-radius: 0.9rem; border: 1.5px solid rgba(122, 61, 118, 0.18); background: #fff; transition: border-color 0.15s, background 0.15s, box-shadow 0.15s; }
.xr-track-opt b { font-weight: 900; color: var(--brand-dark); }
.xr-track-opt small { font-weight: 700; color: #8a7a89; }
.xr-track-opt input:checked + span { border-color: var(--brand-primary); background: #faf4fa; box-shadow: 0 0 0 3px rgba(122, 61, 118, 0.12); }
.xr-track-opt input:focus-visible + span { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.xr-capacity-calc { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 1rem; border-radius: 0.9rem; background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; font-weight: 800; }
.xr-capacity-calc b { font-size: 1.8rem; font-weight: 900; line-height: 1; }
.xr-capacity-calc.is-empty { background: #fff7e6; border-color: #f5deb0; color: #8a5a00; }
/* teacher picker: level, first time, load */
.xr-picker-item { align-items: flex-start; }
.xr-picker-who { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.xr-picker-name { font-weight: 800; }
.xr-picker-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; font-size: 0.72rem; }
.xr-picker-meta [class^="badge-cert"] { font-size: 0.68rem; padding: 0.1rem 0.45rem; border-radius: 999px; }
.xr-first-badge { display: inline-flex; align-items: center; gap: 0.2rem; font-weight: 800; color: #b45309; background: #fff4dc; border-radius: 999px; padding: 0.1rem 0.5rem; }
.xr-load { font-weight: 700; color: #8a7a89; }
.xr-load.has { color: #1f6f71; font-weight: 800; }
/* her practical rooms per week, under the totals in the teacher picker */
.xr-load-weeks { flex-basis: 100%; font-weight: 800; font-size: 0.74rem; color: #6b3f8f; }
[data-bs-theme="dark"] .xr-load-weeks { color: #d4b8e6; }
@media (max-width: 575.98px) { .xr-track-pick { grid-template-columns: 1fr; } }
[data-bs-theme="dark"] .xr-kind-tabs { background: rgba(255, 255, 255, 0.05); border-color: var(--misk-border); }
[data-bs-theme="dark"] .xr-kind-tabs a { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .xr-kind-tabs a.active { color: #fff; }
[data-bs-theme="dark"] .xr-slot, [data-bs-theme="dark"] .xr-track-opt span { background: transparent; }
[data-bs-theme="dark"] .xr-track-opt b { color: var(--bs-body-color); }
[data-bs-theme="dark"] .xr-capacity-calc { background: #10291f; border-color: #1f6f4f; color: #86efac; }
[data-bs-theme="dark"] .xr-first-badge { background: #3a2c10; color: #fbbf24; }
/* Practical: the semester's «مدة اختبار كل طالبة» card */
.xr-minutes-card { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; padding: 0.85rem 1.1rem; border-radius: 1.1rem; background: #fff; border: 1px solid rgba(122, 61, 118, 0.12); }
.xr-minutes-title { display: flex; align-items: center; gap: 0.6rem; flex: 1 1 260px; }
.xr-minutes-title > i { width: 38px; height: 38px; border-radius: 0.7rem; display: inline-flex; align-items: center; justify-content: center; background: rgba(122, 61, 118, 0.09); color: var(--brand-primary); font-size: 1.1rem; flex-shrink: 0; }
.xr-minutes-title b { display: block; font-weight: 900; color: var(--brand-dark); }
.xr-minutes-title small { font-weight: 700; color: #8a7a89; }
.xr-minutes-field { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-weight: 800; font-size: 0.85rem; color: #5b4a5a; }
.xr-minutes-field .input-group { width: 120px; }
[data-bs-theme="dark"] .xr-minutes-card { background: var(--bs-body-bg); border-color: var(--misk-border); }
[data-bs-theme="dark"] .xr-minutes-title b { color: var(--bs-body-color); }
/* Practical times: a tidy grid of equal tiles (start time big, «حتى …» small, state colours) */
.xr-slots-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; margin-top: 0.9rem; padding-top: 0.8rem; border-top: 1px dashed rgba(122, 61, 118, 0.18); }
.xr-slots-head span { font-weight: 900; font-size: 0.9rem; color: var(--brand-dark); display: inline-flex; align-items: center; gap: 0.35rem; }
.xr-slots-head small { font-weight: 800; font-size: 0.75rem; color: #8a7a89; background: rgba(122, 61, 118, 0.07); border-radius: 999px; padding: 0.1rem 0.6rem; }
.xr-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0.5rem; margin-top: 0.6rem; }
.xr-slot-form { margin: 0; display: contents; }
.xr-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem; width: 100%; min-height: 64px; padding: 0.45rem 0.3rem; border-radius: 0.9rem; border: 1.5px solid rgba(122, 61, 118, 0.2); background: #fff; color: var(--brand-primary); text-decoration: none; transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s; }
.xr-slot b { font-size: 1.2rem; font-weight: 900; line-height: 1.1; }
.xr-slot small { font-size: 0.72rem; font-weight: 700; color: #8a7a89; display: inline-flex; align-items: center; gap: 0.2rem; }
button.xr-slot:hover { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; box-shadow: 0 6px 16px rgba(122, 61, 118, 0.22); transform: translateY(-1px); }
button.xr-slot:hover small { color: rgba(255, 255, 255, 0.85); }
.xr-slot.is-taken { border-style: dashed; border-color: #e5dce4; background: #faf8fa; color: #c4b8c3; text-decoration: none; }
.xr-slot.is-taken b { text-decoration: line-through; text-decoration-thickness: 2px; }
.xr-slot.is-taken small { color: #c4b8c3; }
.xr-slot.is-mine { background: #f0cf7a; border-color: #e0b85a; color: #3d1a3c; }
.xr-slot.is-mine small { color: #6b4d12; font-weight: 800; }
@media (max-width: 575.98px) { .xr-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); } .xr-slot b { font-size: 1.05rem; } }
[data-bs-theme="dark"] .xr-slot { background: transparent; }
[data-bs-theme="dark"] .xr-slot.is-taken { background: rgba(255, 255, 255, 0.03); border-color: rgba(255, 255, 255, 0.1); color: #6b5f6a; }
[data-bs-theme="dark"] .xr-slots-head span { color: var(--bs-body-color); }
/* ===== Practical room card: header + timetable (exam-rooms.php?kind=practical) ===== */
.xr-pcard { background: #fff; border: 1px solid rgba(122, 61, 118, 0.12); border-radius: 1.3rem; box-shadow: 0 6px 22px rgba(91, 43, 87, 0.06); overflow: hidden; }
.xr-pcard.is-mine { border-color: #e0b85a; box-shadow: 0 0 0 3px rgba(240, 207, 122, 0.35); }
.xr-pcard-head { display: flex; align-items: center; gap: 0.9rem; padding: 1.1rem 1.2rem; }
.xr-pcard-icon { width: 48px; height: 48px; border-radius: 0.9rem; display: inline-flex; align-items: center; justify-content: center; background: rgba(122, 61, 118, 0.09); color: var(--brand-primary); font-size: 1.3rem; flex-shrink: 0; }
.xr-pcard-title { flex: 1; min-width: 0; }
.xr-pcard-title h3 { font-size: 1.2rem; font-weight: 900; margin: 0 0 0.3rem; color: var(--brand-dark); }
.xr-pcard-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; font-size: 0.82rem; font-weight: 700; color: #6b5a6a; }
.xr-pcard-meta i { color: var(--brand-primary); opacity: 0.75; }
.xr-pcard-free { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 84px; padding: 0.45rem 0.7rem; border-radius: 1rem; flex-shrink: 0; }
.xr-pcard-free b { font-size: 1.6rem; font-weight: 900; line-height: 1; }
.xr-pcard-free small { font-size: 0.7rem; font-weight: 800; margin-top: 0.2rem; }
.xr-pcard-free.is-ok { background: #ecfdf5; color: #047857; }
.xr-pcard-free.is-low { background: #fff7e6; color: #b45309; }
.xr-pcard-free.is-full { background: #fdecec; color: #b42318; }
.xr-pcard-sup { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; padding: 0.65rem 1.2rem; background: #faf6fa; border-top: 1px solid rgba(122, 61, 118, 0.07); border-bottom: 1px solid rgba(122, 61, 118, 0.07); }
.xr-pcard-sup > small { font-weight: 800; color: #8a7a89; margin-inline-end: 0.2rem; }
.xr-pcard-person { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.25rem 0.7rem; border-radius: 999px; background: #fff; border: 1px solid rgba(122, 61, 118, 0.12); font-size: 0.82rem; font-weight: 800; color: var(--brand-dark); }
.xr-pcard-person a { color: var(--brand-primary); text-decoration: none; font-weight: 700; }
.xr-tt-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.9rem 1.2rem 0.5rem; }
.xr-tt-head b { font-weight: 900; color: var(--brand-dark); }
.xr-tt-legend { display: inline-flex; gap: 0.8rem; font-size: 0.75rem; font-weight: 800; color: #8a7a89; }
.xr-tt-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 0.3rem; vertical-align: middle; }
.xr-tt-legend .is-free::before { background: #10b981; }
.xr-tt-legend .is-taken::before { background: #d5cad3; }
.xr-tt-legend .is-mine::before { background: #e0b85a; }
/* Timetable: two columns on wide screens, each row = dot · time · button/state */
.xr-tt { list-style: none; margin: 0; padding: 0.2rem 1.2rem 1.2rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem 1rem; }
.xr-tt-row { display: flex; align-items: center; gap: 0.7rem; min-height: 50px; padding: 0.4rem 0.5rem 0.4rem 0.9rem; border-radius: 0.85rem; border: 1px solid rgba(122, 61, 118, 0.12); background: #fff; }
[dir="rtl"] .xr-tt-row { padding: 0.4rem 0.9rem 0.4rem 0.5rem; }
.xr-tt-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: #10b981; }
.xr-tt-time { flex: 1; font-weight: 900; font-size: 1rem; color: var(--brand-dark); white-space: nowrap; }
.xr-tt-form { margin: 0; }
.xr-tt-btn { border: 0; border-radius: 0.7rem; padding: 0.45rem 1.1rem; font-weight: 900; font-size: 0.85rem; background: var(--brand-primary); color: #fff; transition: background 0.15s, transform 0.1s; }
.xr-tt-btn:hover { background: var(--brand-dark); }
.xr-tt-btn:active { transform: scale(0.96); }
.xr-tt-state { font-size: 0.8rem; font-weight: 800; color: #9a8d99; padding: 0 0.4rem; display: inline-flex; align-items: center; gap: 0.25rem; }
.xr-tt-row.is-free .xr-tt-state { color: #047857; }
.xr-tt-row.is-taken, .xr-tt-row.is-past { background: #faf8fa; border-style: dashed; }
.xr-tt-row.is-taken .xr-tt-dot, .xr-tt-row.is-past .xr-tt-dot { background: #d5cad3; }
.xr-tt-row.is-taken .xr-tt-time, .xr-tt-row.is-past .xr-tt-time { color: #b3a6b1; text-decoration: line-through; text-decoration-thickness: 1.5px; }
.xr-tt-row.is-mine { background: #fff8e6; border-color: #e0b85a; }
.xr-tt-row.is-mine .xr-tt-dot { background: #e0b85a; }
.xr-tt-row.is-mine .xr-tt-state { color: #8a5a00; }
@media (max-width: 767.98px) {
  .xr-tt { grid-template-columns: 1fr; }
  .xr-pcard-head { flex-wrap: wrap; }
  .xr-pcard-free { flex-direction: row; gap: 0.4rem; min-width: 0; padding: 0.3rem 0.8rem; }
  .xr-pcard-free b { font-size: 1.1rem; }
  .xr-pcard-free small { margin: 0; }
}
[data-bs-theme="dark"] .xr-pcard, [data-bs-theme="dark"] .xr-tt-row, [data-bs-theme="dark"] .xr-pcard-person { background: #211823; border-color: rgba(192, 126, 187, 0.2); }
[data-bs-theme="dark"] .xr-pcard-sup { background: rgba(255, 255, 255, 0.03); }
[data-bs-theme="dark"] .xr-pcard-title h3, [data-bs-theme="dark"] .xr-tt-time, [data-bs-theme="dark"] .xr-tt-head b, [data-bs-theme="dark"] .xr-pcard-person { color: #f1e4ef; }
[data-bs-theme="dark"] .xr-tt-row.is-taken, [data-bs-theme="dark"] .xr-tt-row.is-past { background: rgba(255, 255, 255, 0.02); }
[data-bs-theme="dark"] .xr-tt-row.is-mine { background: #2c2416; }
/* Timetable reads down the first column, then the second (not zig-zag) */
@media (min-width: 768px) { .xr-tt { grid-auto-flow: column; grid-template-rows: repeat(var(--rows, 1), auto); } }
/* «مدة اختبار كل طالبة»: title on top, then the two fields + save in one tidy row */
.xr-minutes-card { display: block; padding: 1rem 1.2rem; }
.xr-minutes-card .xr-minutes-title { margin-bottom: 0.85rem; }
.xr-minutes-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 0.75rem; align-items: end; padding-top: 0.85rem; border-top: 1px dashed rgba(122, 61, 118, 0.15); }
.xr-minutes-card .xr-minutes-field { display: flex; flex-direction: column; align-items: stretch; gap: 0.4rem; }
.xr-minutes-card .xr-minutes-field .input-group { width: 100%; }
.xr-minutes-card .xr-minutes-field .form-control { font-size: 1.05rem; }
.xr-minutes-card .xr-minutes-field .input-group-text { font-weight: 700; font-size: 0.8rem; color: #8a7a89; background: #faf6fa; }
.xr-minutes-save { white-space: nowrap; padding-inline: 1.3rem; height: 38px; display: inline-flex; align-items: center; gap: 0.35rem; }
@media (max-width: 767.98px) {
  .xr-minutes-row { grid-template-columns: 1fr 1fr; }
  .xr-minutes-save { grid-column: 1 / -1; justify-content: center; }
}
@media (max-width: 420px) { .xr-minutes-row { grid-template-columns: 1fr; } }
[data-bs-theme="dark"] .xr-minutes-card .xr-minutes-field .input-group-text { background: rgba(255, 255, 255, 0.04); color: var(--bs-secondary-color); }
.xr-minutes-row .xr-minutes-save { height: auto; align-self: stretch; margin-top: calc(0.4rem + 1.6em); border-radius: 0.75rem; }
@media (max-width: 767.98px) { .xr-minutes-row .xr-minutes-save { margin-top: 0; padding-block: 0.6rem; } }
/* Admins: who attended and who didn't (control panel › لجان الاختبارات) */
.xr-att-overview { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.8rem 1.1rem; border-radius: 1.1rem; background: #fff; border: 1px solid rgba(122, 61, 118, 0.12); }
.xr-att-overview-title { font-weight: 900; color: var(--brand-dark); display: inline-flex; align-items: center; gap: 0.4rem; }
.xr-att-overview-title i { color: var(--brand-primary); }
.xr-att-filter { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.xr-att-filter button { display: inline-flex; align-items: center; gap: 0.35rem; border: 1.5px solid rgba(122, 61, 118, 0.15); background: #fff; color: #5b4a5a; border-radius: 999px; padding: 0.35rem 0.85rem; font-weight: 800; font-size: 0.85rem; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.xr-att-filter button b { font-weight: 900; }
.xr-att-filter .is-present { color: #047857; }
.xr-att-filter .is-absent { color: #b42318; }
.xr-att-filter .is-waiting { color: #8a7a89; }
.xr-att-filter button.active { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.xr-att-filter button.is-present.active { background: #10b981; border-color: #10b981; }
.xr-att-filter button.is-absent.active { background: #ef4444; border-color: #ef4444; }
.xr-att-filter button.is-waiting.active { background: #8a7a89; border-color: #8a7a89; }
.xr-att-sum { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.55rem 0 0.2rem; }
.xr-att-sum span { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; font-weight: 800; border-radius: 999px; padding: 0.2rem 0.65rem; }
.xr-att-sum .is-present { background: #ecfdf5; color: #047857; }
.xr-att-sum .is-absent { background: #fdecec; color: #b42318; }
.xr-att-sum .is-waiting { background: #f3eff3; color: #8a7a89; }
.xr-att-pill { display: inline-flex; align-items: center; gap: 0.25rem; margin-inline-start: 0.4rem; font-size: 0.7rem; font-weight: 800; border-radius: 999px; padding: 0.1rem 0.5rem; vertical-align: middle; }
.xr-att-pill small { font-size: 0.68rem; opacity: 0.85; }
.xr-att-pill.is-present { background: #ecfdf5; color: #047857; }
.xr-att-pill.is-absent { background: #fdecec; color: #b42318; }
.xr-att-pill.is-waiting { background: #f3eff3; color: #8a7a89; }
tr[data-att="absent"] td { background: #fffafa; }
[data-bs-theme="dark"] .xr-att-overview { background: var(--bs-body-bg); border-color: var(--misk-border); }
[data-bs-theme="dark"] .xr-att-overview-title { color: var(--bs-body-color); }
[data-bs-theme="dark"] .xr-att-filter button:not(.active) { background: transparent; }
[data-bs-theme="dark"] .xr-att-sum .is-present, [data-bs-theme="dark"] .xr-att-pill.is-present { background: #10291f; color: #86efac; }
[data-bs-theme="dark"] .xr-att-sum .is-absent, [data-bs-theme="dark"] .xr-att-pill.is-absent { background: #3a1616; color: #fca5a5; }
[data-bs-theme="dark"] .xr-att-sum .is-waiting, [data-bs-theme="dark"] .xr-att-pill.is-waiting { background: rgba(255, 255, 255, 0.05); color: var(--bs-secondary-color); }
[data-bs-theme="dark"] tr[data-att="absent"] td { background: rgba(239, 68, 68, 0.05); }
/* ===== توزيع المعلمات على اللجان (control panel › exam_distribute) ===== */
.xd-rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.5rem; }
.xd-rules > div { padding: 0.65rem 0.85rem; border-radius: 0.9rem; background: #fff; border: 1px solid rgba(122, 61, 118, 0.1); font-size: 0.82rem; font-weight: 700; color: #5b4a5a; line-height: 1.7; }
.xd-tag-theory { display: inline-flex; align-items: center; font-size: 0.78rem; font-weight: 800; border-radius: 999px; padding: 0.15rem 0.65rem; background: #fdf3dc; color: #8a5a00; }
.xd-upload { max-width: 640px; margin: 0 auto; padding: 1.6rem; display: flex; flex-direction: column; align-items: center; gap: 0.85rem; text-align: center; }
.xd-upload-icon { font-size: 2.6rem; color: var(--brand-primary); }
.xd-upload h3 { font-size: 1.15rem; font-weight: 900; margin: 0; }
.xd-upload p { margin: 0; color: #8a7a89; font-weight: 700; font-size: 0.88rem; }
.xd-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; width: 100%; text-align: start; }
.xd-mode label { display: flex; gap: 0.5rem; align-items: flex-start; padding: 0.65rem 0.8rem; border-radius: 0.9rem; border: 1.5px solid rgba(122, 61, 118, 0.15); cursor: pointer; margin: 0; }
.xd-mode label:has(input:checked) { border-color: var(--brand-primary); background: #faf4fa; }
.xd-mode b { display: block; font-weight: 900; font-size: 0.88rem; }
.xd-mode small { font-weight: 700; color: #8a7a89; font-size: 0.75rem; }
.xd-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.2rem; padding: 0.8rem 1.1rem; border-radius: 1.1rem; background: #fff; border: 1px solid rgba(122, 61, 118, 0.12); font-weight: 700; color: #5b4a5a; }
.xd-summary b { font-weight: 900; color: var(--brand-dark); }
.xd-summary .is-warn { color: #b45309; }
.xd-summary .is-good { color: #047857; }
.xd-days { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.xd-days span { font-size: 0.75rem; font-weight: 800; border-radius: 999px; padding: 0.15rem 0.6rem; background: rgba(122, 61, 118, 0.07); color: #5b2b57; }
.xd-unmatched { padding: 1rem 1.1rem; border-color: #f5deb0 !important; background: #fffbf2; }
.xd-unmatched-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.5rem; }
.xd-unmatched-grid label { display: flex; flex-direction: column; gap: 0.25rem; margin: 0; font-size: 0.82rem; }
.xd-unmatched-grid small { color: #8a7a89; font-weight: 700; }
.xd-day { margin-bottom: 1.2rem; }
.xd-room { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 0.85rem; align-items: center; padding: 0.75rem 0.95rem; margin-bottom: 0.5rem; border-radius: 1rem; background: #fff; border: 1px solid rgba(122, 61, 118, 0.1); }
.xd-room.has-warn { border-color: #f5deb0; background: #fffcf5; }
.xd-room-time { font-weight: 900; color: var(--brand-primary); font-size: 0.92rem; }
.xd-room-name { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-top: 0.2rem; font-size: 0.85rem; }
.xd-room-teachers { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.xd-person { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.7rem; border-radius: 999px; background: #faf6fa; border: 1px solid rgba(122, 61, 118, 0.12); font-size: 0.85rem; }
.xd-person b { font-weight: 800; }
.xd-person [class^="badge-cert"] { font-size: 0.68rem; padding: 0.08rem 0.45rem; border-radius: 999px; }
.xd-adv { color: #c9a24a; font-size: 0.85rem; }
.xd-none { font-weight: 800; color: #b42318; font-size: 0.85rem; }
.xd-warn { flex-basis: 100%; font-size: 0.78rem; font-weight: 800; color: #b45309; }
.xd-load { padding: 1rem; position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow: auto; }
.xd-load-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 22px; gap: 0.5rem; align-items: center; padding: 0.22rem 0; font-size: 0.82rem; font-weight: 700; }
.xd-load-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xd-load-bar { height: 7px; border-radius: 999px; background: rgba(122, 61, 118, 0.08); overflow: hidden; }
.xd-load-bar span { display: block; height: 100%; border-radius: inherit; background: var(--brand-primary); }
.xd-load-row b { text-align: center; font-weight: 900; }
.xd-load-row.is-zero { color: #b8a9b6; }
.xd-apply-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: 1rem; padding: 0.8rem 1rem; border-radius: 1.1rem; background: #fff; border: 1px solid rgba(122, 61, 118, 0.18); box-shadow: 0 10px 30px rgba(91, 43, 87, 0.15); }
@media (max-width: 767.98px) { .xd-room { grid-template-columns: 1fr; } .xd-mode { grid-template-columns: 1fr; } .xd-load { position: static; max-height: none; } }
[data-bs-theme="dark"] .xd-rules > div, [data-bs-theme="dark"] .xd-summary, [data-bs-theme="dark"] .xd-room, [data-bs-theme="dark"] .xd-apply-bar { background: var(--bs-body-bg); border-color: var(--misk-border); color: var(--bs-body-color); }
[data-bs-theme="dark"] .xd-person { background: rgba(255, 255, 255, 0.04); border-color: var(--misk-border); }
[data-bs-theme="dark"] .xd-room.has-warn, [data-bs-theme="dark"] .xd-unmatched { background: #2a2110; border-color: #5a4720 !important; }
/* Practical results from the examiner's room list (exam-rooms.php) */
.xr-att-row.has-result { flex-wrap: wrap; }
.xr-res-btn { display: inline-flex; align-items: center; gap: 0.35rem; height: 36px; padding: 0 0.85rem; border-radius: 999px; border: 1.5px dashed rgba(122, 61, 118, 0.35); background: #fff; color: var(--brand-primary); font-weight: 900; font-size: 0.82rem; white-space: nowrap; }
.xr-res-btn:hover, .xr-res-btn[aria-expanded="true"] { border-style: solid; background: #faf4fa; }
.xr-res-btn.has-value { border-style: solid; background: #f3ecfa; color: #5b2b57; }
.xr-res-panel { flex-basis: 100%; display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.4rem; padding: 0.85rem; border-radius: 0.9rem; background: #faf6fa; border: 1px solid rgba(122, 61, 118, 0.12); }
.xr-res-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.6rem; }
.xr-res-fields.is-off { opacity: 0.45; }
.xr-res-mark { display: flex; flex-direction: column; gap: 0.25rem; margin: 0; width: 110px; font-weight: 800; font-size: 0.8rem; color: #5b4a5a; }
.xr-res-mark small { color: #9a8d99; font-weight: 700; }
.xr-res-total { display: flex; align-items: baseline; gap: 0.3rem; padding: 0.4rem 0.9rem; border-radius: 0.8rem; background: #fff; border: 1px solid rgba(122, 61, 118, 0.15); }
.xr-res-total b { font-size: 1.4rem; font-weight: 900; color: var(--brand-primary); }
.xr-res-total small { font-weight: 700; color: #8a7a89; }
.xr-res-pass { display: inline-flex; gap: 0.4rem; }
.xr-res-pass label { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.5rem 1.1rem; border-radius: 999px; border: 1.5px solid rgba(122, 61, 118, 0.2); background: #fff; font-weight: 900; cursor: pointer; margin: 0; }
.xr-res-pass .btn-check:checked + .is-yes { background: #10b981; border-color: #10b981; color: #fff; }
.xr-res-pass .btn-check:checked + .is-no { background: #ef4444; border-color: #ef4444; color: #fff; }
.xr-res-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; }
.xr-res-foot .btn { margin-inline-start: auto; }
.xr-res-absent { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0; font-weight: 800; font-size: 0.85rem; color: #b42318; }
[data-bs-theme="dark"] .xr-res-panel { background: rgba(255, 255, 255, 0.03); border-color: var(--misk-border); }
[data-bs-theme="dark"] .xr-res-btn, [data-bs-theme="dark"] .xr-res-total, [data-bs-theme="dark"] .xr-res-pass label { background: transparent; }
/* Practical room rows (examiners): two clean lines - who on top, actions underneath */
.xr-att-row.has-result { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 0.85rem; row-gap: 0.6rem; align-items: center; }
.xr-att-row.has-result .xr-att-who { min-width: 0; }
.xr-att-row.has-result .xr-att-name { flex-wrap: nowrap; }
.xr-att-row.has-result .xr-att-name > :first-child, .xr-att-row.has-result .xr-att-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xr-att-row.has-result .xr-att-name [class*="badge"] { flex-shrink: 0; }
.xr-att-row.has-result .xr-att-teacher { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xr-att-row.has-result .xr-att-actions { grid-column: 1 / -1; width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.45rem; padding-top: 0.6rem; border-top: 1px dashed rgba(122, 61, 118, 0.14); }
.xr-att-row.has-result .xr-att-actions > * { width: 100%; min-width: 0; justify-content: center; height: 38px; }
.xr-att-row.has-result .xr-res-panel { grid-column: 1 / -1; margin-top: 0; }
@media (max-width: 575.98px) { .xr-att-row.has-result .xr-att-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.xr-att-row.has-result .xr-att-name { display: flex; align-items: center; gap: 0.4rem; overflow: visible; }
.xr-att-nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Exam room rows: WhatsApp buttons tucked behind «تواصل» */
.xr-att-row { flex-wrap: wrap; }
.xr-contact-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; height: 36px; padding: 0 0.9rem; border-radius: 999px; border: 1.5px solid rgba(122, 61, 118, 0.2); background: #fff; color: var(--brand-primary); font-weight: 900; font-size: 0.82rem; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.xr-contact-toggle:hover { background: #faf4fa; }
.xr-contact-toggle[aria-expanded="true"] { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.xr-contact-drawer { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; padding: 0.55rem 0.7rem; border-radius: 0.8rem; background: #f6faf7; border: 1px solid #d5efdf; }
.xr-contact-drawer[hidden] { display: none; }
.xr-contact-drawer .xr-wa-btn { flex: 1 1 160px; justify-content: center; height: 36px; }
.xr-contact-hint { flex-basis: 100%; font-weight: 700; color: #6b7d72; font-size: 0.75rem; }
.xr-att-row.has-result .xr-att-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.xr-att-row.has-result .xr-contact-drawer { grid-column: 1 / -1; }
@media (max-width: 575.98px) { .xr-att-row.has-result .xr-att-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); } .xr-att-row.has-result .xr-att-actions > * { padding-inline: 0.4rem; font-size: 0.78rem; } }
[data-bs-theme="dark"] .xr-contact-toggle:not([aria-expanded="true"]) { background: transparent; }
[data-bs-theme="dark"] .xr-contact-drawer { background: rgba(16, 185, 129, 0.06); border-color: #1f6f4f; }
/* Exam rooms: «الموقع على الخريطة» link */
.xr-map-link { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.8rem; border-radius: 999px; background: #e8f3fb; color: #1d5f8c; border: 1px solid #c7e1f3; font-weight: 800; font-size: 0.82rem; text-decoration: none; white-space: nowrap; }
.xr-map-link:hover { background: #1d5f8c; border-color: #1d5f8c; color: #fff; }
.xr-map-link.is-small { padding: 0.12rem 0.6rem; font-size: 0.74rem; margin-inline-start: 0.25rem; vertical-align: middle; }
.xr-ticket-grid .xr-map-link { margin-top: 0.3rem; }
[data-bs-theme="dark"] .xr-map-link { background: #13283a; color: #9ccdf0; border-color: #24496a; }
.xr-no-teachers { font-weight: 800; color: #b45309; background: #fff7e6; border-radius: 999px; padding: 0.05rem 0.55rem; font-size: 0.8rem; }
/* Distribute page: steps, the teachers list, and the «وزّعي» bar */
.xd-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.xd-steps li { display: flex; align-items: center; gap: 0.7rem; padding: 0.75rem 0.9rem; border-radius: 1rem; background: #fff; border: 1px solid rgba(122, 61, 118, 0.1); }
.xd-steps li > span { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 900; background: rgba(122, 61, 118, 0.08); color: #8a7a89; }
.xd-steps li.is-done > span { background: #10b981; color: #fff; }
.xd-steps li.is-now { border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(122, 61, 118, 0.1); }
.xd-steps li.is-now > span { background: var(--brand-primary); color: #fff; }
.xd-steps b { display: block; font-weight: 900; font-size: 0.9rem; color: var(--brand-dark); }
.xd-steps small { font-weight: 700; color: #8a7a89; font-size: 0.78rem; }
.xd-steps small a { color: var(--brand-primary); }
.xd-reupload { display: flex; gap: 0.5rem; align-items: center; padding: 0.7rem; border-radius: 0.9rem; background: #faf6fa; }
.xd-run { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.2rem; padding: 0.9rem 1.1rem; border-radius: 1.1rem; background: linear-gradient(135deg, #faf4fa, #fff); border: 1.5px solid rgba(122, 61, 118, 0.2); }
.xd-run-text { flex: 1 1 240px; }
.xd-run-text b { display: block; font-weight: 900; color: var(--brand-dark); }
.xd-run-text small { font-weight: 700; color: #8a7a89; }
.xd-mode.is-inline { width: auto; flex: 1 1 340px; }
.xd-list { padding: 0; overflow: hidden; }
.xd-list-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.8rem 1rem; border-bottom: 1px solid rgba(122, 61, 118, 0.08); }
.xd-filter { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.xd-filter button { border: 1.5px solid rgba(122, 61, 118, 0.15); background: #fff; color: #5b4a5a; border-radius: 999px; padding: 0.3rem 0.8rem; font-weight: 800; font-size: 0.82rem; }
.xd-filter button.active { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.xd-search { max-width: 260px; }
.xd-row { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr) 64px; gap: 0.9rem; align-items: start; padding: 0.75rem 1rem; border-bottom: 1px solid rgba(122, 61, 118, 0.06); }
.xd-row:last-child { border-bottom: 0; }
.xd-row.is-unmatched { background: #fffbf2; }
.xd-row-name { font-weight: 900; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.xd-row-name [class^="badge-cert"] { font-size: 0.68rem; padding: 0.08rem 0.45rem; border-radius: 999px; }
.xd-row-times { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.xd-time { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.6rem; border-radius: 0.6rem; background: #f3eff7; font-size: 0.78rem; font-weight: 700; color: #5b4a5a; }
.xd-time b { font-weight: 900; color: var(--brand-dark); }
.xd-none-times { font-size: 0.8rem; font-weight: 700; color: #b8a9b6; }
.xd-row-note { flex-basis: 100%; font-size: 0.78rem; font-weight: 700; color: #8a5a00; background: #fff7e6; border-radius: 0.6rem; padding: 0.3rem 0.6rem; margin-top: 0.15rem; }
.xd-row-count { text-align: center; }
.xd-row-count b { display: block; font-size: 1.2rem; font-weight: 900; color: var(--brand-primary); line-height: 1; }
.xd-row-count small { font-weight: 700; color: #8a7a89; font-size: 0.72rem; }
@media (max-width: 767.98px) {
  .xd-steps { grid-template-columns: 1fr; }
  .xd-row { grid-template-columns: 1fr auto; }
  .xd-row-times { grid-column: 1 / -1; grid-row: 2; }
  .xd-search { max-width: none; flex: 1 1 100%; }
}
[data-bs-theme="dark"] .xd-steps li, [data-bs-theme="dark"] .xd-filter button:not(.active) { background: var(--bs-body-bg); border-color: var(--misk-border); }
[data-bs-theme="dark"] .xd-steps b, [data-bs-theme="dark"] .xd-run-text b, [data-bs-theme="dark"] .xd-time b { color: var(--bs-body-color); }
[data-bs-theme="dark"] .xd-run { background: rgba(255, 255, 255, 0.03); }
[data-bs-theme="dark"] .xd-time { background: rgba(255, 255, 255, 0.05); color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .xd-row.is-unmatched { background: #2a2110; }
[data-bs-theme="dark"] .xd-row-note { background: #2a2110; color: #f5d58a; }
/* Teachers list: removable time chips, ✎ for times the admins added, and «+ إضافة وقت» */
form.xd-time { margin: 0; }
.xd-time.is-admin { background: #e8f3fb; color: #1d5f8c; }
.xd-time-admin { font-size: 0.65rem; color: #1d5f8c; }
.xd-time-x { border: 0; background: transparent; color: #b8a9b6; font-weight: 900; font-size: 1rem; line-height: 1; padding: 0 0.1rem; margin-inline-start: 0.1rem; }
.xd-time-x:hover { color: #b42318; }
.xd-time-add { display: inline-flex; align-items: center; gap: 0.25rem; border: 1.5px dashed rgba(122, 61, 118, 0.3); background: #fff; color: var(--brand-primary); border-radius: 0.6rem; padding: 0.15rem 0.6rem; font-weight: 800; font-size: 0.78rem; }
.xd-time-add:hover { border-style: solid; background: #faf4fa; }
.xd-add-wrap { flex-basis: 100%; }
.xd-add-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.35rem; padding: 0.55rem 0.7rem; border-radius: 0.8rem; background: #faf6fa; border: 1px solid rgba(122, 61, 118, 0.12); }
.xd-add-form select { width: auto; min-width: 170px; }
.xd-add-form label { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0; font-weight: 800; font-size: 0.8rem; color: #5b4a5a; }
.xd-add-form input[type="time"] { width: 120px; }
[data-bs-theme="dark"] .xd-time.is-admin { background: #13283a; color: #9ccdf0; }
[data-bs-theme="dark"] .xd-time-add { background: transparent; }
[data-bs-theme="dark"] .xd-add-form { background: rgba(255, 255, 255, 0.03); border-color: var(--misk-border); }
/* Distribute page: the saved sheet card */
.xd-file-card { padding: 0.9rem 1.1rem; border-radius: 1.1rem; background: #fff; border: 1px solid rgba(122, 61, 118, 0.12); }
.xd-file-top { display: flex; align-items: center; gap: 0.75rem; }
.xd-file-icon { width: 42px; height: 42px; border-radius: 0.8rem; display: inline-flex; align-items: center; justify-content: center; background: rgba(122, 61, 118, 0.09); color: var(--brand-primary); font-size: 1.25rem; flex-shrink: 0; }
.xd-file-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.xd-file-info b { font-weight: 900; color: var(--brand-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xd-file-info small { font-weight: 700; color: #8a7a89; font-size: 0.78rem; }
.xd-file-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }
.xd-file-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.5rem; margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px dashed rgba(122, 61, 118, 0.15); }
.xd-file-stats > div { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.5rem; padding: 0.55rem 0.75rem; border-radius: 0.85rem; background: #faf6fa; }
.xd-file-stats b { font-size: 1.25rem; font-weight: 900; color: var(--brand-dark); margin-inline-start: auto; }
.xd-file-stats small { flex-basis: 100%; font-weight: 700; color: #8a7a89; font-size: 0.76rem; }
.xd-file-stats [class^="badge-cert"] { font-size: 0.75rem; padding: 0.15rem 0.6rem; border-radius: 999px; }
.xd-file-stats .is-warn { background: #fff7e6; color: #b45309; font-weight: 800; font-size: 0.85rem; }
.xd-file-stats .is-warn b { color: #b45309; }
@media (max-width: 575.98px) { .xd-file-top { flex-wrap: wrap; } .xd-file-actions { width: 100%; justify-content: flex-end; } }
[data-bs-theme="dark"] .xd-file-card { background: var(--bs-body-bg); border-color: var(--misk-border); }
[data-bs-theme="dark"] .xd-file-info b, [data-bs-theme="dark"] .xd-file-stats b { color: var(--bs-body-color); }
[data-bs-theme="dark"] .xd-file-stats > div { background: rgba(255, 255, 255, 0.04); }
/* ===== Date & time pickers (assets/js/datetime-picker.js, Flatpickr) in the site's colours ===== */
.xr-picker-alt { cursor: pointer; background-color: #fff; }
.xr-picker-alt[readonly] { background-color: #fff; }
.flatpickr-calendar { font-family: inherit; border-radius: 1rem; box-shadow: 0 14px 40px rgba(61, 26, 60, 0.22); border: 1px solid rgba(122, 61, 118, 0.15); }
.flatpickr-months .flatpickr-month, .flatpickr-current-month .flatpickr-monthDropdown-months { font-weight: 900; color: var(--brand-dark); }
.flatpickr-weekday { font-weight: 800; color: #8a7a89; }
.flatpickr-day { font-weight: 700; border-radius: 0.6rem; }
.flatpickr-day.today { border-color: #f0cf7a; }
.flatpickr-day.selected, .flatpickr-day.selected:hover, .flatpickr-day.selected:focus { background: var(--brand-primary); border-color: var(--brand-primary); }
.flatpickr-day:hover { background: #f3ecfa; border-color: #f3ecfa; }
.flatpickr-months .flatpickr-prev-month:hover svg, .flatpickr-months .flatpickr-next-month:hover svg { fill: var(--brand-primary); }
.flatpickr-time input, .flatpickr-time .flatpickr-am-pm { font-weight: 900; font-size: 1.25rem; color: var(--brand-dark); }
.flatpickr-time input:hover, .flatpickr-time .flatpickr-am-pm:hover, .flatpickr-time input:focus, .flatpickr-time .flatpickr-am-pm:focus { background: #faf4fa; }
.flatpickr-calendar.hasTime.noCalendar { width: 220px; }
.flatpickr-time { direction: ltr; }
/* Exam room form: «أوقات جاهزة» */
.xr-time-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-top: -0.25rem; }
.xr-time-presets small { font-weight: 800; color: #8a7a89; margin-inline-end: 0.15rem; }
.xd-hall-presets { margin: 0.15rem 0 0.75rem; }
.xr-time-preset { border: 1.5px solid rgba(122, 61, 118, 0.18); background: #fff; color: var(--brand-primary); border-radius: 999px; padding: 0.25rem 0.75rem; font-weight: 800; font-size: 0.8rem; }
.xr-time-preset:hover { background: #faf4fa; }
.xr-time-preset.active { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
[data-bs-theme="dark"] .xr-picker-alt, [data-bs-theme="dark"] .xr-picker-alt[readonly] { background-color: var(--bs-body-bg); }
[data-bs-theme="dark"] .flatpickr-calendar { background: #211823; border-color: rgba(192, 126, 187, 0.22); }
[data-bs-theme="dark"] .flatpickr-day, [data-bs-theme="dark"] .flatpickr-months .flatpickr-month, [data-bs-theme="dark"] .flatpickr-time input, [data-bs-theme="dark"] .flatpickr-time .flatpickr-am-pm, [data-bs-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months { color: #f1e4ef; fill: #f1e4ef; }
[data-bs-theme="dark"] .flatpickr-day.flatpickr-disabled, [data-bs-theme="dark"] .flatpickr-day.prevMonthDay, [data-bs-theme="dark"] .flatpickr-day.nextMonthDay { color: #6b5f6a; }
[data-bs-theme="dark"] .xr-time-preset:not(.active) { background: transparent; }
/* Calendar: the semester week column */
.flatpickr-weekwrapper .flatpickr-weekday { font-size: 0.72rem; color: var(--brand-primary); font-weight: 900; }
.flatpickr-weekwrapper .flatpickr-weeks { box-shadow: none; padding: 0; }
.flatpickr-weekwrapper span.flatpickr-day { font-weight: 900; color: var(--brand-primary); background: #f6eff6; border-radius: 0.6rem; cursor: default; border: 0; }
.flatpickr-weekwrapper span.flatpickr-day:empty { background: transparent; }
[dir="rtl"] .flatpickr-weekwrapper { border-left: 1px solid rgba(122, 61, 118, 0.08); }
[data-bs-theme="dark"] .flatpickr-weekwrapper span.flatpickr-day { background: rgba(255, 255, 255, 0.05); color: #e9c9e5; }
[dir="rtl"] .flatpickr-calendar.hasWeeks .flatpickr-innerContainer { flex-direction: row-reverse; }
[dir="rtl"] .flatpickr-weekwrapper { border-left: 0; border-right: 1px solid rgba(122, 61, 118, 0.08); }
/* Practical room where the student's own teacher examines */
.xr-own-teacher { margin: 0.8rem 1.2rem 0; padding: 0.6rem 0.85rem; border-radius: 0.85rem; background: #fff7e6; border: 1px solid #f5deb0; color: #8a5a00; font-weight: 800; font-size: 0.85rem; display: flex; gap: 0.45rem; align-items: flex-start; }
[data-bs-theme="dark"] .xr-own-teacher { background: #2a2110; border-color: #5a4720; color: #f5d58a; }
/* Distribute preview: back button + three equal number boxes */
.xd-preview-bar { display: flex; align-items: stretch; gap: 0.75rem; padding: 0.75rem; border-radius: 1.2rem; background: #fff; border: 1px solid rgba(122, 61, 118, 0.12); }
.xd-back { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0 1rem; border-radius: 0.9rem; background: #faf6fa; border: 1px solid rgba(122, 61, 118, 0.14); color: var(--brand-dark); font-weight: 900; text-decoration: none; white-space: nowrap; }
.xd-back:hover { background: #f3ecfa; color: var(--brand-primary); }
.xd-pstats { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.xd-pstats > div { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 0.5rem; padding: 0.6rem 0.85rem; border-radius: 0.9rem; background: #faf6fa; }
.xd-pstats i { font-size: 1.1rem; color: var(--brand-primary); }
.xd-pstats b { font-size: 1.45rem; font-weight: 900; color: var(--brand-dark); line-height: 1; }
.xd-pstats small { font-weight: 800; color: #6b5a6a; font-size: 0.82rem; line-height: 1.3; }
.xd-pstats .is-warn { background: #fff7e6; } .xd-pstats .is-warn i, .xd-pstats .is-warn b, .xd-pstats .is-warn small { color: #b45309; }
.xd-pstats .is-good { background: #ecfdf5; } .xd-pstats .is-good i, .xd-pstats .is-good b, .xd-pstats .is-good small { color: #047857; }
@media (max-width: 767.98px) { .xd-preview-bar { flex-direction: column; } .xd-back { padding: 0.5rem 1rem; justify-content: center; } .xd-pstats { grid-template-columns: 1fr; } }
[data-bs-theme="dark"] .xd-preview-bar { background: var(--bs-body-bg); border-color: var(--misk-border); }
[data-bs-theme="dark"] .xd-back, [data-bs-theme="dark"] .xd-pstats > div:not(.is-warn):not(.is-good) { background: rgba(255, 255, 255, 0.04); color: var(--bs-body-color); }
[data-bs-theme="dark"] .xd-pstats b { color: var(--bs-body-color); }
/* Distribute preview: red flags (must fix) vs light notes (allowed) */
.xd-room.has-flag { border-color: #f3b4b4; background: #fff6f6; box-shadow: inset 4px 0 0 #ef4444; }
[dir="rtl"] .xd-room.has-flag { box-shadow: inset -4px 0 0 #ef4444; }
.xd-room.has-info { border-color: #d6e6f3; }
.xd-flag { flex-basis: 100%; font-size: 0.82rem; font-weight: 900; color: #b42318; background: #fdecec; border-radius: 0.6rem; padding: 0.3rem 0.6rem; margin-top: 0.2rem; }
.xd-info { flex-basis: 100%; font-size: 0.76rem; font-weight: 700; color: #5c7387; margin-top: 0.15rem; }
.xd-pstats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.xd-pstats .is-warn { background: #fdecec; } .xd-pstats .is-warn i, .xd-pstats .is-warn b, .xd-pstats .is-warn small { color: #b42318; }
.xd-pstats .is-info { background: #eef4f9; } .xd-pstats .is-info i, .xd-pstats .is-info b, .xd-pstats .is-info small { color: #4a6378; }
[data-bs-theme="dark"] .xd-room.has-flag { background: #2a1414; border-color: #6b2a2a; }
[data-bs-theme="dark"] .xd-flag { background: #3a1616; color: #fca5a5; }
[data-bs-theme="dark"] .xd-info { color: #9db4c8; }
/* Distribute preview: room filter */
.xd-room-filter { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.xd-room-filter button { display: inline-flex; align-items: center; gap: 0.35rem; border: 1.5px solid rgba(122, 61, 118, 0.15); background: #fff; color: #5b4a5a; border-radius: 999px; padding: 0.35rem 0.9rem; font-weight: 800; font-size: 0.85rem; }
.xd-room-filter button b { font-weight: 900; }
.xd-room-filter button:disabled { opacity: 0.45; }
.xd-room-filter .is-flag { color: #b42318; }
.xd-room-filter .is-info { color: #4a6378; }
.xd-room-filter .is-ok { color: #047857; }
.xd-room-filter button.active { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.xd-room-filter .is-flag.active { background: #ef4444; border-color: #ef4444; }
.xd-room-filter .is-info.active { background: #4a6378; border-color: #4a6378; }
.xd-room-filter .is-ok.active { background: #10b981; border-color: #10b981; }
.xd-day[hidden], .xd-room[hidden] { display: none !important; }
[data-bs-theme="dark"] .xd-room-filter button:not(.active) { background: transparent; }
/* «تذكير المعلمات» window */
/* «رسائل التذكير»: for the teachers' group or the students' group */
.xr-rem-aud { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 0.85rem; }
.xr-rem-aud button { display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem 0.45rem; text-align: start; border: 1.5px solid rgba(122, 61, 118, 0.18); background: #fff; color: #3d1a3c; border-radius: 0.85rem; padding: 0.55rem 0.8rem; font-weight: 900; font-size: 0.9rem; }
.xr-rem-aud button i { color: var(--brand-primary); }
.xr-rem-aud button small { flex-basis: 100%; font-weight: 700; font-size: 0.74rem; color: #8a7488; }
.xr-rem-aud button.active { border-color: var(--brand-primary); background: rgba(122, 61, 118, 0.07); box-shadow: inset 0 0 0 1px var(--brand-primary); }
[data-bs-theme="dark"] .xr-rem-aud button { background: transparent; color: #f2e8f1; }
[data-bs-theme="dark"] .xr-rem-aud button.active { background: rgba(194, 151, 195, 0.12); }
[data-bs-theme="dark"] .xr-rem-aud button small { color: #c9b8c7; }
.xr-rem-days { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.75rem; }
.xr-rem-days button { border: 1.5px solid rgba(122, 61, 118, 0.18); background: #fff; color: #5b4a5a; border-radius: 999px; padding: 0.3rem 0.85rem; font-weight: 800; font-size: 0.82rem; }
.xr-rem-days button b { color: #b45309; margin-inline-end: 0.2rem; }
.xr-rem-days button.active { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.xr-rem-days button.active b { color: #f0cf7a; }
.xr-rem-text { font-size: 0.9rem; line-height: 1.75; background: #f6faf7; border-color: #d5efdf; border-radius: 0.9rem; white-space: pre-wrap; }
[data-bs-theme="dark"] .xr-rem-days button:not(.active) { background: transparent; }
[data-bs-theme="dark"] .xr-rem-text { background: rgba(16, 185, 129, 0.05); border-color: #1f6f4f; }
/* 🎁 beside an online advanced student with midterm ≥ 14 (examiners' list) */
.xr-gift { flex-shrink: 0; font-size: 1.05rem; line-height: 1; cursor: help; filter: drop-shadow(0 1px 2px rgba(240, 207, 122, 0.6)); animation: xrGift 2.4s ease-in-out infinite; }
@keyframes xrGift { 0%, 100% { transform: rotate(0); } 8% { transform: rotate(-12deg); } 16% { transform: rotate(10deg); } 24% { transform: rotate(0); } }
@media (prefers-reduced-motion: reduce) { .xr-gift { animation: none; } }
/* 🎁 is a button now: tap → confetti burst (exam-rooms.php) */
/* Room for the whole emoji: phones (Safari) cut its top off inside a button with line-height 1. */
button.xr-gift { border: 0; background: transparent; padding: 0.15rem 0.15rem 0.05rem; cursor: pointer; -webkit-appearance: none; appearance: none;
    display: inline-flex; align-items: center; justify-content: center; line-height: 1.35; min-height: 1.75rem; overflow: visible; transform-origin: 50% 60%; }
button.xr-gift:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; border-radius: 0.4rem; }
.xr-gift.is-open { animation: xrGiftPop 0.45s ease; }
@keyframes xrGiftPop { 0% { transform: scale(1); } 40% { transform: scale(1.45) rotate(-10deg); } 100% { transform: scale(1); } }
.xr-confetti { position: fixed; z-index: 2000; width: 8px; height: 8px; border-radius: 2px; pointer-events: none; transform: translate(-50%, -50%); animation: xrConfetti 1.1s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes xrConfetti {
  0% { transform: translate(-50%, -50%) rotate(0); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 40px)) rotate(var(--rot)); opacity: 0; }
}

/* ===== CP «الغائبات»: students who missed an exam (theory + practical) ===== */
.xr-kind-tabs a .xr-tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 1.4rem; height: 1.4rem; padding: 0 0.35rem; border-radius: 999px; background: #fde4e1; color: #b42318; font-size: 0.75rem; font-weight: 900; }
.xr-kind-tabs a.active .xr-tab-count { background: #fff; }
.xr-abs-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem; background: #fff; border-radius: 1rem; padding: 0.9rem 1.1rem; box-shadow: 0 4px 16px rgba(61, 26, 60, 0.07); }
.xr-abs-title { display: flex; align-items: center; gap: 0.75rem; }
.xr-abs-title b { display: block; font-weight: 900; color: var(--brand-dark); }
.xr-abs-title small { display: block; font-weight: 700; color: #7a6a79; }
.xr-abs-icon { width: 42px; height: 42px; border-radius: 0.8rem; display: inline-flex; align-items: center; justify-content: center; background: #fde4e1; color: #b42318; font-size: 1.2rem; flex-shrink: 0; }
.xr-abs-search { position: relative; }
.xr-abs-search i { position: absolute; inset-inline-start: 0.9rem; top: 50%; transform: translateY(-50%); color: #9a8a99; }
.xr-abs-search input { padding-inline-start: 2.4rem; border-radius: 999px; font-weight: 700; }
.xr-abs-daycount { margin-inline-start: auto; font-weight: 900; font-size: 0.8rem; color: #b42318; background: #fde4e1; border-radius: 999px; padding: 0.2rem 0.7rem; }
.xr-abs-list { display: flex; flex-direction: column; gap: 0.5rem; }
.xr-abs-row { display: grid; grid-template-columns: minmax(170px, 1.3fr) minmax(170px, 1.2fr) minmax(140px, 1fr) auto; gap: 0.6rem 1rem; align-items: center; background: #fff; border-radius: 0.9rem; padding: 0.75rem 1rem; border-inline-start: 4px solid #e8a39b; box-shadow: 0 2px 10px rgba(61, 26, 60, 0.06); }
.xr-abs-row[hidden] { display: none; }
.xr-abs-who small, .xr-abs-exam small { display: block; font-weight: 700; font-size: 0.8rem; }
.xr-abs-exam small { color: #6b5a6a; }
.xr-abs-exam small i, .xr-abs-teacher i { color: var(--brand-primary); }
.xr-abs-kind { display: inline-block; font-weight: 900; font-size: 0.78rem; border-radius: 999px; padding: 0.12rem 0.6rem; margin-bottom: 0.15rem; background: #f3ecfa; color: #6b3f8f; }
.xr-abs-kind.is-theory { background: #fdf3dc; color: #8a5a00; }
.xr-abs-teacher { font-weight: 800; font-size: 0.85rem; display: flex; flex-direction: column; gap: 0.2rem; }
.xr-abs-teacher small { font-weight: 700; font-size: 0.75rem; }
.xr-abs-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: flex-end; }
.xr-abs-btn { display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 800; font-size: 0.8rem; text-decoration: none; border-radius: 999px; padding: 0.3rem 0.75rem; background: #e7f8ee; color: #15803d; border: 1.5px solid transparent; }
.xr-abs-btn:hover { background: #d3f2e0; color: #126b33; }
.xr-abs-btn.is-ghost { background: transparent; color: var(--brand-primary); border-color: rgba(122, 61, 118, 0.2); }
.xr-abs-btn.is-ghost:hover { background: rgba(122, 61, 118, 0.06); }
.xr-att-goto { font-weight: 800; font-size: 0.85rem; color: #b42318; text-decoration: none; margin-inline-start: 0.6rem; }
.xr-att-overview-title .xr-att-goto i { color: inherit; }
.xr-att-goto:hover { text-decoration: underline; color: #8f1c13; }
@media (max-width: 991.98px) {
    .xr-abs-row { grid-template-columns: 1fr 1fr; }
    .xr-abs-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 575.98px) { .xr-abs-row { grid-template-columns: 1fr; } }
[data-bs-theme="dark"] .xr-abs-head, [data-bs-theme="dark"] .xr-abs-row { background: var(--bs-body-bg); }
[data-bs-theme="dark"] .xr-abs-title b { color: var(--bs-body-color); }
[data-bs-theme="dark"] .xr-abs-icon, [data-bs-theme="dark"] .xr-abs-daycount, [data-bs-theme="dark"] .xr-kind-tabs a .xr-tab-count { background: #3b1512; color: #fca5a5; }
[data-bs-theme="dark"] .xr-abs-btn { background: #10291f; color: #86efac; }
[data-bs-theme="dark"] .xr-abs-btn.is-ghost { background: transparent; color: var(--bs-body-color); }
.xr-res-hint { display: flex; align-items: center; gap: 0.3rem; margin-top: 0.3rem; font-size: 0.76rem; font-weight: 700; color: #8a5a00; }
[data-bs-theme="dark"] .xr-res-hint { color: #fbbf24; }
.xr-res-testers { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; font-size: 0.82rem; color: #6b5a6a; flex: 1 1 260px; }
.xr-res-testers select { width: auto; min-width: 180px; max-width: 100%; flex: 1 1 180px; font-weight: 700; border-radius: 999px; }

/* ===== «حلقتي»: the student's attendance - a small box (closed until opened) between the session card and the students list ===== */
.my-att-box { background: #fff; border-radius: 1rem; box-shadow: 0 2px 12px rgba(61, 26, 60, 0.06); overflow: hidden; }
.my-att-head { display: flex; align-items: center; gap: 0.6rem; width: 100%; border: 0; background: transparent; padding: 0.7rem 1rem; text-align: start; color: var(--brand-dark); }
.my-att-head:hover { background: rgba(122, 61, 118, 0.03); }
.my-att-head-icon { width: 30px; height: 30px; border-radius: 0.6rem; display: inline-flex; align-items: center; justify-content: center; background: rgba(122, 61, 118, 0.1); color: var(--brand-primary); font-size: 0.85rem; }
.my-att-head-title { font-weight: 900; font-size: 0.92rem; flex-grow: 1; }
.my-att-chev { transition: transform 0.2s; font-size: 0.8rem; color: var(--brand-primary); }
.my-att-head:not(.collapsed) .my-att-chev { transform: rotate(180deg); }
.my-att-body { padding: 0 1rem 0.85rem; }
.my-att-grid { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.my-att-tile { display: inline-flex; align-items: center; gap: 0.3rem; border-radius: 999px; padding: 0.25rem 0.7rem; background: var(--tile-bg); color: var(--tile-fg); font-size: 0.8rem; }
.my-att-tile b { font-size: 0.92rem; font-weight: 900; }
.my-att-label { font-weight: 800; }
.my-att-tile small { font-weight: 700; font-size: 0.7rem; opacity: 0.8; }
.my-att-tile small::before { content: "· "; }
.my-att-icon { font-size: 0.8rem; }
.my-att-tile.is-excused { --tile-bg: #efe9f8; --tile-fg: #5b3a8c; }
.my-att-tile.is-unexcused { --tile-bg: #fbe8ec; --tile-fg: #9f1f3f; }
.my-att-tile.is-late { --tile-bg: #fdf3d6; --tile-fg: #8a5a00; }
.my-att-dots { display: inline-flex; gap: 0.18rem; cursor: help; }
.my-att-dots i { width: 0.38rem; height: 0.38rem; border-radius: 50%; background: rgba(138, 90, 0, 0.22); }
.my-att-dots i.on { background: #d08a00; }
[data-bs-theme="dark"] .my-att-box { background: var(--bs-body-bg); }
[data-bs-theme="dark"] .my-att-head { color: var(--bs-body-color); }
[data-bs-theme="dark"] .my-att-tile.is-excused { --tile-bg: #2a2140; --tile-fg: #c4b5fd; }
[data-bs-theme="dark"] .my-att-tile.is-unexcused { --tile-bg: #3b1520; --tile-fg: #fda4af; }
[data-bs-theme="dark"] .my-att-tile.is-late { --tile-bg: #3a2c10; --tile-fg: #fbbf24; }
.my-att-note { display: flex; align-items: flex-start; gap: 0.35rem; margin-top: 0.6rem; font-size: 0.76rem; font-weight: 700; color: #8a5a00; }
[data-bs-theme="dark"] .my-att-note { color: #fbbf24; }
/* Profile: «مطوّرة» - a gold shield in the card's far corner (left in Arabic) */
.dev-shield { position: absolute; top: 0.9rem; inset-inline-end: 1.1rem; z-index: 2; width: 58px; height: 70px; display: block; filter: drop-shadow(0 4px 8px rgba(122, 61, 118, 0.3)); transition: transform 0.2s; }
.dev-shield:hover { transform: translateY(-2px) rotate(-3deg); }
.dev-shield svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.dev-shield-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem; padding-bottom: 8px; color: #fff; text-shadow: 0 1px 2px rgba(61, 26, 60, 0.3); }
.dev-shield-in i { font-size: 1.05rem; line-height: 1; }
.dev-shield-in b { font-size: 0.62rem; font-weight: 900; line-height: 1.3; }
@media (max-width: 575.98px) { .dev-shield { width: 52px; height: 62px; top: 0.7rem; inset-inline-end: 0.8rem; } }
/* Distribute page: seats needed, settings, halls, and the generated committees */
.xd-needs, .xd-halls { padding: 1rem 1.1rem; }
.xd-needs-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.8rem; }
.xd-needs-head b { display: block; font-weight: 900; color: var(--brand-dark); }
.xd-needs-head small { font-weight: 700; color: #8a7a89; font-size: 0.8rem; }
.xd-needs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.55rem; }
.xd-need { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.7rem 0.85rem; border-radius: 0.95rem; background: #faf6fa; border: 1px solid rgba(122, 61, 118, 0.1); }
.xd-need > small { font-weight: 800; color: #8a7a89; font-size: 0.74rem; }
.xd-need > span { font-weight: 900; font-size: 0.85rem; color: #5b2b57; }
.xd-need > b { font-size: 1.4rem; font-weight: 900; color: var(--brand-dark); line-height: 1.2; }
.xd-need > b em { font-style: normal; font-size: 0.8rem; font-weight: 800; color: #8a7a89; }
.xd-need--theory { background: #fdf8ec; }
.xd-need--advanced { background: #f3f0fb; }
.xd-need.is-ok { border-color: #a7e3c9; }
.xd-need.is-ok > small:last-child { color: #047857; }
.xd-need.is-short { border-color: #f3b4b4; background: #fff6f6; }
.xd-need.is-short > small:last-child { color: #b42318; }
.xd-settings { margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px dashed rgba(122, 61, 118, 0.15); display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.8rem; }
.xd-settings fieldset { display: flex; flex-direction: column; gap: 0.45rem; padding: 0.7rem 0.8rem; border-radius: 0.9rem; background: #faf6fa; margin: 0; }
.xd-settings legend { float: none; width: auto; font-size: 0.85rem; font-weight: 900; color: var(--brand-primary); margin: 0 0 0.15rem; }
.xd-settings label { display: flex; flex-direction: column; gap: 0.2rem; margin: 0; font-weight: 800; font-size: 0.78rem; color: #5b4a5a; }
.xd-settings label.xd-check { flex-direction: row; align-items: center; gap: 0.45rem; }
.xd-settings-foot { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.xd-hall-add { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem; padding: 0.7rem; margin-bottom: 0.8rem; border-radius: 0.9rem; background: #faf6fa; }
.xd-hall-add label { display: flex; flex-direction: column; gap: 0.2rem; margin: 0; font-weight: 800; font-size: 0.78rem; color: #5b4a5a; }
.xd-hall-add .xd-hall-url { flex: 1 1 220px; }
.xd-hall-days { display: flex; flex-wrap: wrap; gap: 0.3rem; flex-basis: 100%; }
.xd-hall-days label { flex-direction: row; align-items: center; gap: 0.25rem; padding: 0.2rem 0.6rem; border-radius: 999px; border: 1.5px solid rgba(122, 61, 118, 0.15); background: #fff; cursor: pointer; }
.xd-hall-days label:has(input:checked) { border-color: var(--brand-primary); background: #f3ecfa; }
.xd-hall-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.45rem; }
.xd-hall { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.1rem 0.6rem; padding: 0.5rem 0.75rem; border-radius: 0.85rem; background: #fff; border: 1px solid rgba(122, 61, 118, 0.12); font-size: 0.82rem; font-weight: 700; }
.xd-hall > b { grid-row: span 2; font-size: 1rem; font-weight: 900; color: var(--brand-primary); }
.xd-hall > span:first-of-type { font-weight: 800; }
.xd-hall-time { font-weight: 900; color: var(--brand-dark); }
.xd-hall > small { grid-column: 2 / 4; color: #8a7a89; font-size: 0.74rem; }
.xd-hall > form { grid-row: 1; grid-column: 3; margin: 0; }
.xd-room-meta { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.3rem; }
.xd-hall-tag, .xd-seats { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 800; background: #e8f3fb; color: #1d5f8c; }
.xd-hall-tag.is-none { background: #fff7e6; color: #b45309; }
.xd-seats { background: rgba(122, 61, 118, 0.07); color: #5b2b57; }
[data-bs-theme="dark"] .xd-need, [data-bs-theme="dark"] .xd-settings fieldset, [data-bs-theme="dark"] .xd-hall-add, [data-bs-theme="dark"] .xd-hall, [data-bs-theme="dark"] .xd-hall-days label { background: rgba(255, 255, 255, 0.04); border-color: var(--misk-border); }
[data-bs-theme="dark"] .xd-need > b, [data-bs-theme="dark"] .xd-needs-head b, [data-bs-theme="dark"] .xd-hall-time { color: var(--bs-body-color); }
[data-bs-theme="dark"] .xd-need.is-short { background: #2a1414; }
[data-bs-theme="dark"] .xd-hall-tag { background: #13283a; color: #9ccdf0; }
[data-bs-theme="dark"] .xd-hall-tag.is-none { background: #2a2110; color: #f5d58a; }
/* Exam rooms: a header per semester week */
.xr-week-sep { display: flex; align-items: center; gap: 0.6rem; margin: 1.6rem 0 0.9rem; }
.xr-week-sep:first-of-type { margin-top: 0.4rem; }
.xr-week-sep span { flex-shrink: 0; padding: 0.35rem 1rem; border-radius: 999px; background: var(--brand-primary); color: #fff; font-weight: 900; font-size: 0.95rem; }
.xr-week-sep small { flex-shrink: 0; font-weight: 800; color: #8a7a89; }
.xr-week-sep::after { content: ''; flex: 1; height: 2px; border-radius: 2px; background: rgba(122, 61, 118, 0.15); }
.xr-week-sep[hidden] { display: none; }
/* Room form: teachers free at the room's time first */
.xr-pick-hint { display: block; margin: 0.3rem 0; font-weight: 700; color: #8a7a89; font-size: 0.78rem; }
.xr-pick-group { position: sticky; top: 0; z-index: 1; padding: 0.35rem 0.6rem; font-weight: 900; font-size: 0.8rem; color: #047857; background: #ecfdf5; border-radius: 0.6rem; }
.xr-pick-group.is-rest { color: #6b5a6a; background: #f3eff4; margin-top: 0.4rem; }
.xr-pick-group[hidden], .xr-pick-hint[hidden] { display: none; }
.xr-picker-item.is-free { background: #f6fdf9; }
.xr-pick-why { font-size: 0.72rem; font-weight: 700; color: #a0606a; }
.xr-pick-why[hidden] { display: none; }
[data-bs-theme="dark"] .xr-pick-group { background: rgba(16, 185, 129, 0.1); color: #6ee7b7; }
[data-bs-theme="dark"] .xr-pick-group.is-rest { background: rgba(255, 255, 255, 0.05); color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .xr-picker-item.is-free { background: rgba(16, 185, 129, 0.06); }
/* «لجان المعلمات» window: rooms per teacher by type */
.xr-load-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.7rem; }
.xr-load-top input { max-width: 240px; }
.xr-load-head, .xr-load-item > summary { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 70px) 64px; gap: 0.4rem; align-items: center; text-align: center; }
.xr-load-head { padding: 0 0.75rem 0.35rem; font-size: 0.75rem; font-weight: 900; color: #8a7a89; }
.xr-load-head > :first-child, .xr-load-who { text-align: start; }
.xr-load-item { border-radius: 0.85rem; border: 1px solid rgba(122, 61, 118, 0.1); margin-bottom: 0.35rem; background: #fff; }
.xr-load-item > summary { list-style: none; cursor: pointer; padding: 0.5rem 0.75rem; font-weight: 800; font-size: 0.88rem; }
.xr-load-item > summary::-webkit-details-marker { display: none; }
.xr-load-item[open] { border-color: var(--brand-primary); }
.xr-load-item.is-zero { opacity: 0.6; }
.xr-load-who { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.xr-load-who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 900; }
.xr-load-total { font-size: 1.1rem; font-weight: 900; color: var(--brand-primary); background: #f6eff6; border-radius: 0.6rem; padding: 0.1rem 0; }
.xr-load-rooms { list-style: none; margin: 0; padding: 0.2rem 0.75rem 0.65rem; display: flex; flex-direction: column; gap: 0.3rem; }
.xr-load-rooms li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.6rem; padding: 0.35rem 0.6rem; border-radius: 0.6rem; background: #faf6fa; font-size: 0.8rem; font-weight: 700; }
.xr-load-rooms a { margin-inline-start: auto; font-weight: 800; color: var(--brand-primary); }
.xr-load-none { margin: 0; padding: 0 0.75rem 0.6rem; font-size: 0.8rem; font-weight: 700; color: #8a7a89; }
.xr-load-item[hidden] { display: none; }
@media (max-width: 575.98px) { .xr-load-head, .xr-load-item > summary { grid-template-columns: minmax(0, 1fr) repeat(3, 44px) 44px; gap: 0.25rem; } .xr-load-head { font-size: 0.62rem; padding-inline: 0.5rem; } .xr-load-item > summary { padding-inline: 0.5rem; } }
[data-bs-theme="dark"] .xr-load-item { background: var(--bs-body-bg); border-color: var(--misk-border); }
[data-bs-theme="dark"] .xr-load-rooms li { background: rgba(255, 255, 255, 0.04); }
[data-bs-theme="dark"] .xr-load-total { background: rgba(255, 255, 255, 0.06); }
/* «لجان المعلمات»: one column per week; the name column keeps 170px, the table scrolls sideways if needed */
.xr-load-scroll { overflow-x: auto; contain: inline-size; margin-inline: -0.25rem; padding-inline: 0.25rem; } /* contain: the wide table scrolls here instead of widening the window */
/* exactly the columns + gaps + the row's padding and border, so nothing sticks out of a row */
.xr-load-table { min-width: calc(170px + (3 + var(--weeks, 0)) * 62px + 58px + (4 + var(--weeks, 0)) * 0.4rem + 1.5rem + 2px); }
.xr-load-table .xr-load-head, .xr-load-table .xr-load-item > summary, .xr-load-groups { grid-template-columns: minmax(170px, 1fr) repeat(3, 62px) repeat(var(--weeks, 0), 62px) 58px; }
.xr-load-groups { display: grid; gap: 0.4rem; padding: 0 0.75rem 0.25rem; font-size: 0.68rem; font-weight: 900; color: #a493a3; text-align: center; }
.xr-load-grp { grid-column: span 3; border-bottom: 2px solid rgba(122, 61, 118, 0.15); padding-bottom: 0.15rem; }
.xr-load-grp.is-weeks { grid-column: span var(--weeks, 1); }
.xr-load-head > span { display: inline-flex; align-items: center; justify-content: center; gap: 0.25rem; white-space: nowrap; }
.xr-load-head > span:first-child { justify-content: flex-start; }
.xr-type-ico { font-size: 0.95em; }
.xr-type-ico--theory { color: #7a3d76; }
.xr-type-ico--basic { color: #2f8f91; }
.xr-type-ico--advanced { color: #c88a12; }
.xr-load-wk { border-radius: 0.5rem; background: rgba(122, 61, 118, 0.05); }
.xr-load-head .xr-load-wk { background: rgba(122, 61, 118, 0.1); color: #5b2b57; padding: 0.1rem 0; }
.xr-load-wk.has { font-weight: 900; color: #5b2b57; }
.xr-load-rooms li.xr-load-wkhead { background: transparent; padding: 0.35rem 0.1rem 0; font-weight: 900; color: var(--brand-primary); font-size: 0.78rem; }
@media (max-width: 575.98px) { .xr-load-table { min-width: calc(130px + (3 + var(--weeks, 0)) * 46px + 44px + (4 + var(--weeks, 0)) * 0.25rem + 1rem + 2px); } .xr-load-table .xr-load-head, .xr-load-table .xr-load-item > summary, .xr-load-groups { grid-template-columns: minmax(130px, 1fr) repeat(3, 46px) repeat(var(--weeks, 0), 46px) 44px; gap: 0.25rem; } .xr-load-groups { padding-inline: 0.5rem; } }
[data-bs-theme="dark"] .xr-type-ico--theory { color: #c07ebb; }
[data-bs-theme="dark"] .xr-load-grp { border-color: rgba(255, 255, 255, 0.12); }
[data-bs-theme="dark"] .xr-load-wk { background: rgba(255, 255, 255, 0.04); }
[data-bs-theme="dark"] .xr-load-wk.has, [data-bs-theme="dark"] .xr-load-head .xr-load-wk { color: var(--bs-body-color); }
/* Distribute preview: seats per day on each need card */
.xd-need-days { display: flex; flex-wrap: wrap; gap: 0.2rem; margin-top: 0.3rem; }
.xd-need-days span { font-size: 0.68rem; font-weight: 800; padding: 0.05rem 0.4rem; border-radius: 999px; background: rgba(4, 120, 87, 0.08); color: #047857; }
.xd-need-days span.is-none { background: #fdecec; color: #b42318; }
[data-bs-theme="dark"] .xd-need-days span { background: rgba(16, 185, 129, 0.1); color: #6ee7b7; }
[data-bs-theme="dark"] .xd-need-days span.is-none { background: #3a1616; color: #fca5a5; }
/* Distribute preview: 🌱 teachers still without a practical committee */
.xd-first-missing { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.8rem 1rem; border-radius: 1rem; background: #f0faf3; border: 1px solid #b9e4c7; }
.xd-first-missing b { font-weight: 900; color: #166534; }
.xd-first-missing small { font-weight: 700; color: #4b6b55; }
.xd-first-missing > div { display: flex; flex-wrap: wrap; gap: 0.35rem; }
[data-bs-theme="dark"] .xd-first-missing { background: rgba(22, 101, 52, 0.12); border-color: #1f5f36; }
[data-bs-theme="dark"] .xd-first-missing b { color: #86efac; }
/* Exam rooms page (admins): her own rooms pinned on top */
.xr-pin-head { display: flex; align-items: center; gap: 0.4rem; margin: 0.4rem 0 0.7rem; font-weight: 900; color: var(--brand-primary); font-size: 1rem; }
.xr-pin-head small { color: #8a7a89; font-weight: 800; }
.xr-pin-head.is-rest { margin-top: 1.6rem; color: #6b5a6a; padding-top: 1rem; border-top: 2px dashed rgba(122, 61, 118, 0.15); }
.xr-sup.is-mine { border: 2px solid #f0cf7a !important; box-shadow: 0 6px 18px rgba(201, 162, 74, 0.18); }
[data-bs-theme="dark"] .xr-pin-head.is-rest { color: var(--bs-secondary-color); }
/* ===== Exam rooms page - teachers' view: summary, «now / today / upcoming / ended», tidy room cards ===== */
.xr-tsum { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 0.7rem; }
.xr-tsum-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; }
.xr-tsum-stats > div { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0.7rem 0.4rem; border-radius: 1rem; background: #fff; border: 1px solid rgba(122, 61, 118, 0.12); }
.xr-tsum-stats b { font-size: 1.55rem; font-weight: 900; line-height: 1.1; color: var(--brand-primary); }
.xr-tsum-stats small { font-weight: 800; color: #8a7a89; font-size: 0.78rem; }
.xr-tsum-stats .is-today { background: #fff4f2; border-color: #f6c9c0; } .xr-tsum-stats .is-today b { color: #c2410c; }
.xr-tsum-stats .is-muted b { color: #9a8d99; }
.xr-tsum-next { display: flex; flex-direction: column; justify-content: center; gap: 0.1rem; padding: 0.7rem 1rem; border-radius: 1rem; text-decoration: none; color: #fff; background: linear-gradient(135deg, #8d4a88, #5a2756); box-shadow: 0 8px 20px rgba(91, 43, 87, 0.2); }
.xr-tsum-next:hover { color: #fff; filter: brightness(1.06); }
.xr-tsum-next small { font-weight: 800; opacity: 0.85; font-size: 0.78rem; display: inline-flex; align-items: center; gap: 0.35rem; }
.xr-tsum-next b { font-weight: 900; font-size: 1rem; }
.xr-tsum-next span { font-weight: 700; opacity: 0.9; font-size: 0.85rem; }
.xr-tsum-search { grid-column: 1 / -1; position: relative; }
.xr-tsum-search i { position: absolute; inset-inline-start: 0.9rem; top: 50%; transform: translateY(-50%); color: #9a8d99; }
.xr-tsum-search input { padding-inline-start: 2.3rem; border-radius: 999px; height: 44px; font-weight: 700; }
.xr-state-head { display: flex; align-items: center; gap: 0.45rem; margin: 1.2rem 0 0.6rem; font-weight: 900; font-size: 0.95rem; color: #5b2b57; }
.xr-state-head::after { content: ''; flex: 1; height: 1px; background: rgba(122, 61, 118, 0.15); }
.xr-state-head.is-live { color: #b42318; } .xr-state-head.is-today { color: #c2410c; } .xr-state-head.is-ended { color: #9a8d99; }
.xr-sup { border-radius: 1.1rem; }
.xr-sup.is-live { border: 2px solid #f3a29a !important; }
.xr-sup.is-ended { opacity: 0.85; }
.xr-sup-head { align-items: flex-start; border-bottom: 0; }
.xr-sup-head > .xr-sup-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.xr-sup-head > .xr-sup-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 0.3rem; }
.xr-sup-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.xr-track--theory { background: #fdf3dc; color: #8a5a00; }
.xr-sup-live { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.75rem; font-weight: 900; color: #b42318; background: #fdecec; border-radius: 999px; padding: 0.12rem 0.6rem; }
.xr-sup-title { font-weight: 900; font-size: 1.12rem; color: var(--brand-dark); line-height: 1.3; }
.xr-sup-title > span { font-weight: 800; color: #8a7a89; font-size: 0.95rem; }
/* «إضافة طالبة» suggestion list (student-pick.js) - our own, since phones barely show a <datalist> */
.xr-add-seat, .xr-add-student { position: relative; }
.xr-sup.is-picking { overflow: visible; }
.xr-pick-menu { position: absolute; z-index: 30; inset-inline: 0.5rem; top: 100%; margin: 0.15rem 0 0; padding: 0.3rem; list-style: none;
    max-height: 16rem; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: #fff; border: 1px solid rgba(122, 61, 118, 0.22); border-radius: 0.8rem; box-shadow: 0 10px 28px rgba(43, 16, 41, 0.16); }
.xr-pick-menu li { display: flex; flex-direction: column; gap: 0.05rem; padding: 0.5rem 0.7rem; border-radius: 0.55rem; cursor: pointer; text-align: start; }
.xr-pick-menu li b { font-weight: 800; font-size: 0.9rem; color: #2b1029; }
.xr-pick-menu li small { font-weight: 700; font-size: 0.74rem; color: #8a7488; }
.xr-pick-menu li:hover, .xr-pick-menu li.is-active { background: rgba(122, 61, 118, 0.08); }
.xr-pick-menu li.is-empty { cursor: default; font-weight: 700; font-size: 0.82rem; color: #8a7488; }
[data-bs-theme="dark"] .xr-pick-menu { background: #2a1a29; border-color: rgba(194, 151, 195, 0.3); }
[data-bs-theme="dark"] .xr-pick-menu li b { color: #f2e8f1; }
[data-bs-theme="dark"] .xr-pick-menu li small, [data-bs-theme="dark"] .xr-pick-menu li.is-empty { color: #c9b8c7; }
[data-bs-theme="dark"] .xr-pick-menu li:hover, [data-bs-theme="dark"] .xr-pick-menu li.is-active { background: rgba(194, 151, 195, 0.14); }
/* Teacher: «إضافة طالبة» to her theory room by university ID */
.xr-add-seat { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; padding: 0.55rem 0.9rem; border-bottom: 1px dashed rgba(122, 61, 118, 0.18); }
.xr-add-seat label { font-weight: 900; font-size: 0.82rem; color: var(--brand-primary); margin: 0; }
.xr-add-seat input { width: 15rem; max-width: 100%; flex: 1 1 12rem; }
.xr-sup-levels { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-top: 0.45rem; }
.xr-sup-levels-label { font-weight: 800; font-size: 0.8rem; color: #6b5a6a; }
.xr-sup-levels > span[class^="badge-level-"] { font-weight: 800; border-radius: 0.75rem; padding: 0.15rem 0.6rem; font-size: 0.76rem; }
.xr-sup-levels > span[class^="badge-level-"] b { font-weight: 900; margin-inline-start: 0.2rem; }
[data-bs-theme="dark"] .xr-sup-levels-label { color: #c9b8c7; }
.xr-sup-meta { display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem; font-weight: 700; font-size: 0.84rem; color: #6b5a6a; }
.xr-sup-meta i { color: var(--brand-primary); opacity: 0.75; margin-inline-end: 0.15rem; }
.xr-sup-count small { font-size: 0.75rem; opacity: 0.7; }
.xr-sup-att { font-weight: 900; font-size: 0.8rem; color: #047857; background: #ecfdf5; border-radius: 999px; padding: 0.15rem 0.65rem; }
.xr-sup-toggle { display: flex; align-items: center; gap: 0.45rem; width: 100%; padding: 0.55rem 1.2rem; border: 0; border-top: 1px solid rgba(122, 61, 118, 0.08); background: rgba(122, 61, 118, 0.03); color: var(--brand-primary); font-weight: 900; font-size: 0.88rem; text-align: start; }
.xr-sup-toggle:hover { background: rgba(122, 61, 118, 0.07); }
.xr-sup-toggle i { transition: transform 0.2s; }
.xr-sup-toggle[aria-expanded="true"] i { transform: rotate(180deg); }
.xr-sup-toggle b { font-weight: 800; color: #8a7a89; }
.xr-sup-body[hidden] { display: none; }
.xr-sup-empty { margin: 0; padding: 0.7rem 1.2rem 0.9rem; font-weight: 700; font-size: 0.85rem; color: #9a8d99; border-top: 1px solid rgba(122, 61, 118, 0.06); }
.xr-sup-nomatch { text-align: center; font-weight: 800; color: #9a8d99; padding: 1.5rem 0; }
.xr-sup[hidden], .xr-state-head[hidden], .xr-pin-head[hidden], .xr-sup-nomatch[hidden], .xr-att-row[hidden] { display: none !important; }
@media (max-width: 767.98px) {
  .xr-tsum { grid-template-columns: 1fr; }
  .xr-tsum-stats b { font-size: 1.3rem; }
  .xr-sup-head { gap: 0.6rem; padding: 0.9rem; }
  .xr-sup-head > .xr-sup-side { align-self: flex-start; } /* the student count stays in the top corner (left in Arabic) */
}
[data-bs-theme="dark"] .xr-tsum-stats > div { background: var(--bs-body-bg); border-color: var(--misk-border); }
[data-bs-theme="dark"] .xr-tsum-stats .is-today { background: rgba(194, 65, 12, 0.12); border-color: #7c2d12; }
[data-bs-theme="dark"] .xr-sup-title { color: var(--bs-body-color); }
[data-bs-theme="dark"] .xr-sup-meta, [data-bs-theme="dark"] .xr-state-head { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .xr-sup-toggle { background: rgba(255, 255, 255, 0.03); border-color: var(--misk-border); }
[data-bs-theme="dark"] .xr-track--theory { background: #3a2c10; color: #f5d58a; }
[data-bs-theme="dark"] .xr-sup-att { background: rgba(16, 185, 129, 0.12); color: #6ee7b7; }
[data-bs-theme="dark"] .xr-sup-live { background: #3a1616; color: #fca5a5; }
/* Exam rooms page: week headers inside «القادمة» / «انتهت», and the examiners' phone numbers */
.xr-week-sep.is-sub { margin: 0.6rem 0 0.6rem; }
.xr-week-sep.is-sub span { padding: 0.2rem 0.8rem; font-size: 0.82rem; background: rgba(122, 61, 118, 0.12); color: var(--brand-primary); }
.xr-week-sep[hidden] { display: none !important; }
.xr-sup-with { display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; flex-basis: 100%; }
.xr-sup-person { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.1rem 0.25rem 0.1rem 0.55rem; border-radius: 999px; background: rgba(122, 61, 118, 0.06); }
.xr-sup-person b { font-weight: 800; color: var(--brand-dark); }
.xr-sup-tel { font-weight: 800; color: #1d5f8c; text-decoration: none; white-space: nowrap; }
.xr-sup-tel:hover { text-decoration: underline; }
.xr-sup-tel i { color: #1d5f8c !important; opacity: 1 !important; font-size: 0.75rem; }
.xr-sup-wa { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: #25d366; color: #fff !important; text-decoration: none; }
.xr-sup-wa i { color: #fff !important; opacity: 1 !important; margin: 0 !important; }
.xr-sup-wa:hover { filter: brightness(0.95); }
[data-bs-theme="dark"] .xr-sup-person { background: rgba(255, 255, 255, 0.05); }
[data-bs-theme="dark"] .xr-sup-person b { color: var(--bs-body-color); }
[data-bs-theme="dark"] .xr-sup-tel, [data-bs-theme="dark"] .xr-sup-tel i { color: #9ccdf0 !important; }
/* Distribute settings: theory share per day */
.xd-weights > span { display: block; font-weight: 800; font-size: 0.78rem; color: #5b4a5a; margin-bottom: 0.2rem; }
.xd-weights > div { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.3rem; }
.xd-weights label { gap: 0.1rem !important; align-items: center; }
.xd-weights small { font-size: 0.68rem; font-weight: 800; color: #8a7a89; }
.xd-weights input { text-align: center; padding-inline: 0.2rem; }
/* Exam rooms (control panel): «من يرى اللجان؟» steps + the seat-changes switch */
.xr-control { padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.8rem; }
.xr-control-title { font-weight: 900; color: var(--brand-dark); display: flex; align-items: center; gap: 0.45rem; }
.xr-control-title i { color: var(--brand-primary); }
.xr-stage { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.45rem; position: relative; }
.xr-stage-step { margin: 0; }
.xr-stage-step button { width: 100%; height: 100%; display: flex; align-items: flex-start; gap: 0.55rem; padding: 0.65rem 0.7rem; border-radius: 0.95rem; border: 1.5px solid rgba(122, 61, 118, 0.15); background: #fff; text-align: start; transition: border-color 0.15s, background 0.15s, box-shadow 0.15s; }
.xr-stage-step button:hover:not(:disabled) { border-color: var(--brand-primary); background: #faf4fa; }
.xr-stage-num { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; background: rgba(122, 61, 118, 0.08); color: #8a7a89; }
.xr-stage-text { display: flex; flex-direction: column; min-width: 0; }
.xr-stage-text b { font-weight: 900; font-size: 0.88rem; color: var(--brand-dark); }
.xr-stage-text small { font-weight: 700; font-size: 0.74rem; color: #8a7a89; line-height: 1.45; }
.xr-stage-step.is-past .xr-stage-num { background: #d1fae5; color: #047857; }
.xr-stage-step.is-on button { border-color: var(--brand-primary); background: linear-gradient(135deg, #faf4fa, #fff); box-shadow: 0 0 0 3px rgba(122, 61, 118, 0.12); cursor: default; opacity: 1; }
.xr-stage-step.is-on .xr-stage-num { background: var(--brand-primary); color: #fff; }
.xr-lock-row { display: flex; align-items: center; gap: 0.7rem; margin: 0; padding: 0.65rem 0.8rem; border-radius: 0.95rem; background: #faf6fa; }
.xr-lock-row > i { font-size: 1.15rem; color: var(--brand-primary); }
.xr-lock-row b { display: block; font-weight: 900; font-size: 0.88rem; color: var(--brand-dark); }
.xr-lock-row small { font-weight: 700; font-size: 0.76rem; color: #8a7a89; }
.xr-lock-row.is-locked { background: #fff7e6; } .xr-lock-row.is-locked > i { color: #b45309; }
.xr-toggle { flex-shrink: 0; width: 46px; height: 26px; border-radius: 999px; border: 0; padding: 0; background: #d9ccd8; position: relative; transition: background 0.2s; }
.xr-toggle span { position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: inset-inline-start 0.2s; }
.xr-toggle.is-on { background: #d97706; }
.xr-toggle.is-on span { inset-inline-start: 23px; }
@media (max-width: 767.98px) { .xr-stage { grid-template-columns: 1fr; } }
[data-bs-theme="dark"] .xr-stage-step button { background: var(--bs-body-bg); border-color: var(--misk-border); }
[data-bs-theme="dark"] .xr-stage-step.is-on button { background: rgba(192, 126, 187, 0.1); }
[data-bs-theme="dark"] .xr-stage-text b, [data-bs-theme="dark"] .xr-lock-row b, [data-bs-theme="dark"] .xr-control-title { color: var(--bs-body-color); }
[data-bs-theme="dark"] .xr-lock-row { background: rgba(255, 255, 255, 0.04); }
[data-bs-theme="dark"] .xr-lock-row.is-locked { background: #2a2110; }
/* Distribute: the simplified «إضافة قاعة» form - when (date, from, to) and where (hall, building, link) */
.xd-hall-add { flex-direction: column; align-items: stretch; }
.xd-hall-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.xd-hall-row label span i { color: var(--brand-primary); }
.xd-hall-foot { display: flex; justify-content: flex-end; }
@media (max-width: 575.98px) { .xd-hall-row { grid-template-columns: 1fr; } }
/* Halls: «محجوزة» / «متاحة غير محجوزة» */
.xd-reserved, .xd-unreserved { display: inline-flex; align-items: center; gap: 0.2rem; font-size: 0.66rem; font-weight: 900; border-radius: 999px; padding: 0.05rem 0.5rem; vertical-align: middle; }
.xd-reserved { background: #ecfdf5; color: #047857; }
.xd-unreserved { background: #fff4e5; color: #b45309; }
.xd-hall-foot { align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.xd-reserved-pick { display: inline-flex; gap: 0.35rem; }
.xd-reserved-pick label { margin: 0; cursor: pointer; }
.xd-reserved-pick input { position: absolute; opacity: 0; pointer-events: none; }
.xd-reserved-pick span { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.9rem; border-radius: 999px; border: 1.5px solid rgba(122, 61, 118, 0.18); background: #fff; font-weight: 800; font-size: 0.84rem; color: #6b5a6a; }
.xd-reserved-pick input:checked + span { border-color: #10b981; background: #ecfdf5; color: #047857; }
.xd-reserved-pick .is-free input:checked + span { border-color: #d97706; background: #fff4e5; color: #b45309; }
.xd-reserved-pick input:focus-visible + span { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
[data-bs-theme="dark"] .xd-reserved-pick span { background: transparent; border-color: var(--misk-border); color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .xd-reserved { background: rgba(16, 185, 129, 0.12); color: #6ee7b7; }
[data-bs-theme="dark"] .xd-unreserved { background: #2a2110; color: #f5d58a; }
/* Halls list: by day, one compact line per hall (time · hall · status · ×) */
.xd-hall-days-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.7rem; align-items: start; }
.xd-hall-day { border-radius: 1rem; border: 1px solid rgba(122, 61, 118, 0.12); background: #fff; overflow: hidden; }
.xd-hall-day-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0.5rem 0.85rem; background: #f6eff6; }
.xd-hall-day-head b { font-weight: 900; color: var(--brand-dark); }
.xd-hall-day-head small { font-weight: 800; color: #8a7a89; font-size: 0.75rem; }
.xd-hall-line { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto 22px 22px; align-items: center; gap: 0.5rem; padding: 0.45rem 0.85rem; border-top: 1px solid rgba(122, 61, 118, 0.07); }
.xd-hall-line:first-of-type { border-top: 0; }
.xd-hall-line.is-free { background: #fffbf3; }
.xd-hall-line .xd-hall-time { font-weight: 900; font-size: 0.82rem; color: var(--brand-dark); white-space: nowrap; text-align: start; }
.xd-hall-name { display: flex; flex-direction: column; min-width: 0; }
.xd-hall-name b { font-weight: 900; font-size: 0.95rem; color: var(--brand-primary); }
.xd-hall-name small { font-weight: 700; font-size: 0.7rem; color: #8a7a89; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xd-hall-line .xd-unreserved, .xd-hall-line .xd-reserved { white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.xd-hall-line form { margin: 0; }
.xd-hall-line .xd-hall-edit { font-size: 0.85rem; }
.xd-hall-line .xd-hall-edit:hover { color: var(--brand); }
@media (max-width: 575.98px) {
  .xd-hall-days-grid { grid-template-columns: 1fr; }
  .xd-hall-line { grid-template-columns: 76px minmax(0, 1fr) auto 20px 20px; gap: 0.4rem; padding: 0.45rem 0.65rem; }
  .xd-hall-line .xd-unreserved { max-width: 92px; }
}
[data-bs-theme="dark"] .xd-hall-day { background: var(--bs-body-bg); border-color: var(--misk-border); }
[data-bs-theme="dark"] .xd-hall-day-head { background: rgba(255, 255, 255, 0.04); }
[data-bs-theme="dark"] .xd-hall-day-head b, [data-bs-theme="dark"] .xd-hall-line .xd-hall-time { color: var(--bs-body-color); }
[data-bs-theme="dark"] .xd-hall-line.is-free { background: rgba(217, 119, 6, 0.06); }
/* Teachers' times: tap a time to edit it; ready periods in the form */
.xd-time-edit { border: 0; background: transparent; padding: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 0.3rem; }
.xd-time-edit:hover b, .xd-time-edit:hover span { text-decoration: underline dotted; }
.xd-time-edit.is-editing { outline: 2px solid var(--brand-primary); outline-offset: 3px; border-radius: 0.4rem; }
.xd-add-wrap[hidden] { display: none; }
.xd-add-title { flex-basis: 100%; font-weight: 900; font-size: 0.82rem; color: var(--brand-primary); }
.xd-presets { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.xd-preset { border: 1.5px solid rgba(122, 61, 118, 0.18); background: #fff; color: var(--brand-dark); border-radius: 999px; padding: 0.2rem 0.7rem; font-weight: 800; font-size: 0.78rem; }
.xd-preset:hover { background: #faf4fa; border-color: var(--brand-primary); }
.xd-preset.active { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
[data-bs-theme="dark"] .xd-preset:not(.active) { background: transparent; color: var(--bs-body-color); border-color: var(--misk-border); }
/* Teachers' times: add on several days × several weeks */
.xd-multi { flex-basis: 100%; display: flex; flex-direction: column; gap: 0.35rem; }
.xd-multi[hidden] { display: none; }
.xd-multi-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; }
.xd-multi-group > span { font-weight: 900; font-size: 0.78rem; color: #5b4a5a; min-width: 58px; }
.xd-chk { margin: 0; cursor: pointer; }
.xd-chk input { position: absolute; opacity: 0; pointer-events: none; }
.xd-chk span { display: inline-block; padding: 0.2rem 0.7rem; border-radius: 999px; border: 1.5px solid rgba(122, 61, 118, 0.18); background: #fff; font-weight: 800; font-size: 0.78rem; color: #6b5a6a; }
.xd-chk input:checked + span { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.xd-chk input:focus-visible + span { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
[data-bs-theme="dark"] .xd-chk span { background: transparent; border-color: var(--misk-border); color: var(--bs-secondary-color); }
/* «من يرى اللجان؟» folded into one line; «تغيير» opens the steps */
.xr-control { gap: 0; }
.xr-control-sum { display: flex; align-items: center; gap: 0.7rem; }
.xr-control-sum-icon { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--brand-primary); color: #fff; }
.xr-control-sum-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.xr-control-sum-text > span { font-weight: 800; color: #5b4a5a; font-size: 0.9rem; }
.xr-control-sum-text b { font-weight: 900; color: var(--brand-primary); }
.xr-control-sum-text small { font-weight: 700; color: #8a7a89; font-size: 0.76rem; }
.xr-control-edit { flex-shrink: 0; white-space: nowrap; }
.xr-control-edit[aria-expanded="true"] { background: var(--brand-primary); border-color: var(--brand-primary) !important; color: #fff; }
.xr-control-body { display: flex; flex-direction: column; gap: 0.7rem; padding-top: 0.85rem; margin-top: 0.85rem; border-top: 1px dashed rgba(122, 61, 118, 0.15); }
[data-bs-theme="dark"] .xr-control-sum-text > span { color: var(--bs-body-color); }
/* «المطلوب والموجود» overview (exam rooms, control panel) */
.xr-overview { padding: 1rem 1.1rem; }
.xr-overview-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.3rem 1rem; margin-bottom: 0.7rem; }
.xr-overview-head b { font-weight: 900; color: var(--brand-dark); }
.xr-overview-head b i { color: var(--brand-primary); }
.xr-overview-head small { font-weight: 700; color: #8a7a89; font-size: 0.76rem; }
.xr-overview-rows { display: flex; flex-direction: column; gap: 0.3rem; }
.xr-ov-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 1.2fr) minmax(0, 0.9fr); align-items: center; gap: 0.6rem; padding: 0.5rem 0.75rem; border-radius: 0.8rem; background: #faf6fa; }
.xr-ov-row.is-head { background: transparent; padding-block: 0 0.15rem; font-weight: 900; font-size: 0.76rem; color: #8a7a89; }
.xr-ov-row.is-head small { font-weight: 700; font-size: 0.68rem; }
.xr-ov-row.is-here { box-shadow: inset 0 0 0 2px rgba(122, 61, 118, 0.25); }
.xr-ov-row.is-total { background: transparent; border-top: 2px solid rgba(122, 61, 118, 0.15); border-radius: 0; margin-top: 0.2rem; }
.xr-ov-name { display: flex; flex-direction: column; min-width: 0; }
.xr-ov-name small { font-weight: 800; color: #8a7a89; font-size: 0.72rem; }
.xr-ov-name b { font-weight: 900; font-size: 0.88rem; color: var(--brand-dark); }
.xr-ov-num { font-weight: 700; color: #6b5a6a; font-size: 0.88rem; }
.xr-ov-num b { font-weight: 900; font-size: 1.05rem; color: var(--brand-dark); }
.xr-ov-bar { display: block; height: 5px; margin-top: 0.25rem; border-radius: 999px; background: rgba(122, 61, 118, 0.1); overflow: hidden; }
.xr-ov-bar span { display: block; height: 100%; border-radius: inherit; background: #10b981; }
.xr-ov-row.is-short .xr-ov-bar span { background: #ef4444; }
.xr-ov-state { font-weight: 900; font-size: 0.8rem; }
.xr-ov-row.is-ok .xr-ov-state, .xr-ov-row.is-total .xr-ov-state { color: #047857; }
.xr-ov-row.is-short .xr-ov-state { color: #b42318; }
@media (max-width: 575.98px) {
  .xr-ov-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0.25rem; }
  .xr-ov-row.is-head { display: none; }
  .xr-ov-state { grid-column: 1 / -1; }
}
[data-bs-theme="dark"] .xr-ov-row:not(.is-head):not(.is-total) { background: rgba(255, 255, 255, 0.04); }
[data-bs-theme="dark"] .xr-ov-name b, [data-bs-theme="dark"] .xr-ov-num b, [data-bs-theme="dark"] .xr-overview-head b { color: var(--bs-body-color); }
/* «من يرى اللجان؟» - the «تعديل / إغلاق» button */
.xr-control-edit { display: inline-flex; align-items: center; gap: 0.4rem; flex-shrink: 0; min-height: 40px; padding: 0.4rem 0.95rem; border-radius: 999px; border: 1.5px solid var(--brand-primary); background: #fff; color: var(--brand-primary); font-weight: 900; font-size: 0.88rem; white-space: nowrap; transition: background 0.15s, color 0.15s, box-shadow 0.15s; }
.xr-control-edit:hover { background: #faf4fa; box-shadow: 0 4px 12px rgba(122, 61, 118, 0.15); }
.xr-control-edit:focus-visible { outline: 3px solid rgba(122, 61, 118, 0.35); outline-offset: 2px; }
.xr-control-edit .xr-control-chev { font-size: 0.75rem; transition: transform 0.2s; }
.xr-control-edit .is-open-label { display: none; }
.xr-control-edit[aria-expanded="true"] { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary) !important; box-shadow: 0 4px 12px rgba(122, 61, 118, 0.25); }
.xr-control-edit[aria-expanded="true"] .is-open-label { display: inline; }
.xr-control-edit[aria-expanded="true"] .is-closed-label { display: none; }
.xr-control-edit[aria-expanded="true"] .xr-control-chev { transform: rotate(180deg); }
[data-bs-theme="dark"] .xr-control-edit:not([aria-expanded="true"]) { background: transparent; color: #e9c9e5; border-color: #c07ebb; }
/* «المطلوب والموجود» tab: the settings card */
.xr-needs-settings { padding: 1rem 1.1rem; margin-top: 0; border-top: 0 !important; }
/* Room form: teachers not free at the room's time are hidden; chosen ones stay, marked */
.xr-picker-item.is-unavail-hidden { display: none !important; }
.xr-picker-item.is-unavail { opacity: 0.75; }
.xr-picker-item.is-unavail.is-on { opacity: 1; background: #fff6f6; }
button.xr-pick-group.is-rest { width: 100%; border: 1.5px dashed rgba(122, 61, 118, 0.25); text-align: start; cursor: pointer; display: flex; align-items: center; gap: 0.35rem; }
button.xr-pick-group.is-rest:hover { background: #ece3ee; }
button.xr-pick-group.is-rest[hidden] { display: none; }
[data-bs-theme="dark"] .xr-picker-item.is-unavail.is-on { background: rgba(239, 68, 68, 0.08); }
/* Room form picker: divider before teachers from outside this semester */
.xr-pick-outside { display: flex; align-items: center; gap: 0.5rem; margin: 0.4rem 0.2rem 0.2rem; font-size: 0.72rem; font-weight: 800; color: #9a8d99; }
.xr-pick-outside::after { content: ''; flex: 1; height: 1px; background: rgba(122, 61, 118, 0.15); }
/* Room form picker: the teacher's picture (photo or default avatar) instead of a letter */
.xr-picker-avatar { width: 34px; height: 34px; background: #f3ecf6; overflow: hidden; padding: 0; }
.xr-picker-avatar .xr-picker-avatar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.xr-picker-avatar .avatar-fallback.xr-picker-avatar-img { display: inline-flex; }
.xr-picker-avatar .avatar-fallback svg { width: 100%; height: 100%; display: block; }
/* Register: the university card photo - preview of the picked photo, and a «preparing» state while it is shrunk */
.card-upload .card-upload-preview { display: block; max-width: 100%; max-height: 170px; margin: 0 auto 0.5rem; border-radius: 0.8rem; object-fit: contain; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12); }
.card-upload .card-upload-preview[hidden] { display: none; }
.card-upload.is-busy { opacity: 0.75; pointer-events: none; }
.card-upload.is-busy .upload-label::before { content: ''; display: inline-block; width: 1em; height: 1em; margin-inline-end: 0.4rem; vertical-align: -0.15em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: cardSpin 0.7s linear infinite; }
.card-upload:focus-visible { outline: 3px solid rgba(122, 61, 118, 0.35); outline-offset: 2px; }
@keyframes cardSpin { to { transform: rotate(360deg); } }
/* Exam rooms page (teachers): «طالباتي في اللجان» */
.xr-ms { padding: 0; overflow: hidden; border-radius: 1.25rem; border: 1px solid rgba(122, 61, 118, 0.12); box-shadow: 0 6px 22px rgba(91, 43, 87, 0.07); }
.xr-ms-head { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; padding: 1rem 1.15rem; background: linear-gradient(135deg, #fbf7fb, #f4ecf4); }
.xr-ms-head::-webkit-details-marker { display: none; }
.xr-ms-head:hover .xr-ms-chev { background: var(--brand-primary); color: #fff; }
.xr-ms-icon { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; color: #fff; background: linear-gradient(135deg, #8d4a88, #5a2756); box-shadow: 0 6px 14px rgba(91, 43, 87, 0.25); }
.xr-ms-titles { display: flex; flex-direction: column; min-width: 0; flex: 1 1 180px; }
.xr-ms-title { font-weight: 900; font-size: 1.05rem; color: var(--brand-dark); }
.xr-ms-sub { font-size: 0.78rem; font-weight: 700; color: #8a7a89; }
.xr-ms-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.xr-ms-meter { display: flex; flex-direction: column; gap: 0.3rem; min-width: 118px; padding: 0.45rem 0.7rem; border-radius: 0.85rem; background: #fff; border: 1px solid rgba(122, 61, 118, 0.12); }
.xr-ms-meter-top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; font-size: 0.74rem; font-weight: 800; color: #6b5a6a; }
.xr-ms-meter-top b { font-size: 0.95rem; font-weight: 900; color: var(--brand-primary); }
.xr-ms-meter-top b small { font-size: 0.72rem; color: #9a8d99; }
.xr-ms-meter-bar { display: block; height: 6px; border-radius: 999px; background: #efe4ef; overflow: hidden; }
.xr-ms-meter-bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #c297c3, #7a3d76); }
.xr-ms-meter.is-done .xr-ms-meter-top b { color: #047857; }
.xr-ms-meter.is-done .xr-ms-meter-bar > span { background: linear-gradient(90deg, #6ee7b7, #10b981); }
.xr-ms-warn, .xr-ms-ok { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; font-weight: 900; padding: 0.4rem 0.75rem; border-radius: 999px; }
.xr-ms-warn { background: #fdecec; color: #b42318; }
.xr-ms-ok { background: #ecfdf5; color: #047857; }
.xr-ms-chev { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--brand-primary); background: #fff; border: 1px solid rgba(122, 61, 118, 0.15); transition: transform 0.2s, background 0.2s, color 0.2s; }
.xr-ms[open] .xr-ms-chev { transform: rotate(180deg); }
.xr-ms-body { padding: 0 1.15rem 1.1rem; border-top: 1px solid rgba(122, 61, 118, 0.1); }
.xr-ms-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.9rem 0 0.4rem; }
.xr-ms-tools input { max-width: 260px; border-radius: 999px; font-weight: 700; }
.xr-ms-session { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 0.9rem 0 0.45rem; padding-bottom: 0.35rem; border-bottom: 1px dashed rgba(122, 61, 118, 0.2); font-weight: 900; font-size: 0.85rem; color: var(--brand-primary); }
.xr-ms-session small { font-weight: 900; font-size: 0.72rem; min-width: 1.6rem; text-align: center; padding: 0.05rem 0.5rem; border-radius: 999px; background: #f4ecf4; color: var(--brand-primary); }
.xr-ms-row { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1fr); gap: 0.6rem; align-items: stretch; padding: 0.6rem; margin-bottom: 0.5rem; border-radius: 1rem; background: #fff; border: 1px solid rgba(122, 61, 118, 0.1); transition: box-shadow 0.15s, border-color 0.15s; }
.xr-ms-row:hover { border-color: rgba(122, 61, 118, 0.25); box-shadow: 0 4px 14px rgba(91, 43, 87, 0.08); }
.xr-ms-row.is-missing { border-color: #f6c9c0; }
.xr-ms-row[hidden], .xr-ms-session[hidden] { display: none; }
.xr-ms-who { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.xr-ms-avatar { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; overflow: hidden; display: block; object-fit: cover; }
.xr-ms-avatar .mav { display: block; width: 100%; height: 100%; }
.xr-ms-row.is-missing .xr-ms-avatar { box-shadow: 0 0 0 2px #f5a3a3; }
.xr-ms-whotext { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.xr-ms-whotext b { font-weight: 900; color: var(--brand-dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xr-ms-online { font-size: 0.68rem; font-weight: 800; background: #e8f3fb; color: #1d5f8c; border-radius: 999px; padding: 0 0.45rem; }
.xr-ms-cell { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.82rem; min-width: 0; padding: 0.5rem 0.65rem; border-radius: 0.8rem; background: #faf6fa; }
.xr-ms-cell.is-yes { background: #f0fbf6; }
.xr-ms-cell.is-no { background: #fff5f4; }
.xr-ms-cell.is-na { background: #f6f4f6; }
.xr-ms-cell.is-wait { background: #fffbeb; }
.xr-ms-wait { font-weight: 900; color: #b45309; }
[data-bs-theme="dark"] .xr-ms-cell.is-wait { background: rgba(245, 158, 11, 0.1); }
[data-bs-theme="dark"] .xr-ms-wait { color: #fbbf24; }
.xr-ms-kind { font-size: 0.7rem; font-weight: 900; color: #8a7a89; }
.xr-ms-yes { font-weight: 700; color: #3d1a3c; }
.xr-ms-yes b { font-weight: 900; }
.xr-ms-cell small { color: #6b5a6a; font-weight: 700; font-size: 0.74rem; }
.xr-ms-none { font-weight: 900; color: #b42318; }
.xr-ms-na { font-weight: 800; color: #8a7a89; }
@media (max-width: 767.98px) {
  .xr-ms-row { grid-template-columns: 1fr; }
  .xr-ms-stats { width: 100%; order: 3; }
  .xr-ms-meter { flex: 1 1 0; min-width: 0; }
  .xr-ms-warn, .xr-ms-ok { flex: 1 1 100%; justify-content: center; }
  .xr-ms-tools input { max-width: none; flex: 1 1 100%; }
}
[data-bs-theme="dark"] .xr-ms { border-color: var(--misk-border); }
[data-bs-theme="dark"] .xr-ms-head { background: rgba(255, 255, 255, 0.03); }
[data-bs-theme="dark"] .xr-ms-meter, [data-bs-theme="dark"] .xr-ms-chev, [data-bs-theme="dark"] .xr-ms-row { background: var(--bs-body-bg); border-color: var(--misk-border); }
[data-bs-theme="dark"] .xr-ms-meter-bar,[data-bs-theme="dark"] .xr-ms-session small { background: rgba(255, 255, 255, 0.08); }
[data-bs-theme="dark"] .xr-ms-cell { background: rgba(255, 255, 255, 0.04); }
[data-bs-theme="dark"] .xr-ms-cell.is-yes { background: rgba(16, 185, 129, 0.08); }
[data-bs-theme="dark"] .xr-ms-cell.is-no { background: rgba(239, 68, 68, 0.08); }
[data-bs-theme="dark"] .xr-ms-row.is-missing { border-color: rgba(239, 68, 68, 0.35); }
[data-bs-theme="dark"] .xr-ms-warn { background: rgba(239, 68, 68, 0.12); color: #fca5a5; }
[data-bs-theme="dark"] .xr-ms-ok { background: rgba(16, 185, 129, 0.12); color: #6ee7b7; }
[data-bs-theme="dark"] .xr-ms-title, [data-bs-theme="dark"] .xr-ms-whotext b, [data-bs-theme="dark"] .xr-ms-yes { color: var(--bs-body-color); }
[data-bs-theme="dark"] .xr-ms-cell small { color: var(--bs-secondary-color); }
/* Room form: the hall - from «القاعات» / new / none, and whether it is free at that time */
.xr-hall-mode { display: flex; flex-wrap: wrap; gap: 0.35rem; }
[data-hall-show][hidden] { display: none !important; }
.xr-newhall { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 0.8rem; padding: 0.6rem 0.75rem; border-radius: 0.85rem; background: #faf6fa; }
.xr-newhall-add { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0; font-weight: 800; font-size: 0.85rem; }
.xr-newhall [data-newhall-opts][hidden] { display: none; }
.xr-hall-status { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.55rem 0.8rem; border-radius: 0.85rem; font-weight: 800; font-size: 0.84rem; border: 1px solid transparent; }
.xr-hall-status[hidden] { display: none; }
.xr-hall-status.is-ok { background: #ecfdf5; border-color: #a7e3c9; }
.xr-hall-status.is-warn { background: #fff7e6; border-color: #f5deb0; }
.xr-hall-status.is-bad { background: #fdecec; border-color: #f3b4b4; }
.xr-hall-status.is-info { background: #f3eff7; }
.xr-hall-status .is-ok { color: #047857; } .xr-hall-status .is-warn { color: #b45309; } .xr-hall-status .is-bad { color: #b42318; } .xr-hall-status .is-info { color: #6b5a6a; }
/* «توزيع المعلمات»: the link to «القاعات»; a one-time hall in the list */
.xd-halls-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 1.1rem; text-decoration: none; color: var(--brand-dark); }
.xd-halls-link > i:first-child { font-size: 1.3rem; color: var(--brand-primary); }
.xd-halls-link b { display: block; font-weight: 900; }
.xd-halls-link small { font-weight: 700; color: #8a7a89; }
.xd-halls-link:hover { box-shadow: 0 8px 22px rgba(91, 43, 87, 0.12); color: var(--brand-dark); }
.xd-hall-line.is-once .xd-hall-name small { color: #1d5f8c; }
.xd-hall-when { margin-bottom: 0.2rem; }
[data-hall-show] [hidden], .xd-hall-row label[hidden] { display: none !important; }
[data-bs-theme="dark"] .xr-newhall { background: rgba(255, 255, 255, 0.04); }
[data-bs-theme="dark"] .xr-hall-status.is-ok { background: rgba(16, 185, 129, 0.08); border-color: #1f6f4f; }
[data-bs-theme="dark"] .xr-hall-status.is-warn { background: #2a2110; border-color: #5a4720; }
[data-bs-theme="dark"] .xr-hall-status.is-bad { background: #2a1414; border-color: #6b2a2a; }
[data-bs-theme="dark"] .xd-halls-link { color: var(--bs-body-color); }
/* Room form: hall dropdown - free halls green, the rest yellow */
#xrHallPick optgroup.is-free, #xrHallPick option.is-free { background: #ecfdf5; color: #047857; }
#xrHallPick optgroup.is-busy, #xrHallPick option.is-busy { background: #fff7e6; color: #8a5a00; }
#xrHallPick optgroup.is-unbooked, #xrHallPick option.is-unbooked { background: #eef6ff; color: #1d4ed8; }
[data-bs-theme="dark"] #xrHallPick optgroup.is-unbooked, [data-bs-theme="dark"] #xrHallPick option.is-unbooked { background: #0f1d33; color: #93c5fd; }
#xrHallPick optgroup { font-weight: 900; }
#xrHallPick option { font-weight: 700; }
[data-bs-theme="dark"] #xrHallPick optgroup.is-free, [data-bs-theme="dark"] #xrHallPick option.is-free { background: #0f2a20; color: #6ee7b7; }
[data-bs-theme="dark"] #xrHallPick optgroup.is-busy, [data-bs-theme="dark"] #xrHallPick option.is-busy { background: #2a2110; color: #f5d58a; }
/* Hall dropdown: the middle group - a committee is in it then (orange) */
#xrHallPick optgroup.is-taken, #xrHallPick option.is-taken { background: #fff1e6; color: #c2410c; }
[data-bs-theme="dark"] #xrHallPick optgroup.is-taken, [data-bs-theme="dark"] #xrHallPick option.is-taken { background: #2c1a10; color: #fdba74; }
/* «لجان الاختبارات» page tabs: exams (theory · practical) | tools (planning · halls).
   Laid out by the tab bar's OWN width (container query): one row when there is room, a 2 × 2 grid when narrow
   (phones, or a narrow content area); groups also wrap as a fallback. */
.xr-page-tabs { container-type: inline-size; display: flex; flex-wrap: wrap; align-items: stretch; gap: 0.5rem; padding: 0.35rem; border-radius: 1.1rem; background: rgba(122, 61, 118, 0.07); border: 1px solid rgba(122, 61, 118, 0.12); }
.xr-page-tabs-group { flex: 1 1 230px; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.3rem; }
.xr-page-tabs-group.is-tools { position: relative; padding-inline-start: 0.5rem; }
.xr-page-tabs-group.is-tools::before { content: ''; position: absolute; inset-inline-start: 0; top: 18%; bottom: 18%; width: 1px; background: rgba(122, 61, 118, 0.2); }
.xr-page-tabs a { display: flex; align-items: center; justify-content: center; gap: 0.4rem; min-width: 0; min-height: 44px; padding: 0.45rem 0.5rem; border-radius: 0.8rem; font-weight: 900; font-size: 0.9rem; color: #6b5a6a; text-decoration: none; text-align: center; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background 0.15s, color 0.15s; }
.xr-page-tabs a i { font-size: 1rem; flex-shrink: 0; }
.xr-page-tabs a:hover { color: var(--brand-primary); background: rgba(255, 255, 255, 0.6); }
.xr-page-tabs a.active { background: var(--brand-primary); color: #fff; box-shadow: 0 4px 12px rgba(122, 61, 118, 0.25); }
.xr-page-tabs-group.is-tools a:not(.active) { color: #7d6a7b; }
@container (max-width: 520px) {
  .xr-page-tabs-group { flex-basis: 100%; }
  .xr-page-tabs-group.is-tools { padding-inline-start: 0; padding-top: 0.3rem; border-top: 1px solid rgba(122, 61, 118, 0.15); }
  .xr-page-tabs-group.is-tools::before { display: none; }
  .xr-page-tabs a { min-height: 42px; font-size: 0.86rem; padding: 0.4rem 0.3rem; }
}
@media (max-width: 575.98px) {
  .xr-page-tabs { gap: 0.3rem; padding: 0.3rem; }
  .xr-page-tabs-group { flex-basis: 100%; }
  .xr-page-tabs-group.is-tools { padding-inline-start: 0; padding-top: 0.3rem; border-top: 1px solid rgba(122, 61, 118, 0.15); }
  .xr-page-tabs-group.is-tools::before { display: none; }
}
/* Always two rows: the exam types (النظري · العملي) on top, the three tools (تخطيط اللجان · القاعات · توزيع المعلمات) under them. */
.xr-page-tabs { gap: 0.3rem; }
.xr-page-tabs-group { flex-basis: 100%; }
.xr-page-tabs-group.is-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-inline-start: 0; padding-top: 0.3rem; border-top: 1px solid rgba(122, 61, 118, 0.15); }
.xr-page-tabs-group.is-tools::before { display: none; }
.xr-page-tabs-group.is-tools a { min-height: 40px; font-size: 0.86rem; }
.xr-page-tabs.is-online .xr-page-tabs-group { grid-template-columns: repeat(3, minmax(0, 1fr)); } /* the three online steps */
/* phones: three tabs side by side don't fit in one line - the number and icon on top, the name under it (wrapping, never cut) */
@media (max-width: 575.98px) {
    .xr-page-tabs.is-online a { flex-direction: column; gap: 0.15rem; white-space: normal; overflow: visible; text-overflow: clip; font-size: 0.8rem; line-height: 1.25; padding: 0.45rem 0.25rem; min-height: 56px; }
    .xr-page-tabs.is-online a .av-step-num { font-size: 0.75rem; opacity: 0.85; }
}
@media (max-width: 420px) { .xr-page-tabs-group.is-tools a { font-size: 0.78rem; gap: 0.25rem; padding-inline: 0.2rem; } }
[data-bs-theme="dark"] .xr-page-tabs { background: rgba(255, 255, 255, 0.05); border-color: var(--misk-border); }
[data-bs-theme="dark"] .xr-page-tabs a:not(.active) { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] .xr-page-tabs a:hover:not(.active) { background: rgba(255, 255, 255, 0.06); }

/* «إنشاء الحسابات الجديدة» switch (control panel, includes/cp-signup-switch.php): a settings row + on/off switch */
.cp-signup-switch { flex-direction: row; align-items: center; gap: 0.85rem; padding: 0.8rem 1rem; }
.cp-signup-icon { width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; background: rgba(16, 185, 129, 0.12); color: #059669; transition: background .2s, color .2s; }
.cp-signup-switch.is-closed .cp-signup-icon { background: rgba(239, 68, 68, 0.1); color: #dc2626; }
.cp-signup-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.45; }
.cp-signup-text b { font-size: 0.95rem; }
.cp-signup-text small { color: var(--bs-secondary-color, #6b7280); font-weight: 700; font-size: 0.78rem; }
.cp-signup-toggle { flex-shrink: 0; display: inline-flex; align-items: center; gap: 0.55rem; background: none; border: 0; padding: 0.25rem; border-radius: 999px; cursor: pointer; }
.cp-signup-toggle:focus-visible { outline: 3px solid rgba(154, 82, 148, 0.35); outline-offset: 2px; }
.cp-signup-label { font-weight: 900; font-size: 0.85rem; color: #059669; min-width: 3.2em; text-align: center; }
.cp-signup-switch.is-closed .cp-signup-label { color: #dc2626; }
.cp-signup-track { position: relative; width: 50px; height: 28px; border-radius: 999px; background: #10b981; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15); transition: background .2s; }
.cp-signup-switch.is-closed .cp-signup-track { background: #d1d5db; }
.cp-signup-knob { position: absolute; top: 3px; inset-inline-start: 25px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: inset-inline-start .2s; }
.cp-signup-switch.is-closed .cp-signup-knob { inset-inline-start: 3px; }
.cp-signup-toggle:hover .cp-signup-track { filter: brightness(0.95); }
[data-bs-theme="dark"] .cp-signup-switch.is-closed .cp-signup-track { background: #4b5563; }
@media (max-width: 575.98px) {
    .cp-signup-switch { padding: 0.7rem 0.8rem; gap: 0.65rem; }
    .cp-signup-icon { width: 36px; height: 36px; font-size: 1.1rem; }
    .cp-signup-label { display: none; }
}

/* Semester Record › Overview: students who haven't activated - name · WhatsApp · "sent" tick (cp-assign-overview.php) */
.cp-act-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.9rem 0 0.6rem; }
.cp-act-filter { display: inline-flex; background: #f3f4f6; border-radius: 999px; padding: 3px; gap: 2px; }
.cp-act-filter button { border: 0; background: none; border-radius: 999px; padding: 0.3rem 0.8rem; font-size: 0.8rem; font-weight: 800; color: #6b7280; }
.cp-act-filter button b { font-weight: 900; margin-inline-start: 0.2rem; }
.cp-act-filter button.active { background: #fff; color: var(--brand-dark, #3b1f39); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.cp-act-search { flex: 1 1 200px; max-width: 320px; }
.cp-act-list { list-style: none; counter-reset: act; margin: 0; padding: 0; max-height: 520px; overflow-y: auto; border: 1px solid var(--misk-border, #eee); border-radius: 12px; }
.cp-act-row { counter-increment: act; display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--misk-border, #f0f0f0); transition: background .15s; }
.cp-act-row:last-child { border-bottom: 0; }
.cp-act-row::before { content: counter(act); min-width: 1.8em; text-align: center; font-size: 0.75rem; font-weight: 800; color: #9ca3af; }
.cp-act-row.is-sent { background: rgba(16, 185, 129, 0.06); }
.cp-act-name { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.cp-act-name b { font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-act-name small { color: #9ca3af; font-weight: 700; font-size: 0.72rem; text-align: start; }
.cp-act-wa { flex-shrink: 0; display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.75rem; border-radius: 999px; background: #25d366; color: #fff; font-weight: 800; font-size: 0.8rem; text-decoration: none; }
.cp-act-wa:hover { background: #1ebe5b; color: #fff; }
.cp-act-nowa { flex-shrink: 0; font-size: 0.72rem; font-weight: 700; color: #dc2626; }
.cp-act-tick { flex-shrink: 0; display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; margin: 0; min-width: 5.2em; }
.cp-act-tick input { position: absolute; opacity: 0; pointer-events: none; }
.cp-act-tick-box { width: 24px; height: 24px; border-radius: 7px; border: 2px solid #d1d5db; display: grid; place-items: center; color: transparent; background: #fff; transition: all .15s; }
.cp-act-tick input:checked + .cp-act-tick-box { background: #10b981; border-color: #10b981; color: #fff; }
.cp-act-tick input:focus-visible + .cp-act-tick-box { outline: 3px solid rgba(16, 185, 129, 0.35); outline-offset: 1px; }
.cp-act-tick input:disabled + .cp-act-tick-box { opacity: 0.6; }
.cp-act-tick-text { font-size: 0.75rem; font-weight: 800; color: #9ca3af; }
.cp-act-row.is-sent .cp-act-tick-text { color: #059669; }
.cp-act-empty { text-align: center; color: #9ca3af; font-weight: 700; margin: 1rem 0 0; }
[data-bs-theme="dark"] .cp-act-filter { background: rgba(255, 255, 255, 0.06); }
[data-bs-theme="dark"] .cp-act-filter button.active { background: rgba(255, 255, 255, 0.12); color: #fff; }
[data-bs-theme="dark"] .cp-act-tick-box { background: transparent; border-color: #4b5563; }
@media (max-width: 575.98px) {
    .cp-act-row { gap: 0.5rem; padding: 0.55rem 0.5rem; }
    .cp-act-row::before { display: none; }
    .cp-act-wa span, .cp-act-tick-text { display: none; }
    .cp-act-wa { padding: 0.4rem 0.6rem; }
    .cp-act-tick { min-width: 0; }
    .cp-act-search { max-width: none; }
}

/* Practical rooms: filter all / «مبتدئة وتمهيدية» / «متقدمة» (cp-exam-rooms.php) */
.xr-track-filter { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.xr-track-filter button { display: inline-flex; align-items: center; gap: 0.35rem; border: 1.5px solid rgba(122, 61, 118, 0.15); background: #fff; color: #5b4a5a; border-radius: 999px; padding: 0.4rem 0.95rem; font-weight: 800; font-size: 0.85rem; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.xr-track-filter button b { font-weight: 900; }
.xr-track-filter button:hover { border-color: rgba(122, 61, 118, 0.35); }
.xr-track-filter button.active { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.xr-track-filter button.is-basic.active { background: #1f6f71; border-color: #1f6f71; }
.xr-track-filter button.is-advanced.active { background: #6b3f8f; border-color: #6b3f8f; }
[data-bs-theme="dark"] .xr-track-filter button:not(.active) { background: transparent; color: inherit; }
.xr-track-off { display: none !important; }
@media (max-width: 575.98px) {
    .xr-track-filter { display: grid; grid-template-columns: 1fr 1fr; }
    .xr-track-filter button { justify-content: center; }
    .xr-track-filter button[data-track-filter="all"] { grid-column: 1 / -1; }
}

/* «تحدي التفعيل» per session (includes/cp-activation-challenge.php) */
.cp-ch-deadline { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; font-weight: 800; color: #b45309; background: rgba(234, 179, 8, 0.12); border-radius: 999px; padding: 0.25rem 0.75rem; }
.cp-ch-deadline.is-over { color: #6b7280; background: #f3f4f6; }
.cp-ch-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin: 0.9rem 0; }
.cp-ch-summary > div { background: #faf7fa; border-radius: 12px; padding: 0.6rem; text-align: center; }
.cp-ch-summary > div:first-child { background: rgba(234, 179, 8, 0.12); }
.cp-ch-summary b { display: block; font-size: 1.4rem; font-weight: 900; line-height: 1.2; }
.cp-ch-summary small { font-weight: 700; color: #6b7280; font-size: 0.75rem; }
.cp-ch-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; }
.cp-ch-deadline-form { display: flex; flex-wrap: wrap; align-items: end; gap: 0.5rem; margin-bottom: 0.6rem; }
.cp-ch-deadline-form label { display: flex; flex-direction: column; gap: 0.2rem; }
.cp-ch-list { list-style: none; margin: 0; padding: 0; max-height: 560px; overflow-y: auto; border: 1px solid var(--misk-border, #eee); border-radius: 12px; }
.cp-ch-row { padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--misk-border, #f0f0f0); }
.cp-ch-row:last-child { border-bottom: 0; }
.cp-ch-row.is-won { background: rgba(234, 179, 8, 0.07); }
.cp-ch-main { display: flex; align-items: center; gap: 0.7rem; }
.cp-ch-name { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.cp-ch-name b { font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-ch-name small { color: #9ca3af; font-weight: 700; font-size: 0.72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-ch-progress { flex: 0 0 90px; height: 7px; border-radius: 999px; background: #e5e7eb; overflow: hidden; }
.cp-ch-progress span { display: block; height: 100%; background: #10b981; border-radius: inherit; }
.cp-ch-row.is-won .cp-ch-progress span { background: #eab308; }
.cp-ch-count { flex-shrink: 0; min-width: 3.2em; text-align: center; font-weight: 900; font-size: 0.82rem; }
.cp-ch-chip { flex-shrink: 0; min-width: 5.6em; text-align: center; border-radius: 999px; padding: 0.2rem 0.6rem; font-size: 0.75rem; font-weight: 800; background: #f3f4f6; color: #6b7280; }
.cp-ch-chip.is-won { background: #fef3c7; color: #92400e; }
.cp-ch-who { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.4rem; }
.cp-ch-who span { font-size: 0.72rem; font-weight: 700; background: #fff1f2; color: #be123c; border-radius: 999px; padding: 0.1rem 0.55rem; }
.cp-ch-who span.is-late { background: #f3f4f6; color: #6b7280; }
[data-bs-theme="dark"] .cp-ch-summary > div { background: rgba(255, 255, 255, 0.05); }
[data-bs-theme="dark"] .cp-ch-chip, [data-bs-theme="dark"] .cp-ch-deadline.is-over { background: rgba(255, 255, 255, 0.08); color: #d1d5db; }
@media (max-width: 575.98px) {
    .cp-ch-progress { display: none; }
    .cp-ch-row { padding: 0.55rem; }
    .cp-ch-main { gap: 0.45rem; }
    .cp-ch-chip { min-width: 0; }
}

/* «تحدي التفعيل» on the teacher's homepage (includes/home-activation-challenge.php) */
.hc-card { position: relative; border-radius: 22px; padding: 1.25rem; background: linear-gradient(135deg, #fffbeb 0%, #fff 55%, #fdf4ff 100%); border: 1.5px solid #fde68a; box-shadow: 0 8px 24px rgba(180, 83, 9, 0.08); }
.hc-head { display: flex; gap: 0.8rem; align-items: flex-start; }
.hc-trophy { font-size: 2.2rem; line-height: 1; flex-shrink: 0; filter: drop-shadow(0 3px 6px rgba(234, 179, 8, 0.35)); }
.hc-title b { display: block; font-size: 1.1rem; font-weight: 900; color: #92400e; }
.hc-title p { margin: 0.3rem 0 0; font-weight: 700; color: #57534e; line-height: 1.9; font-size: 0.92rem; }
.hc-title p b { display: inline; font-size: inherit; color: #b45309; }
.hc-countdown { display: flex; justify-content: center; align-items: flex-start; gap: 0.4rem; margin: 1rem 0 0.4rem; direction: ltr; }
.hc-countdown > div { min-width: 72px; background: #fff; border: 1px solid #fde68a; border-radius: 14px; padding: 0.45rem 0.4rem; text-align: center; }
.hc-countdown b { display: block; font-size: 1.7rem; font-weight: 900; color: #b45309; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hc-countdown small { font-size: 0.7rem; font-weight: 800; color: #a8a29e; }
.hc-countdown > span { font-size: 1.5rem; font-weight: 900; color: #fbbf24; padding-top: 0.35rem; }
.hc-ended { text-align: center; font-weight: 800; color: #6b7280; background: #f3f4f6; border-radius: 999px; padding: 0.35rem; margin: 1rem 0 0.4rem; }
.hc-session { margin-top: 0.9rem; background: #fff; border: 1px solid #f1e8d0; border-radius: 16px; padding: 0.85rem 1rem; }
.hc-session.is-won { border-color: #fcd34d; background: #fffbeb; }
.hc-session-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.hc-session-top b { font-weight: 900; }
.hc-count { font-weight: 800; font-size: 0.85rem; color: #059669; }
.hc-bar { height: 9px; border-radius: 999px; background: #e5e7eb; overflow: hidden; margin: 0.5rem 0; }
.hc-bar span { display: block; height: 100%; background: linear-gradient(90deg, #10b981, #34d399); border-radius: inherit; }
.hc-session.is-won .hc-bar span { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.hc-won { margin: 0; font-weight: 800; color: #92400e; }
.hc-left-title { margin: 0 0 0.4rem; font-weight: 800; font-size: 0.85rem; color: #57534e; }
.hc-left { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.4rem; }
.hc-left li { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; background: #fff1f2; border-radius: 12px; padding: 0.35rem 0.4rem 0.35rem 0.7rem; font-weight: 800; font-size: 0.85rem; color: #9f1239; }
[dir="rtl"] .hc-left li { padding: 0.35rem 0.7rem 0.35rem 0.4rem; }
.hc-left li small { color: #6b7280; font-weight: 700; }
.hc-wa { flex-shrink: 0; display: inline-flex; align-items: center; gap: 0.25rem; background: #25d366; color: #fff; border-radius: 999px; padding: 0.2rem 0.65rem; font-size: 0.75rem; font-weight: 800; text-decoration: none; }
.hc-wa:hover { background: #1ebe5b; color: #fff; }
[data-bs-theme="dark"] .hc-card { background: linear-gradient(135deg, rgba(234, 179, 8, 0.12), rgba(255, 255, 255, 0.03)); border-color: rgba(234, 179, 8, 0.35); }
[data-bs-theme="dark"] .hc-title b, [data-bs-theme="dark"] .hc-won { color: #fcd34d; }
[data-bs-theme="dark"] .hc-title p, [data-bs-theme="dark"] .hc-left-title { color: #d6d3d1; }
[data-bs-theme="dark"] .hc-countdown > div, [data-bs-theme="dark"] .hc-session { background: rgba(255, 255, 255, 0.04); border-color: rgba(234, 179, 8, 0.25); }
[data-bs-theme="dark"] .hc-countdown b { color: #fcd34d; }
[data-bs-theme="dark"] .hc-left li { background: rgba(244, 63, 94, 0.12); color: #fda4af; }
@media (max-width: 575.98px) {
    .hc-card { padding: 1rem; border-radius: 18px; }
    .hc-trophy { font-size: 1.8rem; }
    .hc-countdown > div { min-width: 0; flex: 1; }
    .hc-countdown b { font-size: 1.45rem; }
    .hc-left { grid-template-columns: 1fr; }
}
/* Homepage: «لجانكِ في الاختبارات النهائية» (teachers) and «اطلاع المعلمات على لجان الاختبارات» (admins) - includes/home-exam-acks.php */
.xa-card { display: block; background: var(--bs-body-bg, #fff); border-radius: 1.25rem; border: 1px solid rgba(122, 61, 118, 0.14); box-shadow: 0 6px 22px rgba(91, 43, 87, 0.07); overflow: hidden; }
.xa-head { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem 1rem; padding: 1rem 1.15rem; background: linear-gradient(135deg, #fbf7fb, #f4ecf4); }
.xa-head::-webkit-details-marker { display: none; }
.xa-head:hover .xa-chev { background: var(--brand-primary); color: #fff; }
.xa-icon { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; color: #fff; background: linear-gradient(135deg, #8d4a88, #5a2756); box-shadow: 0 6px 14px rgba(91, 43, 87, 0.25); }
.xa-icon-img { padding: 0; object-fit: contain; background: none; box-shadow: none; border-radius: 0; filter: drop-shadow(0 3px 6px rgba(91, 43, 87, 0.2)); }
/* The roll call: the «yessir» cat as decoration beside the question; the answer is «Yessir! 🫡» */
.xa-ask { display: flex; align-items: center; justify-content: center; gap: 1.5rem; padding: 0.9rem 1.2rem; border-radius: 1rem; background: linear-gradient(135deg, #fbf7fb, #f3e9f3); border: 1px dashed rgba(122, 61, 118, 0.25); }
.xa-ask.is-seen { background: linear-gradient(135deg, #f3fbf7, #e7f6ee); border: 1px solid rgba(16, 185, 129, 0.25); padding: 0.6rem 1rem; }
.xa-ask-text { display: flex; flex-direction: column; align-items: flex-start; gap: 0.55rem; min-width: 0; }
.xa-ask-text b { font-weight: 900; font-size: 1.05rem; line-height: 1.6; color: var(--brand-dark); }
.xa-ask.is-seen .xa-ask-text { gap: 0.15rem; }
.xa-ask.is-seen .xa-ask-text b { color: #047857; }
.xa-ask-text small { font-weight: 800; font-size: 0.8rem; color: #8a7a89; }
img.xa-yes { flex: 0 0 auto; width: 140px; height: 140px; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(91, 43, 87, 0.22)); transform-origin: 50% 90%; animation: xaSalute 2.8s ease-in-out infinite; }
img.xa-yes.is-answered { width: 76px; height: 76px; animation: none; filter: drop-shadow(0 4px 8px rgba(5, 150, 105, 0.18)); }
.xa-answers { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.xa-answered { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.3rem 1rem 0.3rem 0.3rem; border-radius: 999px; font-weight: 900; font-size: 0.85rem; color: #047857; background: #ecfdf5; }
.xa-answer { display: inline-flex; align-items: center; gap: 0.65rem; line-height: 1.2; border: 0; border-radius: 999px; padding: 0.3rem 1.25rem 0.3rem 0.3rem; font-weight: 900; font-size: 1.05rem; letter-spacing: 0.02em; color: #fff; background: linear-gradient(135deg, #8d4a88, #5a2756); box-shadow: 0 6px 16px rgba(91, 43, 87, 0.28); transition: transform 0.15s, filter 0.15s, box-shadow 0.15s; }
.xa-answer-kind { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.8rem; border-radius: 999px; background: #fff; color: var(--brand-primary); font-size: 0.9rem; font-weight: 900; letter-spacing: 0; }
.xa-answered .xa-answer-kind { color: #047857; box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.25); }
.xa-answer-yes { white-space: nowrap; }
[dir="rtl"] .xa-answer, [dir="rtl"] .xa-answered { padding: 0.3rem 0.3rem 0.3rem 1.25rem; }
.xa-answer:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 9px 20px rgba(91, 43, 87, 0.32); }
.xa-answer:active { transform: translateY(0); }
.xa-answer:focus-visible { outline: 3px solid rgba(194, 151, 195, 0.8); outline-offset: 3px; }
.xa-answer.is-saving { opacity: 0.75; transform: scale(0.97); cursor: progress; }
.xa-pop { animation: xaPop 0.38s cubic-bezier(.34, 1.56, .64, 1); }
.xa-ask { transition: opacity 0.22s, transform 0.22s; }
.xa-ask.is-leaving { opacity: 0; transform: translateY(6px); }
img.xa-yes.is-saluting { animation: xaSaluteBig 0.7s ease-in-out; }
@keyframes xaPop { 0% { opacity: 0; transform: scale(0.85); } 100% { opacity: 1; transform: scale(1); } }
@keyframes xaSaluteBig { 0%, 100% { transform: rotate(0) scale(1); } 30% { transform: rotate(-10deg) scale(1.08); } 60% { transform: rotate(6deg) scale(1.04); } }
@keyframes xaSalute { 0%, 78%, 100% { transform: rotate(0); } 85% { transform: rotate(-5deg); } 92% { transform: rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { img.xa-yes, img.xa-yes.is-saluting, .xa-pop { animation: none; } .xa-answer, .xa-ask { transition: none; } }
.xa-titles { display: flex; flex-direction: column; min-width: 0; flex: 1 1 200px; }
.xa-titles b { font-weight: 900; font-size: 1.05rem; color: var(--brand-dark); }
.xa-titles small { font-size: 0.8rem; font-weight: 700; color: #8a7a89; }
.xa-progress { font-size: 0.8rem; font-weight: 900; padding: 0.35rem 0.8rem; border-radius: 999px; background: #fff4e5; color: #b45309; }
.xa-progress.is-done { background: #ecfdf5; color: #047857; }
.xa-progress.is-warn { background: #fdecec; color: #b42318; }
.xa-chev { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--brand-primary); background: #fff; border: 1px solid rgba(122, 61, 118, 0.15); transition: transform 0.2s, background 0.2s, color 0.2s; }
.xa-card[open] .xa-chev { transform: rotate(180deg); }
.xa-head-end { display: inline-flex; align-items: center; gap: 0.5rem; margin-inline-start: auto; flex: 0 0 auto; }
.xa-progress-short { display: none; }
.xa-progress-short .bi { font-size: 0.85em; }
@media (max-width: 575.98px) {
  /* Phone: icon · title · [count + arrow] on one line - the count and arrow at the end (left in Arabic). */
  #xrAck .xa-head { flex-wrap: nowrap; gap: 0.6rem; padding: 0.8rem 0.85rem; }
  #xrAck .xa-icon { width: 40px; height: 40px; font-size: 1.1rem; }
  #xrAck .xa-titles { flex: 1 1 0; }
  #xrAck .xa-titles b { font-size: 0.98rem; }
  #xrAck .xa-titles small { font-size: 0.74rem; }
  #xrAck .xa-progress { padding: 0.3rem 0.6rem; }
  #xrAck .xa-progress-long { display: none; }
  #xrAck .xa-progress-short { display: inline-flex; align-items: center; gap: 0.2rem; }
  #xrAck .xa-chev { width: 30px; height: 30px; }
}
.xa-body { padding: 1rem 1.15rem 1.15rem; border-top: 1px solid rgba(122, 61, 118, 0.1); display: flex; flex-direction: column; gap: 0.85rem; }
.xa-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 0.85rem; align-items: start; }
.xa-kind { display: flex; flex-direction: column; border-radius: 1rem; border: 1px solid rgba(122, 61, 118, 0.12); padding: 0.85rem; background: #fff; }
.xa-kind.is-pending, .xa-kind.is-changed { border-top: 3px solid #f59e0b; }
.xa-kind.is-seen { border-top: 3px solid #10b981; }
.xa-kind-head { display: flex; align-items: center; gap: 0.6rem; padding-bottom: 0.65rem; margin-bottom: 0.65rem; border-bottom: 1px solid rgba(122, 61, 118, 0.08); }
.xa-kind-icon { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--brand-primary); background: #f4ecf4; font-size: 1.05rem; }
.xa-kind-title { flex: 1 1 auto; min-width: 0; font-weight: 900; color: var(--brand-dark); display: flex; flex-direction: column; line-height: 1.3; }
.xa-kind-title i { color: var(--brand-primary); }
.xa-kind-title small { font-weight: 800; font-size: 0.74rem; color: #9a8d99; }
.xa-state { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; font-weight: 900; padding: 0.25rem 0.7rem; border-radius: 999px; }
.xa-state small { font-weight: 700; opacity: 0.85; }
.xa-state.is-seen { background: #ecfdf5; color: #047857; }
.xa-state.is-pending { background: #fff4e5; color: #b45309; }
.xa-state.is-changed { background: #fdecec; color: #b42318; }
.xa-rooms { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; max-height: 330px; overflow-y: auto; }
.xa-rooms li { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.55rem 0.65rem; border-radius: 0.85rem; background: #faf6fa; }
.xa-room-main { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.xa-room-main b { font-weight: 900; font-size: 0.86rem; color: var(--brand-dark); }
.xa-room-time { font-weight: 800; color: var(--brand-primary); margin-inline-start: 0.25rem; }
.xa-room-main small { font-size: 0.75rem; font-weight: 700; color: #6b5a6a; }
.xa-kind-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.75rem; }
.xa-more { font-weight: 800; font-size: 0.82rem; color: var(--brand-primary); text-decoration: none; }
.xa-more:hover { text-decoration: underline; }
.xa-meter { display: flex; flex-direction: column; gap: 0.3rem; min-width: 130px; padding: 0.45rem 0.7rem; border-radius: 0.85rem; background: #fff; border: 1px solid rgba(122, 61, 118, 0.12); }
.xa-meter-top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; font-size: 0.74rem; font-weight: 800; color: #6b5a6a; }
.xa-meter-top b { font-size: 0.95rem; font-weight: 900; color: #047857; }
.xa-meter-top b small { font-size: 0.72rem; color: #9a8d99; }
.xa-meter-bar { display: block; height: 6px; border-radius: 999px; background: #efe4ef; overflow: hidden; }
.xa-meter-bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6ee7b7, #10b981); }
.xa-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.xa-tools input { max-width: 240px; border-radius: 999px; font-weight: 700; }
.xa-msg { border-radius: 1rem; border: 1px dashed rgba(122, 61, 118, 0.3); background: #fbf7fb; padding: 0.7rem; display: flex; flex-direction: column; gap: 0.5rem; }
.xa-msg-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; font-weight: 900; font-size: 0.85rem; color: var(--brand-dark); }
.xa-msg-head i { color: var(--brand-primary); }
.xa-msg-head .xa-wa-share i, .xa-msg-head .btn i { color: inherit; }
.xa-msg textarea { font-size: 0.82rem; font-weight: 600; resize: vertical; background: #fff; }
.xa-wa-share { background: #25d366; border-color: #25d366; }
.xa-wa-share:hover { background: #1ebe5b; }
.xa-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.xa-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.8rem; padding: 0.5rem 0.65rem; border-radius: 0.9rem; background: #fff; border: 1px solid rgba(122, 61, 118, 0.1); }
.xa-row[hidden] { display: none; }
.xa-row.is-done { background: #f7fcf9; }
.xa-who { display: flex; align-items: center; gap: 0.55rem; flex: 1 1 200px; min-width: 0; }
.xa-who b { font-weight: 900; color: var(--brand-dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xa-avatar { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; overflow: hidden; display: block; object-fit: cover; }
.xa-avatar .mav { display: block; width: 100%; height: 100%; }
.xa-row.is-done .xa-avatar { box-shadow: 0 0 0 2px #6ee7b7; }
.xa-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.xa-chip { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.76rem; font-weight: 900; padding: 0.2rem 0.6rem; border-radius: 999px; }
.xa-chip small { font-weight: 700; opacity: 0.8; }
.xa-chip.is-seen { background: #ecfdf5; color: #047857; }
.xa-chip.is-pending { background: #fdecec; color: #b42318; }
.xa-chip.is-changed { background: #fff4e5; color: #b45309; }
.xa-chip.is-none { background: #f3f1f3; color: #9a8d99; }
@media (max-width: 575.98px) { .xa-meter { flex: 1 1 100%; } .xa-tools input { max-width: none; flex: 1 1 100%; } .xa-kinds { grid-template-columns: 1fr; } .xa-rooms { max-height: none; } .xa-ask:not(.is-seen) { flex-direction: column; text-align: center; } .xa-ask:not(.is-seen) .xa-ask-text { align-items: center; } img.xa-yes:not(.is-answered) { width: 124px; height: 124px; } .xa-answers, .xa-answers form, .xa-answer, .xa-answered { width: 100%; justify-content: center; } }
.xa-more { display: inline-block; margin-top: auto; padding-top: 0.6rem; }
[data-bs-theme="dark"] .xa-ask { background: rgba(255, 255, 255, 0.04); border-color: var(--misk-border); }
[data-bs-theme="dark"] .xa-ask.is-seen { background: rgba(16, 185, 129, 0.08); }
[data-bs-theme="dark"] .xa-kind-icon { background: rgba(255, 255, 255, 0.08); }
[data-bs-theme="dark"] .xa-answered { background: rgba(16, 185, 129, 0.12); color: #6ee7b7; }
[data-bs-theme="dark"] .xa-answer-kind { background: rgba(255, 255, 255, 0.92); }
[data-bs-theme="dark"] .xa-kind-head { border-color: var(--misk-border); }
[data-bs-theme="dark"] .xa-ask-text b { color: var(--bs-body-color); }
[data-bs-theme="dark"] .xa-ask.is-seen .xa-ask-text b { color: #6ee7b7; }
[data-bs-theme="dark"] .xa-card { border-color: var(--misk-border); }
[data-bs-theme="dark"] .xa-head, [data-bs-theme="dark"] .xa-msg { background: rgba(255, 255, 255, 0.03); }
[data-bs-theme="dark"] .xa-kind, [data-bs-theme="dark"] .xa-row, [data-bs-theme="dark"] .xa-meter, [data-bs-theme="dark"] .xa-chev, [data-bs-theme="dark"] .xa-msg textarea { background: var(--bs-body-bg); border-color: var(--misk-border); }
[data-bs-theme="dark"] .xa-rooms li, [data-bs-theme="dark"] .xa-row.is-done { background: rgba(255, 255, 255, 0.04); }
[data-bs-theme="dark"] .xa-meter-bar, [data-bs-theme="dark"] .xa-chip.is-none { background: rgba(255, 255, 255, 0.08); }
[data-bs-theme="dark"] .xa-titles b, [data-bs-theme="dark"] .xa-kind-title, [data-bs-theme="dark"] .xa-room-main b, [data-bs-theme="dark"] .xa-who b, [data-bs-theme="dark"] .xa-msg-head { color: var(--bs-body-color); }
[data-bs-theme="dark"] .xa-room-main small, [data-bs-theme="dark"] .xa-titles small { color: var(--bs-secondary-color); }

/* Exam rooms (students): each room card shows its own day and date, not only the day group's header. */
.xr-card-date, .xr-card-date b { color: var(--brand-primary); font-weight: 800; }

/* ===== «أوقاتي المتاحة للجان عن بعد» (exam-availability.php, includes/home-exam-availability.php, includes/cp-exam-availability.php) ===== */
.av-page { max-width: 1100px; padding-bottom: 6rem !important; }
.av-hero { display: flex; align-items: center; gap: 1rem; background: linear-gradient(135deg, #8a4486, #3d1a3c); color: #fff; border-radius: 1.5rem; padding: 1.25rem 1.5rem; }
.av-hero h1 { font-size: clamp(1.15rem, 3.4vw, 1.6rem); font-weight: 900; margin: 0; }
.av-hero p { margin: 0.2rem 0 0; font-weight: 700; opacity: 0.9; }
.av-hero-icon { flex: 0 0 auto; width: 54px; height: 54px; border-radius: 1rem; background: rgba(255, 255, 255, 0.16); display: grid; place-items: center; font-size: 1.6rem; }
.av-banner { display: flex; gap: 0.5rem; align-items: flex-start; border-radius: 1rem; padding: 0.75rem 1rem; font-weight: 800; font-size: 0.92rem; }
.av-banner.is-saved { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.av-banner.is-closed { background: #fff7e6; color: #8a5a00; border: 1px solid #f5deb0; }
.av-banner.is-preview { background: #eef6fb; color: #1d5f8c; border: 1px solid #bfdcef; }
.av-intro { padding: 1.1rem 1.3rem; }
.av-intro > b { font-size: 1.1rem; font-weight: 900; color: var(--brand-primary); }
.av-heart { color: #c0498a; font-size: 0.95rem; } /* the site's heart colour (.footer-dev-credit i) */
.av-intro p { margin: 0.4rem 0 0.6rem; font-weight: 700; line-height: 1.7; }
.av-intro ul { list-style: none; padding: 0; margin: 0 0 0.6rem; display: grid; gap: 0.35rem; }
.av-intro li { display: flex; gap: 0.5rem; font-weight: 700; font-size: 0.92rem; }
.av-intro li i { color: var(--brand-primary); }
.av-intro small { color: var(--brand-primary); font-weight: 800; }
.av-week { margin: 1.4rem 0 0.8rem; }
/* the weekly timetable: days across, times down */
.av-tip { font-weight: 700; font-size: 0.88rem; color: #6b5a6a; margin: 0 0 0.25rem; display: flex; gap: 0.4rem; }
.av-tip i { color: var(--brand-primary); }
.av-sched-card { padding: 0.5rem; }
.av-sched-scroll { overflow-x: auto; }
.av-sched { width: 100%; min-width: 560px; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.av-sched .av-corner { width: 108px; text-align: center; color: #a091a0; font-weight: 800; vertical-align: bottom; }
.av-head { width: 100%; border: 0; background: #f6eef6; border-radius: 0.7rem; padding: 0.35rem 0.2rem; display: flex; flex-direction: column; align-items: center; line-height: 1.25; color: var(--brand-dark); }
.av-head b { font-weight: 900; font-size: 0.85rem; }
.av-head small { font-weight: 700; font-size: 0.7rem; color: #8a7a89; }
.av-head, .av-cell { -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
.av-head { border: 1.5px solid transparent; transition: background .15s, border-color .15s, color .15s, transform .1s; }
.av-head:focus { outline: none; }
.av-head:focus-visible { box-shadow: 0 0 0 3px rgba(122, 61, 118, 0.3); }
.av-head:not(:disabled):hover { background: #eddcec; }
.av-head:not(:disabled):active { transform: scale(0.95); }
.av-head:disabled { cursor: default; }
/* the header shows its day / time: part of it ticked (outline), all of it (filled) */
.av-head.is-some { border-color: #c297c3; }
.av-head.is-full, .av-head.is-full:hover { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.av-head.is-full small { color: rgba(255, 255, 255, 0.85) !important; }
.av-cell:active span { transform: scale(0.94); }
.av-cell span { transition: background .12s, border-color .12s, transform .1s; }
.is-weekend > .av-head { background: #fdf3e3; }
.av-time b { font-size: 0.78rem; white-space: nowrap; }
.av-cell { display: block; position: relative; margin: 0; cursor: pointer; }
.av-cell input { position: absolute; opacity: 0; pointer-events: none; }
.av-cell span { height: 42px; border-radius: 0.7rem; border: 1.5px dashed #e1d2e0; background: #fff; display: grid; place-items: center; transition: background .12s, border-color .12s; }
.av-cell span i { color: #fff; font-size: 1.25rem; opacity: 0; transform: scale(0.6); transition: opacity .12s, transform .12s; }
.av-cell:hover span { border-color: #c297c3; background: #fbf6fb; }
td.is-weekend .av-cell span { background: #fffaf2; }
.av-cell input:checked + span { background: #f1e3f1; border: 1.5px solid #cfa6cf; } /* a soft lavender - lighter than the purple headers */
.av-cell input:checked + span i { opacity: 1; transform: none; color: var(--brand-primary); }
.av-cell input:focus-visible + span { outline: 3px solid rgba(122, 61, 118, 0.35); outline-offset: 2px; }
.av-cell input:disabled + span { cursor: default; }
.av-head .av-short { display: none; }
/* phones: the whole week fits the screen - short day names, narrow time column */
@media (max-width: 575.98px) {
    .av-sched-card { padding: 0.25rem; }
    .av-sched { min-width: 0; border-spacing: 3px; }
    .av-sched .av-corner { width: 62px; }
    .av-sched .av-corner small { font-size: 0.62rem; }
    .av-head { padding: 0.3rem 0; border-radius: 0.55rem; }
    .av-head .av-full { display: none; }
    .av-head .av-short { display: block; }
    .av-head b { font-size: 0.66rem; }
    .av-head small { font-size: 0.66rem; font-weight: 900; color: var(--brand-primary); }
    .av-time small { font-size: 0.58rem; }
    .av-time b { font-size: 0.6rem; white-space: normal; line-height: 1.2; }
    .av-cell span { height: 36px; border-radius: 0.55rem; }
    .av-cell span i { font-size: 1rem; }
}
.av-notes { padding: 1rem 1.2rem; }
.av-bar { position: sticky; bottom: 0.75rem; z-index: 5; margin-top: 1rem; display: flex; align-items: center; gap: 0.75rem; background: #fff; border: 1px solid #eadfe9; border-radius: 1.1rem; padding: 0.6rem 0.75rem 0.6rem 1rem; box-shadow: 0 10px 28px rgba(61, 26, 60, 0.16); }
.av-count { font-weight: 800; color: #047857; }
.av-bar .btn { margin-inline-start: auto; white-space: nowrap; flex: 0 0 auto; }
body:has(.av-bar) #scrollTopBtn { display: none !important; } /* the save bar sits where the scroll-to-top button is */
@media (max-width: 575.98px) { .av-count { font-size: 0.85rem; line-height: 1.4; } .av-bar .btn { padding-inline: 0.85rem; } }
/* homepage card */
.av-home { display: flex; align-items: center; gap: 0.9rem; text-decoration: none; background: linear-gradient(135deg, #fff, #f8eff8); border: 1.5px solid #e2c9e1; border-radius: 1.25rem; padding: 0.9rem 1.1rem; color: var(--brand-dark); }
.av-home:hover { border-color: var(--brand-primary); color: var(--brand-dark); }
.av-home.is-done { background: #f2fbf7; border-color: #bfe8d4; }
.av-home-icon { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 0.9rem; display: grid; place-items: center; background: var(--brand-primary); color: #fff; font-size: 1.3rem; }
.av-home.is-done .av-home-icon { background: #10b981; }
.av-home-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.av-home-text b { font-weight: 900; }
.av-home-text small { font-weight: 700; color: #6b5a6a; }
.av-home-btn { margin-inline-start: auto; flex: 0 0 auto; background: var(--brand-primary); color: #fff; font-weight: 900; font-size: 0.85rem; border-radius: 999px; padding: 0.4rem 0.9rem; white-space: nowrap; }
.av-home.is-done .av-home-btn { background: #fff; color: #047857; border: 1px solid #a7f3d0; }
.av-home-meter { margin-inline-start: auto; flex: 0 0 120px; height: 8px; border-radius: 999px; background: #eee3ee; overflow: hidden; }
.av-home-meter span { display: block; height: 100%; background: var(--brand-primary); }
@media (max-width: 575.98px) { .av-home { flex-wrap: wrap; } .av-home-btn { width: 100%; text-align: center; } .av-home-meter { flex-basis: 100%; } }
/* the teacher's card: the same look as the homepage's other cards (.xr-home-card) - white, a thin border,
   the purple → teal edge, a soft icon tile - with the facts as small chips and the button */
.av-home:not(.is-admin) { --av-tone: var(--brand-primary); --av-tint: rgba(122, 61, 118, 0.1);
    position: relative; overflow: hidden; gap: 0.9rem; padding: 1rem 1.3rem; border-radius: 1rem;
    background: rgba(255, 255, 255, 0.93); border: 1px solid rgba(122, 61, 118, 0.14);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04), 0 12px 28px rgba(122, 61, 118, 0.09); transition: transform .15s ease, box-shadow .15s ease; }
.av-home:not(.is-admin)::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(180deg, var(--brand-primary), var(--brand-accent)); }
.av-home:not(.is-admin):hover { transform: translateY(-1px); border-color: rgba(122, 61, 118, 0.14); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05), 0 16px 34px rgba(122, 61, 118, 0.13); }
.av-home:not(.is-admin) .av-home-icon { width: 48px; height: 48px; border-radius: 0.9rem; font-size: 1.35rem; background: var(--av-tint); color: var(--av-tone); }
.av-home:not(.is-admin) .av-home-text b { font-size: 1.02rem; color: var(--brand-dark); }
.av-home:not(.is-admin) .av-home-text small { color: #8a7a89; }
.av-home-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.3rem; }
.av-home-chips span { display: inline-flex; align-items: center; gap: 0.3rem; background: var(--av-tint, rgba(122, 61, 118, 0.1)); border-radius: 999px; padding: 0.12rem 0.6rem; font-size: 0.76rem; font-weight: 800; color: var(--av-tone, var(--brand-primary)); white-space: nowrap; }
.av-home:not(.is-admin) .av-home-btn { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.5rem 1.1rem; }
.av-home-btn i { transition: transform .15s; }
.av-home:not(.is-admin):hover .av-home-btn i { transform: translateX(3px); }
[dir="rtl"] .av-home:not(.is-admin):hover .av-home-btn i { transform: translateX(-3px); }
/* saved: the teal tone the site uses for «booked» (.xr-home-card.is-booked) */
.av-home.is-done:not(.is-admin) { --av-tone: #2f8f91; --av-tint: rgba(70, 172, 174, 0.13); background: rgba(255, 255, 255, 0.93); }
.av-home.is-done:not(.is-admin) .av-home-icon { background: var(--av-tint); color: var(--av-tone); }
.av-home.is-done:not(.is-admin) .av-home-btn { background: #fff; color: var(--av-tone); border: 1px solid rgba(70, 172, 174, 0.4); }
[data-bs-theme="dark"] .av-home:not(.is-admin) { background: var(--bs-body-bg, #2a1f2a); }
/* control panel */
.av-cp-top { padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: 0.9rem; }
.av-cp-state { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.av-cp-state small { display: block; color: #6b5a6a; font-weight: 700; }
.av-cp-dot { width: 14px; height: 14px; border-radius: 50%; background: #d1c4d0; flex: 0 0 auto; }
.av-cp-dot.is-open { background: #10b981; box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18); }
.av-cp-state-text { flex: 1 1 260px; min-width: 0; }
.av-cp-state { flex-wrap: nowrap; align-items: flex-start; }
.av-cp-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
/* the open / close lock in the card's corner (left in Arabic) */
.av-cp-lock-form { margin: 0 0 0 auto; margin-inline-start: auto; margin-inline-end: 0; flex: 0 0 auto; }
/* green «فتح التسجيل» (closed now) / red «إغلاق التسجيل» (open now) */
/* soft, as the site's other states: a light tint with coloured text and border (not a loud solid colour) */
.av-cp-lock { display: inline-flex; align-items: center; gap: 0.45rem; white-space: nowrap; border: 1.5px solid #a9dcbb; border-radius: 999px; padding: 0.5rem 1.05rem; font-weight: 900; font-size: 0.92rem; color: #157a3d; background: #ebf8f0; transition: background .15s, border-color .15s; }
.av-cp-lock i { font-size: 1.05rem; }
.av-cp-lock.is-open { color: #b42318; background: #fdf0ef; border-color: #f2bdb7; }
.av-cp-lock:hover { background: #dcf2e4; border-color: #8fcfa6; }
.av-cp-lock.is-open:hover { background: #fbe2df; border-color: #eaa59d; }
[data-bs-theme="dark"] .av-cp-lock { background: rgba(22, 163, 74, 0.12); border-color: rgba(22, 163, 74, 0.4); color: #6ee7a0; }
[data-bs-theme="dark"] .av-cp-lock.is-open { background: rgba(220, 38, 38, 0.12); border-color: rgba(220, 38, 38, 0.4); color: #fca5a5; }
.av-cp-lock:focus-visible { outline: 3px solid rgba(0, 0, 0, 0.25); outline-offset: 2px; }
@media (max-width: 575.98px) { .av-cp-lock { padding: 0.5rem 0.85rem; font-size: 0.82rem; } }
.av-cp-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem; }
.av-cp-stats > div { justify-content: center; }
.av-cp-stats b { line-height: 1.3; }
@media (max-width: 767.98px) {
    .av-cp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* phones: «صفحة المعلمات» and «الإعدادات» side by side */
    .av-cp-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .av-cp-actions .btn { width: 100%; white-space: nowrap; }
}
.av-cp-stats > div { background: #faf6fa; border-radius: 0.9rem; padding: 0.6rem 0.8rem; display: flex; flex-direction: column; }
.av-cp-stats b { font-size: 1.3rem; font-weight: 900; color: var(--brand-dark); }
.av-cp-stats small { font-weight: 700; color: #8a7a89; }
.av-cp-stats .is-good b { color: #047857; }
.av-cp-stats .is-warn b { color: #b45309; }
.av-cp-settings { border-top: 1px dashed #e3d3e2; padding-top: 0.9rem; }
.av-cp-grid { padding: 1rem 1.2rem; }
.av-heat { border-collapse: separate; border-spacing: 4px; width: 100%; min-width: 640px; table-layout: fixed; }
.av-heat .av-corner { width: 120px; }
.av-heat th { font-weight: 800; font-size: 0.78rem; color: #6b5a6a; text-align: center; white-space: nowrap; }
.av-heat th small { display: block; color: #a091a0; font-size: 0.68rem; }
.av-heat thead th b { display: block; color: var(--brand-dark); font-weight: 900; }
.av-heat thead th.is-weekend b { color: #8a5a00; }
.av-heat-time span { display: block; color: var(--brand-dark); }
.av-heat-week { font-weight: 900; color: var(--brand-primary); margin-top: 0.6rem; }
.av-heat-week small { color: #a091a0; font-weight: 700; }
.av-heat-cell { width: 100%; min-width: 44px; border: 0; border-radius: 0.55rem; padding: 0.35rem 0; font-weight: 900; color: #fff; background: rgba(122, 61, 118, calc(0.22 + var(--av-a, 0) * 0.78)); }
.av-heat-cell.is-zero { background: #f4eef3; color: #c5b6c4; }
.av-heat-cell:not(:disabled) { cursor: pointer; transition: transform .1s, filter .15s; }
.av-heat-cell:not(:disabled):hover { filter: brightness(1.08); transform: scale(1.04); }
.av-heat-cell:focus { outline: none; }
.av-heat-cell:focus-visible { box-shadow: 0 0 0 3px rgba(122, 61, 118, 0.3); }
/* the names window (a tap on a cell) */
.av-heat-names { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.av-heat-names span { background: #fff; border: 1px solid #e6dbe5; border-radius: 999px; padding: 0.15rem 0.65rem; font-weight: 800; font-size: 0.82rem; }
.av-cp-list { padding: 1rem 1.2rem; }
.av-cp-row { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.7rem 0; border-top: 1px solid #f1e8f0; }
.av-cp-row.is-left { align-items: center; }
.av-cp-avatar { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; display: block; object-fit: cover; }
.av-cp-avatar .mav { display: block; width: 100%; height: 100%; }
.av-cp-who { min-width: 0; flex: 1; }
.av-cp-name { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.av-cp-n { font-size: 0.75rem; font-weight: 900; background: #f4eaf4; color: var(--brand-primary); border-radius: 999px; padding: 0.05rem 0.55rem; }
.av-cp-days { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.4rem; }
.av-cp-last { font-size: 0.72rem; font-weight: 800; background: #fff7e6; color: #8a5a00; border: 1px solid #f5deb0; border-radius: 999px; padding: 0.05rem 0.55rem; white-space: nowrap; }
.av-cp-day { background: #faf6fa; border-radius: 0.6rem; padding: 0.2rem 0.55rem; font-size: 0.78rem; font-weight: 700; }
.av-cp-day b { color: var(--brand-primary); font-weight: 900; }
.av-cp-wa { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #25d366; color: #fff; font-size: 1.1rem; text-decoration: none; }
.av-cp-wa:hover { color: #fff; filter: brightness(0.95); }
[data-bs-theme="dark"] .av-bar, [data-bs-theme="dark"] .av-cell span, [data-bs-theme="dark"] td.is-weekend .av-cell span { background: #2a1f2a; border-color: rgba(255, 255, 255, 0.14); }
[data-bs-theme="dark"] .av-head { background: rgba(255, 255, 255, 0.07); color: #f3e8f2; }
[data-bs-theme="dark"] .is-weekend > .av-head { background: rgba(245, 158, 11, 0.12); }
[data-bs-theme="dark"] .av-cell input:checked + span { background: rgba(194, 151, 195, 0.22); border-color: rgba(194, 151, 195, 0.6); }
[data-bs-theme="dark"] .av-cell input:checked + span i { color: #e9c9ea; }
[data-bs-theme="dark"] .av-heat thead th b, [data-bs-theme="dark"] .av-heat-time span { color: #f3e8f2; }
[data-bs-theme="dark"] .av-home { background: #2a1f2a; border-color: rgba(255, 255, 255, 0.14); color: #f3e8f2; }
[data-bs-theme="dark"] .av-home-text small { color: #c9b8c8; }
[data-bs-theme="dark"] .av-cp-stats > div, [data-bs-theme="dark"] .av-heat-names, [data-bs-theme="dark"] .av-cp-day { background: rgba(255, 255, 255, 0.05); }
[data-bs-theme="dark"] .av-heat-cell.is-zero { background: rgba(255, 255, 255, 0.05); color: rgba(255, 255, 255, 0.3); }
[data-bs-theme="dark"] .av-heat-names span { background: #2a1f2a; border-color: rgba(255, 255, 255, 0.12); }

/* ===== Control panel «لجان الاختبارات»: in-person / online switch, tab help, online steps (includes/cp-exam-rooms.php) ===== */
.xr-mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.xr-mode-switch a { display: flex; align-items: center; gap: 0.75rem; padding: 0.8rem 1rem; border-radius: 1.1rem; border: 2px solid #eadfe9; background: #fff; color: var(--brand-dark); text-decoration: none; transition: border-color .15s, background .15s; }
.xr-mode-switch a > i { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 0.8rem; display: grid; place-items: center; font-size: 1.2rem; background: #f4ecf4; color: var(--brand-primary); }
.xr-mode-switch a b { display: block; font-weight: 900; }
.xr-mode-switch a small { display: block; font-weight: 700; color: #7a6a79; font-size: 0.8rem; }
.xr-mode-switch a:hover { border-color: #c297c3; color: var(--brand-dark); }
.xr-mode-switch a.active { border-color: var(--brand-primary); background: linear-gradient(135deg, #fbf5fb, #f4e9f4); box-shadow: 0 6px 18px rgba(122, 61, 118, 0.12); }
.xr-mode-switch a.active > i { background: var(--brand-primary); color: #fff; }
.xr-tab-help { font-size: 0.85rem; font-weight: 700; color: #7a6a79; display: flex; gap: 0.4rem; align-items: flex-start; }
.xr-tab-help i { color: var(--brand-primary); }
.xr-steps-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; counter-reset: none; }
.xr-steps-nav a { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.7rem 0.85rem; border-radius: 1rem; background: #fff; border: 1.5px solid #eadfe9; color: var(--brand-dark); text-decoration: none; }
.xr-steps-nav a b { display: block; font-weight: 900; font-size: 0.92rem; }
.xr-steps-nav a b i { color: var(--brand-primary); }
.xr-steps-nav a small { display: block; font-weight: 700; color: #7a6a79; font-size: 0.75rem; line-height: 1.45; margin-top: 0.1rem; }
.xr-steps-num { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; background: #f4ecf4; color: var(--brand-primary); }
.xr-steps-nav a:hover { border-color: #c297c3; color: var(--brand-dark); }
.xr-steps-nav a.active { border-color: var(--brand-primary); background: #fbf5fb; }
.xr-steps-nav a.active .xr-steps-num { background: var(--brand-primary); color: #fff; }
@media (max-width: 767.98px) {
    .xr-mode-switch a { padding: 0.65rem 0.7rem; gap: 0.5rem; }
    .xr-mode-switch a > i { width: 34px; height: 34px; font-size: 1rem; }
    .xr-mode-switch a small { font-size: 0.7rem; }
    .xr-steps-nav { grid-template-columns: 1fr; }
}
/* «الهدية» switch (theory controls) */
.xr-gift-row { flex-wrap: wrap; }
.xr-gift-icon { font-size: 1.3rem; line-height: 1; }
.xr-seg { display: inline-flex; background: #f4ecf4; border-radius: 999px; padding: 3px; gap: 2px; }
.xr-seg form { margin: 0; }
.xr-seg button { border: 0; background: transparent; border-radius: 999px; padding: 0.3rem 0.8rem; font-weight: 800; font-size: 0.8rem; color: #6b5a6a; white-space: nowrap; }
.xr-seg button.active { background: var(--brand-primary); color: #fff; opacity: 1; }
/* Online rooms: the meeting link (teachers' room card on exam-rooms.php, student's ticket) */
.xr-meet-form { margin-top: 0.55rem; background: #f3f8fb; border: 1px solid #d6e7f1; border-radius: 0.85rem; padding: 0.55rem 0.7rem; }
.xr-meet-form.is-empty { background: #fff8eb; border: 2px dashed #e9b44c; }
/* the saved link: one small line */
.xr-meet-saved { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; margin-top: 0.5rem; font-size: 0.85rem; color: #047857; font-weight: 800; }
.xr-meet-saved b { color: var(--brand-dark); font-weight: 900; }
.xr-meet-saved-open, .xr-meet-saved-edit { display: inline-flex; align-items: center; gap: 0.25rem; border: 1px solid rgba(122, 61, 118, 0.18); background: #fff; color: var(--brand-primary); border-radius: 999px; padding: 0.1rem 0.6rem; font-weight: 800; font-size: 0.78rem; text-decoration: none; }
.xr-meet-saved-open:hover, .xr-meet-saved-edit:hover { background: #f6eef6; color: var(--brand-primary); }
[data-bs-theme="dark"] .xr-meet-saved-open, [data-bs-theme="dark"] .xr-meet-saved-edit { background: transparent; }
.xr-meet-need { display: inline-block; margin-inline-start: 0.3rem; background: #fdecec; color: #b42318; border-radius: 999px; padding: 0 0.5rem; font-size: 0.7rem; font-weight: 900; vertical-align: middle; }
.xr-meet-form.is-flash { animation: xrMeetFlash 1.4s ease; }
@keyframes xrMeetFlash { 0%, 60% { box-shadow: 0 0 0 4px rgba(233, 180, 76, 0.55); } 100% { box-shadow: 0 0 0 0 rgba(233, 180, 76, 0); } }
/* «أضيفي رابط الاجتماع» at the top of the online rooms (teachers) */
.xr-meet-ask { display: flex; gap: 0.9rem; align-items: flex-start; background: #fff8eb; border: 1.5px solid #f1d39a; border-inline-start: 5px solid #e9a23b; border-radius: 1rem; padding: 1rem 1.15rem; }
.xr-meet-ask-icon { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 0.9rem; display: grid; place-items: center; background: #fde9c4; color: #b26a00; font-size: 1.3rem; }
.xr-meet-ask-body { min-width: 0; }
.xr-meet-ask-body > b { display: block; font-weight: 900; font-size: 1.02rem; color: #7a4a00; }
.xr-meet-ask-body > small { display: block; font-weight: 700; color: #8a6a3a; margin-top: 0.1rem; }
.xr-meet-ask-body ol { margin: 0.5rem 0 0.6rem; padding-inline-start: 1.2rem; font-weight: 700; font-size: 0.86rem; color: #5b4a3a; line-height: 1.7; }
.xr-meet-ask-rooms { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.xr-meet-ask-rooms a { display: inline-flex; align-items: center; gap: 0.3rem; background: #fff; border: 1px solid #f1d39a; color: #8a5a00; border-radius: 999px; padding: 0.25rem 0.75rem; font-weight: 800; font-size: 0.8rem; text-decoration: none; }
.xr-meet-ask-rooms a:hover { background: #fde9c4; color: #7a4a00; }
/* the meeting link in the homepage roll call */
.xa-meet { display: block; margin-top: 0.35rem; }
.xa-meet .xr-meet-saved { margin-top: 0; font-size: 0.8rem; }
.xa-meet-form { display: flex; gap: 0.35rem; align-items: center; background: #fff8eb; border: 1.5px dashed #e9b44c; border-radius: 0.75rem; padding: 0.35rem; }
.xa-meet-form .form-control { min-width: 0; }
.xa-meet-form .btn { flex: 0 0 auto; }
[data-bs-theme="dark"] .xa-meet-form { background: rgba(233, 162, 59, 0.08); }
.xa-meet-add { display: inline-flex; align-items: center; gap: 0.25rem; align-self: flex-start; margin-top: 0.2rem; background: #fff8eb; border: 1px dashed #e9b44c; color: #8a5a00; border-radius: 999px; padding: 0.1rem 0.6rem; font-weight: 900; font-size: 0.78rem; text-decoration: none; }
.xa-meet-add:hover { background: #fde9c4; color: #7a4a00; }
.xr-meet-done { display: flex; align-items: center; gap: 0.5rem; background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; border-radius: 0.9rem; padding: 0.6rem 0.9rem; font-weight: 800; font-size: 0.9rem; }
[data-bs-theme="dark"] .xr-meet-ask { background: rgba(233, 162, 59, 0.08); border-color: rgba(233, 162, 59, 0.35); }
[data-bs-theme="dark"] .xr-meet-ask-body > b { color: #f4c77a; }
[data-bs-theme="dark"] .xr-meet-ask-body ol, [data-bs-theme="dark"] .xr-meet-ask-body > small { color: #d9c4a3; }
[data-bs-theme="dark"] .xr-meet-ask-rooms a { background: transparent; color: #f4c77a; }
.xr-meet-form label { display: block; font-weight: 900; font-size: 0.85rem; color: var(--brand-dark); margin-bottom: 0.35rem; }
.xr-meet-form label small { display: block; font-weight: 700; color: #7a6a79; font-size: 0.75rem; }
.xr-meet-row { display: flex; gap: 0.35rem; }
.xr-meet-row .form-control { min-width: 0; }
.xr-meet-btn { margin-top: 0.15rem; }
[data-bs-theme="dark"] .xr-mode-switch a, [data-bs-theme="dark"] .xr-steps-nav a { background: #2a1f2a; border-color: rgba(255, 255, 255, 0.12); color: #f3e8f2; }
[data-bs-theme="dark"] .xr-mode-switch a.active, [data-bs-theme="dark"] .xr-steps-nav a.active { background: rgba(194, 151, 195, 0.14); border-color: #c297c3; }
[data-bs-theme="dark"] .xr-meet-form { background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.12); }
[data-bs-theme="dark"] .xr-seg { background: rgba(255, 255, 255, 0.08); }
