:root {
  --primary: #003eb1;
  --primary-dark: #002875;
  --primary-soft: #eaf1ff;
  --secondary: #fedf02;
  --ink: #0b1739;
  --muted: #667085;
  --line: #dce2ee;
  --surface: #ffffff;
  --background: #f4f7fc;
  --danger: #b42318;
  --success: #087a4b;
  --shadow: 0 20px 60px rgba(0, 35, 104, 0.12);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button, input, select { font: inherit; }
button:disabled { cursor: wait; opacity: .68; }
a { color: inherit; }

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

.print-only { display: none; }

.hero {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  color: white;
  background: var(--primary);
}

.hero::before {
  content: "";
  position: absolute;
  width: 460px;
  height: 460px;
  right: 8%;
  top: -205px;
  border: 72px solid rgba(254, 223, 2, .98);
  border-radius: 50%;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 9px;
  background: var(--secondary);
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: min(1140px, calc(100% - 40px));
  margin: 0 auto;
  padding: 58px 0 88px;
  display: flex;
  align-items: flex-start;
  gap: 28px;
}

.hero-brand-block { width: min(720px, 100%); }
.hero-logo-panel {
  width: 100%;
  padding: clamp(14px, 2.4vw, 24px);
  background: rgba(255, 255, 255, .98);
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 22px;
  box-shadow: 0 22px 55px rgba(0, 25, 78, .22);
}
.hero-logo { display: block; width: 100%; height: auto; }

.hero h1 {
  margin: 3px 0 12px;
  font-size: clamp(3.3rem, 7vw, 6rem);
  line-height: .82;
  letter-spacing: -.07em;
  text-transform: uppercase;
}

.hero-copy { max-width: 360px; margin: 18px 0 0; font-size: 1.15rem; opacity: .84; }
.eyebrow { margin: 0 0 8px; font-size: .75rem; font-weight: 850; letter-spacing: .17em; text-transform: uppercase; color: var(--primary); }
.hero .eyebrow { color: var(--secondary); }

.event-mark {
  display: inline-flex;
  align-items: flex-start;
  gap: 2px;
  color: var(--primary);
  font-weight: 950;
  line-height: .75;
}
.event-mark span { font-size: 5.3rem; letter-spacing: -.1em; }
.event-mark small { padding-top: 7px; font-size: .95rem; letter-spacing: .05em; }
.event-mark-light { color: var(--secondary); }

.hero-track { position: absolute; z-index: 1; inset: 0 0 0 52%; opacity: .2; transform: skewX(-12deg); }
.hero-track i { position: absolute; width: 520px; height: 150%; top: -25%; border: 2px solid white; border-radius: 50%; }
.hero-track i:nth-child(2) { margin-left: 74px; }
.hero-track i:nth-child(3) { margin-left: 148px; }

.public-shell {
  position: relative;
  z-index: 3;
  width: min(1140px, calc(100% - 40px));
  margin: -60px auto 54px;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr);
  gap: 24px;
  align-items: start;
}

.card, .categories-card, .installer-card, .admin-card {
  background: var(--surface);
  border: 1px solid rgba(0, 62, 177, .08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.registration-card, .success-card { padding: clamp(24px, 4vw, 46px); }
.section-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 28px; }
h1, h2, h3 { letter-spacing: -.035em; }
.section-heading h2, .categories-card h2, .success-card h2 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.1; }
.step-pill { flex: none; padding: 7px 11px; border-radius: 999px; color: var(--primary); background: var(--primary-soft); font-size: .75rem; font-weight: 800; }

.stack-form { display: grid; gap: 20px; }
.stack-form fieldset { min-width: 0; margin: 0; padding: 20px; border: 1px solid var(--line); border-radius: 16px; }
.stack-form legend { padding: 0 8px; font-weight: 850; }
.stack-form label { display: grid; gap: 7px; font-size: .9rem; font-weight: 750; color: var(--ink); }
.stack-form label small { color: var(--muted); font-size: .76rem; font-weight: 500; }
.form-grid { display: grid; gap: 16px; }
.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }

input, select {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  color: var(--ink);
  background: white;
  border: 1.5px solid #c9d2e3;
  border-radius: 10px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(0, 62, 177, .12); }
input.field-invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(180, 35, 24, .1); }
input.field-valid { border-color: var(--success); }

.category-fieldset { background: #f9fbff; }
.category-options { display: grid; gap: 10px; }
.category-option {
  position: relative;
  display: grid !important;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 12px !important;
  padding: 14px 16px;
  background: white;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}
.category-option:hover { border-color: #8ba8dc; }
.category-option:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 62, 177, .09); }
.category-option input { position: absolute; opacity: 0; pointer-events: none; }
.category-radio { width: 20px; height: 20px; border: 2px solid #a7b3c8; border-radius: 50%; }
.category-option input:checked + .category-radio { border: 6px solid var(--primary); }
.category-info { display: grid; gap: 1px; }
.category-info small { color: var(--muted); font-weight: 500; }
.category-option b { padding: 7px 10px; color: var(--primary-dark); background: var(--secondary); border-radius: 8px; font-size: .85rem; }
.empty-state { padding: 22px; color: var(--muted); text-align: center; border: 1px dashed #b8c3d7; border-radius: 10px; }
.loading { animation: pulse 1.1s infinite alternate; }
.error-state { color: var(--danger); }
@keyframes pulse { to { opacity: .55; } }

.check-row { display: grid !important; grid-template-columns: 20px 1fr; align-items: start; gap: 10px !important; color: var(--muted) !important; font-weight: 500 !important; }
.check-row input { width: 18px; min-height: 18px; margin: 2px 0 0; accent-color: var(--primary); }

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 10px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.button:hover { transform: translateY(-1px); }
.button-primary { color: white; background: var(--primary); box-shadow: 0 8px 20px rgba(0, 62, 177, .2); }
.button-primary:hover { background: var(--primary-dark); }
.button-secondary { color: var(--primary-dark); background: var(--secondary); }
.button-ghost { color: var(--primary); background: var(--primary-soft); }
.button-danger { color: #fff; background: var(--danger); }
.button-large { min-height: 54px; font-size: 1rem; }

.categories-card { padding: 30px; }
.distance-grid { display: grid; gap: 10px; margin-top: 22px; }
.distance-grid article { display: grid; grid-template-columns: 68px 1fr; column-gap: 12px; padding: 15px 0; border-top: 1px solid var(--line); }
.distance-grid strong { grid-row: span 2; align-self: center; color: var(--primary); font-size: 1.25rem; letter-spacing: -.03em; }
.distance-grid span { font-weight: 800; }
.distance-grid small { color: var(--muted); }
.distance-grid .distance-featured { margin-top: 4px; padding: 16px; color: white; background: var(--primary); border: 0; border-radius: 13px; }
.distance-grid .distance-featured strong { color: var(--secondary); }
.distance-grid .distance-featured small { color: rgba(255,255,255,.72); }

.success-card { grid-column: 1; text-align: center; }
.success-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 20px; color: var(--primary-dark); background: var(--secondary); border-radius: 50%; font-size: 2rem; font-weight: 950; }
.success-card .eyebrow { margin-top: 8px; }
.confirmation-category { margin: 20px auto; padding: 16px; max-width: 440px; color: var(--primary-dark); background: var(--primary-soft); border-radius: 12px; font-weight: 850; }
.folio { color: var(--muted); }
.success-card .button { margin-top: 8px; }

.flash { width: min(1140px, calc(100% - 40px)); margin: 16px auto; padding: 13px 16px; border-radius: 10px; font-size: .9rem; }
.flash-error { color: #7a271a; background: #fef3f2; border: 1px solid #fecdca; }
.flash-success { color: #05603a; background: #ecfdf3; border: 1px solid #abefc6; }
.flash ul { margin: 8px 0 0; padding-left: 20px; }

.public-footer { width: min(1140px, calc(100% - 40px)); margin: 0 auto; padding: 0 0 36px; display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; }
.public-footer a { color: var(--primary); text-decoration: none; font-weight: 750; }

/* Installer */
.installer-body { min-height: 100vh; background: linear-gradient(135deg, var(--primary) 0 32%, var(--background) 32%); }
.installer-shell { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 48px 0; }
.installer-card { padding: clamp(24px, 5vw, 48px); }
.installer-card h1 { margin: 4px 0 12px; font-size: clamp(2rem, 4vw, 3rem); line-height: 1; }
.installer-card .intro { margin-bottom: 28px; color: var(--muted); }
.installer-card fieldset { display: grid; gap: 16px; }
.success-panel { padding: 28px 0 6px; text-align: center; }
.success-panel h2 { margin-bottom: 8px; }
.success-panel p { color: var(--muted); }
.success-panel .button { margin-top: 10px; }

/* Admin */
.admin-body { background: #f5f7fb; }
.admin-header { min-height: 72px; padding: 14px max(24px, calc((100vw - 1240px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 24px; color: white; background: var(--primary-dark); }
.admin-brand { display: flex; align-items: center; padding: 5px 9px; background: white; border-radius: 10px; text-decoration: none; }
.admin-brand img { display: block; width: auto; height: 36px; }
.admin-header nav { display: flex; align-items: center; gap: 18px; }
.admin-header nav a { color: rgba(255,255,255,.78); text-decoration: none; font-size: .88rem; font-weight: 700; }
.admin-header nav a:hover { color: white; }
.admin-main { width: min(1240px, calc(100% - 40px)); margin: 34px auto 60px; }
.admin-main > .flash { width: 100%; margin: 0 0 18px; }
.admin-titlebar { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; }
.admin-titlebar h1 { margin: 0; font-size: clamp(2rem, 4vw, 3rem); }
.admin-titlebar p { margin: 4px 0 0; color: var(--muted); }
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { padding: 20px; background: white; border: 1px solid var(--line); border-radius: 14px; }
.stat-card small { display: block; color: var(--muted); font-weight: 700; }
.stat-card strong { display: block; margin-top: 4px; color: var(--primary); font-size: 2rem; line-height: 1; }
.stat-delivered { border-color: #a9dfc6; }
.stat-delivered strong { color: var(--success); }
.stat-pending { border-color: #f5c9c5; }
.stat-pending strong { color: var(--danger); }
.admin-card { padding: 22px; box-shadow: 0 10px 35px rgba(0, 35, 104, .07); }
.ajax-feedback .flash { width: 100%; margin: 0 0 16px; }
.filters { display: grid; grid-template-columns: 1.8fr 1.1fr 1.1fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 20px; }
.filters label { display: grid; gap: 6px; color: var(--muted); font-size: .78rem; font-weight: 750; }
.filters.is-searching { opacity: .72; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: #45516b; background: #f7f9fc; font-size: .73rem; letter-spacing: .05em; text-transform: uppercase; }
td { font-size: .88rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcff; }
.table-name { white-space: normal; min-width: 190px; font-weight: 750; }
.table-actions { display: flex; gap: 6px; }
.icon-link { display: inline-flex; padding: 6px 9px; color: var(--primary); background: var(--primary-soft); border: 0; border-radius: 7px; font-size: .78rem; font-weight: 750; text-decoration: none; cursor: pointer; }
.icon-link.danger { color: var(--danger); background: #fef3f2; }
.bib-cell { min-width: 190px; }
.bib-form { display: grid; grid-template-columns: minmax(78px, 96px) auto; align-items: center; gap: 6px; }
.bib-form input[type="text"] { min-height: 36px; padding: 6px 9px; font-weight: 850; }
.bib-form .icon-link { min-height: 36px; align-items: center; justify-content: center; }
.bib-status { grid-column: 1 / -1; color: var(--success); font-size: .68rem; font-weight: 700; }
.bib-status.pending { color: var(--muted); }
.empty-table { padding: 36px !important; color: var(--muted); text-align: center; }
.runner-results { margin: 12px 2px 0; color: var(--muted); font-size: .78rem; }
#runner-table-body[aria-busy="true"] { opacity: .55; }
.badge { display: inline-flex; padding: 5px 8px; border-radius: 999px; color: var(--primary); background: var(--primary-soft); font-size: .74rem; font-weight: 800; }
.admin-form { max-width: 760px; }
.form-actions { display: flex; gap: 10px; }

/* Inscripción desde la nómina escolar */
.roster-titlebar { align-items: center; }
.roster-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.roster-courses-section, .roster-students-section { margin-top: 20px; }
.roster-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.roster-section-heading h2 { margin: 0; font-size: clamp(1.4rem, 3vw, 2rem); }
.roster-section-heading > p, .roster-section-heading div > p:last-child { margin: 4px 0 0; color: var(--muted); }
.course-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.course-roster-card { position: relative; display: grid; gap: 4px; min-height: 132px; padding: 17px; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 14px; text-decoration: none; transition: transform .15s, border-color .15s, box-shadow .15s; }
.course-roster-card:hover { transform: translateY(-2px); border-color: #8da9da; box-shadow: 0 10px 25px rgba(0, 62, 177, .09); }
.course-roster-card.is-active { color: white; background: var(--primary); border-color: var(--primary); box-shadow: 0 10px 26px rgba(0, 62, 177, .25); }
.course-roster-card.is-complete:not(.is-active) { border-color: #83d3af; background: #f3fff9; }
.course-roster-name { font-size: 1rem; font-weight: 900; }
.course-roster-teacher { color: var(--muted); font-size: .74rem; }
.course-roster-card.is-active .course-roster-teacher { color: rgba(255,255,255,.75); }
.course-roster-progress { align-self: end; color: var(--primary); font-size: .78rem; font-weight: 700; }
.course-roster-card.is-active .course-roster-progress { color: var(--secondary); }
.course-roster-progress strong { font-size: 1.05rem; }
.roster-empty-selection { margin-top: 20px; padding: 48px 24px; text-align: center; }
.roster-empty-selection > span { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 12px; color: var(--primary); background: var(--primary-soft); border-radius: 50%; font-size: 1.4rem; font-weight: 900; }
.roster-empty-selection h2, .roster-load-error h1 { margin: 0 0 6px; }
.roster-empty-selection p, .roster-load-error p:last-child { margin: 0; color: var(--muted); }
.roster-student-heading { align-items: end; }
.roster-search { display: grid; gap: 5px; width: min(340px, 100%); color: var(--muted); font-size: .76rem; font-weight: 800; }
.roster-search input { min-height: 44px; }
.roster-filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.roster-filter { padding: 8px 12px; color: #506078; background: #f3f6fb; border: 0; border-radius: 999px; font-size: .78rem; font-weight: 850; cursor: pointer; }
.roster-filter span { display: inline-grid; min-width: 22px; height: 22px; margin-left: 4px; place-items: center; color: var(--primary); background: white; border-radius: 999px; }
.roster-filter.is-active { color: white; background: var(--primary); }
.roster-filter.is-active span { color: var(--primary-dark); background: var(--secondary); }
.student-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(285px, 1fr)); gap: 14px; align-items: stretch; }
.student-roster-card { display: flex; flex-direction: column; min-width: 0; padding: 18px; border: 1.5px solid var(--line); border-radius: 15px; background: #fff; }
.student-roster-card[hidden] { display: none; }
.student-roster-card.is-registered { border-color: #a5dfc4; background: #f6fffa; }
.student-roster-card.has-issue:not(.is-registered) { border-color: #f1c980; }
.student-roster-card header { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.student-list-number { color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.student-status { display: inline-flex; padding: 5px 8px; color: var(--primary); background: var(--primary-soft); border-radius: 999px; font-size: .68rem; font-weight: 850; }
.student-status.is-registered { color: #05603a; background: #dff8eb; }
.student-status.is-warning { color: #8a4b00; background: #fff1cf; }
.student-roster-card h3 { margin: 15px 0 12px; font-size: 1.06rem; line-height: 1.22; }
.student-data { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 16px; }
.student-data div { min-width: 0; }
.student-data dt { color: var(--muted); font-size: .66rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.student-data dd { margin: 2px 0 0; font-size: .82rem; font-weight: 750; }
.student-warning, .student-blocked { margin: 0 0 14px; padding: 10px 11px; color: #7a4600; background: #fff8e6; border-radius: 9px; font-size: .72rem; }
.student-blocked { margin-top: auto; }
.registered-category { display: grid; gap: 3px; margin-top: auto; padding: 12px; color: #05603a; background: #e8f9f0; border-radius: 10px; }
.registered-category small, .registered-category span { font-size: .68rem; }
.registered-category span { color: #467160; }
.registered-category strong { font-size: .8rem; line-height: 1.25; }
.student-register-form { display: grid; gap: 10px; margin-top: auto; }
.student-register-form label { display: grid; gap: 5px; color: var(--muted); font-size: .72rem; font-weight: 800; }
.student-register-form select { min-height: 43px; font-size: .8rem; }
.student-register-form .button { width: 100%; }
.roster-no-results { padding: 42px; color: var(--muted); text-align: center; border: 1px dashed #b7c3d5; border-radius: 12px; }
.roster-load-error { max-width: 720px; margin: 90px auto; padding: 38px; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--primary); }
.login-card { width: min(430px, 100%); padding: 38px; background: white; border-radius: 20px; box-shadow: var(--shadow); }
.login-card h1 { margin: 6px 0 8px; }
.login-card > p { margin: 0 0 24px; color: var(--muted); }
.login-card .flash { width: 100%; margin: 0 0 18px; }
.login-logo { display: block; width: min(100%, 330px); height: auto; margin: 0 auto 24px; }

.installer-logo { display: block; width: min(100%, 440px); height: auto; margin: 0 0 26px; }

.report-sheet { padding: 34px; background: white; border-radius: 16px; }
.report-header { display: flex; justify-content: space-between; gap: 20px; align-items: start; padding-bottom: 18px; border-bottom: 3px solid var(--primary); }
.report-header h1 { margin: 0; font-size: 1.8rem; }
.report-header p { margin: 4px 0 0; color: var(--muted); }
.report-date { text-align: right; font-size: .82rem; }
.report-logo { display: block; width: min(330px, 55vw); height: auto; }
.report-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 20px; }
.report-section-heading { margin: 34px 0 12px; padding-bottom: 12px; display: flex; align-items: end; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.report-section-heading h2 { margin: 0; color: var(--primary-dark); }
.report-section-heading p { max-width: 480px; margin: 0; color: var(--muted); font-size: .86rem; text-align: right; }
.report-group { margin-top: 28px; break-inside: avoid; }
.report-state { padding: 8px 12px; color: white; background: var(--success); font-size: .72rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.report-state.is-pending { color: var(--primary-dark); background: var(--secondary); }
.report-group h2 { margin: 0; padding: 10px 14px; color: white; background: var(--primary); font-size: 1rem; letter-spacing: .01em; }
.report-group h2 span { color: var(--secondary); }
.report-table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-top: 0; }
.report-group table { min-width: 780px; }
.report-group td:first-child, .report-group th:first-child { width: 44px; text-align: center; }
.runner-number-cell { min-width: 100px; text-align: center; }
.bib-number-badge { display: inline-flex; min-width: 48px; justify-content: center; padding: 4px 8px; color: white; background: var(--success); border-radius: 7px; font-size: .95rem; }
.manual-number-line { display: block; width: 70px; height: 22px; margin: 0 auto; border-bottom: 1.5px solid #667085; }
.report-empty { padding: 48px; color: var(--muted); text-align: center; }

@media (max-width: 820px) {
  .hero { min-height: 350px; }
  .hero::before { right: -180px; }
  .hero-inner { padding-top: 42px; }
  .hero .event-mark { display: none; }
  .hero-copy { max-width: 260px; }
  .hero-brand-block { width: min(560px, 100%); }
  .public-shell { grid-template-columns: 1fr; }
  .success-card { grid-column: auto; }
  .two-cols { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .search-filter { grid-column: 1 / -1; }
  .admin-header { align-items: flex-start; }
  .admin-header nav { flex-wrap: wrap; justify-content: flex-end; }
  .report-section-heading { display: block; }
  .report-section-heading p { margin-top: 5px; text-align: left; }
  .roster-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .roster-section-heading { align-items: flex-start; }
}

@media (max-width: 560px) {
  .hero { min-height: 320px; }
  .hero-inner, .public-shell, .public-footer, .admin-main { width: min(100% - 24px, 1140px); }
  .hero h1 { font-size: 3.4rem; }
  .hero-logo-panel { border-radius: 15px; }
  .public-shell { margin-top: -42px; }
  .registration-card, .categories-card { padding: 22px; }
  .section-heading { display: block; }
  .step-pill { display: inline-block; margin-top: 12px; }
  .category-option { grid-template-columns: 22px 1fr; }
  .category-option b { grid-column: 2; justify-self: start; }
  .public-footer { gap: 14px; flex-direction: column; }
  .admin-header { display: block; padding: 16px; }
  .admin-header nav { margin-top: 14px; justify-content: flex-start; gap: 12px; }
  .admin-titlebar { display: block; }
  .admin-actions { margin-top: 16px; }
  .filters { grid-template-columns: 1fr; }
  .filters .search-filter { grid-column: auto; }
  .form-actions { flex-direction: column; }
  .roster-summary { grid-template-columns: 1fr; }
  .roster-section-heading, .roster-student-heading { display: grid; align-items: stretch; }
  .roster-search { width: 100%; }
  .course-card-grid, .student-card-grid { grid-template-columns: 1fr; }
  .course-roster-card { min-height: 112px; }
  .roster-courses-section, .roster-students-section { padding: 16px; }
  .roster-filter-bar { display: grid; grid-template-columns: 1fr 1fr; }
  .roster-filter { border-radius: 10px; }
}

@media print {
  @page { size: A4 portrait; margin: 13mm; }
  body { background: white; color: black; font-size: 10pt; }
  .admin-header, .admin-titlebar, .report-header, .no-print, .flash { display: none !important; }
  .admin-main { width: 100%; margin: 0; }
  .report-sheet { padding: 0; }
  .report-group { margin: 0; break-inside: auto; page-break-inside: auto; }
  .report-page-break { break-before: page; page-break-before: always; }
  .category-print-brand { display: flex !important; align-items: center; justify-content: space-between; gap: 18px; padding: 0 0 10mm; }
  .category-print-brand img { display: block; width: 82mm; height: auto; }
  .category-print-brand div { display: grid; gap: 2px; text-align: right; }
  .category-print-brand strong { color: #003eb1; font-size: 10pt; }
  .category-print-brand small { color: #667085; font-size: 8pt; }
  .report-empty.print-only { display: block !important; }
  .report-group h2 { color: white !important; background: #003eb1 !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .report-state { color: white !important; background: #087a4b !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .report-state.is-pending { color: #002875 !important; background: #fedf02 !important; }
  .bib-number-badge { color: white !important; background: #087a4b !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .report-group thead { display: table-header-group; }
  .report-group tr { break-inside: avoid; page-break-inside: avoid; }
  .report-table-wrap { overflow: visible; border: 0; }
  .report-group table { min-width: 0; border: 1px solid #dce2ee; }
  th, td { padding: 6px 8px; }
}

