/*
Theme Name: Smart Academic Report Builder
Theme URI: https://yourdomain.com
Author: Your Name
Description: A production-ready WordPress SaaS theme for creating professional school report cards with Firebase integration, AdSense support, and multi-tenant architecture.
Version: 1.9.0
License: GNU General Public License v2 or later
Text Domain: sarb
Tags: education, saas, firebase, report-builder, multi-tenant, adsense-ready
*/

/* ============================================================
   DESIGN SYSTEM — Ink & Saffron
   Fonts:  Fraunces (display headings) + DM Sans (body)
   Colors: Deep navy-black + warm saffron amber + warm ivory
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,600;0,9..144,700;0,9..144,800;1,9..144,400&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* ── WordPress Admin Bar Reset ─────────────────────────────
   We suppress the admin bar via functions.php (show_admin_bar false).
   This rule is a safety net — if it ever shows, it must NOT push
   our sticky header down or create a gap above it. */
#wpadminbar {
  display: none !important;
}

html.wp-toolbar {
  padding-top: 0 !important;
}

body.admin-bar #site-header {
  top: 0 !important;
}

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --ink:        #0f1923;
  --ink-80:     #1e2d3d;
  --ink-60:     #344d66;
  --ink-40:     #6b8caa;
  --ink-20:     #b8cfe0;
  --ink-10:     #e4eef5;
  --ink-05:     #f2f7fa;

  --saffron:    #e8870a;
  --saffron-lt: #fdf1dc;
  --saffron-dk: #b86208;

  --ivory:      #faf8f4;
  --white:      #ffffff;

  --success:    #1a7a4a;
  --success-lt: #d4f0e3;
  --danger:     #c0392b;
  --danger-lt:  #fde8e6;
  --info:       #1d6fa4;
  --info-lt:    #ddf0fc;
  --warning:    #b45309;
  --warning-lt: #fff8e1;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'DM Sans', -apple-system, sans-serif;

  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-xs: 0 1px 3px rgba(15,25,35,0.07);
  --shadow-sm: 0 2px 8px rgba(15,25,35,0.09);
  --shadow:    0 4px 20px rgba(15,25,35,0.11);
  --shadow-lg: 0 12px 40px rgba(15,25,35,0.15);
  --shadow-xl: 0 24px 64px rgba(15,25,35,0.18);

  --header-h:  68px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--ivory);
  color: var(--ink);
  line-height: 1.65;
  font-size: 16px;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ── Global utilities ──────────────────────────────────── */
.hidden { display: none !important; }

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

/* ============================================================
   HEADER / NAVIGATION
   The header is sticky at top:0. No extra bar above it.
   ============================================================ */

#site-header {
  background: var(--white);
  border-bottom: 1px solid var(--ink-10);
  position: sticky;
  top: 0;
  z-index: 100;
  /* No padding-top — nav is the only thing inside */
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 2rem;
  max-width: 1240px;
  margin: 0 auto;
  gap: 1rem;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo-icon {
  width: 38px; height: 38px;
  background: var(--ink);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-logo-text .name {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.1;
}

.nav-logo-text .tagline {
  display: block;
  font-size: 0.65rem;
  color: var(--ink-40);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  list-style: none;
  flex: 1;
  justify-content: center;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-60);
  text-decoration: none;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
  background: var(--ink-05);
}

/* Auth actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
  background: none;
}

.btn-primary {
  background: var(--saffron);
  color: var(--white);
  border-color: var(--saffron);
}
.btn-primary:hover {
  background: var(--saffron-dk);
  border-color: var(--saffron-dk);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(232,135,10,0.3);
}

.btn-ink {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}
.btn-ink:hover {
  background: var(--ink-80);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(15,25,35,0.22);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink-20);
}
.btn-outline:hover {
  border-color: var(--ink);
  background: var(--ink-05);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-60);
  border-color: transparent;
  padding: 0.6rem 0.9rem;
}
.btn-ghost:hover {
  color: var(--ink);
  background: var(--ink-05);
}

.btn-success {
  background: var(--success);
  color: var(--white);
  border-color: var(--success);
}
.btn-success:hover { background: #155d39; border-color: #155d39; }

.btn-danger {
  background: var(--danger);
  color: var(--white);
  border-color: var(--danger);
}
.btn-danger:hover { background: #a03020; border-color: #a03020; }

.btn-sm  { padding: 0.45rem 0.9rem; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-lg  { padding: 0.9rem 1.75rem; font-size: 0.95rem; }

.btn:disabled,
.btn.loading { opacity: 0.6; pointer-events: none; cursor: not-allowed; }

/* ============================================================
   BADGES / PILLS
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.badge-saffron { background: var(--saffron-lt); color: var(--saffron-dk); }
.badge-success { background: var(--success-lt); color: var(--success); }
.badge-danger  { background: var(--danger-lt);  color: var(--danger); }
.badge-info    { background: var(--info-lt);    color: var(--info); }
.badge-ink     { background: var(--ink-10);     color: var(--ink-60); }
.badge-warning { background: var(--warning-lt); color: var(--warning); }

/* ============================================================
   GRADE DISPLAY
   ============================================================ */

.grade-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
}
.grade-a-plus, .grade-a  { background: var(--success-lt); color: var(--success); }
.grade-b-plus, .grade-b  { background: var(--info-lt);    color: var(--info); }
.grade-c                 { background: var(--warning-lt); color: var(--warning); }
.grade-d                 { background: #fff0e6; color: #9a3412; }
.grade-f                 { background: var(--danger-lt);  color: var(--danger); }

/* ============================================================
   CARDS
   ============================================================ */

.card {
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.card-hover {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--saffron-lt);
}

/* ============================================================
   SECTION TYPOGRAPHY HELPERS
   ============================================================ */

.section-label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--saffron-dk);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  color: var(--ink);
  line-height: 1.15;
}

.section-desc {
  font-size: 1rem;
  color: var(--ink-60);
  line-height: 1.7;
}

.divider {
  width: 44px; height: 3px;
  background: var(--saffron);
  border-radius: 2px;
  margin: 0.6rem 0 1.1rem;
}
.divider-center { margin-left: auto; margin-right: auto; }

/* ============================================================
   HOMEPAGE — HERO
   ============================================================ */

.hero-section {
  background: var(--ink);
  position: relative;
  overflow: hidden;
  padding: 6rem 2rem 5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  max-width: 1240px;
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--saffron);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--white);
  margin-bottom: 1.4rem;
}

.hero-title .accent,
.calc-hero-title .accent,
.blog-hero-title .accent,
.archive-title .accent,
em.accent {
  color: var(--saffron);
  font-style: italic;
  font-weight: 300;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--ink-20);
  line-height: 1.7;
  margin-bottom: 2.25rem;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.25rem;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.8rem;
  color: var(--ink-40);
}

.hero-trust-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.hero-preview-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-xl);
  transform: rotate(2deg);
  transition: transform 0.4s ease;
}
.hero-preview-card:hover { transform: rotate(0deg) scale(1.01); }

/* ============================================================
   FEATURE CARDS
   ============================================================ */

.feature-card {
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--saffron-lt);
}

.feature-icon {
  width: 46px; height: 46px;
  background: var(--saffron-lt);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.feature-title {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.45rem;
}

.feature-desc {
  font-size: 0.875rem;
  color: var(--ink-60);
  line-height: 1.65;
}

/* ============================================================
   PRICING CARDS
   ============================================================ */

.pricing-card {
  background: var(--white);
  border: 1.5px solid var(--ink-10);
  border-radius: var(--radius-xl);
  padding: 2rem;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pricing-card.featured {
  background: var(--ink);
  border-color: var(--ink);
  transform: scale(1.03);
  box-shadow: var(--shadow-xl);
}

.pricing-card:not(.featured):hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.pricing-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--saffron);
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.28rem 0.9rem;
  border-radius: 999px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pricing-plan-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.pricing-price {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  margin: 0.9rem 0 0.2rem;
}

.pricing-period {
  font-size: 0.8rem;
  opacity: 0.55;
  margin-bottom: 1.4rem;
}

.pricing-features {
  list-style: none;
  margin-bottom: 1.75rem;
}

.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.pricing-card.featured .pricing-features li {
  border-bottom-color: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.85);
}

/* ============================================================
   TESTIMONIAL CARDS
   ============================================================ */

.testimonial-card {
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}

.testimonial-quote {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--saffron);
  line-height: 1;
  margin-bottom: 0.65rem;
}

.testimonial-text {
  font-size: 0.9rem;
  color: var(--ink-60);
  line-height: 1.7;
  margin-bottom: 1.2rem;
  font-style: italic;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.testimonial-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--ink-10);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink);
  flex-shrink: 0;
}

/* ============================================================
   FAQ
   ============================================================ */

.faq-item { border-bottom: 1px solid var(--ink-10); }

.faq-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.05rem 0;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  gap: 1rem;
}
.faq-toggle:hover { color: var(--saffron-dk); }

.faq-icon {
  width: 22px; height: 22px;
  background: var(--ink-10);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.3s;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-60);
}

.faq-item.open .faq-icon {
  background: var(--saffron-lt);
  color: var(--saffron-dk);
  transform: rotate(45deg);
}

.faq-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease;
}

.faq-body-inner {
  font-size: 0.875rem;
  color: var(--ink-60);
  line-height: 1.7;
  padding-bottom: 1.1rem;
}

/* ============================================================
   FORMS
   ============================================================ */

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-60);
  margin-bottom: 0.3rem;
  letter-spacing: 0.01em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--ink-20);
  border-radius: var(--radius);
  padding: 0.6rem 0.85rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  line-height: 1.4;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--saffron);
  box-shadow: 0 0 0 3px rgba(232,135,10,0.12);
}

.form-input::placeholder { color: var(--ink-40); }
.form-input.error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(192,57,43,0.1); }

/* ============================================================
   DATA TABLES
   ============================================================ */

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-40);
  padding: 0.7rem 1rem;
  text-align: left;
  background: var(--ink-05);
  border-bottom: 1px solid var(--ink-10);
  white-space: nowrap;
}

.data-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.data-table th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }

.data-table td {
  padding: 0.8rem 1rem;
  font-size: 0.875rem;
  color: var(--ink);
  border-bottom: 1px solid var(--ink-05);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--ivory); }
.data-table td.fail-row { color: var(--danger); font-weight: 600; }

/* ============================================================
   MODALS
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,25,35,0.55);
  backdrop-filter: blur(4px);
  z-index: 9000;
  display: none;          /* hidden by default — JS uses style.display='flex' to open */
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

/* Belt-and-suspenders: .hidden always wins */
.modal-overlay.hidden { display: none !important; }

.modal-box {
  background: var(--white);
  border-radius: var(--radius-xl);
  max-width: 520px;
  width: 100%;
  padding: 2rem;
  position: relative;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.2rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 30px; height: 30px;
  background: var(--ink-05);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--ink-40);
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover { background: var(--ink-10); color: var(--ink); }

/* ============================================================
   TOASTS
   ============================================================ */

#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  min-width: 220px;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  pointer-events: all;
}

.toast::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast-success { background: var(--success);  color: white; }
.toast-success::before { background: rgba(255,255,255,0.5); }
.toast-error   { background: var(--danger);   color: white; }
.toast-error::before   { background: rgba(255,255,255,0.5); }
.toast-info    { background: var(--ink);      color: white; }
.toast-info::before    { background: var(--saffron); }

/* ============================================================
   AD UNITS  (only shown after AdSense approval)
   ============================================================ */

.ad-unit {
  display: block;
  text-align: center;
  overflow: hidden;
}

/* Empty ad unit is invisible — no blank bar */
.ad-unit:empty { display: none; }

.ad-unit ins.adsbygoogle:empty { display: none; }

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastIn { from { transform: translateX(110%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulseDot { 0%,100%{ opacity:1; } 50%{ opacity:0.4; } }

.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--ink-10);
  border-top-color: var(--saffron);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.animate-pulse-dot {
  display: inline-block;
  width: 7px; height: 7px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulseDot 2s ease-in-out infinite;
}

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */

.dashboard-layout {
  display: flex;
  min-height: calc(100vh - var(--header-h));
  background: var(--ivory);
}

/* Sidebar */
.dashboard-sidebar {
  width: 236px;
  flex-shrink: 0;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.4rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-avatar {
  width: 42px; height: 42px;
  background: var(--saffron);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--white);
  margin-bottom: 0.7rem;
}

.sidebar-name {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 0.2rem;
}

.sidebar-school {
  font-size: 0.7rem;
  color: var(--ink-40);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav { padding: 0.9rem 0.75rem; flex: 1; }

.sidebar-nav-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-40);
  padding: 0 0.5rem;
  margin: 0.9rem 0 0.35rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  transition: background 0.14s, color 0.14s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.07);
  color: var(--white);
}

.sidebar-link.active {
  background: rgba(232,135,10,0.16);
  color: var(--saffron);
}

.sidebar-link svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; }
.sidebar-link.active svg { opacity: 1; }

.sidebar-upgrade {
  margin: 0.75rem;
  padding: 0.9rem;
  background: rgba(232,135,10,0.1);
  border: 1px solid rgba(232,135,10,0.22);
  border-radius: var(--radius);
  text-align: center;
}

/* Dashboard main content */
.dashboard-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dashboard-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--ink-10);
  padding: 0 1.75rem;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: var(--header-h);
  z-index: 10;
  flex-shrink: 0;
}

.dashboard-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}

.dashboard-body {
  padding: 1.75rem;
  flex: 1;
}

/* Stat cards */
.stat-card {
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-40);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
}

.stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.2rem;
  font-size: 1.2rem;
}

/* ============================================================
   AUTH / LOGIN PAGE
   ============================================================ */

.auth-page-wrap {
  min-height: calc(100vh - var(--header-h));
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  position: relative;
  overflow: hidden;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  width: 100%;
  max-width: 430px;
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 2;
}

.auth-tabs {
  display: flex;
  background: var(--ink-05);
  border-radius: var(--radius);
  padding: 3px;
  margin-bottom: 1.75rem;
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 0.5rem;
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  color: var(--ink-60);
  border: none;
  background: none;
}

.auth-tab.active {
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

/* ============================================================
   CALCULATOR SPECIFIC (v1 legacy — kept for report-builder page)
   ============================================================ */

.calc-header-strip {
  background: var(--ink);
  padding: 1.25rem 1.75rem;
}

.calc-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
}

/* ============================================================
   REPORT CARD BUILDER  (new page)
   ============================================================ */

.rcb-canvas {
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-lg);
  min-height: 600px;
  position: relative;
}

/* Report card preview output */
.rc-preview {
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-family: var(--font-body);
}

.rc-school-banner {
  background: var(--ink);
  padding: 1.5rem 2rem;
  text-align: center;
  color: var(--white);
  position: relative;
}

.rc-school-banner::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid var(--ink);
}

.rc-school-name-text {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.rc-body {
  padding: 2rem;
}

.rc-student-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  background: var(--ink-05);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.rc-field-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-40);
  margin-bottom: 0.2rem;
}

.rc-field-value {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

.rc-subject-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.rc-subject-table thead tr {
  background: var(--ink);
  color: var(--white);
}

.rc-subject-table thead th {
  padding: 0.7rem 0.85rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-align: left;
}

.rc-subject-table thead th:last-child,
.rc-subject-table thead th:nth-last-child(2),
.rc-subject-table thead th:nth-last-child(3) { text-align: center; }

.rc-subject-table tbody td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--ink-05);
  color: var(--ink);
}

.rc-subject-table tbody tr.fail-row td { color: var(--danger); background: var(--danger-lt); }
.rc-subject-table tbody tr:last-child td { border-bottom: none; }

.rc-totals-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--ink);
}

.rc-total-box {
  background: var(--ink-05);
  border-radius: var(--radius);
  padding: 0.9rem;
  text-align: center;
}

.rc-total-box.highlight {
  background: var(--saffron-lt);
  border: 1px solid rgba(232,135,10,0.25);
}

.rc-total-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-40);
  margin-bottom: 0.3rem;
}

.rc-total-value {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--ink);
}

.rc-result-banner {
  margin-top: 1.25rem;
  padding: 0.85rem;
  border-radius: var(--radius);
  text-align: center;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.rc-result-banner.pass { background: var(--success-lt); color: var(--success); }
.rc-result-banner.fail { background: var(--danger-lt);  color: var(--danger); }

.rc-teacher-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--ink-20);
  font-size: 0.78rem;
  color: var(--ink-60);
}

.rc-sig-line {
  width: 140px;
  border-bottom: 1px solid var(--ink-40);
  padding-bottom: 0.25rem;
  margin-bottom: 0.25rem;
}

/* Watermark */
.rc-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.rc-watermark span {
  font-size: 1.2rem;
  font-weight: 900;
  color: rgba(15,25,35,0.05);
  white-space: nowrap;
  transform: rotate(-30deg);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  user-select: none;
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer { background: var(--ink); color: var(--ink-40); }

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 4rem 2rem 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-heading {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-20);
  margin-bottom: 0.9rem;
}

.footer-links { list-style: none; display: flex; flex-direction: column; gap: 0.45rem; }
.footer-links a { font-size: 0.875rem; color: var(--ink-40); text-decoration: none; transition: color 0.14s; }
.footer-links a:hover { color: var(--white); }

.footer-divider { border: none; border-top: 1px solid rgba(255,255,255,0.07); margin: 0 0 1.25rem; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.78rem;
  flex-wrap: wrap;
}

/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
  #site-header, .site-footer, nav, .ad-unit,
  .no-print, .dashboard-sidebar, .dashboard-topbar,
  .btn, #toast-container, .modal-overlay { display: none !important; }

  body { background: white; font-size: 11pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rc-preview, .card { box-shadow: none; border: 1px solid #ddd; }
  .rc-watermark span { color: rgba(0,0,0,0.07) !important; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .hero-grid   { grid-template-columns: 1fr; }
  .hero-preview-card { display: none; }
}

@media (max-width: 768px) {
  :root { --header-h: 60px; }

  .nav-links, .nav-actions { display: none; }
  #mobile-menu-toggle       { display: flex !important; }

  .dashboard-sidebar  { display: none; }
  .dashboard-body     { padding: 1.25rem; }
  .dashboard-topbar   { padding: 0 1rem; }

  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }

  .hero-section    { padding: 3.5rem 1.25rem 3rem; }
  .hero-title      { font-size: 2.2rem; }
  .hero-actions    { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }

  .pricing-card.featured { transform: scale(1); }

  .auth-card { padding: 1.75rem; }

  .modal-box { padding: 1.5rem; }

  .rc-student-row { grid-template-columns: 1fr 1fr; }
  .rc-totals-row  { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .nav-inner { padding: 0 1rem; }
  .hero-title { font-size: 1.9rem; }
  .rc-student-row { grid-template-columns: 1fr; }
}

/* ============================================================
   PUBLIC PAGE ENHANCEMENTS — About, Contact, Pricing
   ============================================================ */

/* Grain texture overlay (used on hero sections) */
.grain-overlay {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* Hero chip / eyebrow label used on public pages */
.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(232,135,10,0.15);
  border: 1px solid rgba(232,135,10,0.3);
  border-radius: 999px;
  padding: 0.28rem 0.85rem;
  margin-bottom: 1.25rem;
}
.hero-chip span {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--saffron);
}
.hero-chip-dot {
  width: 6px; height: 6px;
  background: var(--saffron);
  border-radius: 50%;
  display: inline-block;
}

/* Stats bar — numbers with labels */
.stats-bar {
  background: var(--white);
  border-bottom: 1px solid var(--ink-10);
}
.stats-bar-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
}
.stats-bar-number {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--ink);
}
.stats-bar-label {
  font-size: 0.72rem;
  color: var(--ink-40);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 0.2rem;
}

/* Value proposition cards (About page) */
.value-card {
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.value-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.value-card-icon { font-size: 1.75rem; margin-bottom: 0.65rem; }
.value-card-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.35rem;
}
.value-card-desc { font-size: 0.8rem; color: var(--ink-60); line-height: 1.55; }

/* Dark tech cards (About page) */
.tech-card {
  background: var(--ink);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: left;
  transition: transform 0.2s;
}
.tech-card:hover { transform: translateY(-3px); }
.tech-card-icon  { font-size: 1.75rem; margin-bottom: 1rem; }
.tech-card-title { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--white); margin-bottom: 0.5rem; }
.tech-card-desc  { font-size: 0.82rem; color: var(--ink-40); line-height: 1.65; }

/* Contact channel cards */
.channel-card {
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: box-shadow 0.2s;
}
.channel-card:hover { box-shadow: var(--shadow-sm); }
.channel-icon {
  width: 42px; height: 42px;
  background: var(--saffron-lt);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.channel-title { font-family: var(--font-display); font-size: 0.9rem; font-weight: 700; color: var(--ink); margin-bottom: 0.25rem; }
.channel-link  { font-size: 0.82rem; color: var(--saffron-dk); text-decoration: none; font-weight: 600; }
.channel-sub   { font-size: 0.72rem; color: var(--ink-40); margin-top: 0.2rem; }

/* Response time card */
.response-card {
  background: var(--ink);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.response-card-title { font-family: var(--font-display); font-size: 0.9rem; font-weight: 700; color: var(--white); margin-bottom: 0.5rem; }
.response-card-body  { font-size: 0.8rem; color: var(--ink-40); line-height: 1.7; }

/* Pricing billing toggle */
.billing-toggle {
  display: flex;
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}
.billing-btn {
  padding: 0.5rem 1.5rem;
  border-radius: 999px;
  border: none;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.billing-btn.active {
  background: var(--ink);
  color: var(--white);
}
.billing-btn:not(.active) {
  background: transparent;
  color: var(--ink-60);
}
.billing-badge {
  background: var(--success-lt);
  color: var(--success);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  font-size: 0.65rem;
  margin-left: 0.3rem;
}

/* Pricing page plan cards */
.plan-card {
  background: var(--white);
  border: 1.5px solid var(--ink-10);
  border-radius: var(--radius-xl);
  padding: 2rem;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.plan-card:hover:not(.plan-featured) {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.plan-card.plan-featured {
  background: var(--ink);
  border-color: var(--ink);
  transform: scale(1.03);
  box-shadow: var(--shadow-xl);
}
.plan-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--saffron);
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.28rem 0.9rem;
  border-radius: 999px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}
.plan-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}
.plan-desc  { font-size: 0.8rem; color: var(--ink-60); margin-bottom: 1.25rem; }
.plan-featured .plan-desc { color: var(--ink-40); }
.plan-price {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--ink);
}
.plan-featured .plan-price { color: var(--white); }
.plan-period { font-size: 0.82rem; color: var(--ink-40); margin-bottom: 1.5rem; }
.plan-features { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 2rem; flex: 1; }
.plan-feature {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--ink-60);
  line-height: 1.45;
}
.plan-featured .plan-feature { color: rgba(255,255,255,0.75); }
.plan-check { color: var(--success); font-weight: 700; flex-shrink: 0; }
.plan-featured .plan-check { color: var(--saffron); }

/* ============================================================
   DASHBOARD V2 ENHANCEMENTS
   ============================================================ */

/* Role badges in topbar */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.role-teacher { background: var(--info-lt);    color: var(--info); }
.role-school  { background: var(--saffron-lt); color: var(--saffron-dk); }
.role-owner   { background: var(--ink-10);     color: var(--ink); }

/* Template cards in grid */
.tpl-card {
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  cursor: default;
}
.tpl-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: rgba(232,135,10,0.25);
}

/* AI Scan upload dropzone states */
#ai-dropzone {
  border: 2px dashed var(--ink-20);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--ink-05);
}
#ai-dropzone:hover {
  border-color: var(--saffron);
  background: var(--saffron-lt);
}

/* Step indicators in report flow */
.step-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.2s;
}
.step-dot-pending  { background: var(--ink-10); color: var(--ink-40); }
.step-dot-active   { background: var(--ink);    color: var(--white); }
.step-dot-complete { background: var(--success); color: var(--white); }

/* Access denied screen */
#auth-denied {
  min-height: 80vh;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: var(--ivory);
}

/* ============================================================
   RESPONSIVE ADDITIONS
   ============================================================ */

@media (max-width: 900px) {
  .stats-bar-inner { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 640px) {
  .stats-bar-inner { grid-template-columns: repeat(2,1fr); gap: 1.25rem; }
  .plan-card.plan-featured { transform: scale(1); }
}

/* ============================================================
   PAGE ENHANCEMENTS v2 — About, Contact, Pricing, Dashboard
   Major visual upgrade: richer layouts, better typography,
   animated interactions, polished cards.
   ============================================================ */

/* ── About page — stats band border fix ───────────────────── */
.stats-band-cell:last-child { border-right: none !important; }

/* ── Section CTA chip variant ─────────────────────────────── */
.chip-saffron {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(232,135,10,0.13);
  border: 1px solid rgba(232,135,10,0.28);
  border-radius: 999px;
  padding: 0.28rem 0.85rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--saffron);
}
.chip-dark {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 0.28rem 0.85rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}

/* ── Contact page FAQ ──────────────────────────────────────── */
.faq-body { transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1); }
.faq-item.open .faq-body { max-height: 400px; }

/* ── Pricing page plan card improvements ───────────────────── */
.plan-card { transition: transform 0.22s cubic-bezier(0.4,0,0.2,1), box-shadow 0.22s ease; }

/* ── Dashboard: powerful section headers ───────────────────── */
.db-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--ink-10);
}
.db-section-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.15rem;
}
.db-section-sub {
  font-size: 0.8rem;
  color: var(--ink-40);
}

/* ── Sidebar enhancements ──────────────────────────────────── */
.sidebar-avatar {
  background: linear-gradient(135deg, var(--saffron) 0%, #c96f04 100%);
  box-shadow: 0 4px 12px rgba(232,135,10,0.3);
}
.sidebar-link.active {
  background: rgba(232,135,10,0.14);
  color: var(--saffron);
  box-shadow: inset 3px 0 0 var(--saffron);
}
.sidebar-link svg { transition: transform 0.15s; }
.sidebar-link:hover svg { transform: translateX(2px); }

/* ── Stat card improvements ────────────────────────────────── */
.stat-card {
  transition: transform 0.2s, box-shadow 0.2s;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--saffron);
  opacity: 0;
  transition: opacity 0.2s;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.stat-card:hover::before { opacity: 1; }

/* ── Templates grid — AI badge ─────────────────────────────── */
.tpl-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  letter-spacing: 0.05em;
}
.tpl-source-ai     { background: var(--saffron-lt);  color: var(--saffron-dk); }
.tpl-source-manual { background: var(--ink-05);       color: var(--ink-40); }

/* ── Template card actions ─────────────────────────────────── */
.tpl-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ink-05);
}

/* ── Step progress indicator ───────────────────────────────── */
.step-bar {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 2rem;
}
.step-node {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.25s;
  flex-shrink: 0;
  position: relative;
}
.step-node.pending  { background: var(--ink-10); color: var(--ink-40); }
.step-node.active   { background: var(--ink);    color: var(--white);  box-shadow: 0 0 0 4px rgba(15,25,35,0.12); }
.step-node.done     { background: var(--success); color: var(--white); }
.step-connector {
  flex: 1;
  height: 2px;
  background: var(--ink-10);
  transition: background 0.3s;
  max-width: 60px;
}
.step-connector.done { background: var(--success); }

/* ── Dashboard overview — quick action buttons ─────────────── */
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.25rem;
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-60);
}
.quick-action:hover {
  border-color: var(--saffron-lt);
  background: var(--saffron-lt);
  color: var(--saffron-dk);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.quick-action .qa-icon {
  font-size: 1.6rem;
  transition: transform 0.2s;
}
.quick-action:hover .qa-icon { transform: scale(1.1); }

/* ── Recent reports list items ─────────────────────────────── */
.report-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--ink-05);
  gap: 0.75rem;
}
.report-list-item:last-child { border-bottom: none; }
.report-list-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.report-list-meta {
  font-size: 0.72rem;
  color: var(--ink-40);
  margin-top: 0.1rem;
}

/* ── Access denied screen ──────────────────────────────────── */
#auth-denied {
  background: var(--ivory);
}
.denied-card {
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-xl);
  padding: 3rem 2.5rem;
  text-align: center;
  max-width: 420px;
  box-shadow: var(--shadow);
}

/* ── AI scanner modal enhancements ────────────────────────── */
#ai-dropzone {
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
#ai-dropzone:active { transform: scale(0.99); }

/* ── Form group with icon ──────────────────────────────────── */
.form-group-icon {
  position: relative;
}
.form-group-icon .form-input {
  padding-left: 2.5rem;
}
.form-group-icon .input-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-40);
  pointer-events: none;
  font-size: 0.95rem;
}

/* ── Animated counter (for stats bar) ─────────────────────── */
@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.stats-band-number { animation: countUp 0.5s ease both; }

/* ── Responsive upgrades ───────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-band-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .plan-card.plan-featured { transform: none; margin: 0; }
  .db-section-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .tpl-card-actions { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .quick-action { padding: 0.9rem; }
}

/* ============================================================
   CALCULATOR PAGE v2
   ============================================================ */

/* Hero */
.calc-hero {
  background: var(--ink);
  padding: 4.5rem 2rem 3.5rem;
  position: relative;
  overflow: hidden;
}
.calc-hero::before {
  content: '';
  position: absolute;
  top: -120px; right: -80px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(232,135,10,0.1) 0%, transparent 70%);
  pointer-events: none;
}
.calc-hero-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3rem;
  flex-wrap: wrap;
}
.calc-hero-left { flex: 1; min-width: 280px; }
.calc-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 0.9rem;
}
.calc-hero-sub {
  font-size: 1rem;
  color: var(--ink-40);
  line-height: 1.65;
  max-width: 480px;
  margin-bottom: 1.5rem;
}
.calc-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.calc-trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(232,135,10,0.12);
  border: 1px solid rgba(232,135,10,0.22);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--saffron);
}

/* Usage box */
.calc-usage-box {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  min-width: 200px;
  text-align: center;
  flex-shrink: 0;
}
.calc-usage-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 0.4rem;
}
.calc-usage-count {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
  margin-bottom: 0.75rem;
}
.calc-usage-bar-wrap {
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}
.calc-usage-bar {
  height: 100%;
  background: var(--saffron);
  border-radius: 999px;
  transition: width 0.5s ease;
}

/* Page background */
.calc-page-bg {
  background: var(--ivory);
  padding: 2rem 2rem 4rem;
}
.calc-page-inner {
  max-width: 1000px;
  margin: 0 auto;
}

/* Calculator card */
.calc-card {
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.calc-card-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 1rem 1.5rem;
}
.calc-card-head svg { opacity: 0.6; flex-shrink: 0; }
.calc-card-body { padding: 1.5rem; }

/* Student info grid */
.calc-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 0.9rem;
}
.calc-field {}
.calc-field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-60);
  margin-bottom: 0.3rem;
  letter-spacing: 0.01em;
}
.calc-required { color: var(--danger); margin-left: 2px; }
.calc-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.855rem;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--ink-20);
  border-radius: var(--radius);
  padding: 0.55rem 0.8rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.calc-input:focus {
  border-color: var(--saffron);
  box-shadow: 0 0 0 3px rgba(232,135,10,0.12);
}
.calc-input::placeholder { color: var(--ink-40); }

/* Subjects table */
.calc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}
.calc-table thead th {
  padding: 0.7rem 0.85rem;
  background: var(--ink-05);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-40);
  border-bottom: 1px solid var(--ink-10);
  white-space: nowrap;
}
.calc-table tbody tr { border-bottom: 1px solid var(--ink-05); }
.calc-table tbody tr:last-child { border-bottom: none; }
.calc-table tbody tr:hover td { background: var(--ivory); }
.calc-table td { padding: 0.65rem 0.85rem; vertical-align: middle; }

/* Actions bar */
.calc-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--ink-05);
  background: var(--ink-05);
}

/* Report card output */
.calc-report-card {
  background: var(--ink);
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.calc-rc-header {
  padding: 2rem 2rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.calc-rc-school {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 0.2rem;
}
.calc-rc-subtitle {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-40);
}
.calc-rc-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.calc-rc-meta-item {
  padding: 1rem 1.25rem;
  border-right: 1px solid rgba(255,255,255,0.07);
}
.calc-rc-meta-item:last-child { border-right: none; }
.calc-rc-meta-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-40);
  margin-bottom: 0.3rem;
}
.calc-rc-meta-value {
  font-weight: 700;
  color: var(--white);
  font-size: 0.875rem;
}
.calc-rc-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1.25rem 2rem;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.calc-rc-stat {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}
.calc-rc-stat-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-40);
  margin-bottom: 0.4rem;
}
.calc-rc-stat-val {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--white);
}

/* Download bar */
.calc-download-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
  align-items: center;
}

/* Upsell box */
.calc-upsell-box {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--saffron-lt);
  border: 1px solid rgba(232,135,10,0.25);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.calc-upsell-icon { font-size: 2rem; flex-shrink: 0; }

/* How it works */
.calc-how-section {
  margin-top: 3.5rem;
  padding-top: 3rem;
  border-top: 1px solid var(--ink-10);
}
.calc-how-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  margin-bottom: 2rem;
}
.calc-how-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.calc-how-card {
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.calc-how-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.calc-how-num {
  width: 36px; height: 36px;
  background: var(--ink);
  color: var(--white);
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.85rem;
}
.calc-how-name {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.4rem;
}
.calc-how-desc { font-size: 0.78rem; color: var(--ink-60); line-height: 1.55; }

/* Grade reference */
.calc-grade-ref {
  margin-top: 2rem;
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
}
.calc-grade-ref-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-40);
  margin-bottom: 1rem;
}
.calc-grade-ref-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.calc-grade-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.78rem;
}
.grade-pill-success { background: var(--success-lt); color: var(--success); }
.grade-pill-info    { background: var(--info-lt);    color: var(--info); }
.grade-pill-warning { background: var(--warning-lt); color: var(--warning); }
.grade-pill-danger  { background: var(--danger-lt);  color: var(--danger); }
.calc-grade-letter { font-weight: 800; font-family: var(--font-display); font-size: 0.9rem; }
.calc-grade-range  { opacity: 0.75; }
.calc-grade-desc   { font-weight: 600; }


/* ============================================================
   BLOG — INDEX (index.php)
   Magazine-style with featured hero post + card list
   ============================================================ */

/* Masthead */
.bl-masthead {
  background: var(--ink);
  position: relative;
  overflow: hidden;
}
.bl-masthead::before {
  content: '';
  position: absolute;
  top: -100px; right: -80px;
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(232,135,10,0.1) 0%, transparent 65%);
  pointer-events: none;
}
.bl-masthead::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(232,135,10,0.35), transparent);
}
.bl-masthead-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4.5rem 2rem 3rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.bl-masthead-left { flex: 1; min-width: 260px; }
.bl-masthead-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--saffron);
  margin-bottom: 1rem;
}
.bl-live-dot {
  width: 7px; height: 7px;
  background: var(--saffron);
  border-radius: 50%;
  flex-shrink: 0;
  animation: blinkDot 1.8s ease-in-out infinite;
}
@keyframes blinkDot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}
.bl-masthead-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.5vw, 3.8rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.05;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}
.bl-masthead-title em {
  font-style: italic;
  font-weight: 300;
  color: var(--saffron);
}
.bl-masthead-desc {
  font-size: 0.975rem;
  color: var(--ink-40);
  line-height: 1.7;
  max-width: 460px;
}

/* Stats trio */
.bl-masthead-stats {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 1.75rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  flex-shrink: 0;
}
.bl-stat { text-align: center; }
.bl-stat-n {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
}
.bl-stat-l {
  display: block;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-40);
  margin-top: 0.25rem;
}
.bl-stat-div {
  width: 1px; height: 36px;
  background: rgba(255,255,255,0.1);
}

/* Topic filter bar */
.bl-topic-bar {
  border-top: 1px solid rgba(255,255,255,0.06);
  position: relative; z-index: 1;
}
.bl-topic-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.bl-topic-inner::-webkit-scrollbar { display: none; }
.bl-topic-pill {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: all 0.14s;
}
.bl-topic-pill:hover { border-color: var(--saffron); color: var(--saffron); }
.bl-topic-pill-active {
  background: var(--saffron);
  border-color: var(--saffron);
  color: var(--white) !important;
}

/* Featured post */
.bl-featured-wrap {
  background: var(--white);
  border-bottom: 2px solid var(--ink-05);
  padding: 2.5rem 2rem;
}
.bl-featured-inner { max-width: 1200px; margin: 0 auto; }
.bl-featured-card {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  min-height: 420px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--ink-10);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s;
}
.bl-featured-card:hover { box-shadow: var(--shadow-lg); }

/* Image side */
.bl-featured-img-wrap {
  display: block;
  overflow: hidden;
  position: relative;
}
.bl-featured-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.55s ease;
}
.bl-featured-card:hover .bl-featured-img { transform: scale(1.04); }
.bl-featured-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15,25,35,0.3) 0%, transparent 55%);
}
.bl-featured-no-img {
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-80) 100%);
  display: flex; align-items: center; justify-content: center;
}
.bl-featured-no-img-icon { font-size: 4.5rem; opacity: 0.2; }

/* Text side */
.bl-featured-body {
  display: flex;
  flex-direction: column;
  padding: 2.5rem 2.75rem;
  background: var(--white);
}
.bl-featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--saffron-dk);
  background: var(--saffron-lt);
  padding: 0.22rem 0.65rem;
  border-radius: 4px;
  margin-bottom: 0.85rem;
  width: fit-content;
}
.bl-featured-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--ink-40);
  margin-bottom: 1rem;
}
.bl-dot { opacity: 0.35; }
.bl-featured-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin-bottom: 1rem;
  flex: 1;
}
.bl-featured-title a { color: inherit; text-decoration: none; transition: color 0.14s; }
.bl-featured-title a:hover { color: var(--saffron-dk); }
.bl-featured-excerpt {
  font-size: 0.94rem;
  color: var(--ink-60);
  line-height: 1.72;
  margin-bottom: 1.75rem;
}
.bl-featured-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--ink-05);
}

/* Shared: category label */
.bl-post-cat {
  display: inline-flex;
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--saffron-dk);
  background: var(--saffron-lt);
  padding: 0.18rem 0.55rem;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.13s;
}
.bl-post-cat:hover { background: rgba(232,135,10,0.22); }

/* Author chip */
.bl-author-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-60);
}
.bl-author-av {
  width: 30px; height: 30px;
  background: var(--ink);
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}
.bl-author-chip-sm { font-size: 0.75rem; }
.bl-author-av-sm   { width: 22px; height: 22px; font-size: 0.6rem; }

/* Read more button */
.bl-read-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--saffron-dk);
  text-decoration: none;
  transition: gap 0.14s;
}
.bl-read-btn:hover { gap: 0.7rem; }

/* Main content wrap */
.bl-main-wrap {
  background: var(--ivory);
  padding: 3rem 2rem 5rem;
}
.bl-main-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 3rem;
  align-items: start;
}
.bl-posts-col { min-width: 0; }

/* Section header */
.bl-col-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.bl-col-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.bl-col-line { flex: 1; height: 1px; background: var(--ink-10); }

/* Card stack — horizontal cards */
.bl-card-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.bl-card {
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: grid;
  grid-template-columns: 210px 1fr;
  min-height: 168px;
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  animation: cardFadeUp 0.4s ease both;
}
.bl-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(232,135,10,0.2);
}
@keyframes cardFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.bl-card-img-wrap {
  display: block;
  overflow: hidden;
}
.bl-card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}
.bl-card:hover .bl-card-img { transform: scale(1.05); }
.bl-card-body {
  padding: 1.35rem 1.5rem;
  display: flex;
  flex-direction: column;
}
.bl-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.bl-card-date {
  font-size: 0.68rem;
  color: var(--ink-40);
  white-space: nowrap;
}
.bl-card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 0.5rem;
}
.bl-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.14s;
}
.bl-card-title a:hover { color: var(--saffron-dk); }
.bl-card-excerpt {
  font-size: 0.835rem;
  color: var(--ink-60);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bl-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--ink-05);
}
.bl-read-time {
  font-size: 0.7rem;
  color: var(--ink-40);
  font-weight: 500;
}

/* Pagination */
.bl-pagination {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}
.bl-pagination a,
.bl-pagination span {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--ink-10);
  color: var(--ink-60);
  background: var(--white);
  transition: all 0.14s;
}
.bl-pagination a:hover { border-color: var(--saffron); color: var(--saffron-dk); }
.bl-pagination .current { background: var(--ink); color: var(--white); border-color: var(--ink); }

/* Empty state */
.bl-empty {
  text-align: center;
  padding: 5rem 2rem;
  background: var(--white);
  border: 2px dashed var(--ink-10);
  border-radius: var(--radius-xl);
}
.bl-empty-glyph {
  font-size: 3rem;
  color: var(--saffron);
  display: block;
  margin-bottom: 1rem;
}
.bl-empty-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.6rem;
}
.bl-empty-desc {
  font-size: 0.9rem;
  color: var(--ink-60);
  max-width: 360px;
  margin: 0 auto 1.5rem;
  line-height: 1.65;
}

/* ============================================================
   SIDEBAR (sidebar.php)
   ============================================================ */

.bl-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: calc(var(--header-h) + 1.25rem);
}

/* Search widget */
.bls-widget {
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
}
.bls-search {
  display: flex;
  border: 1.5px solid var(--ink-10);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.14s;
}
.bls-search:focus-within { border-color: var(--saffron); }
.bls-search-input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.84rem;
  color: var(--ink);
  border: none;
  outline: none;
  padding: 0.6rem 0.85rem;
  background: transparent;
}
.bls-search-input::placeholder { color: var(--ink-40); }
.bls-search-btn {
  background: var(--ink);
  color: var(--white);
  border: none;
  padding: 0 0.85rem;
  cursor: pointer;
  display: flex; align-items: center;
  transition: background 0.14s;
  flex-shrink: 0;
}
.bls-search-btn:hover { background: var(--saffron); }

/* Widget header */
.bls-widget-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--ink-05);
}
.bls-widget-ornament { font-size: 0.65rem; color: var(--saffron); }
.bls-widget-title {
  font-family: var(--font-display);
  font-size: 0.87rem;
  font-weight: 700;
  color: var(--ink);
}

/* Popular articles */
.bls-popular-list { list-style: none; }
.bls-popular-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--ink-05);
}
.bls-popular-item:last-child { border-bottom: none; padding-bottom: 0; }
.bls-popular-num {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ink-10);
  line-height: 1;
  min-width: 30px;
  flex-shrink: 0;
}
.bls-popular-body { flex: 1; min-width: 0; }
.bls-popular-title {
  display: block;
  font-size: 0.815rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 0.2rem;
  text-decoration: none;
  transition: color 0.13s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bls-popular-title:hover { color: var(--saffron-dk); }
.bls-popular-date { font-size: 0.67rem; color: var(--ink-40); }
.bls-empty-msg { font-size: 0.82rem; color: var(--ink-40); padding: 0.5rem 0; }

/* Topic cloud */
.bls-topic-cloud { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.bls-topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-60);
  background: var(--ink-05);
  border: 1px solid var(--ink-10);
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
  text-decoration: none;
  transition: all 0.13s;
}
.bls-topic-chip:hover {
  background: var(--saffron-lt);
  color: var(--saffron-dk);
  border-color: rgba(232,135,10,0.25);
}
.bls-topic-count {
  background: var(--ink-10);
  color: var(--ink-40);
  border-radius: 999px;
  font-size: 0.6rem;
  padding: 0.05rem 0.35rem;
  font-weight: 700;
}

/* Calc CTA */
.bls-calc-cta {
  background: var(--ink);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.bls-calc-pattern {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at top right, rgba(232,135,10,0.18), transparent 60%);
  pointer-events: none;
}
.bls-calc-content { position: relative; z-index: 1; }
.bls-calc-icon { font-size: 2.25rem; display: block; margin-bottom: 0.65rem; }
.bls-calc-title {
  font-family: var(--font-display);
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.4rem;
}
.bls-calc-desc {
  font-size: 0.775rem;
  color: var(--ink-40);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.bls-calc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--saffron);
  color: var(--white);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.14s;
}
.bls-calc-btn:hover { background: var(--saffron-dk); transform: translateY(-1px); }

/* Dashboard CTA */
.bls-dash-cta {
  background: var(--ink);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  text-align: center;
}
.bls-dash-icon { font-size: 1.75rem; display: block; margin-bottom: 0.65rem; }
.bls-dash-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.4rem;
  line-height: 1.35;
}
.bls-dash-desc {
  font-size: 0.75rem;
  color: var(--ink-40);
  margin-bottom: 1rem;
  line-height: 1.6;
}
.bls-dash-note { font-size: 0.67rem; color: var(--ink-60); margin-top: 0.5rem; }

/* ============================================================
   SINGLE POST (single.php)
   Tall hero + reading progress + rich typography + related posts
   ============================================================ */

/* ── Hero ── */
.sp-hero {
  position: relative;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}
.sp-hero-bg {
  position: absolute;
  inset: 0;
}
.sp-hero-bg-img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  filter: brightness(0.5) saturate(0.75);
}
.sp-hero-bg-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    to top,
    rgba(15,25,35,0.96) 0%,
    rgba(15,25,35,0.7)  40%,
    rgba(15,25,35,0.2)  80%,
    transparent 100%
  );
}
.sp-hero-bg-plain {
  background: var(--ink);
}
.sp-hero-bg-plain::after {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(232,135,10,0.13) 0%, transparent 65%);
}
.sp-hero-content {
  position: relative;
  z-index: 2;
  max-width: 820px;
  margin: 0 auto;
  padding: 7rem 2rem 3.5rem;
  width: 100%;
}

/* Breadcrumb */
.sp-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.38);
  margin-bottom: 1.25rem;
}
.sp-breadcrumb a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color 0.13s;
}
.sp-breadcrumb a:hover { color: var(--saffron); }
.sp-bc-sep { opacity: 0.35; }

/* Category on dark hero */
.sp-cat-badge {
  display: inline-flex;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--saffron);
  background: rgba(232,135,10,0.15);
  border: 1px solid rgba(232,135,10,0.3);
  padding: 0.22rem 0.75rem;
  border-radius: 4px;
  text-decoration: none;
  margin-bottom: 1rem;
  display: block;
  width: fit-content;
  transition: background 0.13s;
}
.sp-cat-badge:hover { background: rgba(232,135,10,0.28); }

/* Post title on dark */
.sp-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 3.1rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.12;
  margin-bottom: 1.75rem;
  letter-spacing: -0.02em;
}

/* Meta strip */
.sp-meta-strip {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.sp-author-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sp-author-av {
  width: 40px; height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
  background: var(--ink-80);
}
.sp-author-avatar { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-author-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  line-height: 1.2;
}
.sp-author-role { font-size: 0.7rem; color: rgba(255,255,255,0.38); }
.sp-meta-divider { width: 1px; height: 30px; background: rgba(255,255,255,0.12); }
.sp-meta-items { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.sp-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
}

/* Reading progress bar */
.sp-progress-wrap {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  height: 3px;
  background: var(--ink-10);
}
.sp-progress-bar {
  height: 100%;
  background: linear-gradient(to right, var(--saffron), var(--saffron-dk));
  width: 0%;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

/* Article body layout */
.sp-body-wrap {
  background: var(--ivory);
  padding: 3rem 2rem 4rem;
}
.sp-layout {
  max-width: 1140px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3.5rem;
  align-items: start;
}
.sp-article { min-width: 0; }

/* Lead excerpt box */
.sp-lead-box {
  border-left: 4px solid var(--saffron);
  background: linear-gradient(to right, var(--saffron-lt), transparent);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  font-size: 1.05rem;
  color: var(--ink-60);
  line-height: 1.75;
  font-style: italic;
}
.sp-lead-box p { margin: 0; }

/* Post content — academic typography */
.sp-content {
  font-size: 1.025rem;
  line-height: 1.82;
  color: #2a3a4a;
}
.sp-content > *:first-child { margin-top: 0 !important; }
.sp-content > p:first-child { font-size: 1.08rem; }

.sp-content h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--ink);
  margin: 2.75rem 0 0.85rem;
  letter-spacing: -0.015em;
  padding-left: 1.1rem;
  position: relative;
}
.sp-content h2::before {
  content: '';
  position: absolute;
  left: 0; top: 0.15em;
  width: 4px; height: 1.1em;
  background: var(--saffron);
  border-radius: 2px;
}
.sp-content h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  margin: 2rem 0 0.7rem;
}
.sp-content h4 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-40);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin: 1.5rem 0 0.5rem;
}
.sp-content p { margin-bottom: 1.45rem; }
.sp-content a { color: var(--saffron-dk); text-decoration: underline; text-underline-offset: 3px; }
.sp-content a:hover { color: var(--saffron); }

/* Custom bullet list */
.sp-content ul {
  list-style: none;
  padding: 0;
  margin-bottom: 1.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sp-content ul li {
  padding-left: 1.5rem;
  position: relative;
  line-height: 1.7;
}
.sp-content ul li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--saffron);
  font-size: 0.6rem;
  top: 0.45em;
}
.sp-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.sp-content ol li { list-style: decimal; line-height: 1.7; padding-left: 0.3rem; }

/* Blockquote */
.sp-content blockquote {
  margin: 2.25rem 0;
  padding: 1.75rem 1.75rem 1.5rem;
  background: var(--ink);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
.sp-content blockquote::before {
  content: '"';
  position: absolute;
  top: -0.75rem; left: 1.25rem;
  font-family: var(--font-display);
  font-size: 6rem;
  color: rgba(232,135,10,0.2);
  line-height: 1;
  pointer-events: none;
}
.sp-content blockquote p {
  position: relative; z-index: 1;
  font-size: 1.08rem;
  font-style: italic;
  color: rgba(255,255,255,0.88);
  line-height: 1.72;
  margin: 0;
}
.sp-content blockquote cite {
  display: block;
  margin-top: 0.9rem;
  font-size: 0.75rem;
  color: var(--saffron);
  font-style: normal;
  font-weight: 600;
  position: relative; z-index: 1;
}

/* Images */
.sp-content img {
  border-radius: var(--radius-lg);
  margin: 2rem 0;
  box-shadow: var(--shadow);
  max-width: 100%;
  display: block;
}
.sp-content figure { margin: 2rem 0; }
.sp-content figcaption {
  text-align: center;
  font-size: 0.77rem;
  color: var(--ink-40);
  margin-top: 0.5rem;
  font-style: italic;
}

/* Code */
.sp-content code {
  background: var(--saffron-lt);
  color: var(--saffron-dk);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.875em;
  font-family: 'Courier New', Courier, monospace;
}
.sp-content pre {
  background: var(--ink);
  color: rgba(255,255,255,0.87);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin: 1.75rem 0;
  font-size: 0.875rem;
  border: 1px solid rgba(255,255,255,0.07);
}
.sp-content pre code {
  background: none; color: inherit;
  padding: 0; border-radius: 0; font-size: 1em;
}

/* Tables */
.sp-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75rem 0;
  font-size: 0.9rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--ink-10);
}
.sp-content thead th {
  background: var(--ink);
  color: rgba(255,255,255,0.85);
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: left;
}
.sp-content td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--ink-05);
  vertical-align: top;
}
.sp-content tr:last-child td { border-bottom: none; }
.sp-content tr:nth-child(even) td { background: var(--ink-05); }
.sp-content hr {
  border: none;
  height: 1px;
  background: var(--ink-10);
  margin: 2.5rem 0;
}

/* Tags */
.sp-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 2rem 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ink-10);
}
.sp-tags-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-40);
}
.sp-tags-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.sp-tag {
  display: inline-flex;
  padding: 0.22rem 0.7rem;
  background: var(--ink-05);
  border: 1px solid var(--ink-10);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-60);
  text-decoration: none;
  transition: all 0.13s;
}
.sp-tag:hover { background: var(--saffron-lt); color: var(--saffron-dk); border-color: rgba(232,135,10,0.25); }

/* Ornament divider */
.sp-divider-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  font-size: 0.65rem;
  color: var(--saffron);
  opacity: 0.5;
  margin: 2.5rem 0;
  letter-spacing: 0.5rem;
}

/* Author box */
.sp-author-box {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-xs);
}
.sp-author-box-av {
  width: 68px; height: 68px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid var(--white);
  box-shadow: var(--shadow-sm);
  background: var(--ink-80);
}
.sp-author-box-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-author-box-body { flex: 1; }
.sp-author-box-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--saffron-dk);
  margin-bottom: 0.2rem;
}
.sp-author-box-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.4rem;
}
.sp-author-box-bio {
  font-size: 0.84rem;
  color: var(--ink-60);
  line-height: 1.62;
  margin: 0;
}

/* In-article calculator CTA */
.sp-cta-box {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  background: var(--ink);
  border-radius: var(--radius-xl);
  padding: 1.5rem 1.75rem;
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}
.sp-cta-box::before {
  content: '';
  position: absolute;
  top: -50px; right: -50px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(232,135,10,0.18), transparent 68%);
  pointer-events: none;
}
.sp-cta-icon { font-size: 2.25rem; flex-shrink: 0; position: relative; z-index: 1; }
.sp-cta-content { flex: 1; min-width: 180px; position: relative; z-index: 1; }
.sp-cta-title {
  font-family: var(--font-display);
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.3rem;
}
.sp-cta-desc { font-size: 0.78rem; color: var(--ink-40); line-height: 1.55; }
.sp-cta-btn { flex-shrink: 0; position: relative; z-index: 1; }

/* Post navigation */
.sp-post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--ink-10);
}
.sp-nav-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  transition: all 0.17s;
}
.sp-nav-card:hover {
  border-color: var(--saffron);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.sp-nav-next { text-align: right; }
.sp-nav-dir {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--saffron-dk);
  margin-bottom: 0.3rem;
}
.sp-nav-title {
  font-family: var(--font-display);
  font-size: 0.87rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Related posts */
.sp-related {
  background: var(--ink-05);
  border-top: 1px solid var(--ink-10);
  padding: 3.5rem 2rem 4.5rem;
}
.sp-related-inner { max-width: 1140px; margin: 0 auto; }
.sp-related-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
}
.sp-related-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
}
.sp-related-all {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--saffron-dk);
  text-decoration: none;
  white-space: nowrap;
}
.sp-related-all:hover { text-decoration: underline; }
.sp-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.sp-related-card {
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-xs);
}
.sp-related-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.sp-related-img-wrap {
  display: block;
  aspect-ratio: 16/9;
  overflow: hidden;
}
.sp-related-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}
.sp-related-card:hover .sp-related-img { transform: scale(1.05); }
.sp-related-no-img {
  background: var(--ink-05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.sp-related-body { padding: 1.1rem 1.25rem 1.35rem; }
.sp-related-post-title {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  margin: 0.45rem 0 0.5rem;
}
.sp-related-post-title a { color: inherit; text-decoration: none; transition: color 0.13s; }
.sp-related-post-title a:hover { color: var(--saffron-dk); }
.sp-related-meta { font-size: 0.7rem; color: var(--ink-40); }

/* ============================================================
   RESPONSIVE — Blog & Single
   ============================================================ */
@media (max-width: 1024px) {
  .bl-main-grid  { grid-template-columns: 1fr; }
  .sp-layout     { grid-template-columns: 1fr; }
  .bl-sidebar    { position: static; }
  .sp-related-grid { grid-template-columns: repeat(2, 1fr); }
  .bl-featured-card { grid-template-columns: 1fr; min-height: auto; }
  .bl-featured-img-wrap { aspect-ratio: 16/9; }
  .bl-masthead-stats { display: none; }
}
@media (max-width: 700px) {
  .bl-card { grid-template-columns: 1fr; min-height: auto; }
  .bl-card-img-wrap { aspect-ratio: 16/9; min-height: unset; }
  .sp-hero { min-height: 420px; }
  .sp-post-nav { grid-template-columns: 1fr; }
  .sp-related-grid { grid-template-columns: 1fr; }
  .bl-featured-body { padding: 1.5rem; }
  .sp-cta-box { flex-direction: column; text-align: center; }
  .sp-author-box { flex-direction: column; align-items: center; text-align: center; }
  .sp-meta-strip { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .sp-meta-divider { display: none; }
  .bl-masthead-inner { padding: 3rem 1.25rem 2.5rem; }
  .bl-main-wrap { padding: 2rem 1.25rem 4rem; }
  .sp-body-wrap { padding: 2rem 1.25rem 3rem; }
  .sp-hero-content { padding: 5rem 1.25rem 2.5rem; }
}
@media (max-width: 480px) {
  .bl-masthead-title { font-size: 2rem; }
  .sp-title { font-size: 1.7rem; }
  .sp-related { padding: 2.5rem 1.25rem 3.5rem; }
  .sp-related-grid { gap: 1rem; }
}

/* Post nav prev (default left-align) */
.sp-nav-prev { text-align: left; }


/* ============================================================
   DASHBOARD v3.0 — Multi-Role
   ============================================================ */

/* ── Owner god-mode tab bar ── */
.db-owner-bar {
  background: var(--ink);
  border-bottom: 2px solid var(--saffron);
  position: sticky;
  top: var(--header-h);
  z-index: 80;
}
.db-owner-bar-inner {
  max-width: 1400px; margin: 0 auto;
  padding: 0.55rem 1.5rem;
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
}
.db-owner-bar-label {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--saffron);
  display: flex; align-items: center; gap: 0.4rem; white-space: nowrap;
}
.db-owner-tabs { display: flex; gap: 0.25rem; flex: 1; flex-wrap: wrap; }
.db-owner-tab {
  display: flex; align-items: center; gap: 0.35rem;
  font-size: 0.75rem; font-weight: 600;
  padding: 0.35rem 0.9rem; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.5); background: transparent;
  cursor: pointer; transition: all 0.14s; white-space: nowrap;
}
.db-owner-tab:hover { border-color: var(--saffron); color: var(--saffron); }
.db-owner-tab-active { background: var(--saffron); border-color: var(--saffron); color: var(--white) !important; }
.db-owner-bar-tip { font-size: 0.72rem; color: rgba(255,255,255,0.35); white-space: nowrap; }
.db-owner-bar-tip strong { color: rgba(255,255,255,0.7); }

/* ── Full-screen states ── */
.db-fullscreen-state {
  min-height: 80vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--ivory); gap: 1rem;
}
.db-spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--ink-10); border-top-color: var(--saffron);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
.db-spinner-sm { width: 28px; height: 28px; }
.db-loading-text { font-size: 0.875rem; color: var(--ink-40); }
.db-denied-box { text-align: center; max-width: 400px; padding: 2rem; }
.db-denied-icon { font-size: 3rem; margin-bottom: 1rem; }
.db-denied-title {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 700;
  color: var(--ink); margin-bottom: 0.75rem;
}
.db-denied-desc { font-size: 0.9rem; color: var(--ink-60); margin-bottom: 1.5rem; line-height: 1.6; }

/* ── App layout ── */
.db-app { display: flex; min-height: calc(100vh - var(--header-h)); background: var(--ivory); position: relative; }

/* ── Sidebar ── */
.dashboard-sidebar {
  width: 240px; min-width: 240px;
  background: var(--ink);
  display: flex; flex-direction: column;
  min-height: calc(100vh - var(--header-h));
  position: sticky; top: var(--header-h); align-self: flex-start;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto; scrollbar-width: none; flex-shrink: 0;
}
.dashboard-sidebar::-webkit-scrollbar { display: none; }

.db-sidebar-profile {
  padding: 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex; align-items: center; gap: 0.75rem;
}
.db-sidebar-av {
  width: 38px; height: 38px; background: var(--saffron); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; color: var(--white); flex-shrink: 0;
}
.db-sidebar-info { min-width: 0; }
.db-sidebar-name {
  font-size: 0.85rem; font-weight: 700; color: var(--white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.db-sidebar-school {
  font-size: 0.7rem; color: var(--ink-40);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.db-sidebar-role-wrap { padding: 0.65rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.06); }
.db-sidebar-role-badge {
  display: inline-flex; font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.07em; color: var(--saffron);
  background: rgba(232,135,10,0.12); border: 1px solid rgba(232,135,10,0.25);
  padding: 0.2rem 0.65rem; border-radius: 999px;
}

.db-sidebar-nav { flex: 1; padding: 0.75rem 0; }
.sidebar-link, .db-nav-btn {
  display: flex; align-items: center; gap: 0.7rem;
  width: 100%; padding: 0.6rem 1.25rem;
  font-size: 0.82rem; font-weight: 500; color: rgba(255,255,255,0.55);
  background: none; border: none; cursor: pointer; text-align: left;
  transition: all 0.13s; border-left: 3px solid transparent;
}
.sidebar-link:hover, .db-nav-btn:hover { color: var(--white); background: rgba(255,255,255,0.05); }
.sidebar-link.active, .db-nav-btn.active {
  color: var(--saffron); background: rgba(232,135,10,0.1);
  border-left-color: var(--saffron); font-weight: 700;
}

.db-sidebar-upgrade {
  margin: 0.75rem; background: rgba(232,135,10,0.1);
  border: 1px solid rgba(232,135,10,0.25); border-radius: var(--radius-lg); padding: 1rem;
}
.db-upgrade-title { font-size: 0.78rem; font-weight: 700; color: var(--saffron); margin-bottom: 0.3rem; }
.db-upgrade-desc { font-size: 0.7rem; color: var(--ink-40); margin-bottom: 0.75rem; line-height: 1.5; }

.db-sidebar-footer { padding: 0.75rem; border-top: 1px solid rgba(255,255,255,0.07); }
.db-sidebar-logout {
  display: flex; align-items: center; gap: 0.6rem;
  width: 100%; padding: 0.55rem 0.75rem;
  font-size: 0.8rem; font-weight: 600; color: rgba(239,68,68,0.65);
  background: none; border: none; cursor: pointer;
  border-radius: var(--radius-sm); transition: all 0.13s;
}
.db-sidebar-logout:hover { background: rgba(239,68,68,0.08); color: rgba(239,68,68,0.9); }

/* ── Main content ── */
.dashboard-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.dashboard-topbar {
  background: var(--white); border-bottom: 1px solid var(--ink-10);
  padding: 0 1.5rem; height: 58px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: var(--header-h); z-index: 70; gap: 1rem;
}
.db-topbar-left { display: flex; align-items: center; gap: 0.75rem; }
.db-topbar-right { display: flex; align-items: center; gap: 0.75rem; }
.dashboard-title {
  font-family: var(--font-display); font-size: 1.1rem;
  font-weight: 700; color: var(--ink); margin: 0;
}
.db-mobile-menu-btn {
  display: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 1px solid var(--ink-10);
  border-radius: var(--radius-sm); background: none; cursor: pointer; color: var(--ink);
}

/* ── Notifications ── */
.db-notif-btn {
  position: relative; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--ink-10); border-radius: var(--radius-sm);
  cursor: pointer; color: var(--ink-60); transition: all 0.13s;
}
.db-notif-btn:hover { border-color: var(--saffron); color: var(--saffron); }
.db-notif-badge {
  position: absolute; top: -4px; right: -4px;
  width: 16px; height: 16px; background: var(--danger); color: white;
  border-radius: 50%; font-size: 0.6rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.db-notif-panel {
  position: absolute; top: 58px; right: 1.5rem;
  width: 340px; background: var(--white);
  border: 1px solid var(--ink-10); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); z-index: 200; overflow: hidden;
}
.db-notif-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--ink-05);
  font-weight: 700; font-size: 0.875rem;
}
.db-notif-panel-head button { background: none; border: none; cursor: pointer; color: var(--ink-40); font-size: 1rem; }
.db-notif-list { max-height: 360px; overflow-y: auto; }
.db-notif-item {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--ink-05);
  cursor: pointer; transition: background 0.13s;
}
.db-notif-item:hover { background: var(--ink-05); }
.db-notif-unread { background: var(--saffron-lt); }
.db-notif-msg { font-size: 0.82rem; color: var(--ink); line-height: 1.4; }
.db-notif-time { font-size: 0.7rem; color: var(--ink-40); margin-top: 0.2rem; }
.db-notif-empty { padding: 2rem; text-align: center; font-size: 0.85rem; color: var(--ink-40); }

/* ── Dashboard body ── */
.dashboard-body { padding: 1.75rem; flex: 1; }
.db-section { display: none; }
.db-section-loading { display: flex; align-items: center; justify-content: center; padding: 3rem; }

/* ── Stats ── */
.db-stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(165px,1fr));
  gap: 1.1rem; margin-bottom: 1.75rem;
}
.stat-card {
  background: var(--white); border: 1px solid var(--ink-10);
  border-radius: var(--radius-xl); padding: 1.25rem;
  box-shadow: var(--shadow-xs); transition: box-shadow 0.15s, transform 0.15s;
}
.stat-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.stat-icon {
  width: 42px; height: 42px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin-bottom: 0.85rem;
}
.stat-label {
  font-size: 0.7rem; color: var(--ink-40); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.35rem;
}
.stat-value { font-family: var(--font-display); font-size: 1.85rem; font-weight: 800; color: var(--ink); line-height: 1; }

/* ── Card ── */
.card {
  background: var(--white); border: 1px solid var(--ink-10);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-xs);
}
.db-card-head {
  font-family: var(--font-display); font-size: 0.95rem; font-weight: 700;
  color: var(--ink); margin-bottom: 1rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.db-two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; margin-top: 1.25rem; }
.db-chart-card { padding: 1.5rem; }
.db-list-card  { padding: 1.5rem; }

/* ── Table ── */
.db-table-wrap {
  overflow-x: auto; background: var(--white);
  border: 1px solid var(--ink-10); border-radius: var(--radius-xl);
}
.db-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.db-table th {
  background: var(--ink-05); padding: 0.65rem 1rem;
  font-weight: 700; font-size: 0.72rem; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ink-60); text-align: left;
  white-space: nowrap; border-bottom: 2px solid var(--ink-10);
}
.db-table td {
  padding: 0.7rem 1rem; border-bottom: 1px solid var(--ink-05);
  color: var(--ink); vertical-align: middle;
}
.db-table tr:last-child td { border-bottom: none; }
.db-table tr:hover td { background: var(--ivory); }

/* ── Toolbar / Form controls ── */
.db-section-toolbar {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1.25rem; flex-wrap: wrap;
}
.db-search-input {
  flex: 1; min-width: 180px; font-family: var(--font-body);
  font-size: 0.855rem; color: var(--ink);
  border: 1px solid var(--ink-10); border-radius: var(--radius);
  padding: 0.55rem 0.9rem; background: var(--white); outline: none;
  transition: border-color 0.13s;
}
.db-search-input:focus { border-color: var(--saffron); }
.db-select {
  font-family: var(--font-body); font-size: 0.82rem; color: var(--ink);
  border: 1px solid var(--ink-10); border-radius: var(--radius);
  padding: 0.52rem 0.8rem; background: var(--white);
  outline: none; cursor: pointer; transition: border-color 0.13s;
}
.db-select:focus { border-color: var(--saffron); }
.db-select-sm { padding: 0.3rem 0.6rem; font-size: 0.78rem; }

/* ── Marks collection status grid ── */
.db-marks-status-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr));
  gap: 0.75rem; margin-top: 0.75rem;
}
.db-subject-status-card {
  border-radius: var(--radius-lg); padding: 1rem;
  text-align: center; border: 1px solid; transition: transform 0.15s;
}
.db-subject-status-card:hover { transform: translateY(-2px); }
.db-status-pending { background: var(--ink-05); border-color: var(--ink-10); }
.db-status-draft   { background: #fffbeb; border-color: rgba(180,83,9,0.2); }
.db-status-final   { background: #f0fdf4; border-color: rgba(26,122,74,0.2); }
.db-subject-status-icon  { font-size: 1.5rem; margin-bottom: 0.35rem; }
.db-subject-status-name  { font-size: 0.82rem; font-weight: 700; color: var(--ink); line-height: 1.3; margin-bottom: 0.2rem; }
.db-subject-status-teacher { font-size: 0.7rem; color: var(--ink-40); }
.db-subject-status-label { font-size: 0.68rem; font-weight: 600; color: var(--ink-60); margin-top: 0.35rem; }

/* ── Marks entry ── */
.db-marks-header { margin-bottom: 1.25rem; }
.db-marks-controls { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.75rem; }
.db-marks-table-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; flex-wrap: wrap; gap: 0.75rem;
}
.db-marks-status-indicator { font-size: 0.78rem; font-weight: 600; margin-top: 0.25rem; color: var(--ink-60); }
.db-marks-entry-table input {
  border: 1px solid var(--ink-10); border-radius: 6px;
  padding: 0.3rem 0.45rem; font-family: var(--font-body); font-size: 0.85rem; outline: none;
  transition: border-color 0.13s;
}
.db-marks-entry-table input:focus { border-color: var(--saffron); }

/* ── Incoming marks ── */
.db-incoming-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 1rem; }
.db-incoming-card {
  background: var(--white); border: 1px solid var(--ink-10);
  border-radius: var(--radius-xl); padding: 1.25rem; box-shadow: var(--shadow-xs);
}
.db-incoming-card.db-status-final  { border-color: rgba(26,122,74,0.3); background: #f0fdf4; }
.db-incoming-card.db-status-draft  { border-color: rgba(180,83,9,0.25); background: #fffbeb; }
.db-incoming-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; gap: 0.5rem; }
.db-incoming-subject { font-weight: 700; font-size: 0.9rem; color: var(--ink); }
.db-incoming-teacher { font-size: 0.78rem; color: var(--ink-60); margin-bottom: 0.2rem; }
.db-incoming-count  { font-size: 0.72rem; color: var(--ink-40); margin-bottom: 0.75rem; }

/* ── Report readiness ── */
.db-readiness-box {
  background: var(--white); border: 1px solid var(--ink-10);
  border-radius: var(--radius-xl); padding: 1.25rem; margin-bottom: 1.25rem;
}
.db-readiness-title { font-weight: 700; font-size: 0.9rem; color: var(--ink); margin-bottom: 0.75rem; }
.db-readiness-subjects { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.db-readiness-subject {
  font-size: 0.8rem; padding: 0.22rem 0.7rem;
  background: var(--ink-05); border-radius: 999px; color: var(--ink-60);
}
.db-readiness-warn { color: #b45309; font-size: 0.875rem; }
.db-report-student-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 0; border-bottom: 1px solid var(--ink-05);
}
.db-report-student-row:last-child { border-bottom: none; }

/* ── ST assignments ── */
.db-assignments-list { display: flex; flex-direction: column; gap: 0.75rem; }
.db-assign-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem;
  padding: 0.85rem 1rem; background: var(--ink-05);
  border-radius: var(--radius-lg); border: 1px solid var(--ink-10);
}
.db-assign-subject { font-weight: 700; font-size: 0.875rem; color: var(--ink); flex: 1; min-width: 120px; }
.db-assign-class, .db-assign-ct { font-size: 0.78rem; color: var(--ink-60); }

/* ── History ── */
.db-history-list { display: flex; flex-direction: column; gap: 0.75rem; }
.db-history-card {
  background: var(--white); border: 1px solid var(--ink-10);
  border-radius: var(--radius-lg); padding: 1rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  transition: box-shadow 0.15s;
}
.db-history-card:hover { box-shadow: var(--shadow-sm); }
.db-history-left { display: flex; align-items: center; gap: 0.85rem; }
.db-history-status { font-size: 1.25rem; flex-shrink: 0; }
.db-history-subject { font-weight: 700; font-size: 0.9rem; color: var(--ink); }
.db-history-exam { font-size: 0.78rem; color: var(--ink-60); margin-top: 0.1rem; }
.db-history-meta { font-size: 0.7rem; color: var(--ink-40); margin-top: 0.1rem; }

/* ── SA: Assignment matrix ── */
.db-assign-table .db-assign-cell {
  width: 90px; font-size: 0.72rem; font-weight: 600;
  border-radius: 6px; padding: 0.3rem 0.5rem; cursor: pointer; border: 1px solid;
  transition: all 0.13s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-align: center;
}
.db-assign-cell-empty { background: var(--ink-05); border-color: var(--ink-10); color: var(--ink-40); }
.db-assign-cell-empty:hover { border-color: var(--saffron); color: var(--saffron-dk); background: var(--saffron-lt); }
.db-assign-cell-assigned { background: #f0fdf4; border-color: rgba(26,122,74,0.3); color: #166534; font-weight: 700; }

/* ── Exam / School cards ── */
.db-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 1rem; }
.db-exam-card {
  background: var(--white); border: 1px solid var(--ink-10);
  border-radius: var(--radius-xl); padding: 1.25rem; box-shadow: var(--shadow-xs);
  transition: transform 0.15s, box-shadow 0.15s;
}
.db-exam-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.db-exam-card-name { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--ink); margin: 0.5rem 0; }
.db-exam-progress-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0; border-bottom: 1px solid var(--ink-05);
}
.db-exam-progress-row:last-child { border-bottom: none; }
.db-exam-name { flex: 1; font-size: 0.855rem; font-weight: 600; color: var(--ink); }
.db-school-card {
  background: var(--white); border: 1px solid var(--ink-10);
  border-radius: var(--radius-xl); padding: 1.5rem; text-align: center; box-shadow: var(--shadow-xs);
}
.db-school-name { font-family: var(--font-display); font-size: 0.95rem; font-weight: 700; color: var(--ink); margin: 0.5rem 0 0.25rem; }
.db-school-meta { font-size: 0.78rem; color: var(--ink-40); }

/* ── Settings ── */
.db-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.db-checkbox-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0; font-size: 0.84rem; cursor: pointer; color: var(--ink-60); }
.db-grade-row {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.5rem 0; border-bottom: 1px solid var(--ink-05);
  font-size: 0.85rem; color: var(--ink-60);
}
.db-grade-row:last-child { border-bottom: none; }
.db-grade-badge {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  background: var(--saffron-lt); color: var(--saffron-dk);
  border-radius: var(--radius-sm); font-weight: 800; font-size: 0.82rem;
}

/* ── List row ── */
.db-list-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0; border-bottom: 1px solid var(--ink-05);
}
.db-list-row:last-child { border-bottom: none; }
.db-list-av {
  width: 34px; height: 34px; background: var(--ink); color: var(--white);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem; font-weight: 700; flex-shrink: 0;
}
.db-list-name { font-size: 0.855rem; font-weight: 600; color: var(--ink); }
.db-list-sub  { font-size: 0.72rem; color: var(--ink-40); }

/* ── Badges ── */
.db-badge {
  display: inline-flex; font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 0.18rem 0.55rem; border-radius: 4px;
  background: var(--ink-10); color: var(--ink-60);
}
.db-badge-saffron { background: var(--saffron-lt); color: var(--saffron-dk); }
.db-badge-success { background: #f0fdf4; color: #166534; }
.db-badge-info    { background: var(--info-lt, #eff6ff); color: #1e40af; }
.db-role-chip {
  display: inline-flex; font-size: 0.78rem; font-weight: 600;
  padding: 0.22rem 0.6rem; border-radius: 999px;
  background: var(--ink-05); border: 1px solid var(--ink-10); color: var(--ink-60);
}
.db-grade-chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--saffron-lt); color: var(--saffron-dk);
  font-weight: 800; font-size: 0.8rem;
}
.db-status-dot { font-size: 0.75rem; font-weight: 600; }

/* ── Empty state ── */
.db-empty-state { text-align: center; padding: 3rem 1rem; color: var(--ink-40); }
.db-empty-icon { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; }
.db-empty-msg  { font-size: 0.84rem; color: var(--ink-40); padding: 0.5rem 0; }

/* ── Modals ── */
.db-modal-overlay {
  position: fixed; inset: 0; background: rgba(15,25,35,0.55); z-index: 500;
  display: none; align-items: center; justify-content: center;
  padding: 1.5rem; backdrop-filter: blur(2px);
}
.db-modal {
  background: var(--white); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl); width: 100%; max-width: 520px;
  max-height: 90vh; display: flex; flex-direction: column;
}
.db-modal-wide { max-width: 820px; }
.db-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--ink-10);
  font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--ink);
}
.db-modal-close {
  background: none; border: none; cursor: pointer; font-size: 1rem;
  color: var(--ink-40); width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: all 0.13s;
}
.db-modal-close:hover { background: var(--ink-05); color: var(--ink); }
.db-modal-body { padding: 1.5rem; overflow-y: auto; flex: 1; }
.db-modal-foot {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 0.75rem; padding: 1rem 1.5rem; border-top: 1px solid var(--ink-05);
}

/* ── Form fields ── */
.db-field { display: flex; flex-direction: column; gap: 0.35rem; }
.db-field label {
  font-size: 0.75rem; font-weight: 700; color: var(--ink-60);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.db-input {
  font-family: var(--font-body); font-size: 0.875rem; color: var(--ink);
  border: 1px solid var(--ink-10); border-radius: var(--radius);
  padding: 0.6rem 0.85rem; background: var(--white);
  outline: none; width: 100%; transition: border-color 0.13s;
  box-sizing: border-box;
}
.db-input:focus { border-color: var(--saffron); }
.db-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }

/* ── Toast ── */
.db-toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  padding: 0.75rem 1.25rem; border-radius: var(--radius-lg);
  font-size: 0.875rem; font-weight: 600; z-index: 9999;
  box-shadow: var(--shadow-lg); max-width: 320px;
  animation: toastIn 0.25s ease;
}
.db-toast-success { background: var(--ink); color: var(--white); }
.db-toast-error   { background: #dc2626; color: var(--white); }
@keyframes toastIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }

/* ── Button XS ── */
.btn-xs {
  font-size: 0.72rem !important;
  padding: 0.25rem 0.65rem !important;
  border-radius: var(--radius-sm) !important;
  height: auto !important;
  line-height: 1.4 !important;
}

/* ── Variables needed for success/warning ── */
:root {
  --success:    #166534;
  --success-lt: #f0fdf4;
  --warning:    #b45309;
  --warning-lt: #fffbeb;
  --info-lt:    #eff6ff;
  --danger:     #dc2626;
  --danger-lt:  #fef2f2;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .dashboard-sidebar {
    width: 260px;
    position: fixed;
    left: -270px;
    top: 0; bottom: 0;
    max-height: 100vh;
    z-index: 300;
    transition: left 0.25s ease;
  }
  .dashboard-sidebar.db-sidebar-open { left: 0; box-shadow: var(--shadow-xl); }
  .db-mobile-menu-btn { display: flex !important; }
  .db-two-col { grid-template-columns: 1fr; }
  .db-settings-grid { grid-template-columns: 1fr; }
  .db-owner-bar-inner { gap: 0.75rem; }
  .dashboard-body { padding: 1.25rem; }
}

@media (max-width: 600px) {
  .db-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .db-form-row { grid-template-columns: 1fr; }
  .db-marks-table-head { flex-direction: column; align-items: flex-start; }
  .db-marks-controls { flex-direction: column; }
  .db-assign-row { flex-direction: column; align-items: flex-start; }
  .db-modal-foot { flex-wrap: wrap; justify-content: stretch; }
  .db-modal-foot .btn { flex: 1; justify-content: center; }
  .dashboard-topbar { padding: 0 1rem; }
  .dashboard-body { padding: 1rem; }
}

/* ============================================================
   DASHBOARD v3.1 — Enhanced SA + Dropdown Role Switcher
   ============================================================ */

/* ── Owner dropdown role switcher ── */
.db-owner-bar {
  background: linear-gradient(135deg, var(--ink) 0%, #1a2535 100%);
  border-bottom: 2px solid var(--saffron);
  position: sticky; top: var(--header-h); z-index: 80;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.db-owner-bar-inner {
  max-width: 1400px; margin: 0 auto;
  padding: 0.6rem 1.5rem;
  display: flex; align-items: center; gap: 1.25rem;
}
.db-owner-bar-label {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--saffron); white-space: nowrap;
}
.db-owner-crown { font-size: 1rem; }
.db-owner-bar-tip {
  margin-left: auto; font-size: 0.72rem;
  color: rgba(255,255,255,0.35); white-space: nowrap;
}
.db-owner-bar-tip strong { color: rgba(255,255,255,0.65); }

/* Dropdown button */
.db-role-dropdown-wrap { position: relative; }
.db-role-dropdown-btn {
  display: flex; align-items: center; gap: 0.55rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-lg);
  color: var(--white);
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
  white-space: nowrap; min-width: 160px;
}
.db-role-dropdown-btn:hover,
.db-role-dropdown-btn-open {
  background: rgba(232,135,10,0.2);
  border-color: var(--saffron);
  color: var(--saffron);
}
.db-role-dropdown-chevron { transition: transform 0.2s; margin-left: auto; opacity: 0.7; }
.db-role-dropdown-btn-open .db-role-dropdown-chevron { transform: rotate(180deg); }

/* Dropdown menu */
.db-role-dropdown-menu {
  position: absolute; top: calc(100% + 8px); left: 0;
  min-width: 260px;
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  z-index: 500; overflow: hidden;
}
.db-role-dropdown-title {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-40);
  padding: 0.75rem 1rem 0.4rem;
}
.db-role-option {
  display: flex; align-items: center; gap: 0.75rem;
  width: 100%; padding: 0.7rem 1rem;
  background: none; border: none; cursor: pointer;
  text-align: left; transition: background 0.12s;
  border-top: 1px solid var(--ink-05);
}
.db-role-option:first-of-type { border-top: none; }
.db-role-option:hover { background: var(--ink-05); }
.db-role-option-active { background: var(--saffron-lt) !important; }
.db-role-option-icon { font-size: 1.25rem; flex-shrink: 0; }
.db-role-option-info { flex: 1; }
.db-role-option-name { font-size: 0.855rem; font-weight: 700; color: var(--ink); }
.db-role-option-desc { font-size: 0.72rem; color: var(--ink-40); margin-top: 0.1rem; }
.db-role-option-check { color: var(--saffron); font-weight: 700; opacity: 0; }
.db-role-option-active .db-role-option-check { opacity: 1; }

/* ── SA School header ── */
.sa-school-header {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, var(--ink) 0%, #1e2d42 100%);
  border-radius: var(--radius-xl); padding: 1.5rem 2rem;
  margin-bottom: 1.5rem; gap: 1rem;
}
.sa-school-name-display {
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 800;
  color: var(--white); line-height: 1.2;
}
.sa-school-name-sub { font-size: 0.78rem; color: rgba(255,255,255,0.45); margin-top: 0.25rem; letter-spacing: 0.06em; text-transform: uppercase; }
.sa-edit-school-btn {
  font-size: 0.78rem; font-weight: 600;
  padding: 0.45rem 1rem; border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7); cursor: pointer; transition: all 0.13s; white-space: nowrap;
}
.sa-edit-school-btn:hover { background: rgba(232,135,10,0.25); border-color: var(--saffron); color: var(--saffron); }
.sa-school-name-edit-row {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1.25rem; flex-wrap: wrap;
}

/* ── SA: Inline form ── */
.sa-inline-form {
  background: var(--ink-05);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-xl);
  margin-bottom: 1.5rem;
  overflow: hidden;
  border-left: 4px solid var(--saffron);
}
.sa-inline-form-inner {
  padding: 1.25rem 1.5rem;
  display: grid; grid-template-columns: 1fr 1fr auto;
  gap: 1rem; align-items: end;
}
.sa-inline-form-actions { display: flex; gap: 0.5rem; align-items: center; padding-top: 0; }
.db-section-toolbar-title { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--ink); }

/* ── SA: Classes grid ── */
.sa-classes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.sa-class-card {
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.15s, transform 0.15s;
}
.sa-class-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.sa-class-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 0.75rem; }
.sa-class-number {
  font-family: var(--font-display); font-size: 2rem; font-weight: 800;
  color: var(--ink); line-height: 1;
}
.sa-class-delete-btn {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--ink-05); border: 1px solid var(--ink-10);
  color: var(--ink-40); font-size: 0.7rem;
  cursor: pointer; transition: all 0.13s;
  display: flex; align-items: center; justify-content: center;
}
.sa-class-delete-btn:hover { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }
.sa-class-sections { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.5rem; }
.sa-section-chip {
  font-size: 0.7rem; font-weight: 700; padding: 0.18rem 0.55rem;
  border-radius: 999px; background: var(--saffron-lt);
  color: var(--saffron-dk); letter-spacing: 0.04em;
}
.sa-section-none { background: var(--ink-05); color: var(--ink-40); }
.sa-class-meta { font-size: 0.72rem; color: var(--ink-40); }

/* ── SA: Teacher cards grid ── */
.sa-teachers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.sa-teacher-card {
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.15s, transform 0.15s;
}
.sa-teacher-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.sa-teacher-card-top {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--ink-05);
}
.sa-teacher-av {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--ink) 0%, #2d3f55 100%);
  color: var(--white); display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: 800; flex-shrink: 0;
  letter-spacing: -0.02em;
}
.sa-teacher-info { flex: 1; min-width: 0; }
.sa-teacher-name { font-size: 0.9rem; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-teacher-email { font-size: 0.72rem; color: var(--ink-40); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-teacher-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }
.sa-delete-teacher-btn {
  background: none; border: 1px solid #fca5a5;
  color: #ef4444; border-radius: var(--radius-sm);
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.7rem; transition: all 0.13s;
}
.sa-delete-teacher-btn:hover { background: #fee2e2; }
.sa-teacher-card-body { padding: 0.9rem 1.25rem; display: flex; flex-direction: column; gap: 0.35rem; }
.sa-teacher-role-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em;
  padding: 0.22rem 0.65rem; border-radius: 999px;
  background: var(--saffron-lt); color: var(--saffron-dk);
  width: fit-content; margin-bottom: 0.25rem;
}
.sa-teacher-detail { font-size: 0.8rem; color: var(--ink-60); }
.sa-teacher-detail strong { color: var(--ink); }

/* ── Add Teacher Modal: role-specific fields ── */
.mt-role-fields { transition: all 0.2s; }
.sa-subject-checkbox-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr));
  gap: 0.4rem; margin-top: 0.5rem;
}
.sa-check-label {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.8rem; color: var(--ink-60); cursor: pointer;
  padding: 0.3rem 0.5rem; border-radius: var(--radius-sm);
  border: 1px solid var(--ink-10); transition: all 0.12s;
}
.sa-check-label:hover { background: var(--ink-05); border-color: var(--saffron); }
.sa-check-label input { accent-color: var(--saffron); width: 14px; height: 14px; }

/* ── SA: Assignment matrix (list style) ── */
.sa-matrix-wrap { display: flex; flex-direction: column; gap: 0.75rem; }
.sa-matrix-row {
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.sa-matrix-class-label {
  background: var(--ink);
  color: var(--white);
  padding: 0.65rem 1.25rem;
  font-size: 0.82rem; font-weight: 700;
  letter-spacing: 0.04em;
}
.sa-matrix-subjects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 1px; background: var(--ink-05);
  border-top: 1px solid var(--ink-10);
}
.sa-matrix-cell {
  background: var(--white);
  padding: 0.65rem 0.75rem;
  cursor: pointer; transition: all 0.13s;
  text-align: center;
}
.sa-matrix-cell:hover { background: var(--ink-05); }
.sa-matrix-cell-assigned { background: #f0fdf4; }
.sa-matrix-cell-assigned:hover { background: #dcfce7; }
.sa-matrix-cell-subject { font-size: 0.68rem; font-weight: 700; color: var(--ink-60); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.25rem; }
.sa-matrix-cell-teacher { font-size: 0.78rem; font-weight: 600; }
.sa-matrix-cell-empty .sa-matrix-cell-teacher { color: var(--ink-40); }
.sa-matrix-cell-assigned .sa-matrix-cell-teacher { color: #166534; }
.sa-matrix-cell-empty .sa-matrix-cell-subject { color: var(--ink-40); }

/* ── Sidebar section label ── */
.db-sidebar-section-label {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: rgba(255,255,255,0.25);
  padding: 0.85rem 1.25rem 0.3rem; margin-top: 0.25rem;
}

/* ── Responsive additions ── */
@media (max-width: 700px) {
  .sa-inline-form-inner { grid-template-columns: 1fr; }
  .sa-inline-form-actions { flex-direction: row; }
  .sa-teachers-grid { grid-template-columns: 1fr; }
  .sa-classes-grid { grid-template-columns: repeat(2,1fr); }
  .sa-matrix-subjects { grid-template-columns: repeat(3,1fr); }
  .db-owner-bar-tip { display: none; }
  .sa-school-header { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .sa-classes-grid { grid-template-columns: 1fr; }
  .sa-matrix-subjects { grid-template-columns: repeat(2,1fr); }
}

/* ============================================================
   DASHBOARD v3.2 — SA Panel Polish & Bug Fixes
   ============================================================ */

/* ── Cancel button fix (was invisible) ── */
.btn-outline {
  background: var(--white) !important;
  border: 1.5px solid var(--ink-20, rgba(15,25,35,0.2)) !important;
  color: var(--ink) !important;
}
.btn-outline:hover {
  border-color: var(--ink-40, rgba(15,25,35,0.4)) !important;
  background: var(--ink-05) !important;
}
.btn-outline.btn-xs {
  border-width: 1px !important;
}

/* ── SA Classes: table list view ── */
.sa-classes-table-wrap {
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.sa-classes-table { margin: 0; }
.sa-classes-table td { vertical-align: middle; }
.sa-section-chips-row { display: flex; flex-wrap: wrap; gap: 0.3rem; }

/* ── Inline form layout fix ── */
.sa-inline-form-inner {
  grid-template-columns: 1fr 1fr;
  align-items: end;
}
.sa-inline-form-actions {
  grid-column: 1 / -1;
  display: flex; gap: 0.5rem; padding-top: 0.25rem;
}

/* ── Teacher card edit button ── */
.sa-edit-teacher-btn {
  font-size: 0.72rem !important;
  padding: 0.25rem 0.6rem !important;
}

/* ── Teacher card body spacing ── */
.sa-teacher-card-body { gap: 0.4rem; }
.sa-teacher-detail { font-size: 0.78rem; color: var(--ink-60); line-height: 1.4; }

/* ── Assignment matrix: full subject name, no truncation ── */
.sa-matrix-cell { min-width: 100px; padding: 0.6rem 0.5rem; }
.sa-matrix-cell-subject {
  font-size: 0.65rem; font-weight: 700; color: var(--ink-50, rgba(15,25,35,0.5));
  text-transform: uppercase; letter-spacing: 0.03em;
  margin-bottom: 0.3rem; line-height: 1.3;
  white-space: normal; word-break: break-word;
}
.sa-matrix-cell-teacher {
  font-size: 0.75rem; font-weight: 600; line-height: 1.3;
}
.sa-matrix-cell-assigned .sa-matrix-cell-subject { color: #166534; }
.sa-matrix-cell-assigned .sa-matrix-cell-teacher { color: #15803d; }
.sa-matrix-cell-empty .sa-matrix-cell-teacher { color: var(--ink-30, rgba(15,25,35,0.3)); }
.sa-matrix-subjects {
  grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
}

/* Section badge in matrix header */
.sa-matrix-sec-badge {
  font-size: 0.68rem; font-weight: 600;
  background: rgba(232,135,10,0.2); color: var(--saffron);
  padding: 0.15rem 0.5rem; border-radius: 999px;
  margin-left: 0.5rem;
}
.sa-matrix-class-label {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem;
}

/* ── Assign modal: optgroup style ── */
#m-assign-teacher optgroup { font-weight: 700; color: var(--ink); }
#m-assign-teacher option  { font-weight: 400; padding-left: 0.5rem; }

/* ── Class select optgroup ── */
#mt-class optgroup { font-weight: 700; }

/* ── Modal title span ── */
.modal-title-text { flex: 1; }

/* ── SA matrix wrapper scroll ── */
.sa-assign-wrap { overflow-x: auto; }
.sa-matrix-wrap { min-width: 600px; }

/* ── Responsive fix ── */
@media (max-width: 700px) {
  .sa-inline-form-inner { grid-template-columns: 1fr; }
  .sa-matrix-subjects { grid-template-columns: repeat(2, 1fr); }
  .sa-matrix-cell { min-width: 0; }
}

/* ============================================================
   DASHBOARD v3.3 — SA Exams & Reports panels
   ============================================================ */

/* ── Exam cards ── */
.sa-exam-card {
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column; gap: 0.6rem;
  transition: box-shadow 0.15s, transform 0.15s;
}
.sa-exam-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.sa-exam-card-header { display: flex; align-items: center; justify-content: space-between; }
.sa-exam-type-badge {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--ink); color: var(--white);
  padding: 0.22rem 0.7rem; border-radius: 999px;
}
.sa-exam-status { white-space: nowrap; }
.sa-exam-name {
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 700;
  color: var(--ink); line-height: 1.3;
}
.sa-exam-meta {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  font-size: 0.75rem; color: var(--ink-60);
}
.sa-exam-meta span { display: flex; align-items: center; gap: 0.25rem; }
.sa-exam-classes { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.sa-exam-actions {
  display: flex; gap: 0.5rem; margin-top: 0.25rem;
  padding-top: 0.75rem; border-top: 1px solid var(--ink-05);
}
.sa-exam-actions .btn { flex: 1; justify-content: center; font-size: 0.75rem; }

/* ── Reports: summary cards ── */
.sa-report-summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px,1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.sa-report-card {
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  display: flex; flex-direction: column; gap: 0.25rem;
  border: 1px solid transparent;
}
.sa-report-card-blue   { background: var(--info-lt); border-color: rgba(14,165,233,0.15); }
.sa-report-card-green  { background: var(--success-lt); border-color: rgba(34,197,94,0.15); }
.sa-report-card-saffron{ background: var(--saffron-lt); border-color: rgba(232,135,10,0.15); }
.sa-report-card-purple { background: #f5f3ff; border-color: rgba(139,92,246,0.15); }
.sa-report-card-icon { font-size: 1.4rem; margin-bottom: 0.25rem; }
.sa-report-card-num {
  font-family: var(--font-display); font-size: 2rem;
  font-weight: 800; color: var(--ink); line-height: 1;
}
.sa-report-card-lbl { font-size: 0.82rem; font-weight: 700; color: var(--ink); }
.sa-report-card-sub { font-size: 0.72rem; color: var(--ink-40); }

/* ── Reports: sections ── */
.sa-report-section {
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-xs);
}
.sa-report-section-title {
  font-family: var(--font-display); font-size: 0.95rem;
  font-weight: 700; color: var(--ink); margin-bottom: 1rem;
}
.sa-report-hint { font-size: 0.8rem; color: var(--ink-40); margin-top: 0.5rem; }
.sa-report-table-wrap { overflow-x: auto; }

/* Coverage bar */
.sa-coverage-bar-wrap { display: flex; align-items: center; gap: 0.75rem; }
.sa-coverage-bar-track {
  flex: 1; height: 10px;
  background: var(--ink-10); border-radius: 5px; overflow: hidden;
}
.sa-coverage-bar-fill {
  height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, var(--saffron), #16a34a);
  transition: width 0.5s ease;
}
.sa-coverage-pct { font-size: 0.9rem; font-weight: 800; color: var(--ink); min-width: 40px; }

/* Unassigned list */
.sa-unassigned-list { display: flex; flex-direction: column; gap: 0.6rem; }
.sa-unassigned-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.82rem; }
.sa-unassigned-row strong { min-width: 80px; }

/* db-card-grid used for exams list */
.db-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px,1fr));
  gap: 1rem;
}

@media (max-width:600px) {
  .sa-report-summary-row { grid-template-columns: repeat(2,1fr); }
  .sa-exam-actions { flex-direction: column; }
}

/* ============================================================
   REPORT CARD CALCULATOR v3.0 — Full CSS
   ============================================================ */

/* ── Topbar ── */
.rc-topbar{position:sticky;top:0;z-index:100;background:#fff;border-bottom:1px solid var(--ink-10);box-shadow:0 2px 12px rgba(0,0,0,0.06);}
.rc-topbar-inner{max-width:1300px;margin:0 auto;padding:0.65rem 1.5rem;display:flex;align-items:center;gap:1rem;flex-wrap:wrap;}
.rc-brand{display:flex;align-items:center;gap:0.5rem;flex-shrink:0;}
.rc-brand-icon{font-size:1.2rem;}
.rc-brand-name{font-family:var(--font-display);font-weight:800;color:var(--ink);font-size:0.95rem;}
.rc-brand-free{font-size:0.68rem;background:var(--success-lt);color:#15803d;border:1px solid #bbf7d0;padding:0.15rem 0.5rem;border-radius:999px;font-weight:700;white-space:nowrap;}

/* Steps indicator */
.rc-steps{display:flex;align-items:center;gap:0;flex:1;justify-content:center;min-width:220px;}
.rc-step{display:flex;flex-direction:column;align-items:center;gap:0.15rem;cursor:default;opacity:0.4;transition:opacity 0.2s;}
.rc-step.active,.rc-step.rc-step-done{opacity:1;}
.rc-step-num{width:28px;height:28px;border-radius:50%;border:2px solid var(--ink-20);display:flex;align-items:center;justify-content:center;font-size:0.75rem;font-weight:800;color:var(--ink-40);background:#fff;transition:all 0.2s;}
.rc-step.active .rc-step-num{background:var(--ink);color:#fff;border-color:var(--ink);}
.rc-step.rc-step-done .rc-step-num{background:var(--success-lt);color:#15803d;border-color:#86efac;}
.rc-step-label{font-size:0.65rem;font-weight:700;color:var(--ink-40);white-space:nowrap;}
.rc-step.active .rc-step-label,.rc-step.rc-step-done .rc-step-label{color:var(--ink);}
.rc-step-line{width:40px;height:2px;background:var(--ink-10);flex-shrink:0;margin:0 4px;margin-bottom:10px;}

.rc-usage-pill{font-size:0.72rem;color:var(--ink-60);background:var(--ink-05);padding:0.2rem 0.65rem;border-radius:999px;white-space:nowrap;flex-shrink:0;}

/* ── Step pages ── */
.rc-step-page{min-height:calc(100vh - 56px);}
.rc-step-page-inner{max-width:1000px;margin:0 auto;padding:2rem 1.5rem 4rem;}
.rc-step-header{margin-bottom:2rem;}
.rc-step-title{font-family:var(--font-display);font-size:clamp(1.5rem,3vw,2.2rem);font-weight:800;color:var(--ink);margin-bottom:0.4rem;}
.rc-step-subtitle{font-size:0.9rem;color:var(--ink-60);line-height:1.6;}
.rc-step-footer{margin-top:2rem;text-align:center;}
.rc-step-hint{font-size:0.75rem;color:var(--ink-40);margin-top:0.5rem;}

/* ── Cards ── */
.rc-card{background:#fff;border:1px solid var(--ink-10);border-radius:var(--radius-xl);box-shadow:var(--shadow-xs);margin-bottom:1.25rem;overflow:hidden;}
.rc-card-head{padding:1rem 1.25rem;background:var(--ink-03,#fafafa);border-bottom:1px solid var(--ink-08,#f0eff0);font-family:var(--font-display);font-size:0.88rem;font-weight:800;color:var(--ink);display:flex;align-items:center;gap:0.5rem;}
.rc-card-body{padding:1.25rem;}

/* ── Form elements ── */
.rc-form-row{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:0.85rem;margin-bottom:0.85rem;}
.rc-field{display:flex;flex-direction:column;gap:0.3rem;}
.rc-field label{font-size:0.78rem;font-weight:700;color:var(--ink-60);}
.rc-input{padding:0.5rem 0.75rem;border:1.5px solid var(--ink-15,#e0dfe0);border-radius:var(--radius);font-size:0.85rem;color:var(--ink);background:#fff;transition:border-color 0.15s,box-shadow 0.15s;width:100%;box-sizing:border-box;}
.rc-input:focus{outline:none;border-color:var(--ink-40);box-shadow:0 0 0 3px rgba(0,0,0,0.06);}
.rc-select{padding:0.5rem 0.75rem;border:1.5px solid var(--ink-15,#e0dfe0);border-radius:var(--radius);font-size:0.85rem;color:var(--ink);background:#fff;width:100%;cursor:pointer;}
.rc-required{color:var(--danger);margin-left:2px;}

/* Buttons */
.rc-btn-sm{padding:0.35rem 0.75rem;border-radius:var(--radius);font-size:0.78rem;font-weight:700;cursor:pointer;border:none;transition:all 0.15s;display:inline-flex;align-items:center;gap:0.3rem;}
.rc-btn-primary{background:var(--ink);color:#fff;}
.rc-btn-primary:hover{background:var(--ink-80,#333);}
.rc-btn-outline{background:#fff;border:1.5px solid var(--ink-20);color:var(--ink);}
.rc-btn-outline:hover{background:var(--ink-05);}
.rc-btn-lg{padding:0.75rem 1.75rem;border-radius:var(--radius-xl);font-size:0.95rem;font-weight:800;cursor:pointer;border:none;transition:all 0.2s;display:inline-flex;align-items:center;gap:0.4rem;}

/* Template grid */
.rc-template-grid{display:grid;grid-template-columns:1fr;gap:1.25rem;}

/* Exam rows */
.rc-exam-row{display:flex;align-items:center;gap:0.5rem;padding:0.65rem 0;border-bottom:1px solid var(--ink-05);}
.rc-exam-row:last-child{border-bottom:none;}
.rc-exam-row-drag{color:var(--ink-20);cursor:grab;font-size:1rem;flex-shrink:0;}
.rc-exam-row-fields{flex:1;display:flex;flex-wrap:wrap;align-items:center;gap:0.5rem;}
.rc-exam-splits{display:flex;flex-wrap:wrap;gap:0.5rem;}
.rc-exam-check{display:flex;align-items:center;gap:0.3rem;font-size:0.78rem;color:var(--ink-60);white-space:nowrap;}
.rc-exam-check input[type=checkbox]{accent-color:var(--ink);}
.rc-exam-weight{display:flex;flex-direction:column;align-items:center;gap:0.1rem;}
.rc-exam-del{background:none;border:none;color:var(--ink-30);cursor:pointer;font-size:0.9rem;width:24px;height:24px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;}
.rc-exam-del:hover{background:var(--danger-lt);color:var(--danger);}
.rc-input-sm{padding:0.35rem 0.55rem;font-size:0.8rem;width:auto;min-width:140px;}
.rc-input-tiny{padding:0.3rem 0.4rem;font-size:0.76rem;width:52px;text-align:center;}

/* Subjects list */
.rc-subjects-list{display:flex;flex-direction:column;gap:0.4rem;}
.rc-subject-row{display:flex;align-items:center;gap:0.5rem;flex-wrap:wrap;}
.rc-subject-drag{color:var(--ink-20);cursor:grab;font-size:0.9rem;}
.rc-subject-opt{display:flex;align-items:center;gap:0.3rem;font-size:0.76rem;color:var(--ink-50);white-space:nowrap;}
.rc-opt-tag{font-size:0.65rem;background:var(--ink-10);color:var(--ink-40);border-radius:4px;padding:0.05rem 0.3rem;margin-left:0.3rem;font-style:normal;}

/* Grade preview */
.rc-grade-preview{margin-top:0.75rem;}
.rc-grade-chips{display:flex;flex-wrap:wrap;gap:0.4rem;}
.rc-grade-chip{display:flex;flex-direction:column;align-items:center;gap:0.05rem;padding:0.35rem 0.65rem;border-radius:8px;border:1px solid transparent;min-width:56px;}
.rc-grade-chip strong{font-size:0.9rem;font-weight:900;line-height:1;}
.rc-grade-chip small{font-size:0.62rem;}
.rc-grade-chip em{font-size:0.64rem;font-style:normal;opacity:0.7;}

/* Saved templates */
.rc-saved-bar{display:flex;align-items:center;gap:0.75rem;padding:0.75rem 1rem;background:var(--ink-03);border:1px solid var(--ink-08);border-radius:var(--radius);margin-bottom:1rem;}
.rc-saved-label{font-size:0.78rem;font-weight:700;color:var(--ink-60);white-space:nowrap;}
.rc-saved-list{display:flex;flex-wrap:wrap;gap:0.4rem;}

.rc-empty-hint{padding:1.25rem;text-align:center;font-size:0.82rem;color:var(--ink-40);border:1.5px dashed var(--ink-15);border-radius:var(--radius);background:var(--ink-02,#fefefe);}

/* ══ STEP 2: MARKS ENTRY LAYOUT ══ */
.rc-marks-layout{display:grid;grid-template-columns:220px 1fr;min-height:calc(100vh - 56px);}

/* Sidebar */
.rc-sidebar{border-right:1px solid var(--ink-10);background:#fafafa;display:flex;flex-direction:column;overflow:hidden;}
.rc-sidebar-head{padding:1rem;border-bottom:1px solid var(--ink-08);}
.rc-sidebar-title{font-family:var(--font-display);font-size:0.88rem;font-weight:800;color:var(--ink);}
.rc-sidebar-meta{font-size:0.72rem;color:var(--ink-40);margin-top:0.2rem;}
.rc-sidebar-search{padding:0.5rem;border-bottom:1px solid var(--ink-08);}
.rc-sidebar-search.rc-input{border-radius:6px;font-size:0.78rem;}
.rc-student-list{flex:1;overflow-y:auto;}
.rc-sidebar-item{display:flex;align-items:center;gap:0.5rem;padding:0.55rem 1rem;cursor:pointer;border-bottom:1px solid var(--ink-04);transition:background 0.1s;}
.rc-sidebar-item:hover{background:var(--ink-05);}
.rc-sidebar-item.rc-sidebar-active{background:var(--ink-08);border-left:3px solid var(--ink);}
.rc-sidebar-item.rc-sidebar-done .rc-sidebar-roll{background:var(--success-lt);color:#15803d;}
.rc-sidebar-roll{width:24px;height:24px;border-radius:50%;background:var(--ink-10);color:var(--ink-60);font-size:0.65rem;font-weight:800;display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.rc-sidebar-name{font-size:0.75rem;color:var(--ink);flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.rc-sidebar-name em{color:var(--ink-30);font-style:normal;}
.rc-sidebar-check{font-size:0.7rem;color:#15803d;flex-shrink:0;}

/* Entry panel */
.rc-entry-panel{overflow-y:auto;background:#fff;}
.rc-entry-topbar{position:sticky;top:56px;z-index:50;background:#fff;border-bottom:1px solid var(--ink-08);padding:0.75rem 1.25rem;display:flex;align-items:center;justify-content:space-between;gap:0.5rem;flex-wrap:wrap;}
.rc-roll-badge{background:var(--ink);color:#fff;font-size:0.72rem;font-weight:800;padding:0.2rem 0.6rem;border-radius:999px;}
.rc-entry-name-display{font-size:0.9rem;color:var(--ink);font-weight:600;}
.rc-entry-section{padding:1.25rem;border-bottom:1px solid var(--ink-05);}
.rc-entry-section-title{font-size:0.78rem;font-weight:800;color:var(--ink-50);text-transform:uppercase;letter-spacing:0.06em;margin-bottom:0.85rem;}

/* Marks table */
.rc-marks-table{width:100%;border-collapse:collapse;font-size:0.8rem;}
.rc-marks-table th{background:var(--ink-04);color:var(--ink-60);font-size:0.72rem;font-weight:700;padding:0.4rem 0.5rem;border:1px solid var(--ink-08);text-align:center;white-space:nowrap;}
.rc-th-subject{text-align:left !important;min-width:140px;}
.rc-th-exam-group{background:var(--ink-08) !important;color:var(--ink) !important;font-family:var(--font-display);}
.rc-th-sub{font-size:0.68rem !important;}
.rc-th-subtotal{background:var(--ink-06) !important;}
.rc-marks-table td{padding:0.35rem 0.4rem;border:1px solid var(--ink-06);}
.rc-td-subject{font-size:0.8rem;color:var(--ink);}
.rc-subj-name{font-weight:600;}
.rc-marks-input{width:100%;min-width:44px;border:none;background:transparent;text-align:center;font-size:0.82rem;color:var(--ink);padding:0.2rem;}
.rc-marks-input:focus{outline:none;background:var(--saffron-lt,#fffbeb);}
.rc-td-subtotal{font-weight:700;color:var(--ink);text-align:center;background:var(--ink-03);}
.rc-td-rowtotal,.rc-td-rowpct,.rc-td-rowgrade,.rc-td-rowresult{text-align:center;font-weight:700;background:var(--ink-02);}

/* Live totals */
.rc-live-totals{display:flex;flex-wrap:wrap;gap:0.75rem;padding:0.75rem 0 0;border-top:1px solid var(--ink-06);margin-top:0.5rem;}
.rc-live-stat{background:var(--ink-04);border-radius:var(--radius);padding:0.5rem 0.85rem;text-align:center;}
.rc-live-stat-label{font-size:0.68rem;color:var(--ink-50);font-weight:700;text-transform:uppercase;letter-spacing:0.04em;}
.rc-live-stat-val{font-size:1rem;font-weight:800;color:var(--ink);margin-top:0.1rem;}

/* Pass/Fail tags */
.rc-pass-tag{color:#15803d;background:#dcfce7;padding:0.1rem 0.4rem;border-radius:4px;font-size:0.72rem;font-weight:700;}
.rc-fail-tag{color:#dc2626;background:#fee2e2;padding:0.1rem 0.4rem;border-radius:4px;font-size:0.72rem;font-weight:700;}

/* Entry nav */
.rc-entry-nav{display:flex;align-items:center;gap:1rem;padding:1.25rem;background:var(--ink-02);border-top:1px solid var(--ink-08);position:sticky;bottom:0;}
.rc-nav-center{flex:1;display:flex;flex-direction:column;align-items:center;gap:0.3rem;}
.rc-nav-bar{width:100%;height:6px;background:var(--ink-10);border-radius:3px;overflow:hidden;}
.rc-nav-fill{height:100%;background:var(--ink);border-radius:3px;transition:width 0.3s;}
.rc-nav-text{font-size:0.72rem;color:var(--ink-50);}

/* ══ STEP 3: RESULTS ══ */
.rc-stats-row{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:0.85rem;margin-bottom:1.5rem;}
.rc-stat-card{background:#fff;border:1px solid var(--ink-08);border-radius:var(--radius-xl);padding:1rem 1.25rem;text-align:center;box-shadow:var(--shadow-xs);}
.rc-stat-card.rc-stat-green{background:var(--success-lt,#f0fdf4);}
.rc-stat-card.rc-stat-blue{background:var(--info-lt,#f0f9ff);}
.rc-stat-card.rc-stat-saffron{background:var(--saffron-lt,#fffbeb);}
.rc-stat-icon{font-size:1.3rem;margin-bottom:0.3rem;}
.rc-stat-num{font-family:var(--font-display);font-size:1.75rem;font-weight:900;color:var(--ink);line-height:1;}
.rc-stat-lbl{font-size:0.72rem;font-weight:700;color:var(--ink-60);margin-top:0.2rem;}
.rc-stat-sub{font-size:0.68rem;color:var(--ink-40);margin-top:0.1rem;}

/* Report card output */
#report-card-output{margin-bottom:1.25rem;}
.rc-report-card{background:#fff;border:1px solid var(--ink-10);border-radius:var(--radius-xl);box-shadow:var(--shadow);overflow:hidden;position:relative;}
.rc-rc-header{background:var(--ink);color:#fff;padding:1.5rem 2rem;display:flex;align-items:center;gap:1.25rem;position:relative;}
.rc-rc-logo{font-size:2.5rem;flex-shrink:0;}
.rc-rc-school{font-family:var(--font-display);font-size:1.3rem;font-weight:800;line-height:1.2;}
.rc-rc-subtitle{font-size:0.78rem;opacity:0.6;margin-top:0.2rem;}
.rc-rc-year{font-size:0.72rem;opacity:0.4;margin-top:0.15rem;}
.rc-watermark{position:absolute;right:1.5rem;top:50%;transform:translateY(-50%) rotate(-20deg);font-size:0.6rem;opacity:0.08;font-weight:900;letter-spacing:0.1em;white-space:nowrap;color:#fff;}
.rc-rc-meta-band{display:flex;flex-wrap:wrap;gap:0;border-bottom:2px solid var(--ink-08);}
.rc-rc-meta-item{padding:0.65rem 1.25rem;border-right:1px solid var(--ink-06);min-width:140px;}
.rc-rc-meta-lbl{font-size:0.65rem;font-weight:700;color:var(--ink-40);text-transform:uppercase;letter-spacing:0.06em;}
.rc-rc-meta-val{font-size:0.85rem;font-weight:700;color:var(--ink);margin-top:0.1rem;}

/* RC marks table */
.rc-rc-table-wrap{padding:1.25rem 1.5rem;}
.rc-rc-table{width:100%;border-collapse:collapse;font-size:0.78rem;}
.rc-rc-table th{background:var(--ink-05);font-size:0.7rem;font-weight:800;color:var(--ink-60);padding:0.4rem 0.5rem;border:1px solid var(--ink-08);text-align:center;white-space:nowrap;}
.rc-rc-table td{padding:0.4rem 0.5rem;border:1px solid var(--ink-06);}
.rc-rc-subj-name{font-weight:700;color:var(--ink);}
.rc-rc-num{text-align:center;}
.rc-rc-subtot{font-weight:700;background:var(--ink-03);}
.rc-rc-total{font-weight:800;font-size:0.88rem;text-align:center;}
.rc-rc-tfoot td{background:var(--ink-06);font-weight:800;padding:0.55rem 0.5rem;}
.rc-rc-footer{padding:1.25rem 1.5rem;border-top:1px solid var(--ink-06);}
.rc-rc-remarks{font-size:0.8rem;color:var(--ink);margin-bottom:1rem;background:var(--ink-04);padding:0.5rem 0.75rem;border-radius:var(--radius);}
.rc-rc-signatures{display:flex;gap:2rem;flex-wrap:wrap;margin-bottom:1rem;}
.rc-rc-sig{flex:1;min-width:120px;text-align:center;font-size:0.75rem;color:var(--ink-60);}
.rc-rc-sig-line{height:1px;background:var(--ink-20);margin-bottom:0.4rem;}
.rc-rc-sig-label{font-weight:700;font-size:0.68rem;text-transform:uppercase;letter-spacing:0.05em;color:var(--ink-40);}
.rc-rc-generated{font-size:0.62rem;text-align:center;color:var(--ink-30);margin-top:0.5rem;}

/* Consolidated table */
.rc-consolidated-table{width:100%;border-collapse:collapse;font-size:0.78rem;}
.rc-consolidated-table th{background:var(--ink-06);font-weight:800;font-size:0.72rem;padding:0.5rem 0.65rem;border:1px solid var(--ink-08);color:var(--ink-60);white-space:nowrap;}
.rc-consolidated-table td{padding:0.4rem 0.65rem;border:1px solid var(--ink-06);}
.rc-consolidated-table .rc-row-fail{background:#fff5f5;}
.rc-td-rank{font-weight:900;color:var(--saffron);text-align:center;}
.rc-td-name{font-weight:700;color:var(--ink);}
.rc-td-subj-score small{color:var(--ink-40);font-size:0.65rem;}

/* Upsell */
.rc-upsell-banner{display:flex;align-items:center;gap:1rem;padding:1rem 1.25rem;background:var(--saffron-lt,#fffbeb);border:1px solid rgba(232,135,10,0.2);border-radius:var(--radius-xl);margin-top:1.5rem;flex-wrap:wrap;}
.rc-upsell-text{flex:1;font-size:0.82rem;color:var(--ink);display:flex;flex-direction:column;gap:0.2rem;}
.rc-upsell-text strong{font-weight:800;}
.rc-upsell-text span{color:var(--ink-60);}

/* Toast */
.rc-toast{position:fixed;bottom:1.5rem;left:50%;transform:translateX(-50%) translateY(2rem);background:var(--ink);color:#fff;padding:0.6rem 1.25rem;border-radius:999px;font-size:0.82rem;font-weight:600;opacity:0;pointer-events:none;transition:all 0.3s;z-index:9999;white-space:nowrap;}
.rc-toast.rc-toast-show{opacity:1;transform:translateX(-50%) translateY(0);}
.rc-toast.rc-toast-error{background:#dc2626;}
.rc-toast.rc-toast-success{background:#15803d;}

/* Print */
@media print {
  .rc-topbar,.rc-sidebar,.rc-entry-topbar,.rc-entry-nav,
  .rc-stats-row,.rc-card.no-print,.no-print,
  .rc-upsell-banner,.rc-step-header .rc-btn-sm,
  #step-1,#step-2,.rc-student-list { display:none !important; }
  #step-3 { display:block !important; }
  .rc-report-card { box-shadow:none !important; border:none !important; }
  .rc-rc-header { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  @page { margin:1cm; }
}

/* Responsive */
@media (max-width:768px) {
  .rc-marks-layout { grid-template-columns:1fr; }
  .rc-sidebar { display:none; }
  .rc-form-row { grid-template-columns:1fr 1fr; }
  .rc-rc-meta-band { flex-direction:column; }
  .rc-rc-header { padding:1rem; }
  .rc-stats-row { grid-template-columns:repeat(2,1fr); }
  .rc-entry-nav { flex-direction:column; }
}
@media (max-width:480px) {
  .rc-form-row { grid-template-columns:1fr; }
  .rc-topbar-inner { gap:0.5rem; }
  .rc-step-line { width:20px; }
}

/* ============================================================
   CALCULATOR v3.0 — Report Card Template Builder
   ============================================================ */

/* ── Hero ── */
.rc-hero {
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-80) 60%, #1a3a5c 100%);
  padding: 5rem 2rem 3.5rem;
  position: relative; overflow: hidden;
}
.rc-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 70% 50%, rgba(232,135,10,0.08), transparent);
  pointer-events: none;
}
.rc-hero-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 3rem; flex-wrap: wrap;
}
.rc-hero-text { flex: 1; min-width: 280px; }
.rc-hero-chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12);
  padding: 0.35rem 0.9rem; border-radius: 999px;
  font-size: 0.75rem; color: rgba(255,255,255,0.65); font-weight: 600;
  letter-spacing: 0.03em; margin-bottom: 1.25rem;
}
.rc-hero-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:0.4} }
.rc-hero-title {
  font-family: var(--font-display); font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800; color: var(--white); line-height: 1.1; margin: 0 0 1rem;
}
.rc-accent { font-style: italic; color: var(--saffron); }
.rc-hero-sub { font-size: 1rem; color: rgba(255,255,255,0.55); line-height: 1.6; max-width: 520px; margin-bottom: 1.5rem; }
.rc-hero-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.rc-tag {
  font-size: 0.72rem; font-weight: 600; color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  padding: 0.25rem 0.65rem; border-radius: 999px;
}
.rc-hero-stats {
  display: flex; align-items: center; gap: 0;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-xl); padding: 1.5rem 2rem;
  flex-shrink: 0;
}
.rc-hero-stat { text-align: center; padding: 0 1.5rem; }
.rc-hero-stat-num { font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: var(--saffron); }
.rc-hero-stat-lbl { font-size: 0.72rem; color: rgba(255,255,255,0.4); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.2rem; }
.rc-hero-stat-divider { width: 1px; height: 50px; background: rgba(255,255,255,0.1); }

/* ── App wrapper ── */
.rc-app-bg { background: var(--ivory); padding: 2rem 1rem 4rem; }
.rc-app-inner { max-width: 1100px; margin: 0 auto; }

/* ── Step cards ── */
.rc-step-card {
  background: var(--white); border: 1px solid var(--ink-10);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-sm);
  margin-top: 1.5rem; overflow: hidden;
}
.rc-step-head {
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-80) 100%);
  padding: 1.5rem 2rem; color: var(--white);
}
.rc-step-badge {
  display: inline-block; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; background: var(--saffron); color: var(--white);
  padding: 0.2rem 0.65rem; border-radius: 999px; margin-bottom: 0.5rem;
}
.rc-step-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--white); }
.rc-step-sub { font-size: 0.8rem; color: rgba(255,255,255,0.45); margin-top: 0.3rem; }
.rc-step-body { padding: 1.75rem 2rem; }
.rc-step-foot { text-align: center; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--ink-05); }

/* ── Form fields ── */
.rc-info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.rc-field { display: flex; flex-direction: column; gap: 0.35rem; }
.rc-label { font-size: 0.75rem; font-weight: 700; color: var(--ink-60); letter-spacing: 0.03em; }
.rc-input {
  border: 1.5px solid var(--ink-20); border-radius: var(--radius);
  padding: 0.6rem 0.85rem; font-size: 0.85rem; font-family: var(--font-body);
  color: var(--ink); background: var(--white); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.rc-input:focus { border-color: var(--saffron); box-shadow: 0 0 0 3px rgba(232,135,10,0.12); }
.rc-select { cursor: pointer; }
.rc-textarea { resize: vertical; min-height: 64px; }

/* ── Section label ── */
.rc-section-label {
  font-size: 0.8rem; font-weight: 700; color: var(--ink-60);
  text-transform: uppercase; letter-spacing: 0.05em;
  display: flex; align-items: center; gap: 0.5rem;
  border-bottom: 1px solid var(--ink-10); padding-bottom: 0.5rem; margin-bottom: 0.85rem;
}

/* ── Mini button ── */
.rc-mini-btn {
  margin-left: auto; font-size: 0.72rem; font-weight: 700;
  background: var(--saffron-lt); color: var(--saffron-dk);
  border: 1px solid rgba(232,135,10,0.3); border-radius: 999px;
  padding: 0.2rem 0.65rem; cursor: pointer; transition: background 0.15s;
  font-family: var(--font-body);
}
.rc-mini-btn:hover { background: var(--saffron); color: var(--white); }

/* ── Preset row ── */
.rc-preset-row {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.4rem; margin-bottom: 0.85rem;
}
.rc-preset-label { font-size: 0.72rem; color: var(--ink-40); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.rc-preset-btn {
  font-size: 0.73rem; font-weight: 600; border: 1.5px solid var(--ink-20);
  border-radius: 999px; padding: 0.28rem 0.75rem;
  background: var(--white); color: var(--ink-60); cursor: pointer;
  font-family: var(--font-body); transition: all 0.15s;
}
.rc-preset-btn:hover { border-color: var(--saffron); color: var(--saffron); background: var(--saffron-lt); }

/* ── Template table ── */
.rc-tpl-table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--ink-10); }
.rc-tpl-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; min-width: 680px; }
.rc-tpl-table thead tr { background: var(--ink); color: rgba(255,255,255,0.7); }
.rc-tpl-table th { padding: 0.6rem 0.5rem; text-align: center; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.rc-tpl-table td { padding: 0.45rem 0.4rem; border-bottom: 1px solid var(--ink-05); vertical-align: middle; }
.rc-tpl-row:hover td { background: var(--ink-05); }
.rc-tpl-input {
  border: 1.5px solid var(--ink-20); border-radius: 6px;
  padding: 0.3rem 0.5rem; font-size: 0.82rem; font-family: var(--font-body);
  color: var(--ink); background: var(--white); outline: none; width: 100%;
}
.rc-tpl-input:focus { border-color: var(--saffron); }
.rc-tpl-num {
  width: 60px; border: 1.5px solid var(--ink-20); border-radius: 6px;
  padding: 0.3rem 0.3rem; font-size: 0.82rem; font-family: var(--font-body);
  text-align: center; color: var(--ink); background: var(--white); outline: none;
}
.rc-tpl-num:focus { border-color: var(--saffron); }

/* ── Co-scholastic ── */
.rc-cosch-chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.rc-cosch-chip {
  display: inline-flex; align-items: center; gap: 0.25rem;
  background: var(--saffron-lt); border: 1px solid rgba(232,135,10,0.25);
  border-radius: 999px; padding: 0.3rem 0.6rem 0.3rem 0.8rem;
}

/* ── Options grid ── */
.rc-options-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.75rem; }
.rc-opt-row {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.85rem 1rem; border-radius: var(--radius);
  border: 1.5px solid var(--ink-10); cursor: pointer; transition: border-color 0.15s;
}
.rc-opt-row:hover { border-color: var(--saffron); }
.rc-checkbox { width: 16px; height: 16px; accent-color: var(--saffron); cursor: pointer; flex-shrink: 0; margin-top: 2px; }
.rc-opt-name { font-size: 0.82rem; font-weight: 700; color: var(--ink); }
.rc-opt-desc { font-size: 0.72rem; color: var(--ink-40); margin-top: 0.15rem; }

/* ── Nav strip ── */
.rc-nav-strip { display: flex; align-items: center; gap: 0.5rem; }
.rc-nav-btn {
  font-size: 0.8rem; font-weight: 700; border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 999px; padding: 0.4rem 1rem; background: transparent;
  color: rgba(255,255,255,0.7); cursor: pointer; font-family: var(--font-body);
  transition: all 0.15s;
}
.rc-nav-btn:hover:not(:disabled) { background: rgba(255,255,255,0.1); color: var(--white); }
.rc-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.rc-nav-primary { background: var(--saffron); border-color: var(--saffron); color: var(--white); }
.rc-nav-primary:hover { background: var(--saffron-dk); }
.rc-nav-indicator { font-size: 0.85rem; font-weight: 700; color: var(--white); padding: 0 0.5rem; }
.rc-nav-sep { font-weight: 400; color: rgba(255,255,255,0.35); margin: 0 0.2rem; }

/* ── Batch progress bar ── */
.rc-batch-bar-wrap { height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; margin-top: 1rem; }
.rc-batch-bar { height: 100%; border-radius: 2px; background: var(--saffron); transition: width 0.4s ease; }
.rc-link-btn { background: none; border: none; color: rgba(255,255,255,0.5); font-size: 0.72rem; cursor: pointer; font-family: var(--font-body); text-decoration: underline; }

/* ── Student info bar ── */
.rc-stu-info-bar { display: flex; flex-wrap: wrap; gap: 0.85rem; align-items: flex-end; }
.rc-stu-info-bar .rc-field { flex: 1; min-width: 150px; }

/* ── Marks table ── */
.rc-marks-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; min-width: 600px; }
.rc-marks-table thead tr { background: var(--ink); color: rgba(255,255,255,0.65); }
.rc-marks-table th { padding: 0.6rem 0.75rem; text-align: center; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; white-space: nowrap; }
.rc-marks-table td { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--ink-05); vertical-align: middle; }

/* ── Co-sch entry ── */
.rc-cosch-entry-grid { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.rc-cosch-entry-item { display: flex; flex-direction: column; gap: 0.3rem; }
.rc-cosch-entry-name { font-size: 0.75rem; font-weight: 600; color: var(--ink-60); }

/* ── Entry actions ── */
.rc-entry-actions {
  display: flex; flex-wrap: wrap; gap: 0.65rem; align-items: center;
  margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--ink-05);
}

/* ── Report Card ── */
.rc-report-card {
  background: var(--ink); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl); position: relative;
  overflow: hidden; margin-bottom: 1.25rem;
}
.rc-watermark {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) rotate(-35deg);
  font-size: clamp(0.8rem,2vw,1.1rem); font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.12em; color: rgba(255,255,255,0.04); pointer-events: none;
  white-space: nowrap; z-index: 0; user-select: none;
}
.rc-rc-header {
  background: linear-gradient(135deg, #0a1520, #162237);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 2rem 2rem 1.5rem; text-align: center;
}
.rc-rc-school {
  font-family: var(--font-display); font-size: 1.4rem; font-weight: 700;
  color: var(--white); line-height: 1.2;
}
.rc-rc-subtitle { font-size: 0.78rem; color: rgba(255,255,255,0.35); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 0.3rem; }
.rc-rc-examyear { font-size: 0.72rem; color: rgba(255,255,255,0.3); margin-top: 0.2rem; }
.rc-rc-meta {
  display: flex; flex-wrap: wrap; gap: 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.rc-rc-meta-item {
  flex: 1; min-width: 120px;
  padding: 0.85rem 1.25rem;
  border-right: 1px solid rgba(255,255,255,0.07);
}
.rc-rc-meta-item:last-child { border-right: none; }
.rc-rc-meta-lbl { font-size: 0.65rem; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.2rem; }
.rc-rc-meta-val { font-size: 0.9rem; font-weight: 700; color: var(--white); }
.rc-rc-summary {
  display: flex; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,0.07);
}
.rc-rc-sum-block {
  flex: 1; min-width: 120px; padding: 1rem 1.25rem; text-align: center;
  border-right: 1px solid rgba(255,255,255,0.07);
}
.rc-rc-sum-block:last-child { border-right: none; }
.rc-sum-accent { background: rgba(232,135,10,0.08); }
.rc-rc-sum-lbl { font-size: 0.65rem; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.25rem; }
.rc-rc-sum-val { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; color: var(--white); }
#rc-pct-out { color: var(--saffron) !important; }

/* ── Signatures ── */
.rc-sigs {
  display: flex; justify-content: space-around;
  padding: 1rem 2rem; border-top: 1px solid rgba(255,255,255,0.07);
}
.rc-sig { text-align: center; flex: 1; padding: 0.5rem; }
.rc-sig-line { height: 1px; background: rgba(255,255,255,0.2); margin-bottom: 0.5rem; }
.rc-sig-lbl { font-size: 0.7rem; color: rgba(255,255,255,0.3); }

/* ── Download bar ── */
.rc-dl-bar {
  display: flex; flex-wrap: wrap; gap: 0.65rem; align-items: center;
  padding: 1rem 0; margin-bottom: 1rem;
}

/* ── Class summary ── */
.rc-class-stats {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.85rem; margin-bottom: 1rem;
}
.rc-cls-stat {
  background: var(--ink-05); border-radius: var(--radius); padding: 1rem;
  text-align: center;
}
.rc-cls-stat-icon { font-size: 1.5rem; margin-bottom: 0.3rem; }
.rc-cls-stat-num { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; color: var(--ink); }
.rc-cls-stat-lbl { font-size: 0.72rem; color: var(--ink-40); font-weight: 600; }

.rc-toppers-grid { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.5rem; }
.rc-topper-item {
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--ink-05); border-radius: var(--radius);
  padding: 0.5rem 0.85rem; font-size: 0.82rem;
}
.rc-topper-rank { font-size: 1.1rem; width: 28px; }
.rc-topper-name { flex: 1; font-weight: 600; color: var(--ink); }
.rc-topper-pct { color: var(--saffron); font-weight: 700; }
.rc-topper-grade { font-weight: 800; color: var(--success); margin-left: 0.5rem; }

/* ── Grade reference ── */
.rc-grade-ref-card {
  background: var(--white); border: 1px solid var(--ink-10);
  border-radius: var(--radius-xl); padding: 1.5rem 2rem;
  margin-top: 1.5rem; box-shadow: var(--shadow-xs);
}
.rc-grade-ref-title { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--ink); margin-bottom: 1rem; }
.rc-grade-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.rc-grade-pill {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.5rem 1rem; border-radius: var(--radius);
  font-size: 0.78rem;
}
.rc-gp-grade { font-weight: 800; font-size: 1rem; min-width: 28px; }
.rc-gp-range { color: var(--ink-60); }
.rc-gp-desc { color: var(--ink-40); font-style: italic; }

/* ── Upsell ── */
.rc-upsell {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--saffron-lt), #fff8e8);
  border: 1.5px solid rgba(232,135,10,0.25); border-radius: var(--radius-xl);
  padding: 1.25rem 1.5rem; margin-top: 1.25rem;
}
.rc-upsell-icon { font-size: 2rem; flex-shrink: 0; }
.rc-upsell-title { font-family: var(--font-display); font-size: 0.95rem; font-weight: 700; color: var(--ink); margin-bottom: 0.2rem; }
.rc-upsell-sub { font-size: 0.8rem; color: var(--ink-60); }

/* ── Print ── */
@media print {
  .rc-hero, .rc-step-card, .rc-dl-bar, .rc-upsell, .rc-grade-ref-card,
  .rc-entry-actions, .no-print, header, footer, #wpadminbar { display: none !important; }
  .rc-report-card { box-shadow: none; border-radius: 0; }
  .rc-watermark { color: rgba(0,0,0,0.06) !important; }
  body { background: white; }
}

/* ── Mobile ── */
@media (max-width: 700px) {
  .rc-step-head, .rc-step-body { padding: 1.25rem 1rem; }
  .rc-hero-stats { display: none; }
  .rc-hero { padding: 3rem 1rem 2rem; }
  .rc-info-grid { grid-template-columns: 1fr 1fr; }
  .rc-rc-meta-item { min-width: 50%; }
  .rc-stu-info-bar { flex-direction: column; }
  .rc-sigs { flex-direction: column; gap: 1rem; }
}

/* ============================================================
   CALCULATOR v4.0 — Full overhaul
   ============================================================ */

/* ── Step tracker ── */
.rc-steps-track {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin: 0 0 2rem; padding: 0 1rem;
}
.rc-step-pill {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 1.25rem;
  border: 2px solid var(--ink-15);
  border-radius: 999px;
  font-size: 0.8rem; font-weight: 600; color: var(--ink-40);
  cursor: pointer; background: var(--white);
  transition: all 0.2s;
  white-space: nowrap;
}
.rc-step-pill:hover { border-color: var(--saffron); color: var(--ink); }
.rc-step-pill.active { border-color: var(--saffron); color: var(--saffron); background: var(--saffron-lt); }
.rc-step-pill.done   { border-color: var(--success); color: var(--success); background: var(--success-lt); }
.rc-step-pill-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: currentColor; color: var(--white);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 800; flex-shrink: 0;
  color: var(--white) !important; /* keep white text on badge */
}
.rc-steps-line {
  flex: 1; max-width: 60px; height: 2px; background: var(--ink-10);
}

/* ── Exam type chips ── */
.rc-exam-types-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.rc-exam-type-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.75rem 0.35rem 0.9rem;
  background: var(--ink); color: var(--white);
  border-radius: 999px; font-size: 0.78rem; font-weight: 700;
}
.rc-exam-type-chip button {
  background: none; border: none; color: rgba(255,255,255,0.5);
  cursor: pointer; padding: 0; font-size: 0.85rem; line-height: 1;
  transition: color 0.15s;
}
.rc-exam-type-chip button:hover { color: #fff; }

.rc-add-exam-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }

.rc-mini-btn-primary {
  background: var(--saffron) !important; color: var(--white) !important;
  border-color: transparent !important;
}

/* ── Exam selector in entry ── */
.rc-exam-selector-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.rc-exam-sel-btn {
  padding: 0.45rem 1.1rem;
  border: 1.5px solid var(--ink-20);
  border-radius: var(--radius);
  background: var(--white); color: var(--ink-60);
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
  transition: all 0.15s; font-family: var(--font-body);
}
.rc-exam-sel-btn:hover  { border-color: var(--saffron); color: var(--saffron); }
.rc-exam-sel-btn.active { border-color: var(--saffron); color: var(--saffron); background: var(--saffron-lt); }

/* ── Entry top bar ── */
.rc-entry-top-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem; margin-bottom: 0.75rem;
}

/* ── Student info bar ── */
.rc-stu-info-bar {
  display: grid;
  grid-template-columns: 80px 1fr 1fr 1fr auto;
  gap: 0.75rem; align-items: start;
}
@media (max-width: 700px) { .rc-stu-info-bar { grid-template-columns: 1fr 1fr; } }

/* ── Info grid ── */
.rc-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem 1rem;
}
.rc-field-wide { grid-column: span 2; }
@media (max-width: 600px) { .rc-field-wide { grid-column: span 1; } }

/* ── Section hint ── */
.rc-section-hint {
  font-size: 0.72rem; font-weight: 400; color: var(--ink-40); margin-left: 0.5rem;
}

/* ── Opt row inline ── */
.rc-opt-row-inline {
  display: inline-flex; width: auto;
  padding: 0.75rem 1.25rem;
  border: 1.5px solid var(--saffron-lt);
  border-radius: var(--radius);
  background: var(--saffron-lt);
}

/* ── Progress row ── */
.rc-progress-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.72rem; color: var(--ink-40); margin-top: 0.3rem;
}

/* ── Report card v4 ── */
.rc-rc-header {
  display: flex; align-items: center; gap: 1.25rem;
  padding: 1.5rem 2rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.rc-rc-school-logo {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--saffron), #f59e0b);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 800; color: #fff;
  flex-shrink: 0; letter-spacing: 0.02em;
}
.rc-rc-header-text { flex: 1; }
.rc-rc-footer-note {
  padding: 0.6rem 2rem 1.25rem;
  text-align: center; font-size: 0.63rem; color: rgba(255,255,255,0.15);
}

/* ── Consolidated marksheet ── */
.rc-consolidated-wrap { color: rgba(255,255,255,0.85); }
.rc-consolidated-school {
  font-family: var(--font-display); font-size: 1.2rem; font-weight: 800;
  color: var(--white); margin-bottom: 0.2rem;
}
.rc-consolidated-subtitle { font-size: 0.8rem; color: rgba(255,255,255,0.5); }
.rc-consolidated-year { font-size: 0.75rem; color: var(--saffron); margin-bottom: 1rem; }
.rc-consolidated-table {
  width: 100%; border-collapse: collapse; font-size: 0.78rem;
  white-space: nowrap;
}
.rc-consolidated-table th {
  padding: 0.6rem 0.75rem; text-align: center;
  background: rgba(255,255,255,0.05);
  border-bottom: 2px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.5); font-size: 0.72rem;
  font-weight: 700; letter-spacing: 0.04em;
}
.rc-consolidated-table td {
  padding: 0.55rem 0.75rem;
}
.rc-consolidated-table tr:hover td { background: rgba(255,255,255,0.03); }
.rc-cons-stat {
  background: rgba(255,255,255,0.05); border-radius: var(--radius);
  padding: 0.5rem 1rem; font-size: 0.82rem; color: rgba(255,255,255,0.5);
}
.rc-cons-stat strong { color: var(--white); }

/* ── Class summary: subject analysis ── */
.rc-subj-analysis-grid { display: flex; flex-direction: column; gap: 0.5rem; }
.rc-subj-row { display: grid; grid-template-columns: 160px 1fr 120px; gap: 0.75rem; align-items: center; }
.rc-subj-row-name { font-size: 0.8rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-subj-bar-wrap { height: 8px; background: var(--ink-10); border-radius: 4px; overflow: hidden; }
.rc-subj-bar { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.rc-subj-row-meta { font-size: 0.75rem; color: var(--ink-40); text-align: right; white-space: nowrap; }
@media (max-width: 600px) { .rc-subj-row { grid-template-columns: 1fr 80px; } .rc-subj-bar-wrap { display:none; } }

/* ── Btn saffron ── */
.btn-saffron {
  background: linear-gradient(135deg, var(--saffron), #f59e0b) !important;
  color: var(--white) !important; border: none !important;
}

/* ── Modal ── */
.rc-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,25,35,0.65); z-index: 9999;
  align-items: center; justify-content: center;
}
.rc-modal-box {
  background: var(--white); border-radius: var(--radius-xl);
  padding: 2rem; max-width: 340px; width: 90%;
  box-shadow: var(--shadow-xl);
}
.rc-modal-title {
  font-family: var(--font-display); font-size: 1.05rem;
  font-weight: 700; color: var(--ink); margin-bottom: 1rem;
}

/* ── Hero floating dots ── */
.rc-hero-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.rc-dot {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  animation: rcFloat linear infinite;
}
.rc-dot-0  { width:8px;  height:8px;  top:10%; left:5%;   animation-duration:9s;  animation-delay:0s; }
.rc-dot-1  { width:14px; height:14px; top:70%; left:12%;  animation-duration:13s; animation-delay:2s; }
.rc-dot-2  { width:6px;  height:6px;  top:30%; left:88%;  animation-duration:8s;  animation-delay:1s; }
.rc-dot-3  { width:18px; height:18px; top:80%; left:75%;  animation-duration:15s; animation-delay:0.5s; }
.rc-dot-4  { width:10px; height:10px; top:20%; left:40%;  animation-duration:11s; animation-delay:3s; }
.rc-dot-5  { width:7px;  height:7px;  top:55%; left:60%;  animation-duration:7s;  animation-delay:1.5s; }
.rc-dot-6  { width:20px; height:20px; top:5%;  left:70%;  animation-duration:16s; animation-delay:4s; }
.rc-dot-7  { width:5px;  height:5px;  top:90%; left:35%;  animation-duration:10s; animation-delay:0.8s; }
.rc-dot-8  { width:12px; height:12px; top:45%; left:22%;  animation-duration:12s; animation-delay:2.5s; }
.rc-dot-9  { width:9px;  height:9px;  top:65%; left:90%;  animation-duration:9s;  animation-delay:0.3s; }
.rc-dot-10 { width:15px; height:15px; top:15%; left:55%;  animation-duration:14s; animation-delay:1.2s; }
.rc-dot-11 { width:6px;  height:6px;  top:40%; left:80%;  animation-duration:8s;  animation-delay:3.5s; }

@keyframes rcFloat {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0.06; }
  50%  { opacity: 0.14; }
  100% { transform: translateY(-40px) rotate(180deg); opacity: 0.06; }
}

/* ── Hero panel ── */
.rc-hero-panel {
  display: flex; align-items: center; gap: 1.5rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-xl);
  padding: 1.25rem 2rem;
  flex-shrink: 0;
}
.rc-hero-stat { text-align: center; }
.rc-hero-stat-num {
  font-family: var(--font-display); font-size: 2rem;
  font-weight: 800; color: var(--white); line-height: 1;
}
.rc-hero-stat-lbl { font-size: 0.72rem; color: rgba(255,255,255,0.5); margin-top: 0.2rem; }
.rc-hero-stat-divider { width: 1px; height: 40px; background: rgba(255,255,255,0.12); }

@media (max-width: 640px) {
  .rc-hero-panel { gap: 1rem; padding: 1rem; }
  .rc-hero-stat-num { font-size: 1.5rem; }
  .rc-steps-track { gap: 0; overflow-x: auto; padding-bottom: 0.5rem; }
  .rc-step-pill { padding: 0.45rem 0.85rem; font-size: 0.72rem; }
  .rc-steps-line { max-width: 30px; }
}
