:root {
  --navy: #00325a;
  --grey: #bfccd6;
  --red: #cd3b3b;
  --white: #ffffff;
  --black: #000000;
  --pale-blue: #d7e8f6;
  --deep-blue: #00213d;

  --ink: var(--navy);
  --muted: #52697a;
  --line: #d8e2ea;
  --paper: var(--white);
  --wash: #f4f7fa;
  --accent: var(--navy);
  --shadow: 0 22px 54px rgba(0, 50, 90, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

button,
input,
select {
  font: inherit;
}

input {
  min-height: 42px;
  padding: 0 12px;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 14px clamp(18px, 5vw, 64px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 50, 90, 0.12);
}

.brand-mark img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 24px);
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
}

.desktop-nav a {
  padding: 10px 0;
}

.ghost-button,
.primary-button,
.secondary-button,
.compact-button,
.icon-button,
.compact-link,
.role-button {
  border: 0;
  cursor: pointer;
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.ghost-button,
.secondary-button,
.compact-button,
.compact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  color: white;
  background: var(--navy);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.secondary-button {
  color: var(--navy);
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--navy);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

button:hover,
a.primary-button:hover,
a.secondary-button:hover,
.compact-link:hover {
  transform: translateY(-1px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(42px, 7vw, 96px) clamp(18px, 5vw, 64px) 34px;
  background:
    linear-gradient(110deg, rgba(0, 50, 90, 0.08), rgba(205, 59, 59, 0.06)),
    var(--paper);
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  align-self: center;
  max-width: 760px;
}

.section-label {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 20px;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 22px;
}

.hero-copy p:not(.section-label) {
  max-width: 630px;
  color: #314d62;
  font-size: 18px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.scoreboard-panel {
  overflow: hidden;
  align-self: stretch;
  min-height: 440px;
  background: var(--navy);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.eagles-badge {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px;
  color: white;
  background: linear-gradient(135deg, var(--navy), var(--deep-blue));
}

.eagles-badge img {
  width: 82px;
  height: 82px;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.22));
}

.eagles-badge span,
.eagles-badge strong {
  display: block;
}

.eagles-badge span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.eagles-badge strong {
  font-size: 28px;
  line-height: 1;
}

.photo-strip {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  height: 228px;
}

.photo-strip img,
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.status-grid article {
  padding: 22px;
  color: white;
  background: var(--navy);
}

.status-grid span {
  display: block;
  min-height: 38px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 800;
}

.status-grid strong {
  font-size: 34px;
}

.workspace-band {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  padding: 28px clamp(18px, 5vw, 64px);
}

.role-panel,
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 50, 90, 0.08);
}

.role-panel {
  position: sticky;
  top: 100px;
  align-self: start;
  padding: 20px;
}

.role-buttons {
  display: grid;
  gap: 8px;
}

.role-button {
  min-height: 42px;
  padding: 0 12px;
  color: var(--navy);
  text-align: left;
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.role-button.active {
  color: white;
  background: var(--navy);
  border-color: var(--black);
}

.permission-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 700;
}

.workspace-main {
  display: grid;
  gap: 22px;
}

.panel {
  padding: clamp(18px, 3vw, 28px);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.student-claim-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
  gap: 16px;
  align-items: stretch;
}

.student-lookup,
.claim-result,
.student-profile-editor {
  padding: 16px;
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.student-lookup {
  display: grid;
  gap: 12px;
}

.student-lookup label,
.student-profile-editor label,
.student-profile-editor legend {
  display: grid;
  gap: 8px;
  color: var(--navy);
  font-weight: 800;
}

.claim-result {
  display: grid;
  gap: 10px;
  align-content: start;
}

.claim-result strong {
  font-size: 20px;
}

.claim-result p {
  margin-bottom: 0;
  color: #314d62;
  line-height: 1.45;
}

.student-profile-editor {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.student-profile-editor > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.student-profile-editor fieldset {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  border: 0;
}

.student-profile-editor label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.student-profile-editor input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}

th,
td {
  padding: 16px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td {
  font-weight: 700;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.status-chip.good {
  color: var(--navy);
  background: var(--pale-blue);
}

.status-chip.warn,
.status-chip.gold {
  color: #00325a;
  background: #f2d36b;
}

.status-chip.bad {
  color: #8f2118;
  background: #f9d8d3;
}

.two-column,
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 22px;
}

.select {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  font-weight: 800;
}

.roster-list {
  display: grid;
  gap: 10px;
}

.roster-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.roster-row strong,
.roster-row small {
  display: block;
}

.roster-row small {
  color: var(--muted);
  font-weight: 700;
}

.toggle-team {
  min-width: 96px;
  min-height: 34px;
  color: var(--navy);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
}

.toggle-team.made {
  color: white;
  background: var(--navy);
  border-color: var(--black);
}

.fundraiser-card {
  padding: 20px;
  background: linear-gradient(135deg, var(--deep-blue), var(--navy));
  border: 1px solid var(--line);
  border-radius: 8px;
  color: white;
}

.fundraiser-card p {
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.5;
}

.content-grid {
  padding: 0 clamp(18px, 5vw, 64px) 28px;
}

.schedule-list {
  display: grid;
  gap: 10px;
}

.schedule-list div {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.schedule-list strong {
  color: var(--red);
  font-size: 20px;
}

.schedule-list em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.qr-layout {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 18px;
  align-items: center;
}

.qr-code {
  width: 132px;
  aspect-ratio: 1;
  border: 10px solid white;
  border-radius: 8px;
  background:
    linear-gradient(90deg, var(--ink) 12px, transparent 12px) 0 0 / 24px 24px,
    linear-gradient(var(--ink) 12px, transparent 12px) 0 0 / 24px 24px,
    var(--red);
  box-shadow: inset 0 0 0 1px var(--line), 0 8px 24px rgba(0, 50, 90, 0.12);
}

.stat-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-board div {
  padding: 18px;
  background: var(--navy);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: white;
}

.stat-board span,
.stat-board small {
  display: block;
  color: rgba(255, 255, 255, 0.68);
  font-weight: 800;
}

.stat-board strong {
  display: block;
  margin: 8px 0;
  font-size: 34px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.gallery img {
  aspect-ratio: 1.15;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.brain-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(440px, 100vw);
  height: 100vh;
  padding: 20px;
  background: white;
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 50px rgba(0, 50, 90, 0.16);
  transform: translateX(105%);
  transition: transform 220ms ease;
}

.brain-drawer.open {
  transform: translateX(0);
}

.brain-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.brain-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  padding: 18px 0;
}

.brain-message {
  max-width: 88%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.45;
}

.brain-message.assistant {
  align-self: flex-start;
  background: #f7fafc;
}

.brain-message.user {
  align-self: flex-end;
  color: white;
  background: var(--navy);
}

.brain-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.brain-form input {
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1020px) {
  .desktop-nav {
    display: none;
  }

  .hero-grid,
  .workspace-band,
  .two-column,
  .content-grid,
  .student-claim-grid {
    grid-template-columns: 1fr;
  }

  .role-panel {
    position: static;
  }

  .role-buttons {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 680px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-grid {
    padding-top: 34px;
  }

  .scoreboard-panel {
    min-height: auto;
  }

  .photo-strip,
  .status-grid,
  .stat-board,
  .gallery,
  .role-buttons,
  .qr-layout,
  .student-profile-editor > div,
  .student-profile-editor fieldset {
    grid-template-columns: 1fr;
  }

  .photo-strip {
    height: 340px;
  }

  .panel-heading,
  .schedule-list div,
  .roster-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .panel-heading {
    display: grid;
  }
}
