@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

/* ==========================================================================
   USTAZ Hifz Companion — Design Tokens & Core Variables
   ========================================================================== */
:root {
  --green: #0f5c52;
  --green-dark: #0b3f38;
  --green-hover: #08322c;
  --green-soft: #e5f2ed;
  --green-pale: #f2f7f4;
  --gold: #c8a25a;
  --gold-dark: #9f7d39;
  --gold-soft: #faf5eb;
  --peach: #c87857;
  --peach-soft: #fbf1ec;
  --lilac: #76649a;
  --lilac-soft: #f0edf6;
  --blue: #4f738a;
  --blue-soft: #eaf1f5;
  --ink: #22312b;
  --ink-secondary: #485750;
  --muted: #6e7973;
  --line: #e2e8e4;
  --line-light: #eff2ef;
  --paper: #ffffff;
  --canvas: #f6f8f5;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 6px rgba(15, 92, 82, 0.04);
  --shadow-md: 0 8px 24px rgba(28, 52, 44, 0.06);
  --shadow-lg: 0 16px 36px rgba(15, 92, 82, 0.12);
  --font-sans: 'Inter', 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-arabic: 'IBM Plex Sans Arabic', 'Inter', -apple-system, sans-serif;
  --font-quran: 'Amiri', 'Traditional Arabic', serif;
}

/* ==========================================================================
   Global Resets & Base Styles
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  font-size: 13.5px;
  line-height: 1.6;
  background: var(--canvas);
  color: var(--ink);
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

h1, h2, h3, h4, p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Top Prototype Ribbon
   ========================================================================== */
.prototype-ribbon {
  min-height: 30px;
  background: #efe7d7;
  color: #6b5736;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 4px 16px;
  font-size: 11px;
  font-weight: 500;
  border-bottom: 1px solid #e5dac2;
}

.ribbon-pill {
  background: #6b5736;
  color: #ffffff;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ==========================================================================
   App Shell & Layout
   ========================================================================== */
.shell {
  display: flex;
  min-height: calc(100vh - 30px);
}

/* ==========================================================================
   Sidebar Navigation
   ========================================================================== */
.sidebar {
  width: 254px;
  flex: 0 0 254px;
  background: var(--paper);
  border-right: 1px solid var(--line);
  padding: 22px 16px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: calc(100vh - 30px);
  z-index: 40;
  overflow-y: auto;
}

html[dir="rtl"] .sidebar {
  border-right: 0;
  border-left: 1px solid var(--line);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.brand span {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand b {
  font-size: 17px;
  color: var(--green-dark);
  letter-spacing: 0.03em;
}

.brand small {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
}

.drawer-close-btn {
  display: none;
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--canvas);
  padding: 8px 10px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.profile-chip:hover {
  background: var(--green-pale);
  border-color: #d2ded7;
}

.recording-consent-panel { display: grid; gap: 12px; }
.recording-consent-panel .muted-copy, #recording-approval-note { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 0; }
.recording-request-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 12px; }
.recording-request-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.profile-chip-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.profile-chip-info b {
  font-size: 11px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-chip-info small {
  font-size: 9.5px;
  color: var(--muted);
}

.badge-online {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38a169;
  box-shadow: 0 0 0 2px #d2ebd9;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  color: #929d96;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px 8px;
}

.main-nav {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  position: relative;
}

html[dir="rtl"] .nav-item {
  text-align: right;
}

.nav-item:hover {
  background: var(--green-pale);
  color: var(--green-dark);
}

.nav-item.active {
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 600;
}

.nav-icon {
  width: 18px;
  font-size: 15px;
  line-height: 1;
  text-align: center;
  color: #7b8a82;
}

.nav-item.active .nav-icon {
  color: var(--green);
}

.nav-count {
  margin-left: auto;
  background: var(--paper);
  border: 1px solid #d0ded6;
  color: var(--green);
  min-width: 20px;
  text-align: center;
  border-radius: 10px;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 600;
}

html[dir="rtl"] .nav-count {
  margin-left: 0;
  margin-right: auto;
}

.live-pulse {
  margin-left: auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #48bb78;
  box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.25);
  animation: pulseGreen 1.8s infinite;
}

html[dir="rtl"] .live-pulse {
  margin-left: 0;
  margin-right: auto;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.4); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(72, 187, 120, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(72, 187, 120, 0); }
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 14px;
}

.support-card {
  background: linear-gradient(135deg, #f2f7f4, #faf6ee);
  border: 1px solid #e5ebe7;
  border-radius: var(--radius-md);
  padding: 12px;
  position: relative;
}

.support-mark {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--green-soft);
  color: var(--green);
  display: grid;
  place-items: center;
  font-size: 13px;
  margin-bottom: 8px;
}

.support-card b {
  display: block;
  font-size: 11px;
  color: var(--green-dark);
  margin-bottom: 4px;
}

.support-card p {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 8px;
}

.button-text {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--green);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 0;
  transition: color 0.15s;
}

.button-text:hover {
  color: var(--green-hover);
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  color: #8fa096;
  padding: 12px 4px 0;
}

.privacy-lock {
  font-size: 10px;
}

/* ==========================================================================
   Main Content Area & Topbar
   ========================================================================== */
.main-area {
  flex: 1;
  min-width: 0;
  max-width: 1540px;
  margin: 0 auto;
  padding: 0 32px 36px;
}

.topbar {
  min-height: 64px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.hamburger-bar {
  width: 100%;
  height: 2px;
  background: var(--ink-secondary);
  border-radius: 2px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
}

.breadcrumbs i {
  font-style: normal;
  color: #b8c4bd;
}

.breadcrumbs b {
  color: var(--ink);
  font-weight: 600;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  align-items: center;
}

.language-picker, .zone-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 10.5px;
  color: var(--muted);
}

.language-picker select, .zone-picker select {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
}

.notifications-wrapper {
  position: relative;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  display: inline-grid;
  place-items: center;
  color: var(--ink-secondary);
  font-size: 14px;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}

.icon-button:hover {
  background: var(--green-pale);
  border-color: #cedad2;
}

.small-icon {
  width: 28px;
  height: 28px;
  font-size: 12px;
  border-radius: 6px;
}

.notification-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--peach);
  border: 1px solid var(--paper);
}

.notifications-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 290px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 12px;
  z-index: 50;
  animation: popoverFade 0.18s ease-out;
}

html[dir="rtl"] .notifications-popover {
  right: auto;
  left: 0;
}

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

.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-light);
  font-size: 11px;
}

.badge-counter {
  background: var(--green-soft);
  color: var(--green);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
}

.popover-list {
  list-style: none;
  padding: 0;
  margin: 6px 0;
  display: grid;
  gap: 8px;
}

.popover-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  font-size: 10px;
}

.popover-item.unread {
  background: var(--green-pale);
}

.popover-item div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.popover-item small {
  color: var(--muted);
  font-size: 8.5px;
}

.popover-footer {
  text-align: center;
  font-size: 9px;
  color: var(--muted);
  padding-top: 6px;
  border-top: 1px solid var(--line-light);
}

/* ==========================================================================
   Buttons & Badges
   ========================================================================== */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.12s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.button:active {
  transform: translateY(1px);
}

.button-primary {
  background: var(--green);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 92, 82, 0.16);
}

.button-primary:hover {
  background: var(--green-hover);
}

.button-soft {
  background: var(--green-soft);
  color: var(--green-dark);
  border-color: #d6e8de;
}

.button-soft:hover {
  background: #dbeef3;
  color: var(--green-hover);
}

.button-outline {
  background: var(--paper);
  color: var(--ink-secondary);
  border-color: var(--line);
}

.button-outline:hover {
  background: var(--green-pale);
  border-color: #cdd9d1;
}

.button-xs {
  min-height: 30px;
  padding: 0 10px;
  font-size: 10px;
  border-radius: 6px;
}

.full-width {
  width: 100%;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.tag-green { background: var(--green-soft); color: var(--green-dark); }
.tag-mint { background: var(--mint-soft); color: var(--mint-dark); }
.tag-amber { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.tag-rose { background: var(--peach-soft); color: var(--peach); }
.tag-blue { background: var(--blue-soft); color: var(--blue); }
.tag-muted { background: #eff1ee; color: var(--muted); }

.admin-approval-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11.5px;
  color: #92400e;
  margin-top: 8px;
}

.tz-pill {
  background: #eef3ef;
  color: #4b6758;
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid #dbe6de;
  margin-left: 6px;
}

html[dir="rtl"] .tz-pill {
  margin-left: 0;
  margin-right: 6px;
}

.tz-diff-tag {
  background: var(--gold-soft);
  color: var(--gold-dark);
  font-size: 9.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid #ede3cb;
}

/* ==========================================================================
   Avatars
   ========================================================================== */
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex: 0 0 auto;
}

.avatar-small {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.avatar-teacher {
  background: var(--green-soft);
  color: var(--green-dark);
}

.avatar-student {
  background: #fbf0dc;
  color: #a47535;
}

.avatar-blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.avatar-gold {
  background: var(--gold-soft);
  color: var(--gold-dark);
}

.avatar-purple {
  background: var(--lilac-soft);
  color: var(--lilac);
}

.large-avatar {
  width: 44px;
  height: 44px;
  font-size: 18px;
}

/* ==========================================================================
   Views & View Transitions
   ========================================================================== */
.view {
  display: none;
  animation: fadeIn 0.18s ease-out;
}

.view.active {
  display: block;
}

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

.welcome-row, .page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.eyebrow {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sun-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.wave {
  color: var(--gold);
  font-size: 15px;
}

/* ==========================================================================
   Panels & Cards
   ========================================================================== */
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}

.panel-heading, .section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.two-column {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
}

/* ==========================================================================
   Stat Metric Cards Grid
   ========================================================================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 26px;
}

.stat-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}

.stat-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 14px;
}

.mint { background: var(--green-soft); color: var(--green); }
.peach { background: var(--peach-soft); color: var(--peach); }
.lilac { background: var(--lilac-soft); color: var(--lilac); }
.gold { background: var(--gold-soft); color: var(--gold-dark); }

.stat-number {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
  margin: 8px 0 4px;
}

.stat-number small {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

.stat-note {
  font-size: 10px;
  color: var(--muted);
}

.stat-note.positive { color: #2e7d56; }
.stat-note.warm { color: #9f7236; }

/* ==========================================================================
   Next Session Spotlight Card
   ========================================================================== */
.next-session-card {
  display: flex;
  align-items: center;
  gap: 20px;
  border: 1px solid #dbe6df;
  background: linear-gradient(105deg, #f7faf8, #ffffff);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.session-date-box {
  width: 175px;
  flex: 0 0 175px;
  border-right: 1px solid var(--line);
  padding-right: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

html[dir="rtl"] .session-date-box {
  border-right: 0;
  border-left: 1px solid var(--line);
  padding-right: 0;
  padding-left: 16px;
}

.dual-clock-badge strong {
  display: block;
  font-size: 22px;
  color: var(--green-dark);
  line-height: 1.1;
}

.tz-label {
  font-size: 9.5px;
  color: var(--muted);
}

.session-divider {
  height: 1px;
  background: var(--line);
  width: 100%;
}

.dual-clock-student {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tz-pill-student {
  font-size: 8.5px;
  font-weight: 700;
  color: var(--gold-dark);
  text-transform: uppercase;
}

.dual-clock-student small {
  font-size: 9.5px;
  color: var(--ink-secondary);
  line-height: 1.35;
}

.session-detail {
  flex: 1;
  min-width: 0;
}

.student-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.student-line b {
  font-size: 13px;
  color: var(--ink);
}

.student-line small {
  font-size: 10px;
  color: var(--muted);
}

.session-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--ink-secondary);
  flex-wrap: wrap;
}

.session-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Attention List & Week Bars
   ========================================================================== */
.attention-list {
  display: grid;
}

.attention-row {
  border: 0;
  border-top: 1px solid var(--line-light);
  background: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 10px 4px;
  width: 100%;
  transition: background 0.12s;
}

html[dir="rtl"] .attention-row {
  text-align: right;
}

.attention-row:hover {
  background: var(--green-pale);
}

.attention-name {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.attention-name b {
  font-size: 11.5px;
  color: var(--ink);
}

.attention-name small {
  font-size: 9.5px;
  color: var(--muted);
}

.row-arrow {
  color: #a4b3ab;
  font-size: 13px;
}

.week-bars {
  display: grid;
  gap: 8px;
  padding: 4px 0;
}

.day-bar {
  display: grid;
  grid-template-columns: 46px 1fr 16px;
  gap: 10px;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
}

.day-bar i {
  height: 6px;
  border-radius: 6px;
  background: #eaefe9;
  position: relative;
  overflow: hidden;
}

.day-bar i::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--bar);
  background: #9eccb5;
  border-radius: inherit;
}

html[dir="rtl"] .day-bar i::after {
  left: auto;
  right: 0;
}

.day-bar.today span, .day-bar.today b {
  color: var(--green);
  font-weight: 700;
}

.day-bar.today i::after {
  background: var(--green);
}

.day-bar b {
  font-size: 10px;
  font-weight: 600;
  text-align: right;
}

html[dir="rtl"] .day-bar b {
  text-align: left;
}

.week-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line-light);
  margin-top: 10px;
  padding-top: 10px;
  font-size: 10px;
  color: var(--muted);
}

.week-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--green);
  margin-right: 5px;
}

html[dir="rtl"] .week-legend i {
  margin-right: 0;
  margin-left: 5px;
}

.source-footnote {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  text-align: center;
}

/* ==========================================================================
   Student Table & Profiles
   ========================================================================== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-box {
  height: 38px;
  width: min(340px, 100%);
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  padding: 0 12px;
  color: var(--muted);
}

.search-box input {
  border: 0;
  outline: 0;
  flex: 1;
  background: transparent;
  font-size: 11.5px;
  color: var(--ink);
}

.filter-select {
  height: 38px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-size: 11px;
  color: var(--ink-secondary);
  outline: none;
}

.muted-count {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}

html[dir="rtl"] .muted-count {
  margin-left: 0;
  margin-right: auto;
}

.student-table {
  padding: 0;
  overflow: hidden;
}

.table-head, .table-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.1fr 1.4fr 0.8fr 20px;
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
  text-align: left;
}

html[dir="rtl"] .table-head, html[dir="rtl"] .table-row {
  text-align: right;
}

.table-head {
  background: #fafbf9;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.table-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line-light);
  background: var(--paper);
  font-size: 11px;
  color: var(--ink-secondary);
  transition: background 0.12s;
}

.table-row:last-child {
  border-bottom: 0;
}

.table-row:hover {
  background: var(--green-pale);
}

.quran-tag {
  font-family: var(--font-arabic);
  color: var(--green-dark);
}

.paired-time {
  font-size: 10.5px;
  color: var(--ink);
}

.progress-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-cell i, .progress-line {
  height: 6px;
  border-radius: 6px;
  background: #eaefe9;
  overflow: hidden;
  display: block;
}

.progress-cell i {
  width: 52px;
}

.progress-cell i b, .progress-line b {
  height: 100%;
  display: block;
  background: #5ba37e;
  border-radius: 6px;
}

.progress-cell small {
  font-size: 9.5px;
  color: var(--muted);
}

.timezone-note, .timezone-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #eef5f1;
  border: 1px solid #d8e6dd;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 18px;
}

.timezone-banner {
  margin: 0 0 20px;
}

.timezone-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--paper);
  display: grid;
  place-items: center;
  color: var(--green);
  font-size: 16px;
  flex: 0 0 auto;
}

.timezone-note div, .timezone-banner .banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.timezone-note b, .timezone-banner b {
  font-size: 11.5px;
  color: var(--green-dark);
}

.timezone-note small, .timezone-banner small {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.zone-select-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  color: var(--muted);
}

.zone-select-label select {
  border: 1px solid #c9ded2;
  background: var(--paper);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 10.5px;
  color: var(--ink);
  outline: none;
}

/* ==========================================================================
   Schedule & Calendar Grid
   ========================================================================== */
.schedule-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 18px;
  align-items: start;
}

.calendar-panel {
  padding: 16px;
  overflow: hidden;
}

.calendar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cal-nav h2 {
  font-size: 13.5px;
  display: flex;
  gap: 5px;
}

.cal-range-text {
  color: var(--green);
}

.cal-legend-pills {
  display: flex;
  gap: 6px;
}

.pill-legend {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 8px;
}

.mint-pill { background: var(--green-soft); color: var(--green-dark); }
.lilac-pill { background: var(--lilac-soft); color: var(--lilac); }
.peach-pill { background: var(--peach-soft); color: var(--peach); }

.calendar-grid {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.calendar-days {
  display: grid;
  grid-template-columns: 50px repeat(7, 1fr);
  background: #fafbf9;
  border-bottom: 1px solid var(--line);
}

.calendar-days span {
  padding: 8px 4px;
  text-align: center;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--muted);
}

.calendar-days .current-day {
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 700;
}

.calendar-body {
  height: 290px;
  display: flex;
  position: relative;
  background: var(--paper);
}

.hour-labels {
  width: 50px;
  flex: 0 0 50px;
  border-right: 1px solid var(--line-light);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 4px;
  font-size: 9px;
  color: #9ba8a0;
  text-align: center;
}

html[dir="rtl"] .hour-labels {
  border-right: 0;
  border-left: 1px solid var(--line-light);
}

.day-columns {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  flex: 1;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(12.5% - 1px), #f2f5f2 calc(12.5% - 1px), #f2f5f2 12.5%);
}

.day-column {
  position: relative;
  border-right: 1px solid #f0f3f0;
}

html[dir="rtl"] .day-column {
  border-right: 0;
  border-left: 1px solid #f0f3f0;
}

.day-column.today-column {
  background: rgba(229, 242, 237, 0.35);
}

.event {
  position: absolute;
  left: 3px;
  right: 3px;
  border-left: 3px solid #70a58a;
  border-radius: 4px;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

html[dir="rtl"] .event {
  border-left: 0;
  border-right: 3px solid #70a58a;
}

.event b {
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event small {
  font-size: 7.5px;
  line-height: 1.25;
}

.event-mint { background: var(--green-pale); border-color: var(--green); }
.event-mint b { color: var(--green-dark); }
.event-mint small { color: #587969; }

.event-lilac { background: var(--lilac-soft); border-color: var(--lilac); }
.event-lilac b { color: #574878; }
.event-lilac small { color: #7f739a; }

.event-peach { background: var(--peach-soft); border-color: var(--peach); }
.event-peach b { color: #8e5841; }
.event-peach small { color: #a47662; }

/* Reminder Settings Panel */
.reminder-panel {
  padding: 16px;
}

.small-copy {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 0;
  border-top: 1px solid var(--line-light);
  cursor: pointer;
}

.check-row input {
  accent-color: var(--green);
  margin-top: 2px;
}

.check-row span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.check-row b {
  font-size: 10px;
  color: var(--ink);
}

.check-row small {
  font-size: 8.5px;
  color: var(--muted);
}

.calendar-add {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line-light);
  margin-top: 14px;
  padding-top: 12px;
}

.calendar-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--green-soft);
  color: var(--green);
  display: grid;
  place-items: center;
  font-size: 15px;
}

.calendar-add div {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.calendar-add b {
  font-size: 10.5px;
  color: var(--ink);
}

.calendar-add small {
  font-size: 8.5px;
  color: var(--muted);
}

.mini-add {
  border: 1px solid #cedcd3;
  background: var(--paper);
  color: var(--green-dark);
  font-size: 9.5px;
  padding: 5px 8px;
  border-radius: 6px;
}

.mini-add:hover {
  background: var(--green-soft);
}

.google-cal-row {
  margin-top: 10px;
  text-align: center;
}

.gcal-link {
  font-size: 10px;
  color: var(--green);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.gcal-link:hover {
  text-decoration: underline;
}

.fine-print {
  font-size: 9px;
  line-height: 1.5;
  color: #929d96;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed var(--line-light);
}

/* Upcoming Sessions */
.upcoming-panel {
  margin-top: 20px;
}

.upcoming-list {
  display: grid;
}

.upcoming-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line-light);
}

.date-pill {
  width: 58px;
  flex: 0 0 58px;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.date-pill b {
  font-size: 11px;
  color: var(--green-dark);
}

.date-pill small {
  font-size: 9px;
  color: var(--muted);
}

.upcoming-name {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.upcoming-name b {
  font-size: 12px;
}

.upcoming-name small {
  font-size: 10px;
  color: var(--muted);
}

.time-pair {
  min-width: 170px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.time-pair b {
  font-size: 10.5px;
  color: var(--ink);
}

.time-pair small {
  font-size: 9.5px;
  color: var(--green);
}

.upcoming-actions {
  display: flex;
  gap: 6px;
}

/* ==========================================================================
   Classroom / Lesson Room Cockpit
   ========================================================================== */
.timer-badge {
  background: var(--green-dark);
  color: #ffffff;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-family: monospace;
  margin-left: 8px;
}

html[dir="rtl"] .timer-badge {
  margin-left: 0;
  margin-right: 8px;
}

.class-layout {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 18px;
  align-items: start;
}

.class-main, .class-side {
  display: grid;
  gap: 18px;
}

.call-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

.call-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.call-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--green);
  font-weight: 600;
}

.status-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38a169;
  box-shadow: 0 0 0 3px #c6f6d5;
}

.call-person {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-light);
}

.call-person div {
  display: flex;
  flex-direction: column;
}

.call-person b {
  font-size: 13.5px;
}

.call-person small {
  font-size: 10px;
  color: var(--muted);
}

.call-badges {
  margin-left: auto;
}

html[dir="rtl"] .call-badges {
  margin-left: 0;
  margin-right: auto;
}

/* Call Video Mock Area */
.call-video-container {
  background: #1e2a25;
  border-radius: var(--radius-md);
  padding: 12px;
  color: #ffffff;
}

.video-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.video-box {
  background: #2a3a34;
  border-radius: var(--radius-sm);
  height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.video-name {
  font-size: 10px;
  margin-top: 8px;
  color: #d1ded8;
}

.video-badges {
  position: absolute;
  bottom: 6px;
  right: 6px;
}

.mic-badge {
  font-size: 10px;
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 4px;
  border-radius: 4px;
}

.call-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
  gap: 8px;
}

.call-buttons {
  display: flex;
  gap: 6px;
}

.call-buttons .icon-button {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.call-buttons .icon-button:hover {
  background: rgba(255, 255, 255, 0.25);
}

.meet-notice {
  font-size: 9.5px;
  color: #a7bbb0;
}

/* Push-to-Talk Translation Console */
.ptt-console-panel {
  background: #f7faf8;
  border: 1px solid #dbe6e0;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 16px;
}

.ptt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.ptt-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ptt-icon {
  font-size: 18px;
}

.ptt-title b {
  font-size: 11.5px;
  color: var(--green-dark);
}

.ptt-title small {
  display: block;
  font-size: 9px;
  color: var(--muted);
}

.mode-toggle-group {
  display: flex;
  border: 1px solid #c9ded2;
  border-radius: 8px;
  background: var(--paper);
  overflow: hidden;
}

.mode-toggle-btn {
  padding: 5px 9px;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}

.mode-toggle-btn.active {
  background: var(--green);
  color: #ffffff;
}

.recitation-lock-banner {
  background: #fdf5e6;
  border: 1px solid #ecd8ab;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #835c17;
  margin-bottom: 8px;
}

.recitation-lock-banner b {
  font-size: 11px;
}

.recitation-lock-banner p {
  font-size: 9.5px;
  line-height: 1.45;
  margin-top: 2px;
}

.ptt-controls {
  display: grid;
  gap: 10px;
}

.ptt-main-action {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ptt-mic-button {
  background: var(--green);
  color: #ffffff;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(15, 92, 82, 0.2);
  transition: transform 0.1s, background 0.15s;
}

.ptt-mic-button:hover {
  background: var(--green-hover);
}

.ptt-mic-button.recording {
  background: #c53030;
  animation: micPulse 1.2s infinite;
}

@keyframes micPulse {
  0% { box-shadow: 0 0 0 0 rgba(197, 48, 48, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(197, 48, 48, 0); }
  100% { box-shadow: 0 0 0 0 rgba(197, 48, 48, 0); }
}

.ptt-wave {
  display: none;
  align-items: center;
  gap: 3px;
  height: 24px;
}

.ptt-wave.active {
  display: flex;
}

.ptt-wave span {
  width: 3px;
  height: 100%;
  background: var(--peach);
  border-radius: 2px;
  animation: waveBar 0.8s ease-in-out infinite alternate;
}

.ptt-wave span:nth-child(2) { animation-delay: 0.15s; }
.ptt-wave span:nth-child(3) { animation-delay: 0.3s; }
.ptt-wave span:nth-child(4) { animation-delay: 0.45s; }
.ptt-wave span:nth-child(5) { animation-delay: 0.6s; }

@keyframes waveBar {
  from { height: 4px; }
  to { height: 20px; }
}

.ptt-direction {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 8px;
}

.ptt-select {
  border: 1px solid #cedcd3;
  background: var(--paper);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 10px;
  color: var(--ink);
}

.ptt-privacy-badge {
  font-size: 9px;
  color: var(--muted);
  background: #eef3ef;
  padding: 2px 6px;
  border-radius: 6px;
}

.ptt-transcription-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: grid;
  gap: 6px;
}

.ptt-transcription-line, .ptt-translation-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 11px;
}

.ptt-speaker {
  font-weight: 700;
  font-size: 9.5px;
  color: var(--muted);
  min-width: 85px;
}

.ptt-text {
  color: var(--ink);
  line-height: 1.4;
}

.ptt-quick-samples {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.samples-label {
  font-size: 9.5px;
  color: var(--muted);
}

.sample-chip {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 3px 8px;
  font-size: 9px;
  color: var(--ink-secondary);
  transition: background 0.12s, border-color 0.12s;
}

.sample-chip:hover {
  background: var(--green-soft);
  border-color: #b7d6c6;
  color: var(--green-dark);
}

.ptt-footer-note {
  font-size: 9px;
  color: #8c9c93;
  line-height: 1.45;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #dbe5df;
}

/* ==========================================================================
   Interactive Whiteboard
   ========================================================================== */
.board-panel {
  padding: 16px;
}

.board-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.board-color {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px #ced8d2;
  transition: transform 0.12s, box-shadow 0.15s;
}

.board-color:hover {
  transform: scale(1.1);
}

.board-color.active {
  box-shadow: 0 0 0 2px var(--green);
}

.board-tool-divider {
  width: 1px;
  height: 18px;
  background: var(--line);
  margin: 0 4px;
}

.stroke-btn {
  font-size: 9px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
}

.stroke-btn.active {
  background: var(--green-soft);
  color: var(--green-dark);
  border-color: #b5d8c6;
}

.board-canvas-wrap {
  height: 185px;
  border: 1px dashed #cedbd2;
  border-radius: var(--radius-sm);
  background-color: #fcfdfa;
  background-image: radial-gradient(#d8e4dc 1px, transparent 1px);
  background-size: 16px 16px;
  position: relative;
  overflow: hidden;
  margin-top: 8px;
}

.board-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  position: relative;
  z-index: 2;
  cursor: crosshair;
}

.board-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #adbdb3;
  font-size: 11px;
  z-index: 1;
  pointer-events: none;
}

.board-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 9.5px;
  color: var(--muted);
}

.board-sync-note {
  font-size: 9px;
  color: #8c9e93;
}

/* ==========================================================================
   Class Side: Lesson Steps & Teacher Notes
   ========================================================================== */
.lesson-plan, .class-notes {
  padding: 16px;
}

.lesson-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
}

.lesson-steps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  position: relative;
  padding: 8px 0;
  cursor: pointer;
}

.lesson-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 32px;
  bottom: 0;
  width: 1px;
  background: #e2e8e4;
}

html[dir="rtl"] .lesson-steps li:not(:last-child)::after {
  left: auto;
  right: 12px;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  background: var(--paper);
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
}

.lesson-steps li.done .step-num {
  background: var(--green-soft);
  color: var(--green);
  border-color: #c0ded0;
}

.lesson-steps li.current .step-num {
  background: var(--green);
  color: #ffffff;
  border-color: var(--green);
}

.lesson-steps li div {
  display: flex;
  flex-direction: column;
}

.lesson-steps b {
  font-size: 11px;
  color: var(--ink);
}

.lesson-steps small {
  font-size: 9px;
  color: var(--muted);
}

.class-notes textarea {
  width: 100%;
  height: 75px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 11px;
  color: var(--ink);
  line-height: 1.5;
  outline-color: var(--green);
  resize: vertical;
  background: var(--canvas);
}

.assignment-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-secondary);
  margin: 10px 0 12px;
}

.assignment-label input {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 10.5px;
  color: var(--ink);
  background: var(--canvas);
  outline-color: var(--green);
}

/* ==========================================================================
   Mushaf & Tafsir (Verified Learning Library)
   ========================================================================== */
.source-feature {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 20px;
  padding: 22px;
}

.mushaf-preview {
  display: grid;
  gap: 14px;
}

.mushaf-frame {
  background: #fdfbf7;
  border: 1px solid #e7ddc8;
  border-radius: var(--radius-sm);
  padding: 24px 20px 18px;
  text-align: center;
  box-shadow: inset 0 0 0 5px #fcf9f2;
}

.mushaf-surah-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.mushaf-ornament {
  color: var(--gold);
  font-size: 14px;
}

.mushaf-surah-title {
  font-family: var(--font-quran);
  font-size: 17px;
  font-weight: 700;
  color: #795e34;
}

.bismillah-line {
  font-family: var(--font-quran);
  font-size: 14px;
  color: #8c7247;
  margin-bottom: 14px;
}

.quran-verses-container {
  padding: 6px 4px;
}

.quran-text {
  font-family: var(--font-quran);
  font-size: 17px;
  line-height: 2.1;
  color: #2b332d;
  word-spacing: 2px;
}

.ayah-ornament {
  font-family: var(--font-quran);
  font-size: 15px;
  color: var(--gold-dark);
  margin: 0 4px;
  display: inline-block;
}

.mushaf-meta-line {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #eee5d2;
  font-size: 9.5px;
  color: #9f9888;
}

/* Sacred Status & Source Integration Banner */
.sacred-status-panel {
  display: grid;
  gap: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.sacred-status-banner {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
}

.status-warning-badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  font-weight: 700;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #fde68a;
  white-space: nowrap;
}

.sacred-status-text h2 {
  font-size: 15px;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 8px;
}

.status-body-ar {
  font-family: var(--font-arabic);
  font-size: 13px;
  line-height: 1.8;
  color: #78350f;
  margin-bottom: 8px;
}

.status-body-en {
  font-size: 12px;
  line-height: 1.6;
  color: #92400e;
}

.sacred-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.sacred-rule-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #f9fbf9;
  border: 1px solid #e1ebe3;
  padding: 14px;
  border-radius: var(--radius-sm);
}

.sacred-rule-card .rule-icon {
  font-size: 18px;
  line-height: 1;
}

.sacred-rule-card b {
  display: block;
  font-size: 12.5px;
  color: var(--green-dark);
  margin-bottom: 4px;
}

.sacred-rule-card p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

.official-links-container {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.official-links-header h3 {
  font-size: 13px;
  color: var(--green-dark);
  margin: 4px 0;
}

.official-links-header p {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 10px;
}

.official-links-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Tafsir Display Box */
.tafsir-display-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: var(--radius-sm);
  padding: 14px;
}

html[dir="rtl"] .tafsir-display-box {
  border-left: 1px solid var(--line);
  border-right: 3px solid var(--green);
}

.tafsir-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.tafsir-header b {
  font-size: 11.5px;
  color: var(--green-dark);
}

.verified-badge {
  background: var(--green-soft);
  color: var(--green);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.tafsir-content {
  display: grid;
  gap: 6px;
}

.tafsir-arabic {
  font-family: var(--font-arabic);
  font-size: 12px;
  line-height: 1.8;
  color: #3b4941;
}

.tafsir-translation {
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}

.tafsir-source-citation {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--line-light);
  font-size: 9px;
  color: #91a298;
}

.source-description h2 {
  font-size: 19px;
  margin: 6px 0 10px;
}

.source-description p {
  font-size: 12px;
  color: var(--ink-secondary);
  line-height: 1.7;
  margin-bottom: 14px;
}

.source-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.source-tags span {
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 9.5px;
  color: var(--ink-secondary);
}

.source-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line-light);
}

.source-book {
  width: 32px;
  height: 38px;
  border-radius: 5px;
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid #bfdcce;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
}

.source-book.neutral {
  background: #f4f5f0;
  border-color: #e4e6db;
  color: #928a60;
}

.source-row div {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.source-row b {
  font-size: 12px;
}

.source-row small {
  font-size: 10px;
  color: var(--muted);
}

.verified {
  font-size: 9.5px;
  color: var(--green);
  font-weight: 600;
}

.source-policy p {
  font-size: 11.5px;
  color: var(--ink-secondary);
  line-height: 1.7;
  margin-bottom: 14px;
}

.policy-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line-light);
  font-size: 11px;
  color: var(--ink);
}

.policy-line span {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--green);
}

/* ==========================================================================
   Teacher Pedagogy Guide
   ========================================================================== */
.guide-badge {
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 10.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 16px;
}

.guide-hero {
  background: linear-gradient(115deg, var(--green-dark), var(--green));
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.guide-hero .eyebrow {
  color: #cbe3d6;
}

.guide-hero h2 {
  font-size: 20px;
  color: #ffffff;
  margin: 6px 0 8px;
}

.guide-hero p {
  max-width: 680px;
  font-size: 12px;
  line-height: 1.7;
  color: #e3eee8;
}

.guide-sparkle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: grid;
  place-items: center;
  font-size: 32px;
  color: var(--gold);
  flex: 0 0 auto;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* Verified Quran resources and teacher preparation */
.library-reader-panel,
.tajweed-learning-panel,
.teacher-prep-panel {
  margin-bottom: 18px;
}

.library-panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.library-top-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid rgba(15, 92, 82, 0.15);
}

.status-live-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(15, 92, 82, 0.2);
  display: inline-block;
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(15, 92, 82, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(15, 92, 82, 0); }
  100% { box-shadow: 0 0 0 0 rgba(15, 92, 82, 0); }
}

.library-control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0 10px;
}

/* Touch-friendly, horizontally scrollable tabs on mobile */
.library-resource-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  max-width: 100%;
}
.library-resource-tabs::-webkit-scrollbar {
  display: none;
}

.library-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.18s ease;
  min-height: 40px;
}

.library-tab-btn:hover {
  border-color: var(--green);
  background: var(--green-pale);
  color: var(--green-dark);
}

.library-tab-btn.active,
.library-tab-btn[aria-selected="true"] {
  background: var(--green);
  color: #ffffff;
  border-color: var(--green-dark);
  box-shadow: 0 2px 8px rgba(15, 92, 82, 0.25);
}

.library-tab-btn .tab-icon {
  font-size: 15px;
  line-height: 1;
}

.library-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Edition Strip */
.library-edition-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #f7f6f1;
  border: 1px solid #e9e5d8;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.edition-icon {
  font-size: 18px;
  color: var(--gold-dark);
}

.edition-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 200px;
}

.edition-text b {
  font-size: 13px;
  color: var(--ink);
}

.edition-text small {
  font-size: 11.5px;
  color: var(--muted);
}

.library-verified-tag {
  font-size: 10.5px;
  padding: 2px 8px;
  white-space: nowrap;
}

/* Embed Container & Heights */
.library-embed-wrap {
  position: relative;
  min-height: 700px;
  height: 700px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #f3f0e9;
  overflow: hidden;
  transition: height 0.3s ease, min-height 0.3s ease;
}

.library-embed-wrap.expanded {
  min-height: 85vh;
  height: 85vh;
}

.library-embed-wrap iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

/* Loading Overlay */
.library-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(248, 246, 240, 0.96);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: opacity 0.3s ease;
}

.library-loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.library-loading-content {
  text-align: center;
  padding: 24px;
  max-width: 420px;
}

.library-loading-symbol {
  font-size: 34px;
  color: var(--gold-dark);
  margin-bottom: 12px;
  animation: pulse-symbol 1.6s infinite ease-in-out;
}

@keyframes pulse-symbol {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.15); opacity: 1; }
}

.library-loading-content b {
  display: block;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 6px;
}

.library-loading-content small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.library-loading-bar {
  width: 160px;
  height: 4px;
  background: #e2e8e4;
  border-radius: 999px;
  overflow: hidden;
  margin: 0 auto;
}

.library-loading-progress {
  width: 50%;
  height: 100%;
  background: var(--green);
  border-radius: inherit;
  animation: loading-bar-move 1.4s infinite ease-in-out;
}

@keyframes loading-bar-move {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
  100% { transform: translateX(300%); }
}

/* Fallback Security Notice Card */
.library-fallback-card {
  margin-top: 14px;
  padding: 16px 20px;
  border: 1px solid #e5dccb;
  border-radius: var(--radius-md);
  background: #fbf9f4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.fallback-card-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 680px;
}

.fallback-shield {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1.2;
}

.fallback-card-left b {
  display: block;
  font-size: 13px;
  color: #5c4728;
  margin-bottom: 4px;
}

.fallback-card-left p {
  margin: 0;
  font-size: 12px;
  color: #79664c;
  line-height: 1.6;
}

.fallback-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.library-source-fallback,
.library-content-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.library-source-fallback a {
  color: var(--green);
  font-weight: 700;
}

.tajweed-topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tajweed-topic-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
}

.tajweed-topic-card b {
  color: var(--green-dark, var(--green));
  font-size: 13px;
}

.tajweed-topic-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.tajweed-correction-card {
  background: #f5f2e9;
}

.teacher-prep-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.teacher-prep-progress-track {
  flex: 1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eee9;
}

.teacher-prep-progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 160ms ease;
}

.teacher-prep-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.teacher-prep-checklist label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.6;
  cursor: pointer;
}

.teacher-prep-checklist input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--green);
}

@media (max-width: 900px) {
  .tajweed-topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-embed-wrap, .library-embed-wrap iframe { min-height: 560px; height: 560px; }
}

@media (max-width: 620px) {
  .teacher-prep-checklist, .tajweed-topic-grid { grid-template-columns: 1fr; }
  .library-embed-wrap, .library-embed-wrap iframe { min-height: 460px; height: 460px; }
}

.guide-step, .guide-help {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.guide-number {
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
}

.guide-time {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
}

html[dir="rtl"] .guide-time {
  margin-left: 0;
  margin-right: auto;
}

.guide-step h3, .guide-help h3 {
  font-size: 13.5px;
  margin: 10px 0 8px;
}

.guide-step p, .guide-help p {
  font-size: 11px;
  line-height: 1.65;
  color: var(--ink-secondary);
  flex: 1;
}

.say-box {
  background: var(--canvas);
  border-left: 3px solid var(--green);
  border-radius: 4px;
  padding: 8px 10px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

html[dir="rtl"] .say-box {
  border-left: 0;
  border-right: 3px solid var(--green);
}

.say-box small {
  font-size: 8.5px;
  color: var(--muted);
  text-transform: uppercase;
}

.say-box b {
  font-size: 10.5px;
  color: var(--ink);
  line-height: 1.5;
}

.guide-help {
  background: #faf8f0;
  border-color: #ece3ca;
}

.help-icon {
  font-size: 22px;
  color: var(--gold-dark);
}

/* ==========================================================================
   Progress Reports
   ========================================================================== */
.report-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.report-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.report-card > span {
  font-size: 11px;
  color: var(--muted);
}

.report-card b {
  display: block;
  font-size: 24px;
  color: var(--ink);
  margin: 6px 0 4px;
}

.report-card b small {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

.report-card > small {
  font-size: 10px;
  color: var(--muted);
}

.report-bar {
  height: 6px;
  border-radius: 6px;
  background: #eaefe9;
  margin-top: 12px;
  overflow: hidden;
}

.report-bar i {
  height: 100%;
  display: block;
  background: var(--green);
}

.gold-bar i { background: var(--gold); }
.peach-bar i { background: var(--peach); }

.report-list {
  padding: 16px;
}

.report-student {
  display: grid;
  grid-template-columns: 36px 1.2fr 1.4fr 1fr 40px;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line-light);
  font-size: 11.5px;
}

/* ==========================================================================
   Student Profile Detail View
   ========================================================================== */
.student-hero-card {
  background: linear-gradient(115deg, #eef6f2, #ffffff);
  border: 1px solid #dbe6df;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.student-hero-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.student-hero-main h2 {
  font-size: 18px;
  margin: 4px 0 2px;
}

.student-hero-main p {
  font-size: 11px;
  color: var(--muted);
}

.student-progress {
  width: 220px;
}

.student-progress div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
}

.student-progress b {
  font-size: 20px;
  color: var(--green);
}

.student-progress small {
  font-size: 10px;
  color: var(--muted);
}

.student-progress i {
  height: 8px;
  border-radius: 8px;
  background: #dbe4de;
  display: block;
  overflow: hidden;
}

.student-progress i b {
  height: 100%;
  display: block;
  background: var(--green);
}

.plan-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line-light);
}

.plan-mark {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: var(--green-soft);
  color: var(--green-dark);
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 700;
  flex: 0 0 auto;
}

.plan-mark.neutral-mark {
  background: #eff2ef;
  color: var(--muted);
}

.plan-row div {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.plan-row b {
  font-size: 12px;
}

.plan-row small {
  font-size: 10px;
  color: var(--muted);
}

.note-entry {
  display: flex;
  gap: 10px;
  padding-bottom: 12px;
}

.note-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  margin-top: 5px;
}

.note-entry div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.note-entry b {
  font-size: 11px;
}

.note-entry small {
  font-size: 10px;
  color: var(--ink-secondary);
  line-height: 1.5;
}

.note-entry time {
  font-size: 9px;
  color: #96a59c;
}

.profile-note-input {
  width: 100%;
  height: 60px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px;
  font-size: 10.5px;
  outline-color: var(--green);
  resize: vertical;
  background: var(--canvas);
  margin-bottom: 8px;
}

/* ==========================================================================
   Student Portal View Preview
   ========================================================================== */
.student-next {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.next-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--green-soft);
  color: var(--green);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex: 0 0 auto;
}

.next-text {
  flex: 1;
}

.next-text h2 {
  font-size: 16px;
  margin: 2px 0 4px;
}

.student-local-time-callout {
  font-size: 11px;
  color: var(--green-dark);
  font-weight: 600;
}

.student-next-actions {
  display: flex;
  gap: 8px;
}

.homework-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--canvas);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.homework-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--green-soft);
  color: var(--green);
  display: grid;
  place-items: center;
  font-size: 15px;
}

.homework-card div {
  display: flex;
  flex-direction: column;
}

.homework-card b {
  font-size: 12px;
}

.homework-card small {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.teacher-quote {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-style: italic;
  color: var(--ink-secondary);
  line-height: 1.7;
  border-left: 3px solid var(--gold);
  padding-left: 14px;
  margin: 0 0 10px;
}

html[dir="rtl"] .teacher-quote {
  border-left: 0;
  border-right: 3px solid var(--gold);
  padding-left: 0;
  padding-right: 14px;
}

/* ==========================================================================
   Page Footer
   ========================================================================== */
.page-footer {
  border-top: 1px solid var(--line);
  padding: 18px 0;
  margin-top: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 10px;
}

/* ==========================================================================
   Mobile Bottom Navigation
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--paper);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
  z-index: 50;
  align-items: center;
  justify-content: space-around;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  padding: 6px 12px;
  transition: color 0.15s;
}

.bottom-nav-item.active {
  color: var(--green);
  font-weight: 700;
}

.bottom-nav-icon {
  font-size: 18px;
  line-height: 1;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 37, 30, 0.5);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 100;
  animation: modalFadeIn 0.18s ease-out;
}

/* Author display styles override the browser's default [hidden] behavior. */
.modal-backdrop[hidden] {
  display: none !important;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: min(480px, 100%);
  overflow: hidden;
}

.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 14px;
  color: var(--green-dark);
}

.modal-close {
  font-size: 13px;
  color: var(--muted);
}

.modal-body {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.form-field input, .form-field select {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-size: 11.5px;
  color: var(--ink);
  outline-color: var(--green);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-notice {
  background: #f2f7f4;
  border: 1px solid #d4e4dc;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 10px;
  color: #4b6757;
  line-height: 1.45;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.dual-time-preview-card {
  background: #eef5f1;
  border: 1px solid #d3e5dc;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.preview-badge {
  font-size: 8.5px;
  font-weight: 700;
  color: var(--green);
  text-transform: uppercase;
}

.preview-content {
  display: grid;
  gap: 4px;
  margin-top: 4px;
  font-size: 11px;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: #1c3027;
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-size: 11.5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 120;
  max-width: min(420px, calc(100vw - 32px));
  line-height: 1.5;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

html[dir="rtl"] .toast {
  left: auto;
  right: 24px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Bilingual & RTL Nuances
   ========================================================================== */
html[dir="rtl"] {
  font-family: var(--font-arabic);
}

body[data-language="bi"] .nav-label,
body[data-language="bi"] h1,
body[data-language="bi"] h2 {
  line-height: 1.5;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1140px) {
  .main-area { padding: 0 20px 32px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .two-column { grid-template-columns: 1fr; }
  .class-layout { grid-template-columns: 1fr; }
  .source-feature { grid-template-columns: 1fr; }
  .library-columns { grid-template-columns: 1fr; }
  .guide-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -260px;
    height: 100vh;
    box-shadow: var(--shadow-lg);
    transition: left 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  html[dir="rtl"] .sidebar {
    left: auto;
    right: -260px;
    transition: right 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .sidebar.open {
    left: 0;
  }

  html[dir="rtl"] .sidebar.open {
    right: 0;
  }

  .drawer-close-btn {
    display: inline-grid;
  }

  .drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 35;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
  }

  .drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  .hamburger-btn {
    display: inline-flex;
  }

  .schedule-layout {
    grid-template-columns: 1fr;
  }

  .table-head {
    display: none;
  }

  .table-row {
    grid-template-columns: 1.5fr 1fr 1fr 20px;
  }

  .table-row span:nth-child(2), .table-row span:nth-child(5) {
    display: none;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .main-area {
    padding-bottom: 74px;
  }
}

@media (max-width: 600px) {
  .prototype-ribbon {
    font-size: 9.5px;
    padding: 4px 8px;
    text-align: center;
  }

  .main-area {
    padding: 0 14px 74px;
  }

  .topbar {
    min-height: 54px;
    margin-bottom: 16px;
  }

  .zone-quick-preview {
    display: none;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .stat-card {
    padding: 10px 12px;
  }

  .stat-number {
    font-size: 20px;
  }

  .next-session-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
  }

  .session-date-box {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-right: 0;
    padding-bottom: 12px;
  }

  html[dir="rtl"] .session-date-box {
    border-left: 0;
    padding-left: 0;
  }

  .session-actions {
    width: 100%;
  }

  .session-actions .button {
    flex: 1;
  }

  .table-row {
    grid-template-columns: 1fr 1fr 20px;
    padding: 10px 8px;
  }

  .table-row span:nth-child(3) {
    display: none;
  }

  .guide-grid {
    grid-template-columns: 1fr;
  }

  .report-grid {
    grid-template-columns: 1fr;
  }

  .report-student {
    grid-template-columns: 32px 1fr 34px;
  }

  .report-student span:nth-of-type(2), .report-student .progress-line {
    display: none;
  }

  .student-hero-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
  }

  .student-progress {
    width: 100%;
  }

  .student-next {
    flex-direction: column;
    align-items: flex-start;
  }

  .student-next-actions {
    width: 100%;
  }

  .student-next-actions .button {
    flex: 1;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .video-box {
    height: 110px;
  }

  .toast {
    left: 12px;
    right: 12px;
    bottom: 68px;
    max-width: none;
    text-align: center;
  }

  html[dir="rtl"] .toast {
    right: 12px;
    left: 12px;
  }
}

/* ==========================================================================
   Shared Live Classroom Whiteboard Status & Upgrades
   ========================================================================== */
.board-canvas-wrap {
  height: 235px;
}

.board-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid #b5d8c6;
  background: var(--green-soft);
  color: var(--green-dark);
}

.board-sync-badge.syncing {
  background: #fef6e4;
  border-color: #ebd094;
  color: #8a6116;
}

.board-sync-badge.local {
  background: #eef4f8;
  border-color: #c2d6e6;
  color: #26547c;
}

.board-sync-badge.offline {
  background: #fdf0ed;
  border-color: #e8b8ad;
  color: #8b2626;
}

.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.board-sync-badge.synced .sync-dot,
.board-sync-badge.local .sync-dot {
  animation: syncPulse 2.2s infinite ease-in-out;
}

@keyframes syncPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.help-tour-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid #b5d8c6;
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 800;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.help-tour-btn:hover {
  background: var(--green);
  color: #ffffff;
  border-color: var(--green);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15, 92, 82, 0.2);
}

/* ==========================================================================
   Interactive Spotlight Onboarding Tour
   ========================================================================== */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: auto;
}

.tour-overlay[hidden] {
  display: none !important;
}

.tour-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(14, 28, 24, 0.62);
  backdrop-filter: blur(1.5px);
  transition: opacity 0.25s ease;
}

.tour-spotlight {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(14, 28, 24, 0.68), 0 0 0 3px #c8a25a, 0 8px 28px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  transition: top 0.32s cubic-bezier(0.22, 1, 0.36, 1),
              left 0.32s cubic-bezier(0.22, 1, 0.36, 1),
              width 0.32s cubic-bezier(0.22, 1, 0.36, 1),
              height 0.32s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.2s ease;
  z-index: 10000;
}

.tour-card {
  position: fixed;
  z-index: 10001;
  width: min(440px, calc(100vw - 24px));
  background: #ffffff;
  border: 1.5px solid #d4e3db;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(12, 34, 28, 0.32);
  padding: 18px 20px;
  color: var(--ink);
  transition: top 0.28s cubic-bezier(0.22, 1, 0.36, 1),
              left 0.28s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.tour-card.centered {
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: min(480px, calc(100vw - 24px));
}

.tour-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.tour-step-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.tour-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 13px;
  color: var(--muted);
  background: #f3f7f4;
  border: 1px solid var(--line);
}

.tour-close-btn:hover {
  background: #fbeae8;
  color: #8b2626;
  border-color: #e8b8ad;
}

.tour-lang-bar {
  background: #f6faf8;
  border: 1px solid #d7e6de;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tour-lang-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--green-dark);
}

.tour-lang-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.tour-lang-btn {
  padding: 6px 8px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 7px;
  border: 1px solid #c9ded2;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tour-lang-btn:hover {
  border-color: var(--green);
  background: var(--green-pale);
}

.tour-lang-btn.active {
  background: var(--green);
  color: #ffffff;
  border-color: var(--green);
  box-shadow: 0 2px 6px rgba(15, 92, 82, 0.25);
}

.tour-card-body h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--green-dark);
  margin: 0 0 8px;
  line-height: 1.4;
}

.tour-card-body p {
  font-size: 13px;
  color: #42544b;
  line-height: 1.65;
  margin: 0;
}

.tour-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 12px;
}

.tour-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #d2dfd8;
  transition: all 0.2s ease;
}

.tour-dot.active {
  width: 20px;
  background: var(--green);
}

.tour-card-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line-light);
}

.tour-dont-show {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.tour-dont-show input {
  accent-color: var(--green);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.tour-nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

body[data-role="student"] [data-view="students"],
body[data-role="student"] [data-view="schedule"],
body[data-role="student"] [data-view="guide"],
body[data-role="student"] [data-view="reports"],
body[data-role="parent"] [data-view="students"],
body[data-role="parent"] [data-view="schedule"],
body[data-role="parent"] [data-view="guide"],
body[data-role="parent"] [data-view="reports"],
[hidden] { display: none !important; }

/* ==========================================================================
   Interactive Hifz Studio, English Tajweed & Teacher Phrasebook
   ========================================================================== */
.student-plan-card {
  border: 1.5px solid #0f5c52;
  background: linear-gradient(135deg, rgba(15,92,82,0.05) 0%, rgba(200,162,90,0.08) 100%);
  border-radius: 18px;
  padding: 22px;
  margin-top: 18px;
  box-shadow: 0 4px 18px rgba(15,92,82,0.06);
}
.student-plan-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
}
.student-plan-title {
  margin: 4px 0 8px;
  font-size: 1.35rem;
  color: #123e35;
  font-weight: 800;
}
.student-plan-details {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: #2c4d44;
}
.student-plan-upgrade-row {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed rgba(15,92,82,0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* Hifz Studio */
.hifz-studio-card {
  margin-top: 20px;
  border-radius: 18px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}
.hifz-controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  background: #f4f7f5;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #dbe6df;
  margin-bottom: 16px;
}
.hifz-verse-display {
  background: #fff;
  border: 1.5px solid #cde0d5;
  border-radius: 14px;
  padding: 26px 20px;
  text-align: center;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 16px rgba(15,92,82,0.05);
  position: relative;
  transition: all 0.25s ease;
}
.hifz-verse-display.masked .arabic-text {
  filter: blur(8px);
  user-select: none;
  opacity: 0.25;
}
.hifz-verse-display.first-word-only .arabic-text {
  filter: none;
  opacity: 1;
}

/* Tajweed Tabs */
.tajweed-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  border-bottom: 1px solid #e1ebe5;
  margin-bottom: 16px;
}
.tajweed-tab-btn {
  background: #f1f5f3;
  color: #2c4d44;
  border: 1px solid #d6e2dc;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.tajweed-tab-btn:hover {
  background: #e4eee9;
}
.tajweed-tab-btn.active {
  background: #0f5c52;
  color: #fff;
  border-color: #0f5c52;
}

/* Teacher Phrasebook Modal */
.phrase-filter-btn {
  background: #fff;
  color: #496157;
  border: 1px solid #ccd8d1;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.phrase-filter-btn:hover {
  background: #e8f0ec;
}
.phrase-filter-btn.active {
  background: #0f5c52;
  color: #fff;
  border-color: #0f5c52;
}
.phrase-card {
  background: #fff;
  border: 1px solid #e1ebe5;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: all 0.15s ease;
}
.phrase-card:hover {
  border-color: #0f5c52;
  box-shadow: 0 3px 12px rgba(15,92,82,0.08);
}
.phrase-card-main {
  flex: 1;
}
.phrase-card-en {
  font-size: 15px;
  font-weight: 700;
  color: #0f5c52;
}
.phrase-card-phonetic {
  font-size: 13px;
  color: #906f31;
  font-weight: 600;
  margin-top: 2px;
}
.phrase-card-ar {
  font-size: 13px;
  color: #496157;
  margin-top: 2px;
}
.phrase-card-unit {
  font-size: 11px;
  color: #8fa099;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
