:root {
  color-scheme: light;
  --navy: #26384a;
  --blue: #3a5875;
  --text: #17212b;
  --muted: #66717d;
  --line: #d8dee5;
  --surface: #ffffff;
  --soft: #f5f7f9;
  --success-bg: #edf7f0;
  --success-text: #23613b;
  --error-bg: #fff1f1;
  --error-text: #8a2d2d;
  --radius: 12px;
  font-family: Aptos, Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--text);
  line-height: 1.5;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.page-shell,
.admin-shell {
  width: min(100% - 28px, 720px);
  margin: 36px auto 18px;
}

.admin-shell {
  width: min(100% - 28px, 1440px);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(22px, 5vw, 42px);
  box-shadow: 0 8px 24px rgb(23 33 43 / 5%);
}

.page-header {
  margin-bottom: 28px;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(1.65rem, 4vw, 2.15rem);
  line-height: 1.15;
}

h2 {
  margin: 30px 0 12px;
  font-size: 1.08rem;
}

.lead {
  margin-bottom: 0;
  color: var(--muted);
}

label,
legend {
  display: block;
  margin-bottom: 7px;
  font-size: 0.93rem;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #bfc8d1;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgb(58 88 117 / 13%);
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.search-form {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}

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

.field-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--navy);
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  padding: 10px 18px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: #1c2c3b;
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.button-secondary {
  border-color: #b8c2cb;
  background: #fff;
  color: var(--text);
}

.button-secondary:hover {
  background: var(--soft);
}

.button-small {
  min-height: 38px;
  padding: 7px 13px;
}

.button-full {
  width: 100%;
  margin-top: 6px;
}

.identity-block {
  margin: 24px 0;
  border-left: 3px solid var(--blue);
  background: var(--soft);
  padding: 15px 17px;
}

.identity-block span,
.identity-block small,
.identity-block strong {
  display: block;
}

.identity-block span,
.identity-block small {
  color: var(--muted);
  font-size: 0.82rem;
}

.identity-block strong {
  margin: 3px 0;
}

.response-form {
  display: grid;
  gap: 18px;
}

.response-form label {
  margin-bottom: -11px;
}

.form-guidance {
  margin: 0;
  border-left: 3px solid var(--blue);
  background: var(--soft);
  padding: 12px 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

fieldset {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.radio-row {
  display: flex !important;
  align-items: center;
  gap: 9px;
  margin: 8px 0 !important;
  font-weight: 500;
}

.radio-row input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.nested-field {
  margin-top: 14px;
}

.nested-field label {
  margin-bottom: 7px;
}

.message {
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 0.9rem;
}

.message.success {
  background: var(--success-bg);
  color: var(--success-text);
}

.message.error {
  background: var(--error-bg);
  color: var(--error-text);
}

.site-footer {
  margin: 0 auto 32px;
  text-align: center;
}

.site-footer a {
  color: var(--muted);
  font-size: 0.82rem;
}

.compact-form {
  max-width: 440px;
}

.admin-actions,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-actions {
  justify-content: flex-end;
  padding-bottom: 6px;
}

.summary-table-wrap {
  max-width: 620px;
}

.table-wrap,
.summary-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  background: var(--navy);
  color: #fff;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.summary-table td:last-child,
.summary-table th:last-child {
  width: 130px;
  text-align: center;
  font-weight: 700;
}

.summary-section-row td {
  background: #eaf0f5;
  color: var(--navy);
  font-weight: 750;
}

.data-table {
  min-width: 1500px;
  font-size: 0.86rem;
}

.data-table tbody tr:nth-child(even) {
  background: #fafbfc;
}

.section-heading h2 {
  margin-bottom: 12px;
}

.section-heading input {
  width: min(100%, 300px);
  min-height: 40px;
}

@media (max-width: 640px) {
  .page-shell,
  .admin-shell {
    width: 100%;
    margin: 0;
  }

  .panel {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 22px 18px 32px;
  }

  .search-row,
  .admin-header,
  .admin-actions,
  .section-heading {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .search-row {
    display: grid;
  }

  .admin-actions .button,
  .section-heading input {
    width: 100%;
  }

  .site-footer {
    margin: -48px auto 22px;
    position: relative;
  }
}
