:root {
  color-scheme: light;
  font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
  color: #202124;
  background: #eef7f5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
}

a { color: inherit; }

.shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 24px;
  align-items: center;
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid #cbded9;
  background: linear-gradient(135deg, #ffffff 0%, #eef8fb 55%, #e8f7ed 100%);
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #007f80;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.15;
}

h1 { font-size: clamp(2rem, 4vw, 4rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.05rem; }

.hero-copy {
  max-width: 720px;
  margin: 12px 0 0;
  color: #52625e;
}

.hero-logo {
  width: 132px;
  max-width: 22vw;
  object-fit: contain;
}

.hero-actions,
.toolbar,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.panel {
  border: 1px solid #cbded9;
  background: #fff;
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.split {
  justify-content: space-between;
}

.form-grid,
.stack-form,
.public-form {
  display: grid;
  gap: 14px;
}

.form-grid {
  grid-template-columns: 1fr 1fr;
}

.span-2 { grid-column: 1 / -1; }

label,
fieldset {
  display: grid;
  gap: 7px;
  margin: 0;
  border: 0;
  padding: 0;
}

label span,
legend {
  font-weight: 750;
}

.form-help {
  margin: 0;
  padding: 10px 12px;
  border-left: 4px solid #007f80;
  background: #f2fbf8;
  color: #345551;
  line-height: 1.45;
}

input,
textarea,
select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #b9ccc7;
  border-radius: 6px;
  background: #fff;
  color: #202124;
  font: inherit;
}

textarea { resize: vertical; }

button,
.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  background: #007f80;
  color: #fff;
}

.secondary-button {
  background: #f6fbfa;
  color: #173d3d;
  border-color: #b9d4ce;
}

.danger-button {
  background: #fff2f0;
  color: #9c2c20;
  border-color: #e5aaa3;
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

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

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid #e3eeeb;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: #f5fbf9;
  color: #31524d;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0;
  cursor: pointer;
}

.empty-row,
.empty-state {
  padding: 24px;
  color: #657671;
  text-align: center;
}

.link-button {
  border: 0;
  background: transparent;
  color: #006c80;
  padding: 0;
  min-height: auto;
  font-weight: 850;
  text-align: left;
}

.completion-pill {
  display: inline-grid;
  min-width: 86px;
  gap: 2px;
  padding: 7px 9px;
  border-radius: 6px;
  background: #f1f6f4;
  border: 1px solid #d8e5e1;
}

.completion-pill strong { font-size: 1rem; }
.completion-pill span { font-size: 0.78rem; color: #586965; }
.completion-good { background: #edf8ef; border-color: #a8d8b3; }
.completion-mid { background: #fff8e7; border-color: #f0d388; }
.completion-low { background: #fff0ed; border-color: #e8b0a8; }

.status-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #cbded9;
  background: #f7fbfa;
  color: #244844;
}

.status-box.is-error {
  border-color: #dfaaa1;
  background: #fff2f0;
  color: #9c2c20;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 38, 36, 0.5);
}

.modal-card {
  position: relative;
  width: min(1380px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  margin: 14px auto;
  padding: 20px;
  background: #fff;
  border: 1px solid #bfd4cf;
}

.modal-header,
.detail-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: start;
  margin-bottom: 18px;
}

.detail-grid {
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 0.8fr);
}

.metric-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 0;
}

.metric-list dt {
  font-size: 0.76rem;
  color: #5d706b;
  text-transform: uppercase;
  font-weight: 800;
}

.metric-list dd {
  margin: 3px 0 0;
  font-weight: 850;
}

.public-body {
  background: linear-gradient(135deg, #d9f3e8 0%, #edf6f9 50%, #c9e6ff 100%);
}

.public-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.public-card {
  min-height: calc(100vh - 36px);
  padding: clamp(24px, 5vw, 56px);
  background: rgba(255, 255, 255, 0.9);
}

.public-logo {
  width: 168px;
  max-width: 55vw;
  display: block;
  margin-bottom: 26px;
}

.public-copy {
  max-width: 820px;
  color: #34433f;
  font-size: 1.1rem;
  line-height: 1.6;
}

.required-note {
  color: #b33b2f;
  font-weight: 800;
}

.public-form {
  max-width: 900px;
  margin-top: 28px;
}

.radio-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  font-weight: 500;
}

.radio-row input {
  width: 22px;
  min-height: 22px;
}

.suggestions {
  display: grid;
  gap: 6px;
  margin-top: -8px;
}

.suggestion-button {
  justify-content: flex-start;
  border-color: #cfe0db;
  background: #f7fbfa;
  color: #1e3f3c;
}

.suggestion-button small {
  margin-left: 8px;
  color: #62736f;
  font-weight: 650;
}

.training-link {
  width: fit-content;
  margin: 6px 0 10px;
}

.team-results {
  display: grid;
  gap: 16px;
}

.team-card {
  border: 1px solid #d7e5e1;
  padding: 16px;
}

@media (max-width: 900px) {
  .hero,
  .admin-layout,
  .detail-grid,
  .modal-header {
    grid-template-columns: 1fr;
  }

  .hero-logo {
    max-width: 150px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}
