@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800&family=Inter:wght@400;500;600;700;800&display=swap');

/* ─── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --navy:       #0d1b2a;
  --navy-mid:   #162333;
  --navy-light: #1e3554;
  --gold:       #c9a84c;
  --gold-light: #e5c97e;
  --gold-dark:  #a8863e;
  --cream:      #faf8f2;
  --white:      #ffffff;
  --surface:    #f4f6fb;
  --text:       #0d1b2a;
  --muted:      #6b7a8d;
  --border:     #e2e8f0;
  --green:      #22c55e;
  --red:        #ef4444;
  --orange:     #f59e0b;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow-sm:  0 1px 3px rgba(13,27,42,.08), 0 1px 2px rgba(13,27,42,.06);
  --shadow:     0 4px 16px rgba(13,27,42,.10), 0 2px 4px rgba(13,27,42,.06);
  --shadow-lg:  0 12px 40px rgba(13,27,42,.15), 0 4px 8px rgba(13,27,42,.08);
  --font-body:  'Inter', system-ui, sans-serif;
  --font-disp:  'Barlow Condensed', 'Impact', sans-serif;
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
}

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

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }
img { display: block; max-width: 100%; }

/* ─── Nav ────────────────────────────────────────────────────────────────── */
nav {
  background: rgba(13,27,42,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(201,168,76,0.15);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-family: var(--font-disp);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.nav-crest {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.nav-crest .star-row { color: var(--gold); font-size: 0.9rem; letter-spacing: 2px; }
.nav-crest .name-row { font-size: 1.05rem; letter-spacing: 2px; color: var(--white); }

.nav-links { display: flex; align-items: center; gap: 1.75rem; }

.nav-links a {
  color: rgba(255,255,255,0.55);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0; right: 0;
  height: 1.5px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform var(--transition);
}

.nav-links a:hover,
.nav-links a.active { color: var(--gold); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

.nav-links .btn { font-size: 0.82rem; padding: 0.5rem 1.1rem; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  letter-spacing: 0.2px;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: var(--navy);
  box-shadow: 0 2px 8px rgba(201,168,76,0.35);
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
  color: var(--navy);
  box-shadow: 0 4px 16px rgba(201,168,76,0.45);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.25);
  color: var(--white);
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201,168,76,0.06);
}

.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--navy-light); color: var(--white); box-shadow: var(--shadow); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }

.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #16a34a; color: #fff; }

.btn-sm { padding: 0.38rem 0.85rem; font-size: 0.8rem; border-radius: 6px; }
.btn-full { width: 100%; text-align: center; }

/* ─── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  background: var(--navy);
  color: var(--white);
  padding: 7rem 2rem 5rem;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

/* Diagonal stripe pattern */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -55deg,
    rgba(201,168,76,0.03) 0px,
    rgba(201,168,76,0.03) 1px,
    transparent 1px,
    transparent 40px
  );
  z-index: 0;
}

/* Radial glow */
.hero::after {
  content: '';
  position: absolute;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 120%;
  background: radial-gradient(ellipse at center, rgba(201,168,76,0.12) 0%, transparent 65%);
  z-index: 0;
  pointer-events: none;
}

.hero > * { position: relative; z-index: 1; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(201,168,76,0.12);
  border: 1px solid rgba(201,168,76,0.28);
  color: var(--gold-light);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 30px;
  margin-bottom: 2rem;
}

.hero-eyebrow::before,
.hero-eyebrow::after { content: '★'; font-size: 0.55rem; }

.hero-crest {
  margin: 0 auto 2rem;
  width: 80px;
  height: 80px;
}

.hero-crest svg { width: 100%; height: 100%; }

.hero h1 {
  font-family: var(--font-disp);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 800;
  letter-spacing: 3px;
  line-height: 1;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.hero h1 .gold { color: var(--gold); }

.hero-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 1.2rem auto 1.5rem;
  max-width: 320px;
}

.hero-divider::before,
.hero-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,0.5));
}

.hero-divider::after {
  background: linear-gradient(90deg, rgba(201,168,76,0.5), transparent);
}

.hero-divider span { color: var(--gold); font-size: 1rem; }

.hero p {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.62);
  max-width: 440px;
  margin: 0 auto 2.5rem;
  line-height: 1.65;
  font-weight: 400;
}

.hero-actions { display: flex; gap: 0.85rem; justify-content: center; flex-wrap: wrap; }

/* ─── Stats Strip ────────────────────────────────────────────────────────── */
.stats-strip {
  background: var(--white);
  border-top: 3px solid var(--gold);
  border-bottom: 1px solid var(--border);
  padding: 0;
}

.stats-inner {
  max-width: 860px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  divide-x: 1px solid var(--border);
}

.stat-item {
  padding: 2rem 1.5rem;
  text-align: center;
  position: relative;
}

.stat-item + .stat-item::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 1px;
  background: var(--border);
}

.stat-item .num {
  font-family: var(--font-disp);
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
  letter-spacing: 1px;
}

.stat-item .num .unit {
  font-size: 1.6rem;
  color: var(--gold);
}

.stat-item .lbl {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-top: 0.4rem;
}

/* ─── Sections ───────────────────────────────────────────────────────────── */
.section {
  padding: 5.5rem 2rem;
  max-width: 1160px;
  margin: 0 auto;
}

.section-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.6rem;
}

.section-title {
  font-family: var(--font-disp);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--navy);
  line-height: 1.15;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.section-sub {
  color: var(--muted);
  font-size: 0.97rem;
  margin-bottom: 3rem;
  max-width: 500px;
  line-height: 1.6;
}

.section-alt {
  background: var(--white);
  padding: 5.5rem 2rem;
}

.section-alt .section { padding: 0; }

/* ─── Features Grid ──────────────────────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  transition: all var(--transition);
  cursor: default;
}

.feature-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
  border-top-color: var(--gold-light);
}

.feature-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1.1rem;
  box-shadow: 0 2px 8px rgba(13,27,42,0.2);
}

.feature-card h3 {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.4rem;
  letter-spacing: 0.1px;
}

.feature-card p {
  font-size: 0.87rem;
  color: var(--muted);
  line-height: 1.55;
}

/* ─── Timings ────────────────────────────────────────────────────────────── */
.timings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.timing-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--cream);
}

.timing-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  margin-top: 5px;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(201,168,76,0.2);
}

.timing-card h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.25rem;
}

.timing-card .time {
  font-family: var(--font-disp);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.5px;
}

/* ─── Rules ──────────────────────────────────────────────────────────────── */
.rules-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0.85rem;
}

.rules-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  font-size: 0.93rem;
  color: var(--text);
  line-height: 1.55;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem;
}

.rules-list li .rule-num {
  font-family: var(--font-disp);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1.2;
  flex-shrink: 0;
  min-width: 24px;
}

/* ─── CTA Band ───────────────────────────────────────────────────────────── */
.cta-band {
  background: var(--navy);
  padding: 5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -55deg,
    rgba(201,168,76,0.04) 0px,
    rgba(201,168,76,0.04) 1px,
    transparent 1px,
    transparent 40px
  );
}

.cta-band > * { position: relative; z-index: 1; }

.cta-band h2 {
  font-family: var(--font-disp);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 0.6rem;
}

.cta-band p {
  color: rgba(255,255,255,0.55);
  font-size: 0.97rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */
footer {
  background: var(--navy-mid);
  border-top: 1px solid rgba(201,168,76,0.12);
  padding: 2.5rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  font-family: var(--font-disp);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
}

.footer-copy {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.45);
  transition: color var(--transition);
}

.footer-links a:hover { color: var(--gold); }

/* ─── Check Page ─────────────────────────────────────────────────────────── */
.check-page {
  min-height: calc(100vh - 64px);
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  overflow: hidden;
}

.check-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -55deg,
    rgba(201,168,76,0.03) 0px,
    rgba(201,168,76,0.03) 1px,
    transparent 1px,
    transparent 40px
  );
}

.check-page > * { position: relative; z-index: 1; }

.check-container {
  width: 100%;
  max-width: 460px;
}

.check-header {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--white);
}

.check-header .crest-sm {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-family: var(--font-disp);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-bottom: 1rem;
  opacity: 0.8;
}

.check-header .crest-sm::before,
.check-header .crest-sm::after { content: '★'; font-size: 0.6rem; }

.check-header h1 {
  font-family: var(--font-disp);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.check-header p { color: rgba(255,255,255,0.5); font-size: 0.88rem; }

.check-card {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.check-card-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  padding: 1.5rem 1.75rem;
  border-bottom: 2px solid var(--gold);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.check-card-header .icon {
  width: 36px;
  height: 36px;
  background: rgba(201,168,76,0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.check-card-header h2 {
  font-family: var(--font-disp);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--white);
}

.check-card-header p { font-size: 0.78rem; color: rgba(255,255,255,0.5); }

.check-card-body { padding: 2rem 1.75rem; }

/* ─── Form Fields ────────────────────────────────────────────────────────── */
.field { margin-bottom: 1.1rem; }

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.72rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field input:focus,
.field select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,168,76,0.12); }

.field input::placeholder { color: var(--muted); opacity: 0.6; }

/* ─── Result Card ────────────────────────────────────────────────────────── */
.result-wrap { margin-top: 1.75rem; }

.result-id-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.result-id-header {
  background: var(--navy);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-id-header .name {
  font-family: var(--font-disp);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--white);
}

.result-id-header .seat {
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.result-id-body { padding: 0; }

.month-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  transition: background var(--transition);
}

.month-row:last-child { border-bottom: none; }
.month-row:hover { background: var(--surface); }

.month-row .month-name { color: var(--text); font-weight: 500; }
.month-row .month-amount { font-size: 0.85rem; color: var(--muted); }

.month-row-actions { display: flex; align-items: center; gap: 0.5rem; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.badge-paid    { background: rgba(34,197,94,.12);  color: #15803d; }
.badge-pending { background: rgba(245,158,11,.12); color: #b45309; }
.badge-overdue { background: rgba(239,68,68,.12);  color: #b91c1c; }
.badge-upcoming { background: rgba(100,116,139,.12); color: #475569; }

.pay-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold);
  border: 1px solid rgba(201,168,76,0.3);
  padding: 3px 10px;
  border-radius: 6px;
  transition: all var(--transition);
}

.pay-link:hover {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}

/* ─── Admin — Login ──────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

.login-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -55deg,
    rgba(201,168,76,0.03) 0px,
    rgba(201,168,76,0.03) 1px,
    transparent 1px,
    transparent 40px
  );
}

.login-card {
  position: relative;
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 380px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.login-card-top {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  border-bottom: 2px solid var(--gold);
  padding: 2rem 2rem 1.5rem;
  text-align: center;
}

.login-card-top .crest-text {
  font-family: var(--font-disp);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--white);
  text-transform: uppercase;
}

.login-card-top .crest-star { color: var(--gold); margin: 0 6px; }
.login-card-top .sub { color: rgba(255,255,255,0.5); font-size: 0.8rem; margin-top: 0.3rem; }

.login-card-body { padding: 1.75rem 2rem 2rem; }

/* ─── Admin — Layout ─────────────────────────────────────────────────────── */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background: var(--surface);
}

.sidebar {
  width: 230px;
  background: var(--navy);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid rgba(201,168,76,0.1);
}

.sidebar-brand {
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-brand h2 {
  font-family: var(--font-disp);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--white);
}

.sidebar-brand h2 .star { color: var(--gold); }

.sidebar-brand .env-badge {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 2px 10px;
  border-radius: 30px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(201,168,76,0.15);
  color: var(--gold-light);
  border: 1px solid rgba(201,168,76,0.2);
}

.sidebar-nav {
  list-style: none;
  padding: 0.75rem 0;
  flex: 1;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1.25rem;
  color: rgba(255,255,255,0.5);
  font-size: 0.87rem;
  font-weight: 500;
  transition: all var(--transition);
  border-left: 2.5px solid transparent;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
  color: var(--white);
  background: rgba(201,168,76,0.08);
  border-left-color: var(--gold);
}

.sidebar-footer {
  padding: 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.admin-main {
  flex: 1;
  padding: 2.5rem;
  overflow-y: auto;
  min-width: 0;
}

.admin-header {
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-header-text h1 {
  font-family: var(--font-disp);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--navy);
}

.admin-header-text p { color: var(--muted); font-size: 0.88rem; margin-top: 0.2rem; }

.admin-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
}

/* ─── Admin — Stat Cards ─────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
}

.stat-card .label {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-card .value {
  font-family: var(--font-disp);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.15;
  margin: 0.25rem 0 0.1rem;
  letter-spacing: 0.5px;
}

.stat-card .hint { font-size: 0.75rem; color: var(--muted); }

/* ─── Admin — Tables ─────────────────────────────────────────────────────── */
.table-wrap {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.table-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}

/* Generic panel used by Dues, Revenue, Closures and the Floor Plan. */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* A card wrapping a table owns the border, so the table drops its own. */
.card .table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin-bottom: 0;
}

.card-head {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.card-head h3 { font-size: 0.97rem; font-weight: 700; color: var(--navy); }

.card-head p {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.2rem;
  line-height: 1.5;
}

.table-head h3 { font-size: 0.97rem; font-weight: 700; color: var(--navy); }

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

th {
  background: var(--surface);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0.7rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 0.85rem 1.25rem;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}

tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafbfd; }

/* ─── Admin — Month Nav ──────────────────────────────────────────────────── */
.month-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.35rem;
}

.month-nav button {
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
  font-size: 1.1rem;
  color: var(--navy);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.month-nav button:hover { background: var(--surface); }

.month-nav strong {
  font-size: 0.9rem;
  font-weight: 700;
  min-width: 110px;
  text-align: center;
  color: var(--navy);
}

/* ─── Broadcast Form ─────────────────────────────────────────────────────── */
.broadcast-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  max-width: 520px;
}

.broadcast-card-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.broadcast-card-header h3 { font-size: 0.97rem; font-weight: 700; color: var(--navy); }

.broadcast-card-body { padding: 1.5rem; }

.broadcast-note {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(201,168,76,0.07);
  border: 1px solid rgba(201,168,76,0.2);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ─── Dashboard Tip ──────────────────────────────────────────────────────── */
.dash-tip {
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
}

.dash-tip strong { color: var(--navy); }

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,27,42,0.65);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal {
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-top {
  padding: 1.25rem 1.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.25rem;
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.2px;
}

.modal-close {
  width: 30px;
  height: 30px;
  border: none;
  background: var(--surface);
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all var(--transition);
}

.modal-close:hover { background: var(--border); color: var(--navy); }

.modal-body { padding: 1.5rem; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.9rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* ─── Toast ──────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  background: var(--navy);
  color: var(--white);
  padding: 0.85rem 1.35rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  z-index: 500;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s ease;
  max-width: 300px;
  line-height: 1.4;
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }

@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

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

.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
}

.chip-stage { background: rgba(30,53,84,0.1); color: var(--navy-light); }

/* ─── Checkbox style ─────────────────────────────────────────────────────── */
.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.checkbox-field input[type=checkbox] {
  width: 17px;
  height: 17px;
  accent-color: var(--gold);
  cursor: pointer;
}

.checkbox-field label {
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  margin: 0;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

/* ─── Admin mobile navigation ────────────────────────────────────────────── */
/* Below 900px the sidebar leaves the flow and becomes a slide-in drawer. The
   hamburger and backdrop are the only way to reach any section but Dashboard,
   so these rules are load-bearing, not decoration. */
.nav-toggle {
  display: none;
  position: fixed;
  top: 0.7rem;
  left: 0.7rem;
  z-index: 210;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--navy);
  color: var(--gold);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
  align-items: center;
  justify-content: center;
}

.nav-toggle:active { background: var(--navy-light); }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13,27,42,0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 150;
}

/* The drawer scrolls, the page behind it must not. */
body.nav-open { overflow: hidden; }

/* ── Admin seat map ─────────────────────────────────────────────────────────── */
.seatmap { padding: 0 1rem 1.25rem; }

.seatmap-head {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.occ-figure {
  font-family: var(--font-disp);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
  color: var(--navy);
}

.occ-of { font-size: 1rem; color: var(--muted); font-weight: 600; }

.occ-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* Fill mirrors the occupancy figure beside it. */
.occ-bar {
  flex: 0 1 14rem;
  min-width: 7rem;
  height: 6px;
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
}

.occ-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
}

.seat-key {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.key-box {
  width: 0.85rem;
  height: 0.7rem;
  border-radius: 3px;
  border: 1px solid var(--border);
  display: inline-block;
}

.key-box.taken { background: var(--navy); border-color: var(--navy); }
.key-box.free { background: var(--white); }

.key-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--red);
  display: inline-block;
}

/* Plan view — proportions follow the hand-drawn layout. */
.seatmap-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(13rem, 18rem);
  gap: 1rem;
  align-items: start;
}

.floorplan {
  width: 100%;
  max-width: 900px;
  height: auto;
  display: block;
  margin: 0 auto;
  background: linear-gradient(180deg, var(--white), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.floorplan .room {
  fill: var(--white);
  stroke: var(--navy);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.floorplan .desk {
  fill: rgba(13, 27, 42, 0.045);
  stroke: rgba(13, 27, 42, 0.10);
  stroke-width: 1;
}

.floorplan .zone {
  font-size: 10px;
  letter-spacing: 1.6px;
  font-weight: 600;
  fill: var(--muted);
}

.floorplan .gate {
  stroke: var(--gold);
  stroke-width: 6;
  stroke-linecap: round;
}

.floorplan .gate-label {
  font-size: 10px;
  letter-spacing: 2.5px;
  font-weight: 700;
  fill: var(--gold-dark);
}

.floorplan .svg-seat text { font-size: 11px; font-weight: 600; pointer-events: none; }
.floorplan .svg-seat rect { stroke-width: 1; }

.floorplan .svg-seat.free rect { fill: var(--white); stroke: #cfd8e3; }
.floorplan .svg-seat.free text { fill: var(--muted); }

.floorplan .svg-seat.taken rect { fill: var(--navy); stroke: var(--navy); }
.floorplan .svg-seat.taken text { fill: var(--gold-light); }

.floorplan .svg-seat {
  cursor: pointer;
  outline: none;
}

.floorplan .svg-seat:hover rect,
.floorplan .svg-seat:focus-visible rect,
.floorplan .svg-seat.is-selected rect {
  stroke: var(--gold);
  stroke-width: 2.5;
}

.floorplan .svg-seat.is-selected.taken rect {
  fill: var(--navy-light);
}

.seat-detail-panel {
  position: sticky;
  top: 1rem;
  min-height: 13rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.seat-detail-eyebrow {
  font-size: 0.66rem;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--gold-dark);
}

.seat-detail-panel h3 {
  margin: 0.35rem 0 0.35rem;
  font-family: var(--font-disp);
  font-size: 1.25rem;
  color: var(--navy);
  line-height: 1.15;
}

.seat-detail-panel p {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.seat-detail-panel dl {
  margin: 0.85rem 0 0;
  display: grid;
  gap: 0.6rem;
}

.seat-detail-panel dl div {
  min-width: 0;
}

.seat-detail-panel dt {
  font-size: 0.62rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.seat-detail-panel dd {
  margin: 0.12rem 0 0;
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.floorplan .svg-seat .due-dot {
  fill: var(--red);
  stroke: var(--white);
  stroke-width: 1.5;
  pointer-events: none;
}

.seat-dues {
  margin-top: 0.6rem;
  padding: 0.6rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--muted);
}

.seat-dues.is-owed { background: rgba(239,68,68,0.08); }
.seat-dues.is-clear, .seat-dues.is-unknown { padding: 0; }

.seat-dues-amount {
  font-size: 1.35rem;
  font-weight: 800;
  color: #b91c1c;
  line-height: 1.1;
}

.seat-dues-label { margin-top: 0.1rem; }
.seat-dues-months { margin-top: 0.35rem; }

.seat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.7rem;
}

.seat-detail-panel.is-selected {
  border-color: rgba(201, 168, 76, 0.65);
  box-shadow: var(--shadow);
}

/* ── Dues table ─────────────────────────────────────────────────────────────── */
.pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.pill-paid { background: rgba(34,197,94,0.12); color: #15803d; }
.pill-due  { background: rgba(239,68,68,0.10); color: #b91c1c; }

.chip-due {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  margin: 0.1rem 0.1rem 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  color: var(--orange);
}

.muted-cell { color: var(--muted); font-size: 0.78rem; }
.btn-sm { font-size: 0.72rem; padding: 0.3rem 0.6rem; }

.student-tools {
  margin: -0.35rem 0 1rem;
}

.student-tools input {
  width: min(100%, 28rem);
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text);
  font: inherit;
}

.student-tools input:focus {
  outline: 2px solid rgba(201, 168, 76, 0.35);
  outline-offset: 2px;
  border-color: var(--gold);
}

.student-print-sheet,
.registration-print-sheet {
  display: none;
}

.print-sheet-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35in;
  border-bottom: 2px solid #111827;
  padding-bottom: 0.12in;
}

.print-sheet-kicker {
  font-size: 9pt;
  letter-spacing: 1.2pt;
  text-transform: uppercase;
  font-weight: 700;
  color: #4b5563;
}

.print-sheet-head h2 {
  margin: 0.05in 0 0;
  font-size: 18pt;
  line-height: 1.1;
  color: #111827;
}

.print-sheet-meta {
  font-size: 9pt;
  color: #4b5563;
  white-space: nowrap;
}

.print-student-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 9.5pt;
  color: #111827;
}

.print-student-table th,
.print-student-table td {
  border: 1px solid #9ca3af;
  padding: 0.08in 0.1in;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.print-student-table th {
  background: #f3f4f6;
  font-size: 8pt;
  letter-spacing: 0.3pt;
  text-transform: uppercase;
}

.print-student-table th:nth-child(1) { width: 38%; }
.print-student-table th:nth-child(2) { width: 16%; }
.print-student-table th:nth-child(3) { width: 22%; }
.print-student-table th:nth-child(4) { width: 24%; }

.reg-slip {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: 63mm;
  padding: 3.5mm 5mm 3mm;
  border: 1px solid #9ca3af;
  border-radius: 2mm;
  color: #111827;
  break-inside: avoid;
  page-break-inside: avoid;
}

.reg-slip-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4mm;
  padding-bottom: 1.8mm;
  border-bottom: 1.5px solid #111827;
}

.reg-slip-head .print-sheet-kicker {
  display: block;
  font-size: 7pt;
}

.reg-slip-head strong {
  display: block;
  font-size: 12pt;
  line-height: 1.15;
}

.reg-form-no {
  display: flex;
  align-items: flex-end;
  gap: 1.5mm;
  font-size: 8.5pt;
  color: #4b5563;
  white-space: nowrap;
}

.reg-form-no .reg-line {
  flex: none;
  width: 22mm;
}

.reg-grid {
  flex: 1;
  display: grid;
  grid-template-columns: max-content 1fr;
  align-content: space-evenly;
  column-gap: 9mm;
}

.reg-field {
  display: flex;
  align-items: flex-end;
  gap: 2mm;
  min-width: 0;
}

.reg-field-wide {
  grid-column: 1 / -1;
}

.reg-field-sign {
  padding-top: 3mm;
}

.reg-label {
  flex: none;
  min-width: 25mm;
  font-size: 8.5pt;
  font-weight: 600;
  white-space: nowrap;
}

.reg-line {
  flex: 1;
  min-width: 12mm;
  margin-bottom: 0.6mm;
  border-bottom: 1px solid #6b7280;
}

.reg-prefix {
  font-size: 9pt;
  font-weight: 600;
  color: #4b5563;
}

.reg-digits {
  display: inline-flex;
  align-items: center;
  gap: 1.8mm;
}

.reg-digit-group {
  display: inline-flex;
}

.reg-digit {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.8mm;
  height: 6mm;
  border: 1px solid #6b7280;
  font-size: 6pt;
  color: #b6bcc6;
}

.reg-digit + .reg-digit {
  border-left-width: 0;
}

.reg-digit-sep {
  font-size: 11pt;
  color: #6b7280;
}

.reg-cut {
  position: relative;
  height: 6mm;
}

.reg-cut::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px dashed #9ca3af;
}

.reg-cut span {
  position: absolute;
  top: 50%;
  left: 4mm;
  padding: 0 1.5mm;
  transform: translateY(-50%);
  background: #fff;
  font-size: 10pt;
  line-height: 1;
  color: #6b7280;
}

.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;
}

/* ── Revenue ────────────────────────────────────────────────────────────────── */
.expense-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1rem 1rem;
}

.expense-form select,
.expense-form input {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--white);
  color: var(--text);
}

.expense-form select { min-width: 9rem; }
.expense-form input[type="number"] { width: 8rem; }
.expense-form input[type="text"] { flex: 1; min-width: 10rem; }

/* Profit turns red when the month is underwater. */
.value-loss { color: var(--red); }

/* Structural pillar in the middle of the fourth bench — no seat sits there. */
.floorplan .pillar {
  fill: var(--navy);
  fill-opacity: 0.16;
  stroke: var(--navy);
  stroke-opacity: 0.45;
  stroke-width: 1;
}

/* ── Closures (public) ──────────────────────────────────────────────────────── */
.closure-list { display: flex; flex-direction: column; gap: 0.6rem; }

.closure {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Days already gone are dimmed rather than hidden — the year stays readable. */
.closure.past { opacity: 0.45; }

.closure-date {
  flex: 0 0 3.1rem;
  text-align: center;
  border-right: 1px solid var(--border);
  padding-right: 0.85rem;
}

.closure-day {
  display: block;
  font-family: var(--font-disp);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--navy);
}

.closure-month {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.15rem;
}

.closure-body { flex: 1; min-width: 0; }
.closure-name { font-weight: 700; color: var(--text); }
.closure-meta { font-size: 0.8rem; color: var(--muted); margin-top: 0.1rem; }

.closure-tag {
  flex: 0 0 auto;
  font-size: 0.68rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}

/* Statutory closures read as non-negotiable, not as a library decision. */
.closure-tag.mandatory {
  background: rgba(201, 168, 76, 0.14);
  border-color: var(--gold);
  color: var(--gold-dark);
}

@media (max-width: 560px) {
  .closure { flex-wrap: wrap; }
  .closure-tag { margin-left: 4.1rem; }
}

/* Statutory closures are visually distinct from the library's own days off. */
.pill-mandatory { background: rgba(201, 168, 76, 0.16); color: var(--gold-dark); }

/* ═══════════════════════════════════════════════════════════════════════
   Responsive overrides live last: they have to out-rank the component
   rules above them, and equal-specificity ties go to whichever came later.
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .sidebar-backdrop.open { display: block; }

  .sidebar {
    display: flex;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100%;
    width: 15rem;
    z-index: 160;
    transform: translateX(-100%);
    transition: transform var(--transition);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open { transform: translateX(0); }

  /* The toggle stays put as the close button, so the brand clears it. */
  .sidebar-brand { padding-left: 3.7rem; }

  /* Larger rows: the drawer is driven by thumbs, not a cursor. */
  .sidebar-nav li a { padding: 0.85rem 1.25rem; font-size: 0.95rem; }

  /* Top padding clears the fixed hamburger. */
  .admin-main { padding: 3.75rem 1rem 2rem; }
  .admin-header { margin-bottom: 1.25rem; }
  .admin-header-text h1 { font-size: 1.35rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); margin-bottom: 1.25rem; }
  .stat-card { padding: 1rem; }

  /* Tablet band: still real tables, so let the wide ones scroll rather than
     clip their Actions column off the edge. */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .admin-main table { min-width: 640px; }

  .broadcast-card { max-width: 100%; }
  .seatmap-head { gap: 0.75rem; }
  .floorplan { max-width: 100%; }
}

@media (max-width: 720px) {
  .seatmap-layout {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .seat-detail-panel {
    position: static;
    min-height: 0;
  }

  .seat-detail-panel dl {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  nav { padding: 0 1rem; }
  .hero { padding: 5rem 1rem 4rem; }
  .section { padding: 3.5rem 1rem; }
  .section-alt { padding: 3.5rem 1rem; }
  .cta-band { padding: 3.5rem 1rem; }
  .stats-inner { grid-template-columns: repeat(2, 1fr); }
  footer { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
  .features-grid { grid-template-columns: 1fr; }
  .rules-list { grid-template-columns: 1fr; }
  table { font-size: 0.82rem; }
  th, td { padding: 0.6rem 0.75rem; }
}

/* ─── Admin tables → card rows ───────────────────────────────────────────── */
/* On a phone a seven-column table is a sideways scrubbing exercise, and the
   Actions column — the whole reason the admin opens the page — sits furthest
   from the thumb. Below 700px each row becomes its own card and each cell
   states its own heading from data-label, so nothing scrolls off-screen. */
@media (max-width: 700px) {
  .admin-main .table-wrap {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    margin-bottom: 1rem;
  }

  /* A panel that only wraps a table would box in the row cards it now
     contains, so it gives up its own chrome. Panels holding a form keep it. */
  .admin-main .card:has(> .table-wrap) {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }

  .admin-main table {
    min-width: 0;
    width: 100%;
    font-size: 0.9rem;
    border-collapse: separate;
    border-spacing: 0;
  }

  .admin-main thead { display: none; }
  .admin-main tbody,
  .admin-main tr,
  .admin-main td { display: block; }

  /* Two meta columns keep a card about five lines tall, so a 61-student list
     stays scannable instead of becoming a mile of label/value pairs. */
  .admin-main tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.7rem;
  }

  .admin-main tbody tr:last-child { margin-bottom: 0; }

  .admin-main tbody td {
    display: block;
    padding: 0.4rem 0;
    border: 0;
    text-align: left;
    line-height: 1.35;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .admin-main tbody td[data-label]:not([data-label=""])::before {
    content: attr(data-label);
    display: block;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.1rem;
  }

  /* The first column identifies the row on every table, so it heads the card. */
  .admin-main tbody td:first-child {
    grid-column: 1 / -1;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--navy);
    padding: 0 0 0.5rem;
    margin-bottom: 0.3rem;
    border-bottom: 1px solid var(--border);
  }

  /* Matches the data-label rule's specificity so the title keeps no heading. */
  .admin-main tbody td:first-child[data-label]::before { content: none; }
  .admin-main tbody td:first-child .muted-cell { font-weight: 500; font-size: 0.8rem; }

  /* Action cells have no heading — the buttons take the width instead. */
  .admin-main tbody td[data-label=""] {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.7rem;
  }

  .admin-main tbody td[data-label=""]:empty { display: none; }

  .admin-main tbody td[data-label=""] .btn {
    flex: 1 1 auto;
    min-height: 42px;
    min-width: 7rem;
  }

  /* Loading / empty / error rows stay one centred message. */
  .admin-main tbody td[colspan] {
    grid-column: 1 / -1;
    text-align: center;
    padding: 1.25rem 0;
    border-bottom: 0;
    font-weight: 400;
    font-size: 0.88rem;
    color: var(--muted);
  }

  .admin-main tbody td[colspan]::before { content: none; }

  /* Month stepper stays reachable while a long month scrolls past. */
  .admin-main .month-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    width: 100%;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
  }

  .month-nav button { width: 42px; height: 42px; }
  .month-nav strong { font-size: 0.86rem; min-width: 0; }

  /* 16px floor keeps iOS Safari from zooming the viewport on focus. */
  .admin-main input,
  .admin-main select,
  .modal input,
  .modal select,
  .student-tools input {
    font-size: 16px;
  }

  .admin-main .btn { min-height: 42px; }
  .admin-main .btn-sm { min-height: 36px; padding: 0.4rem 0.75rem; }

  /* The two mode buttons are a choice, so they stack at equal width. */
  #mode-card .btn { width: 100%; }

  /* Stays 2-up: full-width stat cards would push the table a screen down. */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; margin-bottom: 1rem; }
  .stat-card { padding: 0.8rem 0.85rem; border-top-width: 2px; }
  .stat-card .label { font-size: 0.63rem; }
  .stat-card .value { font-size: 1.5rem; }
  .stat-card .hint { font-size: 0.68rem; }

  .admin-header { flex-direction: column; align-items: stretch; }
  .admin-header > .btn { width: 100%; }
  .dash-tip { font-size: 0.84rem; padding: 1.1rem; }
  .card-head { padding-left: 1rem; padding-right: 1rem; }

  .expense-form { flex-direction: column; align-items: stretch; }
  .expense-form select,
  .expense-form input,
  .expense-form input[type="number"],
  .expense-form input[type="text"] {
    width: 100%;
    min-width: 0;
    padding: 0.65rem 0.75rem;
  }

  /* Modal goes near full-bleed and its footer buttons stack. */
  .modal-overlay { padding: 0.5rem; align-items: flex-end; }
  .modal { max-width: 100%; max-height: 94vh; border-radius: 14px; }
  .modal-top { padding: 1rem 1.1rem; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-actions { flex-direction: column-reverse; gap: 0.6rem; }
  .modal-actions .btn { width: 100%; }
  .checkbox-field { margin-top: 0.25rem !important; }

  .seatmap { padding: 0 0.5rem 1rem; }
  .seat-key { margin-left: 0; }
}

@page {
  size: A4;
  margin: 12mm;
}

@media print {
  body.printing-students {
    background: #fff;
  }

  body.printing-students * {
    visibility: hidden;
    box-shadow: none !important;
  }

  body.printing-students .print-hide {
    display: none !important;
  }

  body.printing-students .student-print-sheet {
    display: block;
    visibility: visible;
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    background: #fff;
    color: #111827;
  }

  body.printing-students .student-print-sheet * {
    visibility: visible;
  }

  body.printing-students .admin-layout,
  body.printing-students .admin-main,
  body.printing-students #sec-students {
    display: block;
    min-height: 0;
    padding: 0;
    background: #fff;
  }

  body.printing-students .print-student-table {
    display: table;
    page-break-inside: auto;
  }

  body.printing-students .print-student-table thead {
    display: table-header-group;
  }

  body.printing-students .print-student-table tbody {
    display: table-row-group;
  }

  body.printing-students .print-student-table tr {
    display: table-row;
    page-break-inside: avoid;
    page-break-after: auto;
  }

  body.printing-students .print-student-table th,
  body.printing-students .print-student-table td {
    display: table-cell;
  }

  body.printing-registration {
    background: #fff;
  }

  body.printing-registration > :not(#dashboard-section),
  body.printing-registration .nav-toggle,
  body.printing-registration .sidebar-backdrop,
  body.printing-registration .sidebar,
  body.printing-registration .admin-main > :not(#sec-students),
  body.printing-registration #sec-students > :not(#registration-print-sheet) {
    display: none !important;
  }

  body.printing-registration .admin-layout,
  body.printing-registration .admin-main,
  body.printing-registration #sec-students {
    display: block;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
    background: #fff;
  }

  body.printing-registration .registration-print-sheet {
    display: block;
  }
}
