/* =========================================================================
   Virtualis SIS — Editorial-modern visual system
   Light surfaces, classical Quintivium typography (Georgia + Palatino).
   v2026.05.05 — full overhaul. Linear/Stripe/Vercel-class polish with a
   New Yorker-style serif voice. Designed by a senior UI/UX engineer for
   Zeus Rodriguez. Do not regress.
   ========================================================================= */

:root {
  /* Brand */
  --navy:        #1A2F4B;
  --navy-deep:   #0A1628;
  --navy-mid:    #122340;
  --navy-soft:   #2A4163;
  --navy-ink:    #142339;

  /* RCorp metallic gold palette — refined, not mustard */
  --gold:        #C9A961;
  --gold-light:  #E5CD9A;
  --gold-bright: #D4B36E;
  --gold-deep:   #8C7338;
  --gold-shimmer:#F0DCA8;
  --gold-warm:   #E5CD9A;
  --gold-pale:   #F2EAD2;
  --gold-text:   #8C7338;

  --parchment:   #FDF5E6;
  --parchment-2: #FBF8EE;

  /* Neutrals — warm editorial */
  --bg:           #F7F5F0;
  --bg-tinted:    #F1EEE5;
  --surface:      #FFFFFF;
  --surface-2:    #FBFAF6;
  --sidebar-bg:   #FBF9F2;
  --sidebar-edge: #ECE6D5;
  --border:       #E8E2D2;
  --border-strong:#D6CEB8;
  --hairline:     #F0EBDC;

  /* Text */
  --text:         #1A2F4B;
  --text-body:    #2C2C2E;
  --text-muted:   #6E6B63;
  --text-faint:   #A19D90;

  /* Status */
  --ok:           #2E7D5F;
  --ok-bg:        #E8F2EC;
  --warn:         #B07407;
  --warn-bg:      #FBF1D9;
  --error:        #A0312E;
  --error-bg:     #FBE9E6;
  --info:         #1F4F8B;
  --info-bg:      #E5EDF7;

  /* Shadows — soft, layered, modern */
  --shadow-xs:    0 1px 2px rgba(15,30,51,0.04);
  --shadow-sm:    0 1px 2px rgba(15,30,51,0.04), 0 1px 3px rgba(15,30,51,0.04);
  --shadow-md:    0 4px 14px rgba(15,30,51,0.06), 0 2px 5px rgba(15,30,51,0.04);
  --shadow-lg:    0 14px 32px rgba(15,30,51,0.10), 0 4px 12px rgba(15,30,51,0.05);
  --shadow-xl:    0 30px 70px rgba(15,30,51,0.14), 0 8px 24px rgba(15,30,51,0.06);
  --shadow-gold:  0 6px 22px rgba(201,169,97,0.34), 0 2px 6px rgba(140,115,56,0.20);
  --shadow-navy:  0 8px 24px rgba(15,30,51,0.30), 0 3px 8px rgba(15,30,51,0.18);
  --inset-light:  inset 0 1px 0 rgba(255,255,255,0.20);
  --inset-gold:   inset 0 1px 0 rgba(255,236,178,0.60);

  /* Radii */
  --r-xs:   6px;
  --r-sm:   10px;
  --r-md:   14px;
  --r-lg:   18px;
  --r-xl:   24px;
  --r-pill: 999px;

  /* Motion */
  --t-fast: 130ms cubic-bezier(0.4, 0, 0.2, 1);
  --t:      210ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 340ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --sidebar-w: 272px;
}

* { box-sizing: border-box; }

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(140,115,56,0.16);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(140,115,56,0.32); background-clip: padding-box; border: 2px solid transparent; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text-body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(201,169,97,0.32); color: var(--navy-deep); }

a {
  color: var(--navy);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--gold-deep); }

h1, h2, h3, h4, h5 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--navy);
  font-weight: 700;
  text-wrap: balance;
  letter-spacing: -0.014em;
  margin-top: 0;
  line-height: 1.2;
}
h1 { font-size: 2.05rem; margin-bottom: 0.45rem; }
h2 { font-size: 1.35rem; margin-bottom: 0.55rem; }
h3 { font-size: 1.05rem; color: var(--gold-deep); letter-spacing: 0.02em; }
h4 { font-size: 0.92rem; }

p { margin: 0.5rem 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }

.muted { color: var(--text-muted); font-size: 0.92rem; }
.faint { color: var(--text-faint); font-size: 0.88rem; }
.right { text-align: right; }
.center { text-align: center; }

/* =========================================================================
   App shell
   ========================================================================= */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  background: var(--bg);
}

/* =========================================================================
   Sidebar — light editorial cream, logo reads in full, modern admin feel
   ========================================================================= */
.sidebar {
  background:
    linear-gradient(180deg, #FFFDF5 0%, var(--sidebar-bg) 60%, #F6F1DF 100%);
  color: var(--navy-ink);
  padding: 1.6rem 0.95rem 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-shadow:
    inset -1px 0 0 var(--sidebar-edge),
    1px 0 0 rgba(15,30,51,0.02);
  display: flex;
  flex-direction: column;
}

/* Decorative top accent rule */
.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background:
    linear-gradient(90deg,
      transparent 0%,
      var(--gold-deep) 18%,
      var(--gold) 38%,
      var(--gold-shimmer) 50%,
      var(--gold) 62%,
      var(--gold-deep) 82%,
      transparent 100%);
  opacity: 0.85;
}

.brand-mark {
  display: block;
  padding: 0.35rem 0.4rem 1.1rem;
  margin: 0 0 0.85rem;
  position: relative;
  text-decoration: none;
  transition: transform var(--t);
}
.brand-mark::after {
  content: '';
  position: absolute;
  left: 0.6rem; right: 0.6rem; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong) 20%, var(--border-strong) 80%, transparent);
}
.brand-mark:hover { transform: translateY(-1px); }
.brand-mark img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 78px;
  object-fit: contain;
  /* Logo is dark navy + gold on transparent — show it as designed */
  filter: drop-shadow(0 1px 2px rgba(15,30,51,0.10));
}
.brand-tag {
  font-family: Georgia, serif;
  font-size: 0.62rem;
  color: var(--gold-deep);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  text-align: center;
  margin-top: 0.85rem;
  font-weight: 700;
}

/* legacy compatibility */
.brand-sub { display: none; }
.brand { /* legacy alias kept harmless */ }

/* Nav */
.nav { list-style: none; padding: 0 0.15rem; margin: 0; flex: 1; }
.nav li { margin: 1px 0; }
.nav a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--navy-ink);
  padding: 0.55rem 0.8rem;
  border-radius: var(--r-sm);
  font-size: 0.93rem;
  font-family: Georgia, serif;
  font-weight: 500;
  letter-spacing: 0.005em;
  position: relative;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.nav a .nav-ico {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-deep);
  opacity: 0.85;
  transition: color var(--t-fast), opacity var(--t-fast), transform var(--t-fast);
}
.nav a .nav-ico svg { width: 100%; height: 100%; display: block; }

.nav a:hover {
  background: rgba(201, 169, 97, 0.12);
  color: var(--navy-deep);
}
.nav a:hover .nav-ico {
  color: var(--gold-deep);
  opacity: 1;
  transform: scale(1.05);
}
.nav a.active,
.nav a[aria-current="page"] {
  background:
    linear-gradient(90deg, rgba(201,169,97,0.20) 0%, rgba(201,169,97,0.05) 100%);
  color: var(--navy-deep);
  font-weight: 700;
  box-shadow:
    inset 3px 0 0 var(--gold),
    0 1px 2px rgba(15,30,51,0.04);
}
.nav a.active .nav-ico,
.nav a[aria-current="page"] .nav-ico { color: var(--gold-deep); opacity: 1; }

.nav .group {
  color: var(--gold-deep);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-family: Georgia, serif;
  font-weight: 700;
  padding: 1.4rem 0.85rem 0.45rem;
  position: relative;
}
.nav .group:first-of-type { padding-top: 0.75rem; }

/* Sidebar footer / sign-out is the last <li> — give it a touch of separation */
.nav li:last-child {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.nav li:last-child a {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.nav li:last-child a:hover { color: var(--error); background: rgba(160,49,46,0.06); }

/* =========================================================================
   Main content
   ========================================================================= */
.main {
  padding: 2.5rem 3rem 4rem;
  max-width: 100%;
  overflow-x: auto;
  background: var(--bg);
}

/* =========================================================================
   Page header
   ========================================================================= */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.page-head h1 {
  margin: 0;
  font-size: 2.25rem;
  letter-spacing: -0.018em;
}
.page-head > div {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
}

.crumbs {
  color: var(--text-muted);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: Georgia, serif;
  margin-bottom: 0.45rem;
  font-weight: 600;
}
.crumbs a { color: var(--text-muted); }
.crumbs a:hover { color: var(--gold-deep); }
.crumbs span { color: var(--text-faint); margin: 0 0.4rem; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
}
.section-head h2 { margin: 0; }

/* =========================================================================
   Flash messages
   ========================================================================= */
.flash {
  padding: 0.85rem 1.15rem 0.85rem 1.5rem;
  border-radius: var(--r-md);
  margin-bottom: 1rem;
  font-size: 0.94rem;
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  border: 1px solid transparent;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: var(--shadow-xs);
}
.flash::before {
  content: '';
  width: 4px;
  position: absolute;
  left: 0.5rem;
  top: 0.6rem;
  bottom: 0.6rem;
  border-radius: 2px;
}
.flash.ok    { background: var(--ok-bg);    color: var(--ok);    border-color: rgba(46,125,95,0.16); }
.flash.ok::before    { background: var(--ok); }
.flash.error { background: var(--error-bg); color: var(--error); border-color: rgba(160,49,46,0.18); }
.flash.error::before { background: var(--error); }
.flash.warn  { background: var(--warn-bg);  color: var(--warn);  border-color: rgba(176,116,7,0.20); }
.flash.warn::before  { background: var(--warn); }
.flash.info  { background: var(--info-bg);  color: var(--info);  border-color: rgba(31,79,139,0.16); }
.flash.info::before  { background: var(--info); }

/* =========================================================================
   Cards
   ========================================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.75rem 2rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t), transform var(--t), border-color var(--t);
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card h2 { margin-top: 0; font-size: 1.18rem; }
.card h2 + .muted { margin-top: -0.35rem; margin-bottom: 0.85rem; }
.card.flat { box-shadow: none; }
.card.flat:hover { box-shadow: var(--shadow-xs); }
.card.accent {
  border-top: 4px solid var(--gold);
  padding-top: 1.4rem;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }

/* =========================================================================
   Stat / KPI tiles
   ========================================================================= */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.6rem 1.75rem 1.65rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background:
    linear-gradient(90deg,
      var(--gold-deep) 0%,
      var(--gold) 22%,
      var(--gold-shimmer) 50%,
      var(--gold) 78%,
      var(--gold-deep) 100%);
  box-shadow: 0 1px 4px rgba(201,169,97,0.30);
}
.stat:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}
.stat .label {
  font-size: 0.68rem;
  color: var(--gold-deep);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-family: Georgia, serif;
  font-weight: 700;
  margin-bottom: 0.6rem;
}
.stat .value {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  letter-spacing: -0.025em;
  display: block;
}
.stat .trend {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.55rem;
  font-style: italic;
}

/* =========================================================================
   Buttons — premium, depth-rich, metallic
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background:
    linear-gradient(180deg, var(--navy-soft) 0%, var(--navy) 50%, var(--navy-deep) 100%);
  color: #FFEFCE;
  border: 1px solid var(--navy-deep);
  padding: 0.62rem 1.4rem;
  border-radius: var(--r-sm);
  font-family: Georgia, serif;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  cursor: pointer;
  text-decoration: none;
  box-shadow:
    var(--shadow-navy),
    var(--inset-light);
  transition: all var(--t-fast);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.10) 0%, transparent 50%);
  pointer-events: none;
}
.btn:hover {
  background:
    linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  transform: translateY(-1px);
  box-shadow:
    0 14px 30px rgba(15,30,51,0.36),
    0 4px 10px rgba(15,30,51,0.20),
    var(--inset-gold);
  color: var(--gold-shimmer);
  border-color: var(--gold);
}
.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm), var(--inset-light);
}
.btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 4px rgba(201,169,97,0.36),
    var(--shadow-navy),
    var(--inset-light);
}

/* Gold — luxurious metallic finish */
.btn.gold {
  background:
    linear-gradient(180deg,
      var(--gold-shimmer) 0%,
      var(--gold-bright) 30%,
      var(--gold) 70%,
      var(--gold-deep) 100%);
  color: var(--navy-deep);
  border: 1px solid var(--gold-deep);
  box-shadow:
    var(--shadow-gold),
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -1px 0 rgba(140,115,56,0.30);
  text-shadow: 0 1px 0 rgba(255,255,255,0.30);
}
.btn.gold:hover {
  background:
    linear-gradient(180deg,
      #FCEAB8 0%,
      var(--gold-shimmer) 25%,
      var(--gold-bright) 70%,
      var(--gold) 100%);
  color: var(--navy-deep);
  border-color: var(--gold-deep);
  box-shadow:
    0 12px 32px rgba(201,169,97,0.48),
    0 3px 10px rgba(140,115,56,0.30),
    inset 0 1px 0 rgba(255,255,255,0.70);
}
.btn.gold:active {
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-deep) 100%);
  box-shadow:
    inset 0 2px 4px rgba(140,115,56,0.32),
    inset 0 1px 0 rgba(255,255,255,0.20);
}

/* Ghost — soft tinted surface, NOT a plain outline */
.btn.ghost {
  background:
    linear-gradient(180deg, #FFFFFF 0%, #FBF9F2 100%);
  color: var(--navy);
  border: 1px solid var(--border-strong);
  box-shadow:
    0 1px 2px rgba(15,30,51,0.06),
    inset 0 1px 0 rgba(255,255,255,0.80);
  text-shadow: none;
}
.btn.ghost::before { display: none; }
.btn.ghost:hover {
  background:
    linear-gradient(180deg, #FFFAEC 0%, #F5E9C5 100%);
  color: var(--navy-deep);
  border-color: var(--gold);
  box-shadow:
    0 6px 16px rgba(201,169,97,0.20),
    0 2px 4px rgba(15,30,51,0.06),
    inset 0 1px 0 rgba(255,255,255,0.80);
}

/* Danger — rich crimson */
.btn.danger {
  background:
    linear-gradient(180deg, #D45A55 0%, #B0383A 50%, #872825 100%);
  border-color: #6E1F1D;
  color: #FFF6F4;
  box-shadow:
    0 6px 18px rgba(135,40,37,0.30),
    inset 0 1px 0 rgba(255,255,255,0.20);
}
.btn.danger:hover {
  background:
    linear-gradient(180deg, #C04945 0%, #872825 50%, #5E1614 100%);
  color: white;
  box-shadow:
    0 10px 24px rgba(135,40,37,0.38),
    inset 0 1px 0 rgba(255,255,255,0.20);
}

/* Success — deep emerald */
.btn.success {
  background:
    linear-gradient(180deg, #54B086 0%, #2E7D5F 50%, #1F5A43 100%);
  border-color: #174A36;
  color: #F4FBF7;
  box-shadow:
    0 6px 18px rgba(46,125,95,0.30),
    inset 0 1px 0 rgba(255,255,255,0.22);
}
.btn.success:hover {
  background:
    linear-gradient(180deg, #3F9D74 0%, #1F5A43 50%, #154031 100%);
  color: white;
  box-shadow:
    0 10px 24px rgba(46,125,95,0.38),
    inset 0 1px 0 rgba(255,255,255,0.22);
}

.btn.small {
  padding: 0.42rem 1.05rem;
  font-size: 0.82rem;
}
.btn.tiny {
  padding: 0.3rem 0.8rem;
  font-size: 0.76rem;
}
.btn.block { display: flex; width: 100%; }

/* Toolbar */
.toolbar {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
  background: var(--surface);
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
}
.toolbar .grow { flex: 1; min-width: 220px; }
.toolbar input[type=text],
.toolbar input[type=search] {
  padding: 0.55rem 0.95rem;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: var(--bg-tinted);
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 0.94rem;
  width: 100%;
  transition: all var(--t-fast);
}
.toolbar input[type=text]:focus,
.toolbar input[type=search]:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201,169,97,0.14);
}

/* =========================================================================
   Tables
   ========================================================================= */
table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 0.94rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
table.data th {
  background: linear-gradient(180deg, #FBFAF6 0%, #F4F0E0 100%);
  color: var(--navy);
  font-family: Georgia, serif;
  font-weight: 700;
  text-align: left;
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
}
table.data td {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr { transition: background var(--t-fast); }
table.data tbody tr:hover td { background: rgba(253, 245, 230, 0.45); }
table.data .right { text-align: right; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; font-family: Georgia, serif; }
table.data tr.empty td,
table.data td[colspan].empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-style: italic;
}

/* =========================================================================
   Forms
   ========================================================================= */
form .field { margin-bottom: 1.15rem; }
form label {
  display: block;
  font-size: 0.74rem;
  color: var(--navy);
  font-weight: 700;
  margin-bottom: 0.4rem;
  font-family: Georgia, serif;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
form input[type=text], form input[type=email], form input[type=password],
form input[type=date], form input[type=time], form input[type=number],
form input[type=tel], form input[type=datetime-local], form input[type=url],
form input[type=search],
form select, form textarea {
  width: 100%;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 0.98rem;
  background: var(--surface);
  color: var(--text-body);
  transition: all var(--t-fast);
}
form textarea { min-height: 5.5rem; resize: vertical; line-height: 1.55; }
form input:focus, form select:focus, form textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201,169,97,0.16);
}
form input::placeholder, form textarea::placeholder {
  color: var(--text-faint);
  font-style: italic;
}
form input[type=file] {
  padding: 0.55rem;
  background: var(--bg-tinted);
  border-style: dashed;
  cursor: pointer;
}
form input[type=file]:hover { border-color: var(--gold); background: var(--parchment-2); }

form input[type=checkbox], form input[type=radio] {
  width: auto;
  margin-right: 0.4rem;
  accent-color: var(--gold);
}

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

/* =========================================================================
   Tags / status pills
   ========================================================================= */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.78rem;
  border-radius: var(--r-pill);
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-family: Georgia, serif;
  border: 1px solid transparent;
  line-height: 1.4;
  white-space: nowrap;
}
.tag.enrolled, .tag.proficient, .tag.confirmed, .tag.completed,
.tag.paid, .tag.final, .tag.filled, .tag.approved, .tag.minor,
.tag.returned, .tag.scholarship {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: rgba(46,125,95,0.20);
}
.tag.withdrawn, .tag.declined, .tag.cancelled, .tag.voided,
.tag.major, .tag.beginning, .tag.denied {
  background: var(--error-bg);
  color: var(--error);
  border-color: rgba(160,49,46,0.20);
}
.tag.pending, .tag.late, .tag.moderate, .tag.developing, .tag.open {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: rgba(176,116,7,0.22);
}
.tag.live, .tag.advanced, .tag.partial, .tag.resubmitted,
.tag.in_progress, .tag.az_esa, .tag.wi_choice, .tag.mpcp {
  background: var(--parchment);
  color: var(--gold-deep);
  border-color: rgba(201,169,97,0.22);
}
.tag.flex, .tag.draft, .tag.submitted, .tag.invited, .tag.planned,
.tag.closed, .tag.sent, .tag.private, .tag.graduated {
  background: var(--info-bg);
  color: var(--info);
  border-color: rgba(31,79,139,0.18);
}
.tag.critical { background: #4B0F0F; color: #fff; border-color: #4B0F0F; }

/* =========================================================================
   Login / public pages
   ========================================================================= */
.login-wrap {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 18% 18%, rgba(201,169,97,0.16), transparent 52%),
    radial-gradient(ellipse at 82% 82%, rgba(26,47,75,0.10), transparent 52%),
    linear-gradient(160deg, #FFFDF5 0%, var(--parchment) 60%, #F4ECD2 100%);
  padding: 2rem;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 2.75rem 2.75rem 2.5rem;
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 460px;
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background:
    linear-gradient(90deg,
      var(--gold-deep) 0%,
      var(--gold) 30%,
      var(--gold-shimmer) 50%,
      var(--gold) 70%,
      var(--gold-deep) 100%);
}
.login-card .login-brand {
  text-align: center;
  margin-bottom: 1.6rem;
}
.login-card .login-brand img {
  width: 100%;
  max-width: 280px;
  height: auto;
}
.login-card h1 {
  font-family: Georgia, serif;
  margin-bottom: 0.4rem;
  font-size: 1.55rem;
  text-align: center;
}
.login-card .sub {
  color: var(--text-muted);
  font-size: 0.93rem;
  margin-bottom: 1.85rem;
  font-style: italic;
  text-align: center;
}

/* =========================================================================
   Profile / detail page
   ========================================================================= */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.detail-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.detail-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.94rem;
  gap: 1rem;
}
.detail-list li:last-child { border-bottom: none; }
.detail-list .lbl {
  color: var(--text-muted);
  font-family: Georgia, serif;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.detail-list .val {
  color: var(--text);
  text-align: right;
}

/* =========================================================================
   Detail grid — modern alternative to .detail-list
   Two-column auto-fit grid with each pair as a stat-like cell
   ========================================================================= */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.detail-grid li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.8rem;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.detail-grid li:hover {
  border-color: var(--gold);
  background: var(--surface);
}
.detail-grid .lbl {
  color: var(--text-muted);
  font-family: Georgia, serif;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  line-height: 1.2;
}
.detail-grid .val {
  color: var(--navy);
  font-family: Georgia, serif;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.3;
  word-break: break-word;
}
.detail-grid .val.muted, .detail-grid .val .muted {
  color: var(--text-faint);
  font-weight: 400;
}

/* =========================================================================
   Profile hero — for individual student / family / staff pages
   ========================================================================= */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  padding: 1.4rem 1.65rem;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(201,169,97,0.10), transparent 55%),
    linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
}
.profile-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-deep) 100%);
}
.profile-hero .avatar { flex: 0 0 auto; }
.profile-hero .info { flex: 1; min-width: 0; }
.profile-hero .crumbs { margin-bottom: 0.25rem; }
.profile-hero h1 { margin: 0 0 0.5rem; font-size: 1.85rem; line-height: 1.15; }
.profile-hero .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-top: 0.4rem;
}
.profile-hero .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-self: center;
}

/* Avatar — gold-gradient initials circle */
.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--navy-deep);
  letter-spacing: -0.02em;
  background:
    radial-gradient(circle at 30% 25%, var(--gold-shimmer), transparent 60%),
    linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 50%, var(--gold-deep) 100%);
  box-shadow:
    var(--shadow-md),
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -1px 0 rgba(140,115,56,0.30);
  text-shadow: 0 1px 0 rgba(255,255,255,0.30);
  flex-shrink: 0;
}
.avatar.sm { width: 36px; height: 36px; font-size: 0.85rem; }
.avatar.lg { width: 96px; height: 96px; font-size: 2rem; }
.avatar.navy {
  background:
    radial-gradient(circle at 30% 25%, var(--navy-soft), transparent 60%),
    linear-gradient(135deg, var(--navy-soft) 0%, var(--navy) 50%, var(--navy-deep) 100%);
  color: var(--gold-shimmer);
  text-shadow: 0 1px 0 rgba(0,0,0,0.40);
}

/* Grade chip — small inline meta badge */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: Georgia, serif;
  font-size: 0.82rem;
  color: var(--navy);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.chip .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
}
.chip a { color: var(--navy); }
.chip a:hover { color: var(--gold-deep); }

/* =========================================================================
   Category cards — colored, distinct sections (e.g. notes by category)
   ========================================================================= */
.cat-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1rem 1.15rem 1.1rem;
  margin-bottom: 0.85rem;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}
.cat-card::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 3px;
}
.cat-card .cat-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}
.cat-card .cat-icon {
  width: 28px; height: 28px;
  border-radius: var(--r-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cat-card .cat-icon svg { width: 16px; height: 16px; }
.cat-card .cat-title {
  font-family: Georgia, serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
}
.cat-card .cat-body { color: var(--text-body); font-size: 0.95rem; }
.cat-card .cat-body p { margin: 0.3rem 0; }
.cat-card .cat-body .detail-grid { margin-top: 0.4rem; }

/* Color variants */
.cat-card.cat-blue {
  background: linear-gradient(180deg, #F2F6FB 0%, var(--surface) 60%);
  border-color: rgba(31,79,139,0.16);
}
.cat-card.cat-blue::before { background: var(--info); }
.cat-card.cat-blue .cat-icon { background: var(--info-bg); color: var(--info); }

.cat-card.cat-gold {
  background: linear-gradient(180deg, #FBF6E5 0%, var(--surface) 60%);
  border-color: rgba(201,169,97,0.28);
}
.cat-card.cat-gold::before { background: var(--gold); }
.cat-card.cat-gold .cat-icon { background: var(--gold-pale); color: var(--gold-deep); }

.cat-card.cat-green {
  background: linear-gradient(180deg, #EFF7F2 0%, var(--surface) 60%);
  border-color: rgba(46,125,95,0.18);
}
.cat-card.cat-green::before { background: var(--ok); }
.cat-card.cat-green .cat-icon { background: var(--ok-bg); color: var(--ok); }

.cat-card.cat-rose {
  background: linear-gradient(180deg, #FBF1EF 0%, var(--surface) 60%);
  border-color: rgba(160,49,46,0.16);
}
.cat-card.cat-rose::before { background: var(--error); }
.cat-card.cat-rose .cat-icon { background: var(--error-bg); color: var(--error); }

.cat-card.cat-neutral {
  background: linear-gradient(180deg, var(--bg-tinted) 0%, var(--surface) 60%);
  border-color: var(--border);
}
.cat-card.cat-neutral::before { background: var(--gold-deep); }
.cat-card.cat-neutral .cat-icon { background: var(--bg-tinted); color: var(--gold-deep); }

/* Sub-nav (used as page-level secondary navigation, distinct from primary tabs) */
.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0 0 1.5rem;
  padding: 0.45rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
}
.subnav a {
  padding: 0.5rem 0.95rem;
  border-radius: var(--r-sm);
  font-family: Georgia, serif;
  font-size: 0.86rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all var(--t-fast);
}
.subnav a:hover {
  background: var(--surface);
  color: var(--navy);
  box-shadow: var(--shadow-xs);
}
.subnav a.active, .subnav a.current {
  background: var(--surface);
  color: var(--navy);
  box-shadow:
    var(--shadow-sm),
    inset 0 -2px 0 var(--gold);
  font-weight: 700;
}

/* =========================================================================
   Tabs
   ========================================================================= */
.tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding: 0;
  flex-wrap: wrap;
}
.tabs a {
  padding: 0.7rem 1.15rem;
  font-family: Georgia, serif;
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.012em;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  transition: all var(--t-fast);
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
}
.tabs a:hover {
  color: var(--navy);
  background: rgba(201,169,97,0.06);
}
.tabs a.active, .tabs a.current {
  color: var(--navy);
  border-bottom-color: var(--gold);
  font-weight: 700;
}

/* =========================================================================
   Empty state
   ========================================================================= */
.empty {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-lg);
  color: var(--text-muted);
}
.empty h3 { color: var(--navy); margin-bottom: 0.5rem; font-size: 1.1rem; }
.empty p { color: var(--text-muted); margin: 0.5rem 0 1rem; }

/* =========================================================================
   Misc UI primitives
   ========================================================================= */
.attendance-grid input[type=number] { max-width: 80px; }

.gb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--surface);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.gb-table th, .gb-table td {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
}
.gb-table thead th {
  background: var(--parchment-2);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  height: 6rem;
  font-size: 0.78rem;
}
.gb-table thead th.name {
  writing-mode: initial;
  transform: none;
  height: auto;
  text-align: left;
}

.legal-box {
  background: var(--parchment-2);
  border-left: 4px solid var(--gold);
  padding: 1rem 1.25rem;
  font-size: 0.92rem;
  margin-bottom: 1rem;
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.legal-box strong { color: var(--navy); font-family: Georgia, serif; }

.callout {
  background: var(--info-bg);
  border-left: 4px solid var(--info);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--r-md) var(--r-md) 0;
  margin: 1rem 0;
  font-size: 0.94rem;
}

.divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

.kbd {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  background: var(--bg-tinted);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  font-family: Georgia, monospace;
  font-size: 0.84rem;
  color: var(--navy);
}

.page-section {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.page-section:first-child { margin-top: 0; padding-top: 0; border-top: none; }

/* =========================================================================
   Dashboard hero — navy keepsake against the lighter shell
   ========================================================================= */
.dash-hero {
  background:
    radial-gradient(ellipse at 88% 0%, rgba(229,205,154,0.32), transparent 56%),
    radial-gradient(ellipse at 12% 100%, rgba(201,169,97,0.16), transparent 56%),
    linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 50%, var(--navy-deep) 100%);
  color: var(--parchment);
  padding: 2.25rem 2.5rem;
  border-radius: var(--r-xl);
  margin-bottom: 1.75rem;
  box-shadow:
    var(--shadow-lg),
    inset 0 1px 0 rgba(229,205,154,0.18);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(201,169,97,0.22);
}
.dash-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background:
    linear-gradient(90deg,
      transparent 0%,
      var(--gold) 25%,
      var(--gold-shimmer) 50%,
      var(--gold) 75%,
      transparent 100%);
}
.dash-hero h1 {
  color: #FFFFFF;
  margin-bottom: 0.4rem;
  font-size: 2.4rem;
  letter-spacing: -0.02em;
}
.dash-hero p {
  color: rgba(253,245,230,0.82);
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    background: var(--bg);
  }
  .sidebar {
    position: static;
    height: auto;
    box-shadow: inset 0 -1px 0 var(--sidebar-edge);
    padding: 1.25rem 1rem 1.5rem;
  }
  .main { padding: 1.5rem 1.25rem 3rem; }
  .row2, .row3, .row4 { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-head h1 { font-size: 1.65rem; }
  .profile-grid { grid-template-columns: 1fr; }
  .toolbar { border-radius: var(--r-md); padding: 0.6rem; }
}

/* =========================================================================
   Print
   ========================================================================= */
@media print {
  .sidebar, .page-head .btn, .page-head a.btn, .flash, .crumbs, .toolbar {
    display: none !important;
  }
  .app {
    display: block !important;
    grid-template-columns: none !important;
    background: #fff !important;
  }
  .main { padding: 0 !important; max-width: none !important; }
  body { background: #fff; }
  .card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    page-break-inside: avoid;
  }
  a { color: inherit; text-decoration: none; }
}

/* =========================================================================
   CLASSICAL TREATMENT — Virtualis flagship components
   Scoped under .classical-page so they only fire on themed course/lesson views.
   Mirrors arizona.virtualis.school cls-* vocabulary: page-banner, scripture-block
   (with curator-trigger popup), curator-card, poem-plate, ornamental-divider.
   ========================================================================= */

.classical-page {
  --rubric: #8B1A1A;
  --rubric-soft: #B14545;
  --vellum: #F9F0D5;
  --vellum-2: #F4E8CC;
  --gold-edge: #D4B05F;
  --gold-deeper: #8C7338;
  --ink: #2a1a0d;
}

/* Themed page-banner: the hero, big title + tagline, optional artwork backdrop */
.classical-page .page-banner {
  position: relative;
  margin: -1.5rem -1.5rem 1.5rem;
  padding: 3.4rem 2rem 3.6rem;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(252,247,232,0.96), rgba(244,232,204,0.94)),
    url('/img/parchment-tile.png') center/cover;
  border-bottom: 6px double var(--gold-edge);
  overflow: hidden;
}
.classical-page .page-banner::before,
.classical-page .page-banner::after {
  content: '✦';
  position: absolute;
  top: 1rem;
  font-size: 1.4rem;
  color: var(--gold-deeper);
  opacity: 0.8;
}
.classical-page .page-banner::before { left: 1.2rem; }
.classical-page .page-banner::after  { right: 1.2rem; }
.classical-page .page-banner.has-hero {
  background:
    linear-gradient(180deg, rgba(20,28,48,0.78) 0%, rgba(20,28,48,0.55) 100%),
    var(--banner-bg, #1a1a1a) center/cover;
  color: #FFFDF5;
  border-bottom-color: var(--gold-edge);
}
.classical-page .page-banner h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 900;
  font-style: italic;
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
  color: var(--navy);
}
.classical-page .page-banner.has-hero h1 { color: #FFFDF5; }
.classical-page .page-banner h1::first-letter { color: var(--rubric); }
.classical-page .page-banner.has-hero h1::first-letter { color: var(--gold-light); }
.classical-page .page-banner .tagline {
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--gold-deeper);
  margin: 0 auto;
  max-width: 700px;
  letter-spacing: 0.04em;
}
.classical-page .page-banner.has-hero .tagline { color: var(--gold-shimmer); }
.classical-page .page-banner .kicker {
  display: inline-block;
  font-family: Georgia, serif;
  font-variant: small-caps;
  font-size: 0.75rem;
  letter-spacing: 0.36em;
  color: var(--gold-deeper);
  margin: 0 0 1rem;
  padding: 4px 14px;
  border-top: 1px solid var(--gold-edge);
  border-bottom: 1px solid var(--gold-edge);
}
.classical-page .page-banner.has-hero .kicker { color: var(--gold-shimmer); border-color: var(--gold-shimmer); }

/* Curator card — museum-label */
.classical-page .curator-card {
  max-width: 720px;
  margin: 0 auto 1.6rem;
  background: var(--vellum);
  background-image: linear-gradient(180deg, var(--vellum) 0%, var(--vellum-2) 100%);
  border: 1px solid var(--gold-deeper);
  border-left: 4px solid var(--rubric);
  border-radius: 2px;
  padding: 1.1rem 1.5rem 1.1rem;
  box-shadow: 0 3px 16px rgba(74,46,26,.10), inset 0 0 0 1px var(--gold-edge);
}
.classical-page .curator-label {
  display: inline-block;
  font-family: Georgia, serif;
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--rubric);
  font-weight: 700;
  margin: 0 0 0.3rem;
  padding: 3px 10px;
  border: 1px solid var(--rubric);
}
.classical-page .curator-title {
  color: var(--ink);
  font-family: Georgia, serif;
  font-variant: small-caps;
  font-weight: 900;
  font-size: 1.15rem;
  margin: 0.3rem 0 0.1rem;
  letter-spacing: 0.5px;
}
.classical-page .curator-title::first-letter { color: var(--rubric); }
.classical-page .curator-provenance {
  color: var(--rubric);
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 0.78rem;
  margin: 0 0 0.6rem;
}
.classical-page .curator-ethos {
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 0.92rem;
  line-height: 1.65;
  margin: 0;
}
.classical-page .curator-ethos em { color: var(--rubric); font-style: italic; }
.classical-page .curator-further {
  margin-top: 0.6rem;
  font-family: Georgia, serif;
  font-size: 0.85rem;
  font-style: italic;
}
.classical-page .curator-further a {
  color: var(--rubric);
  text-decoration: underline;
  font-weight: 700;
  font-style: normal;
}
.classical-page .curator-further a:hover { color: #5c0f0f; }

/* Scripture block — framed, large quote glyph, click to reveal context popup */
.classical-page .scripture-block {
  max-width: 800px;
  margin: 1.5rem auto;
  background: #fff;
  border: 1px solid var(--gold-deeper);
  border-left: 6px solid var(--rubric);
  border-radius: 2px;
  padding: 1.6rem 1.8rem 1.4rem 3rem;
  box-shadow: 0 3px 18px rgba(74,46,26,.10), inset 0 0 0 1px var(--gold-edge);
  position: relative;
}
.classical-page .scripture-block::before {
  content: '\201C';
  position: absolute;
  top: 0.4rem;
  left: 0.9rem;
  font-family: Georgia, serif;
  font-size: 3.4rem;
  color: var(--rubric);
  opacity: 0.5;
  line-height: 1;
}
.classical-page .scripture-block blockquote {
  margin: 0 0 0.6rem;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--ink);
}
.classical-page .scripture-block cite {
  font-family: Georgia, serif;
  font-style: normal;
  font-variant: small-caps;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  color: var(--rubric);
  font-weight: 700;
  display: block;
  margin-top: 0.6rem;
}
.classical-page .scripture-block cite::before {
  content: '\271C\00a0';
  color: var(--gold-edge);
}
.classical-page .scripture-block.curator-trigger {
  cursor: pointer;
  transition: box-shadow 130ms;
}
.classical-page .scripture-block.curator-trigger:hover {
  box-shadow: 0 5px 22px rgba(74,46,26,.18), inset 0 0 0 1px var(--gold-edge);
}
.classical-page .scripture-block.curator-trigger::after {
  content: 'Tap for context →';
  position: absolute;
  right: 1rem;
  bottom: 0.4rem;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 0.72rem;
  color: var(--gold-deeper);
  opacity: 0.7;
}

/* Poem plate — 3D framed vellum aside */
.classical-page .poem-plate {
  max-width: 620px;
  margin: 2rem auto;
  background: var(--vellum);
  border: 1px double var(--gold-deeper);
  border-radius: 2px;
  padding: 1.6rem 2rem 1.2rem;
  text-align: center;
  box-shadow:
    inset 0 0 0 1px var(--gold-edge),
    inset 0 0 0 5px var(--vellum),
    inset 0 0 0 6px var(--gold-edge),
    0 6px 22px rgba(74,46,26,.16);
  position: relative;
}
.classical-page .poem-plate::before {
  content: '❦';
  display: block;
  font-size: 1.2rem;
  color: var(--rubric);
  margin-bottom: 0.5rem;
}
.classical-page .poem-plate .poem-verse {
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink);
  white-space: pre-line;
  margin: 0 0 0.7rem;
}
.classical-page .poem-plate .poem-attr {
  font-family: Georgia, serif;
  font-variant: small-caps;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: var(--rubric);
}

/* Section heading + gold rule + ornamental divider */
.classical-page .section-title {
  text-align: center;
  font-family: Georgia, serif;
  font-weight: 900;
  font-size: clamp(1.6rem, 2.6vw, 2rem);
  color: var(--navy);
  margin: 1.2rem 0 0.4rem;
}
.classical-page .gold-rule {
  width: 70px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-deeper), var(--gold-edge), var(--gold-deeper));
  border: none;
  margin: 0 auto 1.6rem;
  border-radius: 2px;
  position: relative;
}
.classical-page .gold-rule::after {
  content: '✦';
  position: absolute;
  top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--bg);
  padding: 0 8px;
  font-size: 0.95rem;
  color: var(--gold-deeper);
}
.classical-page .ornamental-divider {
  text-align: center;
  margin: 2.4rem 0;
  position: relative;
}
.classical-page .ornamental-divider::before {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-edge) 40%, var(--gold-deeper) 50%, var(--gold-edge) 60%, transparent);
  margin-bottom: 0.8rem;
}
.classical-page .ornamental-divider::after {
  content: '✦';
  font-size: 1.2rem;
  color: var(--gold-deeper);
}

/* Module + lesson tree on classical course page */
.classical-page .module-block {
  background: #fff;
  border: 1px solid var(--gold-edge);
  border-radius: 6px;
  padding: 1.2rem 1.6rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}
.classical-page .module-block h3 {
  font-family: Georgia, serif;
  font-style: italic;
  color: var(--navy);
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}
.classical-page .module-block h3::first-letter { color: var(--rubric); font-style: normal; }
.classical-page .module-block ul { margin: 0; padding-left: 1.2rem; }
.classical-page .module-block ul li {
  margin: 0.3rem 0;
  font-family: Georgia, serif;
}
.classical-page .module-block ul li a { color: var(--navy); }
.classical-page .module-block ul li a:hover { color: var(--rubric); }

/* Curator popup overlay (triggered by .curator-trigger element) */
.curator-popup-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 25, 50, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.curator-popup-backdrop.open { display: flex; }
.curator-popup {
  max-width: 560px;
  background: #F9F0D5;
  background-image: linear-gradient(180deg, #F9F0D5 0%, #F4E8CC 100%);
  border: 1px solid #8a6611;
  border-left: 4px solid #8B1A1A;
  border-radius: 2px;
  padding: 1.6rem 1.8rem 1.4rem;
  box-shadow: 0 18px 60px rgba(15,25,50,0.45), inset 0 0 0 1px #D4B05F;
  position: relative;
}
.curator-popup-close {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  background: none;
  border: none;
  color: #8B1A1A;
  font-size: 1.4rem;
  font-family: Georgia, serif;
  cursor: pointer;
  line-height: 1;
}
.curator-popup-label {
  display: inline-block;
  font-family: Georgia, serif;
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #8B1A1A;
  font-weight: 700;
  padding: 3px 10px;
  border: 1px solid #8B1A1A;
  margin-bottom: 0.5rem;
}
.curator-popup h3 {
  font-family: Georgia, serif;
  font-variant: small-caps;
  font-weight: 900;
  color: #2a1a0d;
  margin: 0.3rem 0 0.4rem;
  font-size: 1.2rem;
}
.curator-popup p {
  font-family: Georgia, serif;
  color: #2a1a0d;
  font-size: 0.95rem;
  line-height: 1.65;
}

/* =========================================================================
   CLASSICAL — INNER PAGE COMPONENTS (lesson + assignment views)
   Tighter banner, illuminated content frame, rubricated drop-cap,
   fleuron navigation between previous/next lessons.
   ========================================================================= */

.classical-page .page-banner.compact {
  padding: 1.6rem 1.4rem 1.7rem;
  border-bottom: 4px double var(--gold-edge);
}
.classical-page .page-banner.compact h1 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin-bottom: 0.25rem;
}

.classical-page .illuminated-frame {
  max-width: 880px;
  margin: 1.4rem auto;
  background: #FFFDF5;
  border: 1px solid var(--gold-deeper);
  border-radius: 2px;
  padding: 2.2rem 2.6rem;
  box-shadow:
    inset 0 0 0 1px var(--gold-edge),
    inset 0 0 0 5px #FFFDF5,
    inset 0 0 0 6px var(--gold-edge),
    0 4px 22px rgba(74,46,26,.10);
  position: relative;
}
.classical-page .illuminated-frame::before {
  content: '✦';
  position: absolute;
  top: 8px; left: 12px;
  font-size: 0.95rem;
  color: var(--gold-deeper);
}
.classical-page .illuminated-frame::after {
  content: '✦';
  position: absolute;
  top: 8px; right: 12px;
  font-size: 0.95rem;
  color: var(--gold-deeper);
}
.classical-page .illuminated-frame > .frame-bottom {
  text-align: center;
  margin-top: 1.4rem;
  color: var(--gold-deeper);
  font-size: 0.9rem;
  letter-spacing: 0.6rem;
}

.classical-page .lesson-body {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--ink);
}
/* Drop-cap: opt-in via .has-dropcap on the .lesson-body. Keeps it off
   submit-form prose, teacher feedback, and short blurbs where it would jar. */
.classical-page .lesson-body.has-dropcap > p:first-of-type::first-letter,
.classical-page .lesson-body.has-dropcap > div:first-of-type > p:first-of-type::first-letter {
  font-family: Georgia, serif;
  font-size: 3.6rem;
  font-weight: 900;
  color: var(--rubric);
  float: left;
  line-height: 1;                  /* sit on its own baseline, don't crash into the next line */
  padding: 0.45rem 0.85rem 0 0;    /* generous gap between the cap and "ubmission" */
  margin: 0 0 -0.05rem 0;
  text-shadow: 0 1px 0 rgba(255,255,255,0.7);
}
.classical-page .lesson-body.has-dropcap > p:first-of-type,
.classical-page .lesson-body.has-dropcap > div:first-of-type > p:first-of-type {
  line-height: 1.85;               /* loosen body lines around the cap so they don't crowd it */
}
.classical-page .lesson-body h2,
.classical-page .lesson-body h3 {
  font-family: Georgia, serif;
  color: var(--navy);
  font-weight: 900;
  margin: 1.4rem 0 0.4rem;
}
.classical-page .lesson-body h2 {
  font-style: italic;
  font-size: 1.45rem;
  text-align: center;
  padding-top: 0.3rem;
  border-top: 1px solid var(--gold-edge);
}
.classical-page .lesson-body h3 { font-size: 1.15rem; color: var(--gold-deeper); }
.classical-page .lesson-body img {
  max-width: 100%;
  height: auto;
  margin: 1rem auto;
  display: block;
  border-radius: 2px;
  border: 1px solid var(--gold-edge);
  box-shadow: inset 0 0 0 4px #fff, 0 2px 12px rgba(74,46,26,.12);
}
.classical-page .lesson-body a {
  color: var(--rubric);
  text-decoration: underline;
  text-decoration-color: var(--gold-edge);
  text-underline-offset: 2px;
}
.classical-page .lesson-body a:hover { color: var(--navy); }
.classical-page .lesson-body blockquote {
  border-left: 3px solid var(--gold-edge);
  padding: 0.6rem 1.2rem;
  margin: 1.2rem 0;
  background: var(--vellum-2);
  font-style: italic;
}

/* Fleuron navigation row between lessons */
.classical-page .fleuron-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  max-width: 880px;
  margin: 1.6rem auto 0;
  padding: 1.2rem 0 0;
  border-top: 1px solid var(--gold-edge);
}
.classical-page .fleuron-nav .ctr {
  text-align: center;
  color: var(--gold-deeper);
  font-size: 1rem;
}
.classical-page .fleuron-nav .prev a,
.classical-page .fleuron-nav .next a {
  font-family: Georgia, serif;
  font-style: italic;
  color: var(--navy);
  text-decoration: none;
  display: inline-block;
  max-width: 280px;
  line-height: 1.35;
}
.classical-page .fleuron-nav .prev a:hover,
.classical-page .fleuron-nav .next a:hover { color: var(--rubric); }
.classical-page .fleuron-nav .prev { text-align: left; }
.classical-page .fleuron-nav .next { text-align: right; }
.classical-page .fleuron-nav .prev .arrow { color: var(--gold-deeper); margin-right: 0.3rem; }
.classical-page .fleuron-nav .next .arrow { color: var(--gold-deeper); margin-left: 0.3rem; }
.classical-page .fleuron-nav .nav-kicker {
  display: block;
  font-family: Georgia, serif;
  font-variant: small-caps;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--gold-deeper);
  font-style: normal;
  margin-bottom: 0.15rem;
}

/* Assignment status / submit blocks in classical chrome */
.classical-page .status-card {
  max-width: 880px;
  margin: 1rem auto 1.4rem;
  background: var(--vellum);
  border: 1px solid var(--gold-deeper);
  border-left: 4px solid var(--rubric);
  padding: 1rem 1.4rem;
  border-radius: 2px;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: Georgia, serif;
}
.classical-page .status-card .status-label {
  font-variant: small-caps;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  color: var(--rubric);
  font-weight: 700;
}
.classical-page .status-card .status-grade {
  margin-left: auto;
  font-family: Georgia, serif;
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--navy);
}
.classical-page .status-card .status-grade .out-of {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 400;
}

@media (max-width: 720px) {
  .classical-page .illuminated-frame { padding: 1.4rem 1.2rem; margin: 1rem 0; }
  .classical-page .fleuron-nav { grid-template-columns: 1fr; }
  .classical-page .fleuron-nav .prev, .classical-page .fleuron-nav .next { text-align: center; }
}
