/* ── Design tokens ─────────────────────────────────────────────────────────── */

:root {
  --ink-950: #0e1a2b;
  --ink-700: #2f3f59;
  --ink-500: #5b6d89;
  --ink-300: #9aadc5;

  --surface-0: #ffffff;
  --surface-50: #f5f8ff;
  --surface-100: #eef3fb;

  --line: #d2deef;
  --line-strong: #c2d3ea;

  --brand-700: #0f7f74;
  --brand-500: #1f998f;
  --brand-400: #36b5aa;
  --brand-100: #d3f2ef;

  --accent-700: #c95723;
  --accent-500: #dd6e37;
  --accent-100: #fde8d8;

  --gold: #c9971a;
  --gold-bg: #fdf5dc;

  --danger: #dc2626;
  --danger-bg: #fee2e2;

  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;

  --shadow-sm: 0 2px 8px rgb(14 26 43 / 8%);
  --shadow-md: 0 8px 24px rgb(14 26 43 / 12%);
  --shadow-lg: 0 18px 48px rgb(14 26 43 / 16%);

  --font-sans: "Sora", system-ui, -apple-system, sans-serif;
  --font-arabic: "Tajawal", "Sora", system-ui, sans-serif;

  --nav-h: 64px;
  --sidebar-w: 240px;
}

/* ── Reset & base ─────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--ink-950);
  background: var(--surface-0);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.sn-icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sn-icon, .inline-icon {
  width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em;
}

.app-loading-screen {
  position: fixed; inset: 0; z-index: 999;
  display: grid; place-content: center; gap: 0.875rem;
  background: var(--surface-0); color: var(--ink-950);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.app-loading-screen--hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.app-loading-mark {
  width: 56px; height: 56px; border: 1px solid var(--line);
  border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-100); color: var(--brand-700);
  animation: float-in 0.7s ease both;
}
.app-loading-icon { width: 28px; height: 28px; }
.app-loading-text { font-size: 0.9rem; color: var(--ink-500); animation: fade-up 0.6s ease both; }
.site-error-toast {
  position: fixed; left: 50%; bottom: 1.5rem; z-index: 1000;
  transform: translateX(-50%); max-width: min(92vw, 420px);
  padding: 0.8rem 1rem; border-radius: var(--radius-md);
  background: var(--ink-950); color: #fff; box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
}
.flow-in, .main-content > * { animation: fade-up 0.36s ease both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes float-in { from { opacity: 0; transform: translateY(8px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }

html[lang="ar"] body { font-family: var(--font-arabic); }

a { color: var(--brand-500); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ── Typography ───────────────────────────────────────────────────────────── */

h1, h2, h3, h4 { line-height: 1.25; font-weight: 600; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }
p { line-height: 1.65; }

.page-title { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; color: var(--ink-950); }
.page-subtitle { font-size: 1.0625rem; color: var(--ink-500); margin-top: 0.5rem; }
.section-title { font-size: 1.5rem; font-weight: 700; text-align: center; margin-bottom: 2rem; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
  font-family: inherit; font-size: 0.9375rem; font-weight: 600;
  line-height: 1; cursor: pointer; border: 2px solid transparent;
  border-radius: var(--radius-md); padding: 0.65em 1.35em;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap; text-decoration: none;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--brand-500); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-700); text-decoration: none; }
.btn-outline { background: transparent; border-color: var(--brand-500); color: var(--brand-500); }
.btn-outline:hover:not(:disabled) { background: var(--brand-100); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink-700); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-100); text-decoration: none; }
.btn-sm { font-size: 0.8125rem; padding: 0.45em 0.95em; }
.btn-lg { font-size: 1.0625rem; padding: 0.85em 1.75em; }
.btn-full { width: 100%; }

/* ── Navigation ───────────────────────────────────────────────────────────── */

.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface-0); border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 1.5rem;
  height: var(--nav-h); display: flex; align-items: center; gap: 1rem;
}
.nav-brand {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 1.125rem; font-weight: 700; color: var(--ink-950); text-decoration: none;
  flex-shrink: 0;
}
.nav-brand-icon { width: 1.25rem; height: 1.25rem; color: var(--brand-500); }
.nav-links { display: flex; gap: 0.25rem; flex: 1; align-items: center; min-width: 0; }
.nav-link {
  font-size: 0.9rem; font-weight: 500; color: var(--ink-700);
  padding: 0.4em 0.75em; border-radius: var(--radius-sm);
  text-decoration: none; transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-link:hover { background: var(--surface-100); color: var(--brand-500); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
.nav-lang-toggle {
  font-size: 0.8125rem; color: var(--ink-500); padding: 0.3em 0.65em;
  border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none;
}
.nav-lang-toggle:hover { background: var(--surface-100); text-decoration: none; }
.nav-auth-area { display: flex; gap: 0.5rem; align-items: center; }
.nav-user-link { gap: 0.45rem; }
.nav-user-avatar {
  width: 24px; height: 24px; border-radius: 50%; background: var(--brand-100); color: var(--brand-700);
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 800; overflow: hidden;
}
.nav-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.nav-user-name { font-weight: 600; }
.nav-user-role { display: block; font-size: 0.65rem; color: var(--ink-500); text-transform: capitalize; }
.nav-hamburger {
  display: none; background: none; border: none; cursor: pointer;
  padding: 0.5rem 0.25rem; flex-shrink: 0; touch-action: manipulation;
}
.nav-hamburger span {
  display: block; width: 24px; height: 2.5px; background: var(--ink-800);
  margin: 5px 0; border-radius: 3px;
  transition: transform 0.22s ease, opacity 0.18s ease;
  transform-origin: center;
}
.nav-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.nav-mobile-menu {
  padding: 0.5rem 0.75rem 1rem;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 0.125rem;
  background: var(--surface-0);
}
.nav-mobile-menu[hidden] { display: none; }
.nav-mobile-menu .nav-link {
  padding: 0.75rem 0.875rem;
  font-size: 0.9625rem;
  border-radius: var(--radius-sm);
}
.nav-mobile-signup {
  font-weight: 700; color: var(--brand-600);
}
.nav-mobile-lang {
  color: var(--ink-500); font-size: 0.875rem;
}
.nav-mobile-sep {
  height: 1px; background: var(--line); margin: 0.5rem 0;
}
#nav-mobile-auth {
  display: flex; flex-direction: column; gap: 0.125rem;
}

@media (max-width: 1080px) {
  /* Brand grows → everything else clusters on the right */
  .nav-brand { margin-inline-end: auto; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex !important; align-items: center; justify-content: center; }
  /* All nav-actions buttons + login/signup links go into the mobile drawer */
  .nav-lang-toggle { display: none; }
  .nav-auth-area > a:not(.nav-user-link) { display: none; }
  .nav-auth-area > button { display: none; }
  /* Show only a compact avatar when logged in */
  .nav-user-name, .nav-user-role { display: none; }
  .nav-user-avatar { width: 32px; height: 32px; font-size: 0.9rem; }
}

@media (min-width: 1081px) {
  .nav-actions { margin-inline-start: auto; }
}

/* ── Main & footer ────────────────────────────────────────────────────────── */

.main-content { flex: 1; }

.site-footer {
  background: var(--ink-950); color: var(--ink-300);
  padding: 2.5rem 1.5rem; margin-top: auto;
}
.footer-inner { max-width: 1280px; margin: 0 auto; text-align: center; }
.footer-brand { font-size: 1.125rem; font-weight: 700; color: #fff; margin-bottom: 0.25rem; }
.footer-tagline { font-size: 0.875rem; margin-bottom: 1rem; }
.footer-links { display: flex; justify-content: center; gap: 1.5rem; }
.footer-links a { color: var(--ink-300); font-size: 0.875rem; }
.footer-links a:hover { color: #fff; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.hero {
  display: grid; grid-template-columns: 1fr auto;
  align-items: center; gap: 3rem;
  max-width: 1280px; margin: 0 auto;
  padding: 5rem 1.5rem 4rem;
}
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } .hero-visual { display: none; } }

.hero-badge {
  display: inline-block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--brand-500); background: var(--brand-100);
  padding: 0.3em 0.75em; border-radius: 100px; margin-bottom: 1.25rem;
}
.hero-title { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; line-height: 1.15; margin-bottom: 1rem; }
.hero-subtitle { font-size: 1.125rem; color: var(--ink-500); max-width: 54ch; line-height: 1.65; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.hero-stats { display: flex; gap: 2rem; flex-wrap: wrap; }
.hero-stat { }
.hero-stat-number { display: block; font-size: 1.75rem; font-weight: 800; color: var(--brand-500); }
.hero-stat-label { font-size: 0.8125rem; color: var(--ink-500); }

.hero-card-stack { position: relative; width: 260px; }
.hero-card {
  background: var(--surface-0); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1rem 1.25rem; box-shadow: var(--shadow-md);
  display: flex; align-items: center; gap: 0.75rem;
}
.hero-card--offset { margin-top: -0.5rem; margin-left: 1.5rem; }
.hero-card-avatar { width: 2rem; height: 2rem; color: var(--brand-700); flex-shrink: 0; }
.hero-card-photo { width: 2rem; height: 2rem; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.hero-card-info { flex: 1; }
.hero-card-info strong { display: block; font-size: 0.9rem; font-weight: 600; }
.hero-card-info span { font-size: 0.8rem; color: var(--ink-500); }
.hero-card-rating { font-size: 0.875rem; font-weight: 700; color: var(--gold); }

/* ── Subjects strip ───────────────────────────────────────────────────────── */

.subjects-strip { background: var(--surface-50); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 3rem 1.5rem; }
.subjects-strip-inner { max-width: 1280px; margin: 0 auto; }
.subjects-strip-title { font-size: 1.375rem; font-weight: 700; text-align: center; margin-bottom: 2rem; }
.subjects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; }

.subject-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  padding: 1.25rem 0.75rem; border-radius: var(--radius-lg);
  border: 2px solid var(--line); background: var(--surface-0);
  text-decoration: none; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  cursor: pointer; text-align: center;
}
.subject-card:hover { border-color: var(--brand-500); box-shadow: var(--shadow-sm); transform: translateY(-2px); text-decoration: none; }
.subject-card--quran { border-color: var(--brand-100); }
.subject-card--quran:hover { border-color: var(--brand-500); }
.subject-card--arabic { border-color: var(--gold-bg); }
.subject-card--arabic:hover { border-color: var(--gold); }
.subject-icon { font-size: 1.5rem; }
.subject-name { font-size: 0.8125rem; font-weight: 600; color: var(--ink-700); }

/* ── Trust section ────────────────────────────────────────────────────────── */

.trust-section { padding: 4rem 1.5rem; }
.trust-inner { max-width: 1280px; margin: 0 auto; }
.trust-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5rem; }
.trust-card {
  padding: 1.75rem; border-radius: var(--radius-lg);
  border: 1px solid var(--line); background: var(--surface-50);
  text-align: center;
}
.trust-icon { width: 2rem; height: 2rem; margin-bottom: 0.75rem; color: var(--brand-700); }
.trust-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.trust-card p { font-size: 0.875rem; color: var(--ink-500); }

/* ── CTA section ──────────────────────────────────────────────────────────── */

.cta-section { background: var(--ink-950); color: #fff; padding: 4rem 1.5rem; }
.cta-inner { max-width: 640px; margin: 0 auto; text-align: center; }
.cta-inner h2 { font-size: 1.75rem; color: #fff; margin-bottom: 0.75rem; }
.cta-inner p { color: var(--ink-300); margin-bottom: 2rem; }
.cta-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.cta-actions .btn-outline { border-color: var(--ink-300); color: var(--ink-300); }
.cta-actions .btn-outline:hover { border-color: #fff; color: #fff; background: transparent; }

/* ── Chips & badges ───────────────────────────────────────────────────────── */

.chip {
  display: inline-flex; align-items: center;
  font-size: 0.8125rem; font-weight: 500; cursor: pointer;
  padding: 0.35em 0.85em; border-radius: 100px;
  border: 1.5px solid var(--line); background: var(--surface-0); color: var(--ink-700);
  transition: all 0.15s;
}
.chip:hover { border-color: var(--brand-400); color: var(--brand-500); }
.chip--active { border-color: var(--brand-500); background: var(--brand-100); color: var(--brand-700); }

.badge {
  display: inline-flex; align-items: center;
  font-size: 0.7rem; font-weight: 700; padding: 0.2em 0.6em;
  border-radius: 100px; background: var(--surface-100); color: var(--ink-500);
}
.badge--hafiz { background: var(--gold-bg); color: var(--gold); }
.badge--ijazah { background: var(--brand-100); color: var(--brand-700); }
.badge--verified { background: #dcfce7; color: #166534; }

.subject-tag {
  display: inline-block; font-size: 0.75rem; font-weight: 600;
  padding: 0.2em 0.6em; border-radius: 100px; background: var(--surface-100); color: var(--ink-500);
}
.subject-tag--quran { background: var(--brand-100); color: var(--brand-700); }
.subject-tag--arabic { background: var(--gold-bg); color: #a07a10; }

/* ── Forms ────────────────────────────────────────────────────────────────── */

.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--ink-700); margin-bottom: 0.35rem; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 0.65em 0.9em;
  border: 1.5px solid var(--line); border-radius: var(--radius-md);
  font-family: inherit; font-size: 0.9375rem; color: var(--ink-950);
  background: var(--surface-0); transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgb(31 153 143 / 15%);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 0.8rem; color: var(--ink-500); margin-top: 0.25rem; }
.form-error {
  font-size: 0.875rem; color: var(--danger); background: var(--danger-bg);
  border-radius: var(--radius-sm); padding: 0.6em 0.9em;
  margin: 0.25rem 0 1rem;
}
.form-message { font-size: 0.875rem; color: var(--brand-700); background: var(--brand-100); border-radius: var(--radius-sm); padding: 0.6em 0.9em; margin-top: 1rem; }
.form-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 640px) { .form-grid-2 { grid-template-columns: 1fr; } }

.password-wrap { position: relative; }
.password-wrap .form-input { padding-right: 2.75rem; }
.password-toggle {
  position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 1rem; color: var(--ink-500);
}
.password-icon { width: 1rem; height: 1rem; }
html[dir="rtl"] .password-wrap .form-input { padding-right: 0.9em; padding-left: 2.75rem; }
html[dir="rtl"] .password-toggle { right: auto; left: 0.5rem; }

.checkbox-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; cursor: pointer; margin-bottom: 0.5rem; }
.checkbox-label input[type="checkbox"] { width: 1rem; height: 1rem; accent-color: var(--brand-500); }

/* ── Auth pages ───────────────────────────────────────────────────────────── */

.auth-page { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - var(--nav-h) - 80px); padding: 2rem 1rem; }
.auth-card {
  background: var(--surface-0); border: 1px solid var(--line);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  padding: 2.5rem; width: 100%; max-width: 440px;
}
.auth-card--signup { max-width: 680px; }
.auth-brand { display: flex; align-items: center; gap: 0.5rem; justify-content: center; margin-bottom: 1.5rem; color: var(--ink-950); font-size: 1.125rem; font-weight: 700; }
.auth-brand-icon { color: var(--brand-500); width: 1.375rem; height: 1.375rem; }
.auth-title { text-align: center; font-size: 1.625rem; font-weight: 800; margin-bottom: 0.25rem; }
.auth-subtitle { text-align: center; color: var(--ink-500); font-size: 0.9rem; margin-bottom: 1.75rem; }
.auth-form { }
.auth-switch { text-align: center; font-size: 0.875rem; color: var(--ink-500); margin-top: 1.25rem; }
.auth-switch a { color: var(--brand-500); font-weight: 600; }
.auth-success { background: var(--brand-100); color: var(--brand-700); border-radius: var(--radius-md); padding: 1rem; text-align: center; font-size: 0.9375rem; margin-top: 1rem; }
.auth-error-state { background: var(--danger-bg); color: var(--danger); border-radius: var(--radius-md); padding: 1rem; text-align: center; font-size: 0.9375rem; margin-top: 1rem; }

.signup-role-toggle { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; }
.role-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
  padding: 0.85rem; border: 2px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface-50); cursor: pointer; font-size: 0.9rem; font-weight: 600;
  transition: border-color 0.15s, background 0.15s; font-family: inherit;
}
.role-btn--active { border-color: var(--brand-500); background: var(--brand-100); color: var(--brand-700); }
.role-icon { width: 1.25rem; height: 1.25rem; }

.signup-application { text-align: center; }
.signup-application-art {
  height: 156px; margin: -0.25rem -0.25rem 1.5rem;
  border-radius: var(--radius-lg); background: #ffe4f0;
  display: grid; place-items: center;
}
.signup-application-hero-icon { width: 86px; height: 86px; color: var(--ink-950); }
.signup-application h2 { font-size: clamp(1.75rem, 4vw, 2.4rem); font-weight: 800; margin-bottom: 0.75rem; }
.signup-application p { max-width: 48ch; margin: 0 auto 1.25rem; color: var(--ink-500); }
.signup-subject-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem; margin: 1.25rem 0;
}
.signup-subject-chip {
  display: flex; align-items: center; justify-content: flex-start; gap: 0.625rem;
  min-height: 56px; padding: 0.75rem 0.9rem;
  border: 2px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface-0); color: var(--ink-950);
  font-family: inherit; font-weight: 600; cursor: pointer; text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}
html[dir="rtl"] .signup-subject-chip { text-align: right; }
.signup-subject-chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.signup-subject-chip--quran { border-color: var(--brand-100); }
.signup-subject-chip--arabic { border-color: var(--gold-bg); }
.signup-subject-chip--selected { border-color: var(--brand-500); background: var(--brand-100); color: var(--brand-700); }
.signup-subject-icon { width: 1.35rem; height: 1.35rem; flex-shrink: 0; }
.signup-application-actions { display: grid; gap: 0.65rem; margin-top: 1rem; }

/* ── Onboarding wizard ────────────────────────────────────────────────────── */

.onboarding-wrapper {
  max-width: 700px; margin: 0 auto; padding: 2rem 1.5rem 3rem;
  min-height: calc(100vh - var(--nav-h));
  display: flex; flex-direction: column;
}
.onboarding-header { margin-bottom: 2rem; }
.onboarding-progress { height: 4px; background: var(--line); border-radius: 100px; overflow: hidden; margin-bottom: 0.6rem; }
.ob-progress-bar { height: 100%; background: var(--brand-500); border-radius: 100px; transition: width 0.35s ease; }
.onboarding-step-label { font-size: 0.8125rem; color: var(--ink-500); font-weight: 500; }
.onboarding-body { flex: 1; }
.ob-step-container { }
.ob-step-title { font-size: 1.625rem; font-weight: 700; margin-bottom: 0.5rem; }
.ob-step-hint { font-size: 0.9rem; color: var(--ink-500); margin-bottom: 1.25rem; }
.onboarding-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 1.5rem; border-top: 1px solid var(--line); margin-top: 1.5rem; }

.ob-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.875rem; margin-top: 1.25rem; }
.ob-choices--multi { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.ob-choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem;
  padding: 1rem 1.125rem; border: 2px solid var(--line);
  border-radius: var(--radius-lg); background: var(--surface-50);
  cursor: pointer; text-align: left; font-family: inherit;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
html[dir="rtl"] .ob-choice { text-align: right; }
.ob-choice:hover { border-color: var(--brand-400); background: var(--surface-0); }
.ob-choice--selected { border-color: var(--brand-500); background: var(--brand-100); }
.ob-choice-icon { width: 1.375rem; height: 1.375rem; color: var(--brand-700); }
.ob-choice-label { font-size: 0.9375rem; font-weight: 600; color: var(--ink-950); }
.ob-choice-sub { font-size: 0.8rem; color: var(--ink-500); }

.ob-budget-wrap { margin-top: 1.25rem; }
.ob-budget-choices { display: flex; flex-wrap: wrap; gap: 0.875rem; }
.ob-budget-choices .ob-choice { min-width: 100px; }

/* ── Tutor listing ────────────────────────────────────────────────────────── */

.tutors-page { max-width: 1280px; margin: 0 auto; padding: 2rem 1.5rem 3rem; }
.tutors-header { margin-bottom: 2rem; }
.tutors-mode-toggle { display: flex; gap: 0.5rem; margin-top: 1rem; }
.mode-btn {
  font-size: 0.875rem; font-weight: 600; padding: 0.5em 1.1em;
  border: 1.5px solid var(--line); border-radius: 100px; background: var(--surface-0);
  cursor: pointer; font-family: inherit; transition: all 0.15s; color: var(--ink-700);
}
.mode-btn--active { border-color: var(--brand-500); background: var(--brand-100); color: var(--brand-700); }

.tutors-layout { display: grid; grid-template-columns: 260px 1fr; gap: 2rem; align-items: start; }
@media (max-width: 900px) { .tutors-layout { grid-template-columns: 1fr; } .tutors-sidebar { position: static; } }

.tutors-sidebar {
  position: sticky; top: calc(var(--nav-h) + 1rem);
  background: var(--surface-0); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 1.25rem;
}
.filter-heading { font-size: 0.9375rem; font-weight: 700; margin-bottom: 1rem; }
.filter-section { display: flex; flex-direction: column; gap: 1.25rem; }
.filter-group { }
.filter-label { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--ink-700); margin-bottom: 0.5rem; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.filter-range-row { display: flex; align-items: center; gap: 0.75rem; }
.filter-range-row input[type="range"] { flex: 1; accent-color: var(--brand-500); }
.filter-range-row span { font-size: 0.875rem; font-weight: 600; min-width: 3ch; }
.filter-reset { align-self: flex-start; color: var(--ink-500); font-size: 0.8rem; }

.tutors-main { min-width: 0; }
.tutors-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.tutors-count { font-size: 0.875rem; color: var(--ink-500); }
.tutors-count span:first-child { font-weight: 700; color: var(--ink-950); }
.sort-select { font-size: 0.875rem; padding: 0.4em 0.75em; border: 1.5px solid var(--line); border-radius: var(--radius-sm); font-family: inherit; }

.tutors-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.tutors-loading { grid-column: 1/-1; display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 3rem; color: var(--ink-500); }
.tutors-empty { padding: 3rem; text-align: center; color: var(--ink-500); }

.tutor-card {
  background: var(--surface-0); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden; transition: box-shadow 0.2s, transform 0.2s;
  display: flex; flex-direction: column;
}
.tutor-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.tutor-card-link { display: flex; flex-direction: column; text-decoration: none; color: inherit; flex: 1; }
.tutor-card-link:hover { text-decoration: none; }
.tutor-card-photo-wrap { background: var(--surface-100); height: 160px; overflow: hidden; }
.tutor-card-photo { width: 100%; height: 100%; object-fit: cover; }
.tutor-card-photo-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--ink-300); }
.placeholder-icon { width: 3rem; height: 3rem; }
.tutor-card-body { padding: 1rem 1.125rem; flex: 1; display: flex; flex-direction: column; gap: 0.4rem; }
.tutor-card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.tutor-card-name { font-size: 1rem; font-weight: 700; }
.tutor-card-badges { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.tutor-card-country { font-size: 0.8rem; color: var(--ink-500); }
.tutor-card-bio { font-size: 0.875rem; color: var(--ink-700); line-height: 1.5; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.tutor-card-subjects { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tutor-card-footer { display: flex; align-items: center; gap: 0.75rem; margin-top: auto; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.tutor-card-stat { display: flex; align-items: center; gap: 0.25rem; font-size: 0.8125rem; }
.tutor-card-stat-icon { width: 0.875rem; height: 0.875rem; color: var(--gold); }
.tutor-card-rate { margin-left: auto; font-weight: 700; font-size: 0.9rem; color: var(--brand-700); }
html[dir="rtl"] .tutor-card-rate { margin-left: 0; margin-right: auto; }
.tutor-card-book { margin: 0.75rem 1.125rem 1rem; }

.match-reason-callout {
  display: flex; align-items: flex-start; gap: 0.4rem;
  background: var(--gold-bg); border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem; margin-top: 0.25rem;
}
.match-reason-icon { width: 0.875rem; height: 0.875rem; flex-shrink: 0; color: var(--gold); }
.match-reason-callout p { font-size: 0.8rem; color: #7a5c00; line-height: 1.45; }

/* ── Tutor profile page ───────────────────────────────────────────────────── */

.tutor-profile-page { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.tutor-profile-loading { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 4rem; color: var(--ink-500); }

.tutor-profile-hero {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 1.5rem; align-items: flex-start; margin-bottom: 2rem;
  padding-bottom: 2rem; border-bottom: 1px solid var(--line);
}
@media (max-width: 700px) { .tutor-profile-hero { grid-template-columns: 1fr; } .tutor-profile-cta { flex-direction: row; flex-wrap: wrap; } }

.tutor-profile-photo-wrap { width: 100px; height: 100px; border-radius: 50%; overflow: hidden; background: var(--surface-100); flex-shrink: 0; }
.tutor-profile-photo { width: 100%; height: 100%; object-fit: cover; }
.tutor-profile-photo-placeholder { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--ink-300); }
.tutor-profile-name { font-size: 1.5rem; font-weight: 800; margin-bottom: 0.25rem; }
.tutor-profile-country { font-size: 0.875rem; color: var(--ink-500); margin-bottom: 0.5rem; }
.tutor-profile-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.75rem; }
.tutor-profile-meta { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.tutor-meta-stat { display: flex; align-items: center; gap: 0.35rem; font-size: 0.875rem; color: var(--ink-700); }
.meta-icon { width: 1rem; height: 1rem; color: var(--brand-700); }

.tutor-profile-cta { display: flex; flex-direction: column; gap: 0.75rem; align-items: flex-start; }
.tutor-profile-rate { font-size: 1.375rem; font-weight: 800; color: var(--brand-700); }

.tutor-section { margin-bottom: 2.5rem; }
.tutor-section-title { font-size: 1.125rem; font-weight: 700; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--line); }
.tutor-about-text { color: var(--ink-700); line-height: 1.7; white-space: pre-wrap; }

.tutor-subjects-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tutor-subject-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.4em 0.85em; border-radius: 100px; font-size: 0.875rem; }
.tutor-subject-item .subject-name { font-weight: 600; }
.tutor-subject-item .subject-levels { font-size: 0.75rem; color: var(--ink-500); }

.credentials-list { display: flex; flex-direction: column; gap: 0.5rem; }
.credential-item { font-size: 0.9rem; color: var(--ink-700); }

.ijazah-list { display: flex; flex-direction: column; gap: 0.75rem; }
.ijazah-card { padding: 0.875rem 1rem; background: var(--brand-100); border-radius: var(--radius-md); }
.ijazah-riwayah { font-weight: 700; margin-bottom: 0.25rem; }
.ijazah-sheikh { font-size: 0.875rem; color: var(--ink-700); }

.availability-week { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.avail-day { padding: 0.35em 0.85em; background: var(--surface-100); border-radius: 100px; font-size: 0.875rem; font-weight: 600; }

.reviews-list { display: flex; flex-direction: column; gap: 1rem; }
.reviews-empty { color: var(--ink-500); font-size: 0.9rem; }
.review-card { padding: 1rem; background: var(--surface-50); border-radius: var(--radius-md); border: 1px solid var(--line); }
.review-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.review-stars { color: var(--gold); letter-spacing: 0.05em; }
.review-author { font-size: 0.875rem; font-weight: 600; }
.review-comment { font-size: 0.9rem; color: var(--ink-700); line-height: 1.55; }

.packages-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.package-card {
  padding: 1.25rem; background: var(--surface-50); border: 1px solid var(--line);
  border-radius: var(--radius-lg); display: flex; flex-direction: column; gap: 0.5rem;
}
.package-name { font-size: 1rem; font-weight: 700; }
.package-details { display: flex; flex-wrap: wrap; gap: 0.5rem; font-size: 0.8125rem; color: var(--ink-500); }
.package-discount { color: var(--accent-500); font-weight: 700; }
.package-price { font-size: 1.375rem; font-weight: 800; color: var(--brand-700); }

/* ── Booking page ─────────────────────────────────────────────────────────── */

.booking-page { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.booking-header { margin-bottom: 2rem; }
.back-link { font-size: 0.875rem; color: var(--ink-500); display: inline-flex; align-items: center; gap: 0.25rem; margin-bottom: 0.75rem; }
.booking-layout { display: grid; grid-template-columns: 280px 1fr; gap: 2rem; }
@media (max-width: 768px) { .booking-layout { grid-template-columns: 1fr; } }

.booking-tutor-summary {
  position: sticky; top: calc(var(--nav-h) + 1rem);
  background: var(--surface-50); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 1.25rem;
}
.booking-tutor-mini { display: flex; align-items: center; gap: 0.75rem; }
.booking-tutor-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--surface-100); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; overflow: hidden; }
.booking-tutor-avatar img { width: 100%; height: 100%; object-fit: cover; }
.booking-tutor-mini strong { display: block; font-weight: 700; }
.booking-tutor-mini span { font-size: 0.875rem; color: var(--ink-500); }

.booking-step { margin-bottom: 2rem; }
.booking-step-title { font-size: 1.125rem; font-weight: 700; display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; }
.step-num { width: 28px; height: 28px; background: var(--brand-500); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.875rem; font-weight: 700; flex-shrink: 0; }
.booking-sub-title { font-size: 0.9375rem; font-weight: 600; margin-bottom: 0.75rem; }

.booking-choice-group { display: flex; flex-direction: column; gap: 0.75rem; }
.booking-choice input[type="radio"] { position: absolute; opacity: 0; }
.booking-choice { display: block; }
.booking-choice-card {
  display: flex; align-items: center; gap: 0.875rem;
  padding: 1rem 1.125rem; border: 2px solid var(--line);
  border-radius: var(--radius-lg); cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.booking-choice input:checked + .booking-choice-card { border-color: var(--brand-500); background: var(--brand-100); }
.booking-choice-icon { width: 1.5rem; height: 1.5rem; color: var(--brand-700); flex-shrink: 0; }
.booking-choice-info strong { display: block; font-weight: 700; }
.booking-choice-info span { font-size: 0.85rem; color: var(--ink-500); }

.booking-packages { margin-top: 1.25rem; }
.booking-actions { display: flex; justify-content: space-between; align-items: center; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.booking-summary { background: var(--surface-50); border-radius: var(--radius-lg); padding: 1.25rem; border: 1px solid var(--line); margin-bottom: 1.25rem; }
.booking-confirm-row { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.booking-confirm-row:last-child { border-bottom: none; }
.booking-confirm-row label { color: var(--ink-500); }
.booking-error { background: var(--danger-bg); color: var(--danger); border-radius: var(--radius-sm); padding: 0.6em 0.9em; font-size: 0.875rem; }

/* ── Dashboard ────────────────────────────────────────────────────────────── */

.dashboard-page {
  display: grid; grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--nav-h));
}

.dashboard-sidebar {
  position: sticky; top: var(--nav-h); height: calc(100vh - var(--nav-h));
  overflow-y: auto; background: var(--surface-50);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.dashboard-user-card { padding: 1.25rem; display: flex; align-items: center; gap: 0.75rem; border-bottom: 1px solid var(--line); }
.dash-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-100); color: var(--brand-700); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dash-avatar img, .student-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dash-avatar-icon { width: 1.25rem; height: 1.25rem; }
.dash-user-name { font-weight: 700; font-size: 0.9rem; }
.dash-user-role { font-size: 0.8rem; color: var(--ink-500); }

.dash-tab-nav { flex: 1; padding: 0.75rem 0.5rem; display: flex; flex-direction: column; gap: 0.15rem; }
.dash-tab {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.55rem 0.875rem; border-radius: var(--radius-sm);
  border: none; background: none; cursor: pointer; font-family: inherit; font-size: 0.875rem; font-weight: 500;
  color: var(--ink-700); transition: background 0.15s, color 0.15s; text-align: left; width: 100%;
}
html[dir="rtl"] .dash-tab { text-align: right; }
.dash-tab:hover { background: var(--surface-100); }
.dash-tab--active { background: var(--brand-100); color: var(--brand-700); font-weight: 700; }
.dash-tab-icon { width: 1rem; height: 1rem; flex-shrink: 0; }

.dash-sidebar-footer { padding: 0.75rem; border-top: 1px solid var(--line); }

.dashboard-main { padding: 2rem; min-width: 0; }
.dash-panel { display: none; }
.dash-panel--active { display: block; animation: fade-up 0.24s ease both; }
.dash-panel-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 1.5rem; }

.dash-stats-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.dash-stat-card {
  flex: 1; min-width: 120px;
  padding: 1.25rem; background: var(--surface-50); border: 1px solid var(--line);
  border-radius: var(--radius-lg); text-align: center;
}
.dash-stat-num { display: block; font-size: 1.75rem; font-weight: 800; color: var(--brand-500); }
.dash-stat-label { font-size: 0.8rem; color: var(--ink-500); }

.dash-quick-sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.dash-quick-card { background: var(--surface-50); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.25rem; }
.dash-quick-card h2 { font-size: 0.9375rem; font-weight: 700; margin-bottom: 0.75rem; }
.dash-quick-item { padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.dash-quick-item:last-child { border-bottom: none; }
.dash-quick-item > span { display: block; }
.dash-quick-item-title { display: block; font-size: 0.875rem; font-weight: 600; }
.dash-quick-item-sub { font-size: 0.8rem; color: var(--ink-500); }
.dash-quick-item--unread .dash-quick-item-title::before { content: "●"; color: var(--brand-500); margin-right: 0.35rem; font-size: 0.6rem; }
.dash-empty { font-size: 0.875rem; color: var(--ink-500); padding: 0.5rem 0; }

.dash-hint { font-size: 0.9rem; color: var(--ink-500); margin-bottom: 1.25rem; }

.dash-approval-banner {
  background: var(--gold-bg); border: 1px solid var(--gold); border-radius: var(--radius-md);
  padding: 0.875rem 1rem; margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.dash-approval-banner p { font-size: 0.9rem; color: #7a5c00; }
.tutor-dashboard--pending .dash-tab:not([data-tab="overview"]) { display: none; }
.tutor-dashboard--pending .dash-tab-nav { flex: 0; }
.tutor-dashboard--pending .dashboard-sidebar { height: auto; min-height: 0; align-self: start; }
.tutor-dashboard--pending .dash-sidebar-footer { margin-top: 0; }

@media (max-width: 768px) {
  .dashboard-page { display: flex; flex-direction: column; }
  .dashboard-sidebar {
    position: sticky; top: var(--nav-h); z-index: 10;
    height: auto !important; min-height: 0; overflow: hidden;
    flex-direction: row; align-items: center;
    border-right: none; border-bottom: 2px solid var(--line);
  }
  .dashboard-user-card { display: none !important; }
  .dash-sidebar-footer { display: none !important; }
  .dash-tab-nav {
    flex-direction: row !important; flex: 1;
    overflow-x: auto; scrollbar-width: none;
    padding: 0.375rem 0.5rem; gap: 0.25rem;
    -webkit-overflow-scrolling: touch;
  }
  .dash-tab-nav::-webkit-scrollbar { display: none; }
  .dash-tab {
    white-space: nowrap; flex-shrink: 0; width: auto !important;
    padding: 0.45rem 0.75rem; font-size: 0.8125rem;
  }
  .dash-tab-icon { width: 1rem; height: 1rem; }
  .dashboard-main { padding: 1rem; }
  .dash-panel-title { font-size: 1.25rem; margin-bottom: 1rem; }
  .dash-stats-row { gap: 0.625rem; }
  .dash-quick-sections { grid-template-columns: 1fr; }
  .tutor-dashboard--pending .dashboard-sidebar { flex-direction: row; }
}

.tutor-application-workflow {
  max-width: 720px; padding: 1.25rem; margin-bottom: 1.5rem;
  background: var(--surface-50); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.tutor-application-workflow h2 { font-size: 1.1rem; margin-bottom: 0.35rem; }
.tutor-application-workflow > p { font-size: 0.88rem; color: var(--ink-500); margin-bottom: 1.25rem; }

/* ── Sessions ─────────────────────────────────────────────────────────────── */

.sessions-filter-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.sessions-list { display: flex; flex-direction: column; gap: 0.75rem; }
.session-card {
  padding: 1rem 1.125rem; background: var(--surface-50); border: 1px solid var(--line);
  border-radius: var(--radius-md); display: flex; justify-content: space-between; align-items: center;
}
.session-card-info { display: flex; flex-direction: column; gap: 0.2rem; }
.session-subject { font-weight: 700; font-size: 0.9rem; }
.session-tutor, .session-date, .session-duration { font-size: 0.8125rem; color: var(--ink-500); }
.session-status { font-size: 0.75rem; font-weight: 700; padding: 0.25em 0.65em; border-radius: 100px; }
.session-status--scheduled { background: var(--brand-100); color: var(--brand-700); }
.session-status--completed { background: #dcfce7; color: #166534; }
.session-status--cancelled { background: var(--danger-bg); color: var(--danger); }

/* ── Homework ─────────────────────────────────────────────────────────────── */

.homework-list { display: flex; flex-direction: column; gap: 0.75rem; }
.homework-card { padding: 1.125rem; background: var(--surface-50); border: 1px solid var(--line); border-radius: var(--radius-md); }
.homework-card h4 { font-size: 0.9375rem; font-weight: 700; margin-bottom: 0.35rem; }
.homework-card p { font-size: 0.875rem; color: var(--ink-700); margin-bottom: 0.5rem; }
.homework-due { font-size: 0.8rem; color: var(--ink-500); }
.homework-feedback { margin-top: 0.5rem; font-size: 0.85rem; color: var(--brand-700); background: var(--brand-100); border-radius: var(--radius-sm); padding: 0.5rem 0.75rem; }
.homework-submission { margin-top: 0.75rem; font-size: 0.85rem; color: var(--ink-700); background: var(--surface-0); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.65rem 0.8rem; }
.dash-homework-actions { margin-bottom: 1rem; }

/* ── Reports ──────────────────────────────────────────────────────────────── */

.reports-list { display: flex; flex-direction: column; gap: 0.75rem; }
.report-card {
  padding: 1rem 1.125rem; background: var(--surface-50); border: 1px solid var(--line);
  border-radius: var(--radius-md); display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.student-card {
  padding: 1rem 1.125rem; background: var(--surface-50); border: 1px solid var(--line);
  border-radius: var(--radius-md); display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.student-card-main { display: flex; align-items: center; gap: 0.75rem; min-width: 220px; }
.student-card-main strong { display: block; font-size: 0.95rem; }
.student-card-main span { display: block; font-size: 0.8rem; color: var(--ink-500); margin-top: 0.1rem; }
.student-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-100); color: var(--brand-700); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.student-card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ── Progress ─────────────────────────────────────────────────────────────── */

.progress-tabs-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.progress-content { }
.progress-empty { font-size: 0.9rem; color: var(--ink-500); }
.progress-item { padding: 1.25rem; background: var(--surface-50); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.progress-item h3 { margin-bottom: 1rem; }
.progress-bar-wrap { background: var(--line); border-radius: 100px; height: 8px; overflow: hidden; margin-bottom: 0.5rem; }
.progress-bar-fill { background: var(--brand-500); height: 100%; border-radius: 100px; transition: width 0.5s ease; }
.progress-notes { margin-top: 0.75rem; font-size: 0.875rem; color: var(--ink-700); }

/* ── Messages ─────────────────────────────────────────────────────────────── */

.messages-layout { display: grid; grid-template-columns: 280px 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; height: 500px; }
.messages-layout--fullpage { height: calc(100vh - var(--nav-h) - 120px); margin: 0 1.5rem; }
@media (max-width: 700px) { .messages-layout { grid-template-columns: 1fr; height: auto; } }

.messages-page { padding: 1.5rem 0; }
.messages-page-header { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem 1.25rem; }

.messages-threads { border-right: 1px solid var(--line); overflow-y: auto; background: var(--surface-50); }
.messages-loading { display: flex; justify-content: center; padding: 1.5rem; }
.message-thread {
  display: flex; flex-direction: column; padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--line); cursor: pointer;
  background: none; border-left: none; border-right: none; border-top: none;
  font-family: inherit; text-align: left; transition: background 0.15s; width: 100%;
}
html[dir="rtl"] .message-thread { text-align: right; }
.message-thread:hover { background: var(--surface-100); }
.message-thread--active { background: var(--brand-100); }
.thread-name { font-weight: 700; font-size: 0.875rem; }
.thread-last { font-size: 0.8rem; color: var(--ink-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-badge { background: var(--brand-500); color: #fff; border-radius: 100px; font-size: 0.7rem; font-weight: 700; padding: 0.15em 0.5em; align-self: flex-start; margin-top: 0.2rem; }

.messages-conversation { display: flex; flex-direction: column; overflow: hidden; }
.messages-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--ink-500); font-size: 0.9rem; }
.messages-empty-state {
  height: 100%; min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.4rem; text-align: center; padding: 1.25rem; color: var(--ink-500);
}
.messages-empty-state strong { color: var(--ink-700); font-size: 0.95rem; }
.messages-empty-state span { max-width: 28ch; font-size: 0.82rem; line-height: 1.5; }
.messages-empty-icon { width: 1.75rem; height: 1.75rem; color: var(--brand-500); }
.messages-empty-state--conversation { min-height: 100%; }
.conv-header { padding: 0.875rem 1rem; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 0.9rem; background: var(--surface-50); }
.conv-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.conv-msg { max-width: 70%; }
.conv-msg p { padding: 0.65em 1em; background: var(--surface-100); border-radius: var(--radius-md); font-size: 0.9rem; line-height: 1.5; }
.conv-msg--mine { align-self: flex-end; }
.conv-msg--mine p { background: var(--brand-100); color: var(--brand-700); }
.conv-msg-time { font-size: 0.7rem; color: var(--ink-300); display: block; margin-top: 0.2rem; }
.conv-form { display: flex; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid var(--line); }
.conv-form .form-input { flex: 1; }

/* ── Admin ────────────────────────────────────────────────────────────────── */

.applications-list, .disputes-list, .users-list { display: flex; flex-direction: column; gap: 0.75rem; }
.application-card, .dispute-card {
  padding: 1.125rem; background: var(--surface-50); border: 1px solid var(--line);
  border-radius: var(--radius-md); display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap;
}
.application-info strong, .dispute-info strong { font-weight: 700; display: block; margin-bottom: 0.25rem; }
.application-info p, .dispute-info p { font-size: 0.875rem; color: var(--ink-700); margin-bottom: 0.25rem; }
.application-info span, .dispute-info span { font-size: 0.8rem; color: var(--ink-500); display: block; }
.application-actions, .dispute-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.admin-search-row { margin-bottom: 1rem; max-width: 400px; }

/* ── Profile edit ─────────────────────────────────────────────────────────── */

.profile-edit-form { max-width: 640px; }
.profile-section-title { font-size: 0.875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-500); margin: 1.75rem 0 0.875rem; border-bottom: 1px solid var(--line); padding-bottom: 0.4rem; }
.subjects-editor { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.4rem; margin-bottom: 0.5rem; }
.ijazah-editor-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.75rem; }
.ijazah-editor-item { padding: 0.625rem 0.875rem; background: var(--surface-100); border-radius: var(--radius-sm); font-size: 0.875rem; }

/* ── Packages list ────────────────────────────────────────────────────────── */

.packages-list { display: flex; flex-direction: column; gap: 0.75rem; }
.students-list { display: flex; flex-direction: column; gap: 0.75rem; }
.package-card--outline { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.package-card--outline h3 { font-size: 1rem; }
.package-card--outline p { font-size: 0.85rem; color: var(--ink-500); }
.curriculum-builder { max-width: 560px; padding: 1.25rem; background: var(--surface-50); border: 1px solid var(--line); border-radius: var(--radius-lg); margin-bottom: 1.25rem; }
.curriculum-list { display: flex; flex-direction: column; gap: 0.75rem; }
.curriculum-card {
  display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start;
  padding: 1rem 1.125rem; background: var(--surface-50); border: 1px solid var(--line); border-radius: var(--radius-md);
}
.curriculum-card strong, .curriculum-card span { display: block; }
.curriculum-card span { font-size: 0.8rem; color: var(--ink-500); margin-top: 0.2rem; }
.curriculum-card p { font-size: 0.85rem; color: var(--ink-700); margin-top: 0.45rem; }
.package-choice { display: block; }
.package-choice input[type="radio"] { position: absolute; opacity: 0; }
.package-choice .package-card { cursor: pointer; border: 2px solid var(--line); transition: border-color 0.15s; }
.package-choice input:checked + .package-card { border-color: var(--brand-500); background: var(--brand-100); }

/* ── Earnings ─────────────────────────────────────────────────────────────── */

.earnings-summary { padding: 1.25rem; background: var(--surface-50); border: 1px solid var(--line); border-radius: var(--radius-lg); margin-bottom: 1.5rem; }
.earnings-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.5rem; }
.earnings-connect { margin-top: 1rem; }

/* ── Settings ─────────────────────────────────────────────────────────────── */

.settings-sections { max-width: 480px; }
.settings-section { }
.settings-section h2 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }

/* ── Modal ────────────────────────────────────────────────────────────────── */

.modal-backdrop {
  position: fixed; inset: 0; background: rgb(0 0 0 / 50%); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.modal {
  background: var(--surface-0); border-radius: var(--radius-xl); padding: 2rem;
  width: 100%; max-width: 480px; box-shadow: var(--shadow-lg);
}
.modal h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 1.25rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.25rem; }

/* ── Help ─────────────────────────────────────────────────────────────────── */

.help-page { max-width: 960px; margin: 0 auto; padding: 3rem 1.5rem; }
.help-header { text-align: center; margin-bottom: 3rem; }
.help-grid { display: grid; grid-template-columns: 1fr 280px; gap: 2.5rem; }
@media (max-width: 768px) { .help-grid { grid-template-columns: 1fr; } }

.help-section h2, .help-contact h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 1.25rem; }
.faq-list { display: flex; flex-direction: column; gap: 0.5rem; }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.faq-question { padding: 1rem 1.125rem; font-weight: 600; font-size: 0.9375rem; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.faq-question::after { content: "+"; font-size: 1.25rem; color: var(--ink-300); }
.faq-item[open] .faq-question::after { content: "–"; }
.faq-answer { padding: 0 1.125rem 1rem; font-size: 0.9rem; color: var(--ink-700); line-height: 1.6; }

.help-contact {
  padding: 1.5rem; background: var(--surface-50); border: 1px solid var(--line);
  border-radius: var(--radius-lg); height: fit-content;
}
.help-contact p { font-size: 0.9rem; color: var(--ink-700); margin-bottom: 1rem; }
.help-contact h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.help-contact-divider { border: none; border-top: 1px solid var(--line); margin: 1.25rem 0; }

/* ── 404 ──────────────────────────────────────────────────────────────────── */

.not-found-page { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - var(--nav-h) - 80px); padding: 2rem; }
.not-found-content { text-align: center; }
.not-found-number { font-size: 7rem; font-weight: 900; color: var(--line); line-height: 1; margin-bottom: 1rem; }
.not-found-content h1 { margin-bottom: 0.5rem; }
.not-found-content p { color: var(--ink-500); margin-bottom: 1.5rem; }

/* ── Spinner ──────────────────────────────────────────────────────────────── */

.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--brand-500);
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-text { color: var(--danger); font-size: 0.9rem; }

/* ── RTL overrides ────────────────────────────────────────────────────────── */

html[dir="rtl"] .nav-links { flex-direction: row-reverse; }
html[dir="rtl"] .hero-actions { flex-direction: row; }
html[dir="rtl"] .messages-threads { border-right: none; border-left: 1px solid var(--line); }
html[dir="rtl"] .dash-tab { text-align: right; }
html[dir="rtl"] .conv-msg--mine { align-self: flex-start; }

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .hero { padding: 3rem 1rem 2.5rem; }
  .subjects-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .trust-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-main { padding: 1rem; }
  .tutors-layout { grid-template-columns: 1fr; }
  .ob-choices { grid-template-columns: 1fr; }
  .booking-layout { grid-template-columns: 1fr; }
  .tutor-profile-hero { grid-template-columns: 1fr; }
}

/* ── Hero welcome (logged-in state) ───────────────────────────────────────── */
.hero-welcome-box { display: flex; flex-direction: column; gap: 1rem; }
.hero-welcome-greeting { font-size: 1.15rem; font-weight: 600; color: var(--text); }

/* ── Admin users list ─────────────────────────────────────────────────────── */
.user-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 0.5rem; }
.user-info { display: flex; flex-direction: column; gap: 0.2rem; }
.user-email { font-size: 0.8rem; color: var(--text-muted); }
.user-card-actions { display: flex; align-items: center; gap: 0.75rem; }
.form-select--sm { padding: 0.3rem 0.5rem; font-size: 0.8rem; }
.admin-search-row { margin-bottom: 1rem; }

/* ── Application preview panel ────────────────────────────────────────────── */
.app-preview-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; margin-top: 1rem; }
.app-preview-note { color: var(--text-muted); margin-bottom: 1.25rem; font-size: 0.9rem; }
.app-preview-content { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem; }
.preview-row { display: flex; gap: 0.75rem; align-items: baseline; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.preview-row label { font-weight: 600; font-size: 0.85rem; min-width: 160px; color: var(--text-muted); }
.preview-row span, .preview-row a { font-size: 0.95rem; }

/* ── Application success panel ────────────────────────────────────────────── */
.app-success-panel { background: var(--surface); border: 2px solid var(--primary); border-radius: var(--radius); padding: 2.5rem 1.5rem; margin-top: 1rem; text-align: center; }
.app-success-inner { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.app-success-icon { width: 3.5rem; height: 3.5rem; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.75rem; font-weight: 700; }
.app-success-panel h2 { color: var(--primary); font-size: 1.3rem; }
.app-success-panel p { color: var(--text-muted); max-width: 420px; }
