:root {
  color-scheme: light;
  --ink: #12202f;
  --muted: #637184;
  --soft: #f5f8fb;
  --paper: #ffffff;
  --line: #dbe4ec;
  --line-strong: #c8d4df;
  --brand: #0f6f63;
  --brand-dark: #0b4f49;
  --brand-soft: #e9f6f3;
  --blue: #2468d8;
  --blue-soft: #edf4ff;
  --amber: #b76600;
  --amber-soft: #fff4e5;
  --red: #c93d3a;
  --red-soft: #fff0ef;
  --green: #0a8065;
  --green-soft: #eaf8f3;
  --shadow: 0 16px 40px rgba(33, 48, 70, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, #eef6f5 0, #f6f8fb 260px, #f6f8fb 100%);
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

button:hover {
  border-color: #9fb1c0;
  box-shadow: 0 8px 22px rgba(28, 48, 70, 0.08);
}

button:active {
  transform: translateY(1px);
}

button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

button.primary:hover {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
}

form {
  display: grid;
  gap: 14px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cad7e2;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 650;
}

textarea {
  min-height: 104px;
  padding: 10px 12px;
  line-height: 1.55;
  resize: vertical;
}

input::placeholder {
  color: #9aa7b4;
}

input[readonly] {
  background: #f0f4f7;
  color: #7d8b99;
  cursor: not-allowed;
}

input:focus,
select:focus,
button:focus {
  outline: 3px solid rgba(15, 111, 99, 0.14);
  border-color: var(--brand);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 82px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(203, 216, 226, 0.8);
  backdrop-filter: blur(14px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 260px;
}

.brand-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 79, 73, 0.16);
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #ffffff;
  font-size: 24px;
  font-weight: 900;
}

.brand {
  color: var(--brand);
  font-size: 14px;
  font-weight: 900;
}

h1 {
  margin-top: 2px;
  font-size: 24px;
  line-height: 1.18;
  letter-spacing: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

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

.status span,
.disclaimer-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #526173;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.status strong {
  color: var(--brand-dark);
  margin-right: 4px;
}

.disclaimer-link {
  color: var(--brand);
  border-color: #b9dbd2;
  background: var(--brand-soft);
}

.hero-band {
  position: relative;
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(260px, 0.35fr);
  gap: 18px;
  width: min(1500px, calc(100vw - 32px));
  min-height: 360px;
  margin: 18px auto 0;
  overflow: hidden;
  border: 1px solid rgba(185, 219, 210, 0.34);
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(8, 24, 38, 0.94) 0%, rgba(9, 45, 57, 0.86) 36%, rgba(9, 45, 57, 0.36) 66%, rgba(9, 45, 57, 0.14) 100%),
    url("/static/assets/admissions-hero.jpg") center / cover no-repeat;
  box-shadow: 0 24px 70px rgba(14, 35, 54, 0.22);
}

.hero-copy {
  position: relative;
  z-index: 1;
  align-self: center;
  max-width: 710px;
  padding: 44px 0 44px 46px;
  color: #ffffff;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(212, 178, 91, 0.58);
  border-radius: 999px;
  background: rgba(212, 178, 91, 0.15);
  color: #f5d78a;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 900;
}

.hero-copy h2 {
  margin-top: 16px;
  max-width: 680px;
  font-size: clamp(34px, 4.1vw, 58px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-copy p {
  margin-top: 16px;
  max-width: 590px;
  color: rgba(239, 248, 246, 0.84);
  font-size: 16px;
  line-height: 1.8;
}

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

.hero-actions a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 900;
  text-decoration: none;
}

.hero-primary {
  background: #ffffff;
  color: var(--brand-dark);
}

.hero-secondary {
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.hero-proof {
  position: absolute;
  left: 46px;
  bottom: 24px;
  z-index: 1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-proof div {
  min-width: 138px;
  display: grid;
  gap: 2px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(12px);
  padding: 12px 14px;
  color: #ffffff;
}

.hero-proof strong {
  font-size: 23px;
}

.hero-proof span {
  color: rgba(239, 248, 246, 0.74);
  font-size: 12px;
  font-weight: 800;
}

.hero-steps {
  position: relative;
  z-index: 1;
  align-self: end;
  justify-self: end;
  display: grid;
  gap: 10px;
  width: min(330px, calc(100% - 28px));
  margin: 0 22px 22px 0;
}

.hero-steps article {
  display: grid;
  grid-template-columns: 44px 1fr;
  column-gap: 12px;
  row-gap: 3px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  padding: 13px;
}

.hero-steps article span {
  grid-row: span 2;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #ffffff;
  font-weight: 900;
}

.hero-steps strong {
  color: #132235;
  font-size: 15px;
}

.hero-steps small {
  color: #637184;
  line-height: 1.4;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 18px;
  width: min(1500px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.query-panel,
.guide-strip,
.filter-panel,
.recommend-workbench,
.report-panel,
.dock-panel,
.ai-modal,
.admin-card,
.admin-settings,
.admin-help {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.query-panel {
  position: sticky;
  top: 100px;
  align-self: start;
  max-height: calc(100vh - 118px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.query-panel::-webkit-scrollbar {
  width: 8px;
}

.query-panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c8d7d3;
}

.query-panel::-webkit-scrollbar-track {
  background: #f4f8f7;
}

.panel-heading {
  padding: 20px 20px 18px;
  background: linear-gradient(180deg, #ffffff, #f7fbfa);
  border-bottom: 1px solid var(--line);
}

.panel-heading h2,
.workbench-head h2,
.report-head h2 {
  font-size: 20px;
  line-height: 1.25;
}

.panel-heading p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.profile-form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.form-block {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e4ebf1;
  border-radius: 8px;
  background: #fbfcfd;
}

.form-block-title {
  color: #2c3a49;
  font-size: 13px;
  font-weight: 900;
}

.score-card {
  border-color: #bfe1d8;
  background: var(--brand-soft);
}

label,
fieldset {
  display: grid;
  gap: 7px;
  color: #344252;
  font-size: 13px;
  font-weight: 800;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

legend {
  padding: 0 0 8px;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.choice-row,
.secondary-subjects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.secondary-subjects {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.radio-card,
.chips label {
  display: block;
}

.radio-card input,
.chips input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-card span,
.chips span {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cad7e2;
  border-radius: 8px;
  background: #ffffff;
  color: #354457;
  font-weight: 850;
}

.radio-card input:checked + span,
.chips input:checked + span {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.rank-note {
  min-height: 26px;
  border: 1px solid #bfe1d8;
  border-radius: 8px;
  background: #ffffff;
  color: var(--brand-dark);
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.45;
}

.form-note {
  border: 1px solid #d9e3ea;
  border-radius: 8px;
  background: #f7fafb;
  color: #667585;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.65;
}

.activation-card {
  display: grid;
  gap: 8px;
  border: 1px solid #dbe9e6;
  border-radius: 8px;
  background: #fbfdfd;
  padding: 14px;
}

.activation-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 6px;
}

.activation-input-row input {
  text-transform: uppercase;
}

.activation-input-row button {
  min-height: 40px;
  padding: 0 14px;
}

#activationStatus {
  margin: 0;
  color: #758296;
  font-size: 13px;
  font-weight: 800;
}

#activationStatus.active {
  color: var(--brand);
}

#activationStatus.error {
  color: var(--red);
}

.actions {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 10px;
}

.actions button {
  min-height: 46px;
}

.secondary-action {
  border-color: #b9dbd2;
  background: #ffffff;
  color: var(--brand);
}

.report-action {
  border-color: #123c7a;
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(36, 104, 216, 0.18);
}

.report-action:hover {
  border-color: #123c7a;
  background: #1c56b8;
}

.button-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 14px;
  font-weight: 850;
  text-decoration: none;
}

.results {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.guide-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 76px;
  padding: 16px 18px;
}

.guide-strip strong {
  display: block;
  margin-top: 3px;
  font-size: 20px;
  line-height: 1.3;
}

.toolbar-button {
  border-color: #bfd6e6;
  color: #24506f;
  background: #f4f9fc;
  padding: 0 14px;
}

.filter-panel {
  padding: 16px;
}

.result-search-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1.2fr) minmax(130px, 0.7fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #dfe9ee;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f8fbfb);
}

.result-search-grid label {
  gap: 6px;
}

.result-search-grid input,
.result-search-grid select {
  min-height: 38px;
}

.result-search-grid button {
  min-height: 38px;
  padding: 0 14px;
  color: #516174;
  background: #ffffff;
}

.filter-note {
  margin-top: 12px;
  color: #7b8795;
  font-size: 12px;
  line-height: 1.6;
}

.recommend-workbench {
  overflow: hidden;
}

.workbench-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.workbench-head h2 span {
  display: inline-flex;
  min-width: 34px;
  justify-content: center;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 2px 9px;
  font-size: 16px;
}

.recommend-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid #edf2f5;
  background: #fbfcfd;
}

.score-range {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: #435367;
  font-size: 13px;
  font-weight: 900;
}

.score-range input {
  width: 94px;
  min-height: 36px;
}

.score-range button,
.compact {
  min-height: 36px;
  padding: 0 13px;
}

.compact.active {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
}

.risk-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 13px 18px;
  border-bottom: 1px solid #edf2f5;
  background: #ffffff;
}

.risk-chip {
  min-height: 34px;
  border-color: #dce6ee;
  background: #ffffff;
  padding: 0 12px;
}

.risk-chip span {
  color: inherit;
  opacity: 0.72;
  margin-left: 3px;
}

.risk-chip.danger { color: var(--red); background: var(--red-soft); }
.risk-chip.rush { color: #b65b00; background: var(--amber-soft); }
.risk-chip.fit { color: var(--blue); background: var(--blue-soft); }
.risk-chip.stable { color: var(--green); background: var(--green-soft); }
.risk-chip.safe { color: #526c94; background: #f0f5fb; }
.risk-chip.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}

.table-wrap {
  overflow: auto;
  background: #ffffff;
}

.recommend-table {
  width: 100%;
  min-width: 890px;
  border-collapse: separate;
  border-spacing: 0;
}

.recommend-table th,
.recommend-table td {
  padding: 14px 14px;
  border-bottom: 1px solid #edf2f5;
  text-align: left;
  vertical-align: top;
}

.recommend-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #526173;
  font-size: 13px;
  font-weight: 900;
}

.recommend-table tbody tr:hover {
  background: #fbfdfd;
}

.recommend-table td strong {
  color: #132235;
  font-size: 15px;
}

.recommend-table td small {
  display: block;
  margin-top: 5px;
  color: #738092;
  font-size: 12px;
  line-height: 1.35;
}

.table-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid #dce6ee;
  border-radius: 999px;
  background: #f7fafb;
  color: #46576b;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 850;
}

.metric-value {
  color: var(--ink);
  font-size: 18px;
}

.table-empty {
  height: 170px;
  color: #788596;
  text-align: center !important;
  vertical-align: middle !important;
}

.risk-badge {
  display: inline-grid;
  place-items: center;
  gap: 3px;
  min-width: 70px;
  border-radius: 8px;
  padding: 8px 9px;
  color: #ffffff;
  font-weight: 900;
}

.risk-badge small {
  margin: 0 !important;
  color: #ffffff !important;
  font-size: 11px;
}

.risk-badge.danger { background: var(--red); }
.risk-badge.rush { background: #e27b18; }
.risk-badge.fit { background: var(--blue); }
.risk-badge.stable { background: var(--green); }
.risk-badge.safe { background: #557095; }

.fill-button {
  min-height: 34px;
  border-color: #b9dbd2;
  background: #ffffff;
  color: var(--brand);
  padding: 0 13px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: #fbfcfd;
}

.pagination button,
.pagination select {
  min-height: 34px;
}

.pagination button {
  padding: 0 12px;
}

.pagination button:disabled {
  color: #a9b4bf;
  background: #f2f5f8;
  cursor: not-allowed;
  box-shadow: none;
}

.pagination span,
.pagination label {
  color: #667386;
  font-size: 13px;
  font-weight: 800;
}

.pagination label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination select {
  width: auto;
  padding: 0 24px 0 8px;
}

.report-panel {
  padding: 18px;
}

.report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

#reportMode {
  border: 1px solid #dce6ee;
  border-radius: 999px;
  background: #f7fafb;
  color: #657386;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 850;
}

#reportContent,
.report-prose {
  color: #344252;
  line-height: 1.78;
}

#reportContent h3,
.report-prose h3 {
  margin: 18px 0 10px;
  padding-left: 10px;
  border-left: 4px solid var(--brand);
  color: var(--ink);
  font-size: 17px;
}

#reportContent h2,
.report-prose h2 {
  margin: 4px 0 18px;
  color: var(--brand-dark);
  font-size: 22px;
  line-height: 1.35;
}

#reportContent p,
.report-prose p {
  margin: 0 0 12px;
}

#reportContent ul,
.report-prose ul,
#reportContent ol,
.report-prose ol {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding-left: 20px;
}

#reportContent strong,
.report-prose strong {
  color: #102338;
}

.volunteer-dock {
  position: fixed;
  right: 16px;
  top: 124px;
  z-index: 35;
  display: flex;
  align-items: stretch;
  transform: translateX(calc(100% - 48px));
  transition: transform 0.2s ease;
}

.volunteer-dock.open {
  transform: translateX(0);
}

.dock-tab {
  width: 48px;
  height: 156px;
  writing-mode: vertical-rl;
  border-radius: 8px 0 0 8px;
  border-color: var(--brand-dark);
  background: var(--brand-dark);
  color: #ffffff;
}

.dock-panel {
  width: min(420px, calc(100vw - 72px));
  min-height: 460px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  padding: 18px;
  border-radius: 8px 0 8px 8px;
}

.dock-panel h2 {
  color: var(--brand);
  font-size: 19px;
  text-align: center;
  padding-bottom: 13px;
  border-bottom: 1px solid #edf2f5;
}

.volunteer-list {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
}

.volunteer-empty {
  color: var(--muted);
  text-align: center;
  padding-top: 72px;
}

.volunteer-item {
  position: relative;
  display: grid;
  gap: 6px;
  border: 1px solid #e3ebf1;
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px 40px 12px 12px;
}

.volunteer-item button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  min-height: 28px;
  border: 0;
  color: #8c99a6;
  background: transparent;
}

.volunteer-item span {
  color: #6d7a89;
}

.dock-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  background: rgba(13, 24, 36, 0.54);
  padding: 20px;
}

.modal-layer.hidden {
  display: none;
}

.ai-modal {
  position: relative;
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 34px;
}

.summary-modal {
  background: linear-gradient(180deg, #eef8f5 0, #ffffff 180px);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 38px;
  min-height: 38px;
  border: 0;
  background: transparent;
  color: #8793a0;
  font-size: 28px;
}

.modal-brand {
  color: var(--brand);
  font-size: 22px;
  font-weight: 900;
}

.ai-modal h2 {
  margin-top: 14px;
  font-size: 22px;
  line-height: 1.35;
}

.donut-wrap {
  display: grid;
  place-items: center;
  margin: 26px 0 18px;
}

.donut {
  position: relative;
  width: 220px;
  height: 220px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.donut::before {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #e5eeeb;
}

.donut strong,
.donut span {
  position: relative;
  z-index: 1;
}

.donut strong {
  align-self: end;
  font-size: 44px;
}

.donut span {
  align-self: start;
  color: var(--muted);
  font-size: 15px;
  font-weight: 850;
}

.risk-summary {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 16px;
  font-weight: 900;
}

.risk-summary span {
  border-radius: 999px;
  padding: 7px 11px;
  background: #f7fafb;
}

.risk-summary .danger { color: var(--red); }
.risk-summary .rush { color: #b65b00; }
.risk-summary .fit { color: var(--blue); }
.risk-summary .stable { color: var(--green); }
.risk-summary .safe { color: #526c94; }

.summary-card {
  margin: 22px 0;
  padding: 20px;
  border: 1px solid #e3ebf1;
  border-radius: 8px;
  background: #ffffff;
}

.summary-card h3 {
  font-size: 20px;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.summary-stats div {
  display: grid;
  gap: 4px;
  text-align: center;
  border: 1px solid #edf2f5;
  border-radius: 8px;
  padding: 12px 8px;
}

.summary-stats strong {
  font-size: 25px;
}

.summary-stats span,
.important-tip {
  color: var(--muted);
}

.important-tip {
  border: 1px solid #e3ebf1;
  border-radius: 8px;
  background: #fbfcfd;
  padding: 16px;
  line-height: 1.75;
}

.important-tip h3 {
  color: var(--ink);
  font-size: 18px;
  margin-bottom: 8px;
}

.modal-ok {
  display: block;
  width: 220px;
  margin: 24px auto 0;
}

.report-modal {
  background: #ffffff;
}

.report-modal h2 {
  text-align: left;
}

.report-modal-meta {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin: 14px 0 18px;
}

.report-modal-meta span {
  border: 1px solid #dce7e7;
  border-radius: 999px;
  background: #f3f7f7;
  color: #52616f;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 850;
}

.report-preference-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  border: 1px solid #dbe8ef;
  border-radius: 8px;
  background: #f7fafb;
  padding: 16px;
}

.report-preference-panel[hidden] {
  display: none;
}

.report-preference-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.report-preference-grid label:last-child {
  grid-column: 1 / -1;
}

.report-generate-button {
  justify-self: start;
  min-width: 220px;
}

.report-prose {
  max-height: min(58vh, 620px);
  overflow: auto;
  border: 1px solid #e3ebeb;
  border-radius: 8px;
  background: #fbfdfd;
  padding: 18px;
}

.report-prose code {
  border-radius: 5px;
  background: #eef4f4;
  padding: 2px 5px;
}

.download-layout {
  width: min(1320px, calc(100vw - 32px));
  margin: 18px auto 40px;
  display: grid;
  gap: 18px;
}

.download-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: stretch;
  border: 1px solid rgba(185, 219, 210, 0.52);
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(8, 24, 38, 0.96), rgba(12, 75, 77, 0.78)),
    url("/static/assets/admissions-hero.jpg") center / cover no-repeat;
  color: #ffffff;
  padding: 28px;
  box-shadow: 0 20px 56px rgba(14, 35, 54, 0.18);
}

.download-hero h2 {
  max-width: 820px;
  margin-top: 8px;
  font-size: clamp(26px, 4vw, 46px);
  line-height: 1.12;
  letter-spacing: 0;
}

.download-hero p {
  max-width: 760px;
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.75;
}

.download-hero code {
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.16);
  padding: 2px 6px;
  color: #ffffff;
}

.download-access-card {
  display: grid;
  grid-template-columns: 108px 1fr;
  align-content: center;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  padding: 14px;
}

.download-access-card img,
.qr-placeholder {
  width: 108px;
  height: 108px;
  border-radius: 8px;
  background: #ffffff;
  object-fit: cover;
}

.qr-placeholder {
  display: grid;
  place-items: center;
  color: #5d6b75;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  padding: 10px;
}

.download-access-card span,
.download-access-card small {
  display: block;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 750;
}

.download-access-card strong {
  display: block;
  margin: 4px 0;
  font-size: 34px;
  letter-spacing: 0;
}

.download-access-button,
.download-access-empty {
  grid-column: 1 / -1;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 900;
  text-decoration: none;
}

.download-access-button {
  background: #ffffff;
  color: var(--brand-dark);
}

.download-access-empty {
  border: 1px dashed rgba(255, 255, 255, 0.42);
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
}

.download-panel {
  padding: 18px;
}

.download-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1.3fr) minmax(180px, 0.7fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.download-table-wrap {
  overflow: auto;
  border: 1px solid #e3ebf1;
  border-radius: 8px;
  background: #ffffff;
}

.download-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 14px;
}

.download-table th,
.download-table td {
  border-bottom: 1px solid #edf2f5;
  padding: 12px;
  text-align: left;
  vertical-align: middle;
}

.download-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7fafb;
  color: #526173;
  font-size: 12px;
}

.download-table td strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.download-table td small {
  display: block;
  max-width: 620px;
  margin-top: 4px;
  color: var(--muted);
  white-space: normal;
  word-break: break-all;
}

.download-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--brand);
  color: #ffffff;
  padding: 0 14px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.download-note {
  margin-top: 14px;
  border: 1px solid #dbe9e6;
  border-radius: 8px;
  background: #f6fbfa;
  color: #526173;
  padding: 12px;
  line-height: 1.65;
}

.report-loading {
  min-height: 260px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 14px;
  text-align: center;
}

.loading-ring {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 4px solid #dce8e8;
  border-top-color: var(--brand);
  border-right-color: var(--blue);
  animation: reportSpin 0.9s linear infinite;
}

.report-loading strong {
  color: var(--ink);
  font-size: 18px;
}

.report-loading span {
  max-width: 420px;
  color: var(--muted);
  font-size: 14px;
}

.loading-steps {
  display: flex;
  gap: 7px;
  margin-top: 4px;
}

.loading-steps i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--brand);
  opacity: 0.35;
  animation: reportPulse 1.1s ease-in-out infinite;
}

.loading-steps i:nth-child(2) {
  animation-delay: 0.16s;
}

.loading-steps i:nth-child(3) {
  animation-delay: 0.32s;
}

.secondary-action:disabled,
.secondary-action.is-loading {
  cursor: wait;
  opacity: 0.68;
}

@keyframes reportSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes reportPulse {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  50% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.admin-body {
  display: grid;
  place-items: center;
}

.admin-shell {
  width: min(420px, calc(100vw - 28px));
}

.admin-card,
.admin-settings,
.admin-help {
  padding: 22px;
}

.admin-card {
  display: grid;
  gap: 18px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 620px) minmax(260px, 420px);
  gap: 20px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px;
}

.admin-settings h2,
.admin-help h2 {
  font-size: 18px;
  margin-bottom: 16px;
}

.admin-message {
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
}

.admin-message.error {
  color: #7b2325;
  background: #fff0f0;
  border: 1px solid #f2b9bb;
}

.admin-message.success {
  color: #0d5d49;
  background: #eefaf5;
  border: 1px solid #b8e4d5;
  margin-bottom: 14px;
}

.admin-test-result {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  border: 1px solid #dce6ee;
  border-radius: 8px;
  background: #f7fafb;
  color: #34404d;
  padding: 14px;
  font-size: 13px;
  line-height: 1.55;
}

.admin-test-result[hidden] {
  display: none;
}

.admin-test-result strong {
  font-size: 15px;
}

.admin-test-result.success {
  border-color: #b8e4d5;
  background: #eefaf5;
  color: #0d5d49;
}

.admin-test-result.error {
  border-color: #f2b9bb;
  background: #fff0f0;
  color: #7b2325;
}

.admin-test-result pre {
  max-height: 220px;
  overflow: auto;
  margin: 4px 0 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  padding: 10px;
  white-space: pre-wrap;
}

.settings-divider {
  display: grid;
  gap: 4px;
  border-top: 1px solid #e3ebf1;
  padding-top: 16px;
  margin-top: 4px;
}

.settings-divider strong {
  font-size: 15px;
}

.settings-divider span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.settings-divider code {
  color: var(--brand-dark);
  font-weight: 900;
}

.qr-admin-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #dbe9e6;
  border-radius: 8px;
  background: #f6fbfa;
  padding: 10px;
}

.qr-admin-preview img {
  width: 74px;
  height: 74px;
  border-radius: 8px;
  background: #ffffff;
  object-fit: cover;
}

.qr-admin-preview span {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  word-break: break-all;
}

.full-field {
  display: grid;
  gap: 7px;
}

.activation-admin {
  grid-column: 1 / -1;
}

.activation-create-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
}

.agent-create-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 0.5fr);
  gap: 12px;
}

.agent-create-form .actions {
  grid-column: 1 / -1;
}

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

.agent-stats div,
.package-list span {
  border: 1px solid #e3ebf1;
  border-radius: 8px;
  background: #f7fafb;
  padding: 12px;
}

.agent-stats strong {
  display: block;
  color: var(--brand);
  font-size: 22px;
}

.agent-stats span {
  color: var(--muted);
  font-size: 13px;
}

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

.package-editor {
  display: grid;
  gap: 10px;
}

.package-editor div {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.delete-package {
  color: #9f2d31;
  font-weight: 900;
}

.activation-create-form .actions {
  grid-column: 1 / -1;
}

.activation-table-wrap {
  max-height: 520px;
  overflow: auto;
  margin-top: 18px;
  border: 1px solid #e3ebf1;
  border-radius: 8px;
}

.activation-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  font-size: 13px;
}

.activation-table th,
.activation-table td {
  border-bottom: 1px solid #edf2f5;
  padding: 10px;
  text-align: left;
  white-space: nowrap;
}

.activation-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7fafb;
  color: #526173;
  font-size: 12px;
}

.activation-table code {
  color: var(--brand-dark);
  font-weight: 900;
}

.table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.table-actions form {
  display: flex;
  gap: 6px;
  align-items: center;
}

.table-actions input {
  width: 92px;
  min-height: 32px;
}

.new-code-box {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  border: 1px solid #dbe9e6;
  border-radius: 8px;
  background: #f6fbfa;
  padding: 12px;
}

.new-code-box textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.compact-form {
  grid-template-columns: repeat(2, minmax(140px, 1fr));
}

.danger-button {
  border-color: #f2b9bb;
  background: #fff0f0;
  color: #9f2d31;
}

.admin-help {
  display: grid;
  gap: 12px;
  align-self: start;
  color: #34404d;
  line-height: 1.65;
}

.admin-help pre {
  margin: 0;
  overflow: auto;
  border-radius: 6px;
  background: #16202a;
  color: #edf6f4;
  padding: 14px;
}

.admin-console-body {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  background: #f4f7f9;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-right: 1px solid #dfe8ef;
  background: #ffffff;
  padding: 22px 16px;
}

.admin-brand-block {
  border-bottom: 1px solid #edf2f5;
  padding-bottom: 18px;
}

.admin-brand-block h1 {
  font-size: 22px;
}

.admin-nav {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px 0;
}

.admin-nav a {
  min-height: 42px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  color: #34404d;
  padding: 0 12px;
  font-weight: 850;
  text-decoration: none;
}

.admin-nav a:hover,
.admin-nav a.active {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.admin-nav a.active {
  box-shadow: inset 3px 0 0 var(--brand);
}

.admin-sidebar-actions {
  display: grid;
  gap: 8px;
  border-top: 1px solid #edf2f5;
  padding-top: 14px;
}

.admin-sidebar-actions form,
.admin-sidebar-actions button,
.admin-sidebar-actions .button-link {
  width: 100%;
}

.admin-console {
  min-width: 0;
  padding: 24px;
}

.admin-console-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.admin-console-head h2 {
  margin-top: 4px;
  font-size: 28px;
  letter-spacing: 0;
}

.admin-console-head p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.admin-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.admin-metric-grid article {
  min-height: 122px;
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid #dfe8ef;
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
  box-shadow: 0 10px 28px rgba(33, 48, 70, 0.05);
}

.admin-metric-grid span,
.admin-metric-grid small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.admin-metric-grid strong {
  color: var(--brand-dark);
  font-size: 30px;
  letter-spacing: 0;
}

.analytics-board {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 16px;
}

.analytics-card {
  padding: 18px;
}

.analytics-bars {
  display: grid;
  gap: 10px;
}

.analytics-bars div {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 150px;
  gap: 10px;
  align-items: center;
}

.analytics-bars span,
.analytics-bars small,
.analytics-list span,
.analytics-recent span,
.analytics-recent small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.analytics-bars strong {
  position: relative;
  min-height: 30px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-radius: 7px;
  background: #edf4ff;
  color: #123c7a;
  padding: 0 10px;
  font-size: 13px;
  z-index: 0;
}

.analytics-bars strong::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--bar);
  background: rgba(36, 104, 216, 0.18);
  z-index: -1;
}

.analytics-list,
.analytics-recent {
  display: grid;
  gap: 8px;
}

.analytics-list div,
.analytics-recent div {
  display: grid;
  gap: 4px;
  border: 1px solid #edf2f5;
  border-radius: 8px;
  background: #fbfcfd;
  padding: 10px;
}

.analytics-list div {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.analytics-list strong {
  color: var(--brand-dark);
  font-size: 18px;
}

.analytics-list span,
.analytics-recent strong,
.analytics-recent small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-board {
  display: block;
}

.admin-panel[hidden] {
  display: none !important;
}

.admin-panel.is-active {
  display: block;
}

.admin-section {
  min-width: 0;
  padding: 20px;
  scroll-margin-top: 20px;
}

.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-section-head h2 {
  margin-top: 4px;
  font-size: 20px;
  letter-spacing: 0;
}

#help {
  align-self: stretch;
}

.settings-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-form-grid .settings-divider,
.settings-form-grid .full-field,
.settings-form-grid .qr-admin-preview,
.settings-form-grid .actions {
  grid-column: 1 / -1;
}

.narrow-actions {
  grid-template-columns: minmax(160px, 240px);
  justify-content: start;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
}

.compact-table {
  max-height: 360px;
}

.activation-table td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.admin-help-content {
  display: grid;
  gap: 12px;
  color: #34404d;
  line-height: 1.65;
}

.admin-help-content pre {
  margin: 0;
  overflow: auto;
  border-radius: 6px;
  background: #16202a;
  color: #edf6f4;
  padding: 14px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .hero-band {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding-right: 34px;
    padding-bottom: 132px;
  }

  .hero-steps {
    width: calc(100% - 44px);
    justify-self: start;
    margin-left: 22px;
  }

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

  .query-panel {
    position: static;
    max-height: none;
    overflow: visible;
    overscroll-behavior: auto;
  }
}

@media (max-width: 760px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .topbar-right,
  .status {
    width: 100%;
  }

  .status span,
  .disclaimer-link {
    flex: 1 1 150px;
  }

  .workspace {
    width: min(100vw - 20px, 1500px);
    padding-top: 10px;
  }

  .hero-band {
    width: min(100vw - 20px, 1500px);
    min-height: auto;
    margin-top: 10px;
    background:
      linear-gradient(180deg, rgba(8, 24, 38, 0.95) 0%, rgba(9, 45, 57, 0.88) 55%, rgba(9, 45, 57, 0.58) 100%),
      url("/static/assets/admissions-hero.jpg") center / cover no-repeat;
  }

  .hero-copy {
    padding: 30px 22px 146px;
  }

  .hero-proof {
    left: 22px;
    right: 22px;
    bottom: 20px;
  }

  .hero-proof div {
    min-width: 0;
    flex: 1 1 120px;
  }

  .hero-steps {
    grid-template-columns: 1fr;
    width: calc(100% - 32px);
    margin: 0 16px 16px;
  }

  .field-row,
  .actions,
  .summary-stats,
  .admin-layout,
  .admin-console-body,
  .admin-board,
  .settings-form-grid,
  .admin-metric-grid,
  .analytics-board,
  .report-preference-grid {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }

  .admin-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-sidebar-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-console {
    padding: 14px;
  }

  .admin-console-head,
  .admin-section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .side-section,
  #activation,
  #settings {
    grid-column: auto;
  }

  .secondary-subjects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guide-strip,
  .workbench-head,
  .recommend-toolbar,
  .report-head {
    align-items: stretch;
    flex-direction: column;
  }

  .download-layout {
    width: min(100vw - 20px, 1320px);
    margin-top: 10px;
  }

  .download-hero,
  .download-toolbar {
    grid-template-columns: 1fr;
  }

  .download-hero {
    padding: 24px 18px;
  }

  .download-access-card {
    min-height: 132px;
  }

  .result-search-grid {
    grid-template-columns: 1fr;
  }

  .score-range input {
    flex: 1 1 90px;
  }

  .score-range button,
  .compact {
    width: 100%;
  }

  .volunteer-dock {
    right: 0;
    top: 96px;
  }

  .ai-modal {
    padding: 26px 18px;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 21px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand-logo {
    width: 46px;
    height: 46px;
  }

  .hero-copy h2 {
    font-size: 31px;
  }

  .hero-copy p {
    font-size: 14px;
  }

  .hero-actions a {
    width: 100%;
  }

  .hero-proof {
    position: static;
    padding: 0 16px 16px;
  }

  .hero-copy {
    padding-bottom: 22px;
  }

  .profile-form,
  .panel-heading,
  .filter-panel,
  .workbench-head,
  .recommend-toolbar,
  .risk-row,
  .report-panel {
    padding-left: 14px;
    padding-right: 14px;
  }

  .pagination {
    justify-content: center;
  }

  .modal-layer {
    padding: 12px;
  }
}
