/* ===================================================
   ClassLedger (www.classledger.net) Design System
   Minimalism & Swiss Style — light, high-contrast, grid-based
   =================================================== */

/* Open Sans is loaded here via @import — deliberately, even though it costs
   an extra round trip vs. a <link> in every page's <head> (the browser can't
   discover an @import-loaded font until this whole file downloads and
   parses first). Every page across the site already links this one file,
   but there's no shared <head> partial for the ~20 standalone public/SEO/
   legal pages (only the app pages share includes/header.php) — loading the
   font here instead of duplicating a <link> tag in each of those pages'
   <head> means a future typeface change is a one-file edit instead of a
   20+-file one. Each page's own <head> may still carry a leftover
   <link rel="stylesheet" href=".../css2?family=Inter..."> from before this
   change; that now fetches an unused font file (harmless, just wasted
   bytes) — safe to clean up opportunistically, not urgent. */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Brand Palette */
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-light: rgba(37, 99, 235, 0.08);
  --accent: #0EA5A5;
  --accent-light: rgba(14, 165, 165, 0.1);
  /* --accent itself only clears ~2.7:1 as text/icon color — fails even the
     3:1 AA minimum for large text/icons, let alone 4.5:1 for body text.
     Use --accent-text (~4.9:1, verified) for anything readable; keep --accent
     only for fills/borders/backgrounds where text-contrast rules don't apply. */
  --accent-text: #0F766E;
  --warning: #F59E0B;
  --warning-light: rgba(245, 158, 11, 0.12);
  /* #F59E0B itself only clears ~2:1 as text — same issue as --accent/--danger
     above. --warning-text verified at ~7.4:1 on white / ~6.9:1 on
     --warning-light. */
  --warning-text: #92400E;
  --danger: #EF4444;
  /* #DC2626 only cleared ~4.2:1 against --danger-light — under the 4.5:1 AA
     minimum for text. Darkened to a value verified at ~5.7:1 on that exact
     background (WCAG relative-luminance formula, not eyeballed). */
  --danger-text: #B91C1C;
  --danger-light: rgba(239, 68, 68, 0.1);
  /* Same issue: #16A34A only cleared ~3.0:1 against --success-light.
     Darkened to a value verified at ~6.5:1 on that background. */
  --success-text: #166534;
  --success-light: rgba(34, 197, 94, 0.1);

  /* Growth/highlight accent — warm secondary, used for progress/achievement
     emphasis (e.g. the dashboard's "Avg. Growth" stat). Shifted toward
     orange-red so it isn't confusable with --warning (golden-amber) at a
     glance. --growth itself is ~3:1 on white — fine for fills/borders/icons,
     not for text; use --growth-text (~7.3:1 on white, AA-verified) for
     anything readable. */
  --growth: #EA7317;
  --growth-light: rgba(234, 115, 23, 0.12);
  --growth-text: #9A3412;

  /* Deep navy neutral — public-facing nav/footer contrast surfaces, same
     blue family as --primary so it reads as "this brand, darker" rather
     than an unrelated hue. --on-navy verifies at ~16:1 on --navy. */
  --navy: #14213D;
  --navy-hover: #1C2E52;
  --on-navy: #FFFFFF;
  --on-navy-muted: rgba(255, 255, 255, 0.72);
  --border-navy: rgba(255, 255, 255, 0.14);

  /* Light Neutral Theme */
  --bg-main: #FFFFFF;
  --bg-subtle: #F7F7FB;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FAFAFC;
  --bg-sidebar: #FAFAFC;
  --border-color: #EBEAF2;
  --border-strong: #D8D6E3;

  /* Compatibility aliases — several pages reference these under older
     names; keep them wired to the current tokens so nothing silently
     falls back to unset/default browser styling. */
  --bg-body: var(--bg-main);
  --text-primary: var(--text-main);

  /* Typography — single sans family, per Swiss/Minimalism style */
  --font-heading: 'Open Sans', -apple-system, sans-serif;
  --font-body: 'Open Sans', -apple-system, sans-serif;
  --text-main: #15131F;
  --text-muted: #6B6879;
  --text-dark: #111827;

  /* Shadows & Radius — flat/low-decoration, per Minimalism style spec */
  --shadow-sm: 0 1px 2px rgba(21, 19, 31, 0.05);
  --shadow-md: 0 4px 12px rgba(21, 19, 31, 0.06);
  --shadow-lg: 0 8px 24px rgba(21, 19, 31, 0.08);
  /* Elevated shadow reserved for marketing "featured" moments only (sample-
     report showcase, highlighted pricing plan) — --shadow-lg stays the
     default everywhere else. */
  --shadow-xl: 0 20px 40px rgba(21, 19, 31, 0.10);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* Spacing scale — use --space-section between major page sections/cards
     (KPI row → Quick Actions → charts, etc.) so app pages read as distinct
     blocks instead of a tightly stacked column. Smaller ad-hoc gaps
     (icon-to-label, form-field-to-label) stay as-is; this is deliberately
     just the "how far apart are the big pieces of the page" scale. */
  --space-section: 2.5rem;
}

/* Base Resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-main);
  font-weight: 800;
  letter-spacing: -0.02em;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--primary-hover);
}

/* Header Brand Link */
.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.brand-link:hover .brand-icon {
  transform: scale(1.05);
}

.brand-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
}

/* Every .brand-title render (public nav, app sidebar, marketing footer)
   picks up the trademark mark from one place instead of being typed by
   hand at each call site. */
.brand-title::after {
  content: "\2122";
  font-size: 0.6em;
  font-weight: 600;
  vertical-align: super;
  margin-left: 1px;
}

/* Footer nav links (marketing pages, legal pages, brand-guidelines). Uses a
   real class instead of an inline color= so :hover can actually win — an
   inline style on the element beats any external a:hover rule by
   specificity, which is why these previously had no rollover effect. */
.footer-link {
  color: var(--text-muted);
  transition: color 0.15s ease;
}
.footer-link:hover {
  color: var(--primary);
}

/* App-shell footer (dashboard/students/report/etc. via includes/footer.php) */
.footer-copyright {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}
.footer-copyright p {
  margin: 0.35rem 0;
}

/* Shared content-page layout (brand-guidelines.php and similar static pages) */
.site-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}
.terms-section h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: var(--text-main);
}
.terms-section h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.125rem;
  color: var(--text-main);
}
.terms-section ul, .terms-section ol {
  margin: 1rem 0 1rem 1.5rem;
  line-height: 1.8;
}
.terms-section li {
  margin-bottom: 0.5rem;
}

/* ===================================================
   Public site nav (marketing/auth pages)
   Dark-navy surface — deliberately distinct from the light app-shell
   sidebar/topbar, so the public/marketing surface reads with more visual
   presence than the light-on-white admin chrome underneath it.
   =================================================== */
.site-nav {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  padding: 1.4rem 3rem;
  background: var(--navy);
  border-bottom: 1px solid var(--border-navy);
  position: relative;
}
.site-nav .brand-title {
  color: var(--on-navy);
}
.site-nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.site-nav-links a {
  color: var(--on-navy-muted);
  font-weight: 500;
  font-size: 0.95rem;
}
.site-nav-links a:hover {
  color: var(--on-navy);
}
.site-nav-cta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.site-nav .btn-outline {
  border-color: var(--border-navy);
  color: var(--on-navy);
}
.site-nav .btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--on-navy);
  color: var(--on-navy);
}
.nav-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--border-navy);
  border-radius: var(--radius-sm);
  color: var(--on-navy);
  font-size: 1.1rem;
  cursor: pointer;
}

/* ===================================================
   Layout Shell (authenticated app)
   =================================================== */
.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 50;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 0.5rem 0.75rem 1.5rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border-left: 3px solid transparent;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
  border-left-color: var(--primary);
}

/* Sign Out: same .nav-link structure/hover behavior, red family instead of
   primary so a destructive action doesn't hover into brand blue. */
.nav-link-danger {
  color: var(--danger-text);
}
.nav-link-danger:hover {
  color: var(--danger-text);
  background: var(--danger-light);
  border-left-color: var(--danger);
}

.main-content {
  margin-left: 260px;
  flex: 1;
  padding: 2rem;
  max-width: 1400px;
  min-width: 0;
}

/* Topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-section);
  flex-wrap: wrap;
  gap: 1rem;
}
.topbar h1 {
  color: var(--text-main);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  padding: 0.5rem 1rem;
  border-radius: 30px;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* Card System */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

/* Marketing-only card variant — softer/more elevated than the app's default
   .card, for the landing page's feature grid and sample-report showcase.
   Not used inside the authenticated app (keeps that surface calm/dense). */
.card-feature {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
}

/* Small circular icon badge that overlaps the top edge of a .card-feature —
   pair as: <div class="card-feature"><div class="icon-badge">...</div>...</div> */
.icon-badge {
  width: 56px;
  height: 56px;
  margin: -2.75rem auto 1rem;
  border-radius: 50%;
  background: var(--primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: var(--shadow-md);
}
.icon-badge.icon-badge-accent {
  background: var(--accent);
}
.icon-badge.icon-badge-growth {
  background: var(--growth);
}

/* Reusable seam for a genuine educator testimonial — nothing renders here
   until a real, permissioned quote exists (see POSITIONING_STRATEGY.md and
   the "What You Can Create" section comment in index.php: no fabricated
   testimonials, ever). Pair as:
   <div class="testimonial-card">
     <div class="testimonial-quote-mark"><i class="fa-solid fa-quote-left"></i></div>
     <p class="testimonial-quote">&quot;...&quot;</p>
     <div class="testimonial-attribution">
       <span class="testimonial-name">Jane Smith</span>
       <span class="testimonial-role">Independent Math Tutor</span>
     </div>
   </div>
   Use "Independent Tutor" (role only, no name) instead of testimonial-name
   when the educator didn't give permission to publish their name. */
.testimonial-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-md);
  text-align: left;
  max-width: 480px;
}
.testimonial-quote-mark {
  color: var(--accent);
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}
.testimonial-quote {
  color: var(--text-main);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}
.testimonial-attribution {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.testimonial-name {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.92rem;
}
.testimonial-role {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Small "ⓘ" hover/focus tooltip next to a heading, e.g. <span class="info-tip" data-tip="...">i</span> */
.info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 0.4rem;
  border-radius: 50%;
  background: var(--border-color);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  font-style: normal;
  cursor: help;
  vertical-align: middle;
}
/* Invisible 44x44 hit area centered on the 16px icon — keeps the visual
   size but meets the touch-target minimum (WCAG 2.5.5) without shifting
   surrounding layout. */
.info-tip::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}
.info-tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 240px;
  background: var(--text-main);
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
  z-index: 20;
  text-transform: none;
  letter-spacing: normal;
}
.info-tip:hover::after,
.info-tip:focus::after {
  opacity: 1;
  visibility: visible;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Unlike .grid-3's auto-fit (which wraps a 4th card to its own row once
   columns can't hold 280px each), this always renders exactly 4 columns —
   they shrink together instead of wrapping. Use for card counts that are
   always exactly 4; collapses to 2-across then 1-across below. */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Like .grid-3, but for card counts that don't divide evenly (e.g. 4 cards
   in a 3-across layout) — flexbox wrap centers the leftover row instead of
   stranding it flush-left the way CSS Grid's auto-fit does. */
.grid-wrap-center {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}
.grid-wrap-center > .card,
.grid-wrap-center > .card-feature {
  flex: 1 1 280px;
  max-width: 340px;
}

/* Buttons — minimum 44px touch target height for mobile */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
}
.btn-primary:hover {
  background: var(--primary-hover);
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-accent {
  background: var(--accent);
  color: #FFFFFF;
}
.btn-accent:hover {
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover {
  background: var(--bg-subtle);
  border-color: var(--text-main);
  color: var(--text-main);
}

/* Larger CTA variant — reserved for the marketing hero and the featured
   pricing plan; not used anywhere in the authenticated app. */
.btn-lg {
  min-height: 52px;
  padding: 1rem 2rem;
  font-size: 1.05rem;
}

/* Form Controls */
.form-group {
  margin-bottom: 1.25rem;
}
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-control {
  width: 100%;
  min-height: 44px;
  padding: 0.75rem 1rem;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* Badges — soft-tone pills (tint background, saturated text) */
.badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}
.badge-pro {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.25);
}
.badge-admin {
  background: var(--danger-light);
  color: var(--danger-text);
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.badge-educator {
  background: var(--accent-light);
  color: #0F766E;
  border: 1px solid rgba(14, 165, 165, 0.25);
}

/* Dual View Audience Pill Switch */
.view-switch {
  display: inline-flex;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
}
.view-pill {
  padding: 0.4rem 1.2rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.view-pill.active {
  background: var(--primary);
  color: #FFFFFF;
}
.view-pill:hover:not(.active) {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

/* Table Design */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.table th {
  background: var(--bg-subtle);
  padding: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}
.table tr:hover {
  background: var(--bg-subtle);
}

/* ===================================================
   Modals — shared overlay/panel, used by the New Class / Add Student /
   Enable Privacy Mode (students.php), CSV import (assessment.php), and
   Edit User (admin_users.php) dialogs. Same computed values as the
   inline styles they replace; toggled the same way (an ancestor's
   `style.display = 'flex' | 'none'`), just named so the visual layer
   only has to be defined once.
   =================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 33, 61, 0.55);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.modal-overlay.active {
  display: flex;
}
.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  padding: 1.75rem;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.modal-header h3 {
  font-size: 1.15rem;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
}
.modal-close:hover {
  color: var(--text-main);
}

/* ===================================================
   Alerts — shared flash/banner style, replacing the inline-styled divs
   previously duplicated per page (email-verify reminder, flash messages,
   form errors, demo-session notice).
   =================================================== */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.9rem;
  margin-bottom: var(--space-section);
}
.alert-success {
  background: var(--success-light);
  color: var(--success-text);
  border-color: rgba(34, 197, 94, 0.25);
}
.alert-warning {
  background: var(--warning-light);
  color: var(--warning-text);
  border-color: rgba(245, 158, 11, 0.3);
}
.alert-danger {
  background: var(--danger-light);
  color: var(--danger-text);
  border-color: rgba(239, 68, 68, 0.25);
}
.alert-info {
  background: var(--accent-light);
  color: var(--accent-text);
  border-color: rgba(14, 165, 165, 0.25);
}

/* ===================================================
   Details Panel — the collapsible "optional extras" pattern used by
   report.php's "Add Progress Details" and assessment.php's "Add a Skill".
   Gives <details> a real card frame plus an explicit open/close chevron
   (list-style:none removes the native marker, so without this there is no
   visual cue at all that the summary row is interactive).
   =================================================== */
.details-panel {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.details-panel > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
  background: var(--bg-subtle);
  transition: background 0.15s ease;
}
.details-panel > summary::-webkit-details-marker {
  display: none;
}
.details-panel > summary:hover {
  background: var(--bg-card-hover);
}
.details-panel > summary .details-panel-chevron {
  margin-left: auto;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}
.details-panel[open] > summary {
  border-bottom: 1px solid var(--border-color);
}
.details-panel[open] > summary .details-panel-chevron {
  transform: rotate(180deg);
}
.details-panel-body {
  padding: 1.25rem;
}

/* Demo-session banner — a persistent mode indicator, not a dismissible
   flash message, so it gets its own compact component rather than reusing
   .alert-info: stays on one line whenever there's room (text wraps inside
   its own column instead of pushing the button to a new row), and leads
   with a scannable "Demo Mode" tag instead of a full opening sentence. */
.demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1rem;
  margin: 1.5rem 1.5rem var(--space-section);
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  border: 1px solid rgba(14, 165, 165, 0.25);
  border-left: 3px solid var(--accent);
}
.demo-banner-text {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  color: var(--accent-text);
  font-size: 0.85rem;
  line-height: 1.4;
}
.demo-banner-text i {
  flex-shrink: 0;
  font-size: 0.95rem;
}
.demo-banner-tag {
  flex-shrink: 0;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 20px;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.demo-banner .btn {
  flex-shrink: 0;
  min-height: auto;
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
}
.demo-banner .btn-outline {
  border-color: var(--accent);
  color: var(--accent-text);
}
.demo-banner .btn-outline:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}
@media (max-width: 640px) {
  .demo-banner {
    flex-wrap: wrap;
  }
}

/* Dismissible warning/action banners (e.g. the email-verification
   reminder) — same non-wrapping technique as .demo-banner above: the text
   wraps within its own column instead of pushing the action buttons down
   to a new row. */
.dismissible-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.1rem;
  margin: 1.5rem 1.5rem var(--space-section);
  border-radius: var(--radius-sm);
}
.dismissible-banner-text {
  min-width: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}
.dismissible-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .dismissible-banner {
    flex-wrap: wrap;
  }
}

/* Mobile Sidebar Toggle */
.sidebar-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  min-width: 44px;
  min-height: 44px;
  padding: 0.5rem 0.7rem;
  font-size: 1.05rem;
  cursor: pointer;
  flex-shrink: 0;
}

.sidebar-backdrop {
  display: none;
}

/* ===================================================
   Responsive Breakpoints (mobile-first overrides)
   =================================================== */
@media (max-width: 900px) {
  .sidebar-toggle-btn {
    display: inline-flex;
  }

  .sidebar {
    left: -260px;
    transition: left 0.25s ease;
  }

  .sidebar.sidebar-open {
    left: 0;
  }

  .sidebar-backdrop.active {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(21, 19, 31, 0.4);
    z-index: 45;
  }

  .main-content {
    margin-left: 0;
    padding: 1.25rem;
  }
}

@media (max-width: 768px) {
  .nav-toggle-btn {
    display: inline-flex;
  }
  .site-nav {
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
  }
  .site-nav-links {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    width: 100%;
    order: 3;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border-navy);
  }
  .site-nav-links.open {
    display: flex;
  }
  .site-nav-links a {
    width: 100%;
    padding: 0.6rem 0;
  }

  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr !important;
  }

  .responsive-stack {
    grid-template-columns: 1fr !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .responsive-stack > * {
    width: 100% !important;
  }

  .main-content {
    padding: 1rem;
  }

  .card {
    padding: 1.1rem;
  }

  .hero-title {
    font-size: 2.1rem !important;
  }

  .site-nav-cta {
    gap: 0.5rem;
  }

  .user-profile-badge > div:not(.avatar) {
    display: none;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: rgba(21, 19, 31, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}
