/* ============ Fonts ============ */
/* Brand book (Jul 2026) specifies Century Gothic for Latin and the Ravi family
   for Persian. Both are commercial, so the files are self-hosted here rather
   than fetched from a CDN. Each face lists local() first: users who already
   have the desktop font get it without a download. Vazirmatn stays as the
   fallback so the site never renders unstyled if a file is missing. */

/* --- Ravi (Persian) — FontIran, variable weight axis ---
   One 93KB file covers the whole 1-950 range; the four static weights this site
   uses would have been ~192KB. The plain "Ravi" cut is deliberate: "RaviFaNum"
   renders ASCII digits as Persian glyphs, which would force Persian numerals
   onto the English pages and fight the culture-aware ToLocalNumber() helper. */
@font-face {
  font-family: "Ravi";
  src: url("/fonts/Ravi-VF.woff2") format("woff2-variations"),
       url("/fonts/Ravi-VF.woff2") format("woff2");
  font-weight: 1 950;
  font-display: swap;
}

/* --- Century Gothic (Latin) ---
   unicode-range confines it to Latin so it never pre-empts Ravi on Persian
   text; the browser downloads it only on pages that actually contain Latin. */
@font-face {
  font-family: "Century Gothic W";
  src: local("Century Gothic"), local("CenturyGothic"),
       url("/fonts/CenturyGothic-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-024F, U+2000-206F, U+2070-209F, U+20A0-20BF;
}
@font-face {
  font-family: "Century Gothic W";
  src: local("Century Gothic Bold"), local("CenturyGothic-Bold"),
       url("/fonts/CenturyGothic-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0000-024F, U+2000-206F, U+2070-209F, U+20A0-20BF;
}

/* --- Vazirmatn (fallback) --- */
@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/Vazirmatn-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/Vazirmatn-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

/* ============ Design tokens (light) ============ */
/* Brand palette per QEEG MED. corporate identity manual (Jul 2026):
   amber  PANTONE 7549C  #FDB92E  -> --brand-400 (its natural lightness step)
   navy   PANTONE 281C   #2B3559  -> --navy-600
   The amber ramp is hue-matched to #FDB92E; each step keeps the contrast
   ratio the previous generic-amber ramp had, so no text regressed. */
:root {
  --brand-50: #fffbf0;
  --brand-100: #fef1d4;
  --brand-200: #fde3ac;
  --brand-300: #fdd274;
  --brand-400: #fdb92e; /* brand amber, exact */
  --brand-500: #f69e06;
  --brand-600: #ce7e05;
  --brand-700: #a55d06;
  --brand-800: #884809;
  --brand-900: #713a0b;
  --brand-rgb: 253, 185, 46; /* for rgba() tints of the brand amber */

  --navy-50: #f2f4fa;
  --navy-100: #e1e5f2;
  --navy-200: #c2cae2;
  --navy-300: #94a1c9;
  --navy-400: #5263a0;
  --navy-500: #3a4776;
  --navy-600: #2b3559; /* brand navy, exact */
  --navy-700: #202846;
  --navy-800: #161c34;
  --navy-900: #101426;

  /* Semantic: navy carries solid fills that hold white text (11.96:1);
     amber is the accent — as a fill it takes navy text (6.92:1), never white. */
  --primary: var(--navy-600);
  --primary-hover: var(--navy-700);
  --on-primary: #ffffff;
  --accent: var(--brand-400);
  --on-accent: var(--navy-700);

  --surface: #ffffff;
  --surface-alt: #f8f6f2;
  --surface-card: #ffffff;
  --border: #ece6da;
  --text: #241f18;
  --text-muted: #786f60;

  --sidebar-bg: #ffffff;
  --sidebar-text: #6f7787;
  --sidebar-text-active: #1f2430;

  --success: #1f9d6b;
  --success-bg: #e6f6ef;
  --danger: #e0483f;
  --danger-bg: #fdeceb;
  --info: #3b7fc4;
  --info-bg: #eaf2fb;
  --warning: var(--brand-600);
  --warning-bg: var(--brand-50);

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(36, 31, 24, 0.06);
  --shadow-md: 0 10px 30px rgba(36, 31, 24, 0.08);

  /* "Free" green. Text tone is darker than the fill so both clear AA on their surface. */
  /* Accent text on a card surface; --brand-600 is too light to clear AA here. */
  --brand-link: #884809;

  --free-text: #166534;
  --free-fill: #15803d;
  --free-bg: rgba(21, 128, 61, 0.12);

  color-scheme: light;
}

[data-theme="dark"] {
  --surface: #14171e;
  --surface-alt: #1a1e27;
  --surface-card: #1d222c;
  --border: #2a3040;
  --text: #edeef2;
  --text-muted: #99a1b0;

  --sidebar-bg: #21242f;
  --sidebar-text: #9aa1b1;
  --sidebar-text-active: #ffffff;

  --success-bg: rgba(31, 157, 107, 0.14);
  --danger-bg: rgba(224, 72, 63, 0.14);
  --info-bg: rgba(59, 127, 196, 0.14);
  --warning-bg: rgba(var(--brand-rgb), 0.14);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.35);

  /* Navy sits too close to the dark surface to read as a button, so the
     brand pairing inverts here: amber fill + navy text (10.38:1 on surface). */
  --primary: var(--brand-400);
  --primary-hover: var(--brand-300);
  --on-primary: var(--navy-700);

  --brand-link: #fdd274;

  --free-text: #4ade80;
  --free-fill: #15803d;
  --free-bg: rgba(74, 222, 128, 0.14);

  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #14171e;
    --surface-alt: #1a1e27;
    --surface-card: #1d222c;
    --border: #2a3040;
    --text: #edeef2;
    --text-muted: #99a1b0;

    --sidebar-bg: #21242f;
    --sidebar-text: #9aa1b1;
    --sidebar-text-active: #ffffff;

    --success-bg: rgba(31, 157, 107, 0.14);
    --danger-bg: rgba(224, 72, 63, 0.14);
    --info-bg: rgba(59, 127, 196, 0.14);
    --warning-bg: rgba(var(--brand-rgb), 0.14);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.35);

    --primary: var(--brand-400);
    --primary-hover: var(--brand-300);
    --on-primary: var(--navy-700);

    --brand-link: #fdd274;
    --free-text: #4ade80;
    --free-fill: #15803d;
    --free-bg: rgba(74, 222, 128, 0.14);

    color-scheme: dark;
  }
}

/* ============ Base ============ */
html, body {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  /* Century Gothic is unicode-range-limited to Latin, so Persian falls through
     to Ravi even though Century Gothic is listed first. */
  font-family: "Century Gothic W", "Ravi", "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  background: var(--surface-alt);
  color: var(--text);
  font-size: 15px;
  transition: background-color .2s ease, color .2s ease;
}

a {
  text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
}

.text-muted-2 {
  color: var(--text-muted) !important;
}

.card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}

/* Solid brand button is navy in light theme, amber in dark — see --primary.
   The old amber fill under white text only reached 3.19:1; this clears AA. */
.btn-brand {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}
.btn-brand:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--on-primary);
}
.btn-outline-brand {
  border: 1px solid var(--primary);
  color: var(--primary);
  font-weight: 600;
  background: transparent;
}
.btn-outline-brand:hover {
  background: var(--primary);
  color: var(--on-primary);
}
/* Amber accent CTA, per the brand book's amber panel with navy type. */
.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}
.btn-accent:hover {
  background: var(--brand-300);
  border-color: var(--brand-300);
  color: var(--on-accent);
}
/* Compact rounded action button used inside data tables. */
.btn-pill {
  border-radius: 999px;
  padding-inline: 18px;
  font-size: 13px;
}

.form-control, .form-select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 0.2rem rgba(var(--brand-rgb), 0.15);
  background: var(--surface);
  color: var(--text);
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.badge-status.draft { background: var(--surface-alt); color: var(--text-muted); }
.badge-status.submitted { background: var(--info-bg); color: var(--info); }
.badge-status.processing { background: var(--warning-bg); color: var(--warning); }
.badge-status.answered { background: var(--success-bg); color: var(--success); }
.badge-status.rejected { background: var(--danger-bg); color: var(--danger); }

.alert-success { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.alert-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning); }

.list-group-item {
  background: var(--surface-card);
  border-color: var(--border);
  color: var(--text);
}
.list-group-item-action:hover, .list-group-item-action:focus {
  background: var(--surface-alt);
  color: var(--text);
}

.hero-gradient {
  background: linear-gradient(180deg, var(--brand-50), var(--surface-alt));
}
[data-theme="dark"] .hero-gradient {
  background: linear-gradient(180deg, rgba(var(--brand-rgb),0.12), var(--surface-alt));
}

/* ============ Public layout ============ */
.public-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.public-header .brand-logo {
  height: 46px;
  width: auto;
}
.brand-text {
  font-weight: 700;
  font-size: 17px;
  line-height: 1.35;
  color: var(--brand-link);
}
.brand-text small {
  display: block;
  font-weight: 400;
  font-size: 12px;
  color: var(--text-muted);
}
.public-header .navbar-nav .nav-link {
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  padding-inline: 14px;
  border-radius: var(--radius-sm);
  transition: color .15s ease, background-color .15s ease;
}
.public-header .navbar-nav .nav-link:hover {
  color: var(--brand-600);
}
.public-header .navbar-nav .nav-link.active {
  color: var(--brand-link);
  background: var(--brand-50);
}
[data-theme="dark"] .public-header .navbar-nav .nav-link.active {
  background: rgba(var(--brand-rgb), .14);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.lang-switch:hover {
  border-color: var(--brand-500);
  color: var(--brand-600);
  background: var(--brand-50);
}
[data-theme="dark"] .lang-switch:hover {
  background: rgba(var(--brand-rgb), .14);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-links a {
  color: var(--text-muted);
  font-size: 14px;
  text-decoration: none;
  transition: color .15s ease;
}
.footer-links a:hover {
  color: var(--brand-600);
}

/* ============ Marketing pages ============ */
.hero-badge {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--brand-100);
  color: var(--brand-800);
  font-weight: 600;
  font-size: 13px;
}
[data-theme="dark"] .hero-badge {
  background: rgba(var(--brand-rgb), .18);
  color: var(--brand-300);
}
.hero-title {
  font-weight: 800;
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  line-height: 1.5;
  color: var(--text);
}
.hero-lead {
  font-size: 1.05rem;
  line-height: 2.1;
  color: var(--text-muted);
  max-width: 54ch;
}
.hero-art {
  max-width: 300px;
  width: 100%;
  filter: drop-shadow(0 18px 40px rgba(var(--brand-rgb), .30));
}

.section-head {
  text-align: center;
  max-width: 62ch;
  margin: 0 auto 40px;
}
.section-head h2 {
  font-weight: 800;
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 10px;
  color: var(--text);
}
.section-head p {
  color: var(--text-muted);
  margin-bottom: 0;
}
.section-alt {
  background: var(--surface-alt);
}

.step-card {
  position: relative;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 20px 22px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
.step-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.step-card .step-number {
  position: absolute;
  top: -14px;
  inset-inline-start: 50%;
  transform: translateX(50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-400);
  color: var(--navy-700);
  font-weight: 700;
  font-size: 13px;
  line-height: 30px;
}
[dir="ltr"] .step-card .step-number {
  transform: translateX(-50%);
}
.step-card .step-icon {
  width: 58px;
  height: 58px;
  margin: 8px auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: var(--brand-50);
  color: var(--brand-600);
}
[data-theme="dark"] .step-card .step-icon {
  background: rgba(var(--brand-rgb), .15);
}

.brain-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 50% 45%, var(--brand-100), transparent 70%);
}
[data-theme="dark"] .brain-visual {
  background: radial-gradient(circle at 50% 45%, rgba(var(--brand-rgb), .18), transparent 70%);
}
.brain-visual img {
  max-width: 240px;
  width: 100%;
}

.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 36px 40px;
  border-radius: var(--radius-lg);
  /* Navy panel + amber CTA, as the brand book pairs them. The previous amber
     gradient carried white text at 2.14:1 on its light end. */
  background: linear-gradient(135deg, var(--navy-600), var(--navy-800));
  color: #fff;
  box-shadow: var(--shadow-md);
}
.cta-band h3, .cta-band p { color: #fff; }
.cta-band p { opacity: .92; }
.cta-btn {
  background: var(--brand-400);
  color: var(--navy-700);
  font-weight: 700;
  border: none;
  white-space: nowrap;
}
.cta-btn:hover {
  background: var(--brand-300);
  color: var(--navy-800);
}

.page-hero {
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  padding: 48px 0;
}

/* Long-form admin-authored content */
.prose {
  line-height: 2.1;
  color: var(--text);
}
.prose h2, .prose h3, .prose h4 {
  font-weight: 700;
  margin-top: 1.6em;
  margin-bottom: .6em;
}
.prose h2:first-child, .prose h3:first-child, .prose p:first-child {
  margin-top: 0;
}
.prose p { margin-bottom: 1.1em; color: var(--text-muted); }
.prose ul, .prose ol { margin-bottom: 1.1em; padding-inline-start: 1.4em; color: var(--text-muted); }
.prose li { margin-bottom: .5em; }
.prose a { color: var(--brand-link); }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius-md); }

/* ============ Course catalog ============ */

.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.catalog-search {
  position: relative;
  flex: 1 1 260px;
  min-width: 0;
}
.catalog-search i {
  position: absolute;
  inset-inline-start: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.catalog-search .form-control {
  padding-inline-start: 40px;
}
.catalog-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-chip {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all .15s ease;
}
.filter-chip:hover {
  border-color: var(--brand-400);
  color: var(--brand-700);
}
/* Dark text on a lighter amber: white on --brand-500 measures 2.15:1 and
   --brand-900 on --brand-500 only reaches 4.22:1. This combination clears AA. */
.filter-chip.active {
  background: var(--brand-400);
  border-color: var(--brand-400);
  color: var(--brand-900);
}
.catalog-sort {
  width: auto;
  min-width: 150px;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
  gap: 24px;
}

.course-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-300);
  color: var(--text);
}
.course-card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.course-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.course-card-placeholder {
  font-size: 42px;
  color: var(--brand-300);
}
.course-badge {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.course-badge.free {
  background: var(--free-fill);
  color: #fff;
}
.course-card-body {
  padding: 18px 18px 8px;
  flex: 1;
}
.course-level {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-700);
  background: var(--brand-50);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.course-level.light {
  background: rgba(255, 255, 255, .16);
  color: #fff;
}
.course-card-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.7;
  margin-bottom: 8px;
}
.course-card-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.9;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-card-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.course-card-meta i {
  color: var(--brand-500);
  margin-inline-end: 3px;
}
.course-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  margin-top: 14px;
}
.course-price {
  font-weight: 700;
  color: var(--text);
}
.course-price.is-free {
  color: var(--free-text);
}
.course-cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-link);
}

/* ============ Course detail ============ */

.course-hero {
  background: linear-gradient(135deg, var(--navy-600), var(--navy-900));
  color: #fff;
  padding: 44px 0 56px;
}
.course-crumbs {
  font-size: 13px;
  color: rgba(255, 255, 255, .75);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.course-crumbs a {
  color: rgba(255, 255, 255, .9);
  text-decoration: none;
}
.course-crumbs a:hover { color: #fff; text-decoration: underline; }
.course-hero-title {
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 800;
  line-height: 1.6;
  margin: 10px 0 14px;
}
.course-hero-lead {
  font-size: 16px;
  line-height: 2.1;
  color: rgba(255, 255, 255, .88);
  max-width: 60ch;
  margin-bottom: 22px;
}
.course-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  font-size: 14px;
  color: rgba(255, 255, 255, .9);
}
.course-hero-meta i {
  color: var(--brand-200);
  margin-inline-end: 5px;
}

.buy-panel {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  color: var(--text);
}
@media (min-width: 992px) {
  .buy-panel {
    position: sticky;
    top: 90px;
  }
}
.buy-panel-media {
  aspect-ratio: 16 / 9;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.buy-panel-media video,
.buy-panel-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.buy-panel-body {
  padding: 20px;
}
.buy-price {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 16px;
}
.buy-price.is-free { color: var(--free-text); }
.buy-enrolled {
  color: var(--free-text);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}
.buy-perks {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}
.buy-perks li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}
.buy-perks i { color: var(--brand-500); }

/* Curriculum accordion — Bootstrap pins its own colors, so every surface is restated. */
.curriculum-accordion .accordion-item {
  background: var(--surface-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md) !important;
  margin-bottom: 10px;
  overflow: hidden;
}
/* Bootstrap pins --bs-accordion-color on the item, so the body text stays dark-on-dark
   unless it is restated here. */
.curriculum-accordion .accordion-collapse,
.curriculum-accordion .accordion-body {
  background: var(--surface-card);
  color: var(--text);
}
.curriculum-accordion .accordion-button {
  background: var(--surface-card);
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
  gap: 12px;
  padding: 16px 18px;
  box-shadow: none;
}
.curriculum-accordion .accordion-button:not(.collapsed) {
  background: var(--brand-50);
  color: var(--brand-800);
}
/* The brand tints stay light in dark mode, so the expanded header would put the light
   --text-muted of .chapter-count onto cream. Tint the surface instead. */
[data-theme="dark"] .curriculum-accordion .accordion-button:not(.collapsed) {
  background: rgba(var(--brand-rgb), .14);
  color: var(--brand-300);
}
.curriculum-accordion .accordion-button:focus {
  box-shadow: 0 0 0 .2rem var(--brand-100);
}
.curriculum-accordion .accordion-button::after {
  margin-inline-start: auto;
  margin-inline-end: 0;
}
[dir="rtl"] .curriculum-accordion .accordion-button::after {
  margin-inline-start: 0;
  margin-inline-end: auto;
}
.chapter-index {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: var(--brand-500);
  color: #fff;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chapter-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.lesson-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.lesson-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}
.lesson-row i { color: var(--brand-500); }
.lesson-row .bi-lock { color: var(--text-muted); }
.lesson-title { flex: 1; }
.lesson-preview-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--free-text);
  background: var(--free-bg);
  padding: 3px 9px;
  border-radius: 999px;
}
.lesson-duration {
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.instructor-card {
  display: flex;
  gap: 14px;
  padding: 18px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 14px;
}
.instructor-card img,
.instructor-card-initial {
  width: 60px;
  height: 60px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
}
.instructor-card-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-100);
  color: var(--brand-700);
  font-size: 24px;
  font-weight: 700;
}
.instructor-card h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}
.instructor-card p {
  font-size: 13px;
  line-height: 1.9;
  color: var(--text-muted);
  margin: 0;
}

/* ============ Course player ============ */

.learn-shell {
  display: grid;
  grid-template-columns: 1fr 340px;
  min-height: calc(100vh - 160px);
  background: var(--surface-alt);
}
@media (max-width: 991.98px) {
  .learn-shell {
    grid-template-columns: 1fr;
  }
}

.learn-main {
  min-width: 0;
}
.learn-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: var(--surface-card);
  border-bottom: 1px solid var(--border);
}
.learn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text);
}
.learn-back:hover { color: var(--brand-600); }

.learn-stage {
  background: #000;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.learn-stage video {
  width: 100%;
  height: 100%;
  display: block;
}
.learn-novideo {
  color: rgba(255, 255, 255, .7);
  text-align: center;
}
.learn-novideo i {
  font-size: 42px;
  display: block;
  margin-bottom: 10px;
}

.learn-body {
  padding: 22px 20px;
}
.learn-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 18px;
}
.learn-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.learn-nav {
  display: flex;
  gap: 8px;
  margin-inline-start: auto;
}

.learn-sidebar {
  background: var(--surface-card);
  border-inline-start: 1px solid var(--border);
  padding: 20px;
  overflow-y: auto;
  max-height: calc(100vh - 80px);
  position: sticky;
  top: 72px;
}
@media (max-width: 991.98px) {
  .learn-sidebar {
    position: static;
    max-height: none;
    border-inline-start: none;
    border-top: 1px solid var(--border);
    display: none;
  }
  .learn-sidebar.open { display: block; }
}

.learn-progress {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.learn-progress .progress {
  height: 8px;
  background: var(--surface-alt);
}
.learn-progress .progress-bar {
  background: var(--brand-500);
}

.learn-chapter + .learn-chapter { margin-top: 18px; }
.learn-chapter-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .02em;
  margin-bottom: 8px;
}
.learn-lessons {
  list-style: none;
  padding: 0;
  margin: 0;
}
.learn-lesson {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
}
.learn-lesson:hover {
  background: var(--surface-alt);
  color: var(--text);
}
.learn-lesson.active {
  background: var(--brand-50);
  color: var(--brand-800);
  font-weight: 600;
}
[data-theme="dark"] .learn-lesson.active {
  background: rgba(var(--brand-rgb), .14);
  color: var(--brand-300);
}
.learn-lesson i { color: var(--text-muted); flex: none; }
.learn-lesson i.done { color: var(--free-text); }

.contact-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.contact-row:last-child { border-bottom: none; }
.contact-row a { color: var(--text); text-decoration: none; }
.contact-row a:hover { color: var(--brand-600); }
.contact-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: var(--brand-50);
  color: var(--brand-600);
}
[data-theme="dark"] .contact-icon {
  background: rgba(var(--brand-rgb), .15);
}
/* Honeypot: off-screen rather than display:none so naive bots still see it. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.auth-wrapper {
  min-height: calc(100vh - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 36px 32px;
  border-radius: var(--radius-lg);
}
.auth-card .brand-logo {
  height: 56px;
  margin-bottom: 12px;
}

.public-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  padding: 18px 0;
}

/* ============ Global topbar (spans full width, above sidebar+content) ============ */
:root {
  --topbar-height: 78px;
}

.site-topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-topbar .topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.site-topbar .topbar-brand img {
  height: 46px;
}
.site-topbar .topbar-brand .brand-text {
  font-weight: 700;
  font-size: 17px;
  line-height: 1.35;
  color: var(--brand-link);
}
.site-topbar .topbar-brand .brand-text small {
  display: block;
  font-weight: 400;
  font-size: 12px;
  color: var(--text-muted);
}
.site-topbar .topbar-search {
  flex: 1;
  max-width: 520px;
  display: flex;
}
/* Logical radii so the pill's *outer* edges round correctly under RTL
   (physical TL/TR values would round the seam between input and button). */
.site-topbar .topbar-search input {
  border-start-start-radius: 999px;
  border-end-start-radius: 999px;
  border-start-end-radius: 0;
  border-end-end-radius: 0;
  border-inline-end: none;
  padding-inline-start: 18px;
}
.site-topbar .topbar-search button {
  border-start-end-radius: 999px;
  border-end-end-radius: 999px;
  border-start-start-radius: 0;
  border-end-start-radius: 0;
  border: 1px solid var(--border);
  border-inline-start: none;
  background: var(--surface-alt);
  color: var(--text-muted);
  padding: 0 18px;
}
.site-topbar .topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-inline-start: auto;
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.icon-btn:hover {
  background: var(--surface-alt);
}
.topbar-badge {
  position: absolute;
  top: -4px;
  inset-inline-start: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--brand-400);
  color: var(--navy-700);
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text);
}

/* ============ Panel shell (sidebar + content, below topbar) ============ */
.panel-shell {
  display: flex;
  min-height: calc(100vh - var(--topbar-height));
}

/* Sidebar: theme-coloured panel with a brand capsule pinned to its outer
   (right, in RTL) edge. Nav icons sit *inside* that capsule; labels sit
   beside it on the panel background. --capsule-w keeps the capsule and the
   icon column exactly the same width so icons always land centred on it. */
.panel-sidebar {
  --capsule-w: 62px;
  position: relative;
  width: 236px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  z-index: 1;
  transition: width .2s ease;
}

.sidebar-collapse-btn {
  position: absolute;
  top: 50%;
  inset-inline-end: -14px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  z-index: 20;
  box-shadow: var(--shadow-sm);
}
.panel-shell.sidebar-collapsed .sidebar-collapse-btn i {
  transform: rotate(180deg);
}

.panel-nav {
  position: relative;
  padding: 22px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Inner (start-side) corners only. Measured off the reference: the arc spans
   ~97% of the capsule width both horizontally and vertically, i.e. a circular
   quarter-arc of radius == the capsule width, leaving essentially no flat
   top/bottom run. Tying the radius to --capsule-w keeps that true when the
   sidebar collapses and the capsule widens. */
.nav-accent-capsule {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: var(--capsule-w);
  border-radius: var(--capsule-w) 0 0 var(--capsule-w);
  background: linear-gradient(180deg, var(--brand-400), var(--brand-600));
  pointer-events: none;
  z-index: 0;
}

.panel-nav .nav-link {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 0;
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 500;
  transition: color .15s ease;
}
.panel-nav .nav-link .nav-icon {
  flex: 0 0 var(--capsule-w);
  width: var(--capsule-w);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  color: #fff;
}
.panel-nav .nav-link .nav-label {
  flex: 1;
  min-width: 0;
  padding-inline-end: 22px;
  /* Explicit: the logout row is a <button>, which browsers default to
     text-align:center — without this its label drifts out of line. */
  text-align: start;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Normalise the <button> logout row against the <a> rows. */
.panel-nav button.nav-link {
  width: 100%;
  font-family: inherit;
  text-align: start;
  appearance: none;
}
.panel-nav .nav-link:hover {
  color: var(--sidebar-text-active);
}
.panel-nav .nav-link.active {
  color: var(--brand-600);
  font-weight: 700;
}
[data-theme="dark"] .panel-nav .nav-link.active {
  color: var(--brand-400);
}
.panel-nav .nav-link.active::before {
  content: "";
  position: absolute;
  inset-inline-end: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 26px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--brand-500);
}
.nav-link-form {
  display: contents;
}

/* Collapsed (icon-only): sidebar shrinks to the capsule, labels hide. */
.panel-shell.sidebar-collapsed .panel-sidebar {
  width: 72px;
  --capsule-w: 72px;
}
.panel-shell.sidebar-collapsed .panel-nav .nav-label {
  display: none;
}
.panel-shell.sidebar-collapsed .panel-nav .nav-link.active::before {
  display: none;
}

.panel-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.panel-content {
  padding: 24px;
  flex: 1;
}

/* Quick action cards on dashboard — tinted card, centred icon/title/subtitle.
   Tints sampled from the reference template. */
.quick-action {
  border-radius: var(--radius-md);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  height: 100%;
  background: var(--qa-tint);
  transition: transform .18s ease, box-shadow .18s ease;
}
.quick-action:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.quick-action .qa-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  background: #fff;
  color: var(--qa-fg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .10);
}
.quick-action .qa-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.quick-action .qa-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
}
.qa-purple { --qa-tint: #f8f6fe; --qa-fg: #7c4ee0; }
.qa-pink   { --qa-tint: #fff4f8; --qa-fg: #e0509a; }
.qa-amber  { --qa-tint: var(--brand-50); --qa-fg: var(--brand-700); }
.qa-green  { --qa-tint: #f0fef9; --qa-fg: #1f9d6b; }
[data-theme="dark"] .qa-purple { --qa-tint: rgba(124, 78, 224, .16); }
[data-theme="dark"] .qa-pink   { --qa-tint: rgba(224, 80, 154, .16); }
[data-theme="dark"] .qa-amber  { --qa-tint: rgba(var(--brand-rgb), .16); }
[data-theme="dark"] .qa-green  { --qa-tint: rgba(31, 157, 107, .18); }

/* Welcome / profile strip above the quick actions (mirrors the reference).
   flex-direction is explicit: Bootstrap's .card sets column, which would
   otherwise stack the button under the name instead of pushing it to the end. */
.profile-strip {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.profile-strip .ps-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--brand-200);
  flex-shrink: 0;
}

.stat-card {
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--brand-50);
  color: var(--brand-600);
  flex-shrink: 0;
}
[data-theme="dark"] .stat-card .stat-icon {
  background: rgba(var(--brand-rgb),0.15);
}
.stat-card .stat-value {
  font-size: 22px;
  font-weight: 700;
}
.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

.table-panel {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.table-panel table {
  margin-bottom: 0;
  color: var(--text);
}
.table-panel table > :not(caption) > * > * {
  background-color: transparent;
  color: var(--text);
}
.table-panel thead {
  background: var(--primary);
}
.table-panel thead th {
  border: none;
  font-weight: 600;
  font-size: 13px;
  color: #fff !important;
  padding: 14px 16px;
}
.table-panel tbody td {
  padding: 14px 16px;
  vertical-align: middle;
  border-color: var(--border);
  font-size: 14px;
}
.table-panel tbody tr:hover td {
  background-color: var(--surface-alt);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state i {
  font-size: 40px;
  color: var(--brand-300);
  margin-bottom: 12px;
}

/* ============ Admin: courses & instructors ============ */

.course-thumb-sm {
  width: 56px;
  height: 36px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex: none;
}
.course-thumb-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-alt);
  color: var(--text-muted);
}
.course-thumb-preview {
  display: block;
  max-width: 220px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.instructor-avatar-sm {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--border);
  flex: none;
}
.instructor-avatar-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-alt);
  color: var(--text-muted);
}
.instructor-avatar-preview {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.curriculum-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  color: var(--text-muted);
  font-size: 14px;
}
.curriculum-summary i {
  color: var(--brand-500);
  margin-inline-end: 4px;
}

.section-head-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

/* This table lives inside a plain .card, so it misses the .table-panel overrides that
   stop Bootstrap 5.3 pinning its own light background in dark mode. */
.curriculum-table {
  color: var(--text);
}
.curriculum-table > :not(caption) > * > * {
  background-color: transparent;
  color: var(--text);
  border-color: var(--border);
}
.curriculum-table thead th {
  background: var(--surface-alt);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}
.curriculum-table tbody td {
  padding: 12px 16px;
  font-size: 14px;
}
.curriculum-table tbody tr:hover > td {
  background-color: var(--surface-alt);
}

/* Bootstrap pins modal colors to its own theme vars; override for dark mode. */
.modal-content {
  background: var(--surface-card);
  color: var(--text);
  border: 1px solid var(--border);
}
.modal-header,
.modal-footer {
  border-color: var(--border);
}

/* Theme toggle switch */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 991.98px) {
  .panel-sidebar {
    position: fixed;
    right: 0;
    top: var(--topbar-height);
    bottom: 0;
    transform: translateX(100%);
    transition: transform .2s ease;
    z-index: 60;
  }
  .panel-shell.sidebar-open .panel-sidebar {
    transform: translateX(0);
  }
  .sidebar-toggle {
    display: inline-flex;
  }
  .site-topbar .topbar-search {
    display: none;
  }
  .sidebar-collapse-btn {
    display: none;
  }
  .panel-backdrop {
    display: none;
    position: fixed;
    inset: var(--topbar-height) 0 0 0;
    background: rgba(0,0,0,0.4);
    z-index: 55;
  }
  .panel-shell.sidebar-open .panel-backdrop {
    display: block;
  }
}

/* ============ Persian datepicker (persian-datepicker.js) theme ============ */
.datepicker-plot-area {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-md) !important;
  background: var(--surface-card) !important;
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif !important;
  padding: 10px !important;
}
.datepicker-plot-area * {
  color: var(--text) !important;
  font-family: inherit !important;
  text-shadow: none !important;
}
.datepicker-plot-area .datepicker-day-view .table-days td span,
.datepicker-plot-area .datepicker-year-view .year-item,
.datepicker-plot-area .datepicker-month-view .month-item {
  background-color: transparent !important;
  border-radius: 8px;
}
.datepicker-plot-area .datepicker-day-view .table-days td.disabled span,
.datepicker-plot-area .datepicker-year-view .year-item-disable,
.datepicker-plot-area .datepicker-month-view .month-item-disable {
  background-color: transparent !important;
  color: var(--text-muted) !important;
  opacity: .4;
}
.datepicker-plot-area .datepicker-day-view .table-days td span.other-month {
  color: var(--text-muted) !important;
  opacity: .4;
}
.datepicker-plot-area .datepicker-day-view .table-days td.today span {
  background-color: var(--brand-100) !important;
  color: var(--brand-700) !important;
  font-weight: 700;
}
.datepicker-plot-area .datepicker-day-view .table-days td.selected span,
.datepicker-plot-area .datepicker-year-view .year-item.selected,
.datepicker-plot-area .datepicker-month-view .month-item.selected {
  background-color: var(--primary) !important;
  color: var(--on-primary) !important;
  font-weight: 700;
}
.datepicker-plot-area .datepicker-day-view .table-days td span:hover,
.datepicker-plot-area .datepicker-year-view .year-item:hover,
.datepicker-plot-area .datepicker-month-view .month-item:hover {
  background-color: var(--brand-100) !important;
  color: var(--brand-700) !important;
}
.datepicker-plot-area .datepicker-day-view .month-grid-box .header .header-row-cell {
  color: var(--text-muted) !important;
  font-weight: 600;
}
.datepicker-plot-area .datepicker-navigator .pwt-btn-next,
.datepicker-plot-area .datepicker-navigator .pwt-btn-switch,
.datepicker-plot-area .datepicker-navigator .pwt-btn-prev {
  background-color: transparent !important;
  border-radius: 8px;
  font-weight: 700;
}
.datepicker-plot-area .datepicker-navigator .pwt-btn-next:hover,
.datepicker-plot-area .datepicker-navigator .pwt-btn-switch:hover,
.datepicker-plot-area .datepicker-navigator .pwt-btn-prev:hover {
  background-color: var(--brand-50) !important;
  color: var(--brand-700) !important;
}
.datepicker-plot-area .toolbox .pwt-btn-submit,
.datepicker-plot-area .toolbox .pwt-btn-today {
  background-color: var(--primary) !important;
  color: var(--on-primary) !important;
  border-radius: 8px;
}
.datepicker-plot-area .toolbox .pwt-btn-submit:hover,
.datepicker-plot-area .toolbox .pwt-btn-today:hover {
  background-color: var(--primary-hover) !important;
}
/* Gregorian-calendar toggle — not needed, we only want the Jalali picker. */
.datepicker-plot-area .toolbox .pwt-btn-calendar {
  display: none !important;
}
[data-theme="dark"] .datepicker-plot-area .datepicker-day-view .table-days td.today span {
  background-color: rgba(var(--brand-rgb),0.2) !important;
  color: var(--brand-300) !important;
}
[data-theme="dark"] .datepicker-plot-area .datepicker-day-view .table-days td span:hover,
[data-theme="dark"] .datepicker-plot-area .datepicker-year-view .year-item:hover,
[data-theme="dark"] .datepicker-plot-area .datepicker-month-view .month-item:hover,
[data-theme="dark"] .datepicker-plot-area .datepicker-navigator .pwt-btn-next:hover,
[data-theme="dark"] .datepicker-plot-area .datepicker-navigator .pwt-btn-switch:hover,
[data-theme="dark"] .datepicker-plot-area .datepicker-navigator .pwt-btn-prev:hover {
  background-color: rgba(var(--brand-rgb),0.15) !important;
  color: var(--brand-300) !important;
}

/* ============ Select2 (searchable dropdown) theme ============ */
.select2-container--default .select2-selection--single {
  height: calc(1.5em + 0.75rem + 2px) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  background-color: var(--surface) !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--text) !important;
  line-height: calc(1.5em + 0.75rem) !important;
  padding-right: 12px;
  padding-left: 12px;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: var(--text-muted) !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: calc(1.5em + 0.75rem + 2px) !important;
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--brand-500) !important;
  box-shadow: 0 0 0 0.2rem rgba(var(--brand-rgb), 0.15);
}
.select2-dropdown {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  background-color: var(--surface-card) !important;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.select2-search--dropdown {
  background-color: var(--surface-card) !important;
  padding: 8px !important;
}
.select2-search--dropdown .select2-search__field {
  background-color: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}
.select2-results__option {
  color: var(--text) !important;
  background-color: transparent !important;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: var(--brand-100) !important;
  color: var(--brand-800) !important;
}
.select2-container--default .select2-results__option[aria-selected="true"] {
  background-color: var(--brand-50) !important;
  color: var(--brand-700) !important;
}
.select2-results__option--disabled {
  color: var(--text-muted) !important;
}
.select2-container--default .select2-selection--single .select2-selection__clear {
  color: var(--text-muted) !important;
}
[data-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: rgba(var(--brand-rgb),0.18) !important;
  color: var(--brand-300) !important;
}
[data-theme="dark"] .select2-container--default .select2-results__option[aria-selected="true"] {
  background-color: rgba(var(--brand-rgb),0.1) !important;
  color: var(--brand-300) !important;
}
