:root {
  --sky-200: #9eb8dc;
  --navy: #002366;
  --royal: #0056b3;
  --ink-900: #002366;
  --ink-500: #3d5680;
  --ink-400: #5a7194;
  --ok: #15803d;
  --err: #be123c;
  --border-soft: rgba(0, 35, 102, 0.16);
  --shadow: 0 28px 64px rgba(0, 35, 102, 0.22), 0 10px 24px rgba(0, 35, 102, 0.12);
  --radius-xl: 1.75rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { min-height: 100%; }

body {
  min-height: 100dvh;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  color: var(--ink-900);
  background: var(--sky-200);
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 95% 70% at 6% -12%, rgba(0, 86, 179, 0.38), transparent 58%),
    radial-gradient(ellipse 80% 60% at 98% 0%, rgba(0, 35, 102, 0.28), transparent 55%),
    linear-gradient(168deg, #b7cce8 0%, #9eb8dc 45%, #7fa3d0 100%);
}

.wrap {
  width: min(40rem, 100%);
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
  flex: 1;
}
.wrap.wide { width: min(92rem, 100%); }

.board {
  border-radius: var(--radius-xl);
  border: 1px solid rgba(197, 204, 216, 0.65);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(236, 244, 255, 0.8));
  box-shadow: inset 0 1px 0 #fff, var(--shadow);
  backdrop-filter: blur(24px);
  padding: clamp(1.15rem, 3vw, 1.7rem);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.brand { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.brand img { width: 2.8rem; height: 2.8rem; flex-shrink: 0; }
.kicker {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--royal);
}
h1 {
  font-family: "Outfit", system-ui, sans-serif;
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.lead {
  font-size: 0.9rem;
  font-weight: 550;
  color: var(--ink-500);
  line-height: 1.45;
  margin-bottom: 1.1rem;
}

.home, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1.5px solid rgba(0, 35, 102, 0.16);
  background: rgba(255, 255, 255, 0.88);
  color: var(--navy);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary {
  border: none;
  background: linear-gradient(180deg, #1a4bb8, var(--navy));
  color: #fff;
  width: 100%;
  min-height: 2.85rem;
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 1rem;
}
.btn:disabled { opacity: 0.55; cursor: wait; }

.note, .record, .hint {
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.85rem;
  background: rgba(0, 35, 102, 0.06);
  border: 1px solid rgba(0, 35, 102, 0.1);
  font-size: 0.78rem;
  font-weight: 550;
  color: var(--ink-500);
  line-height: 1.4;
}
.record {
  background: rgba(0, 86, 179, 0.1);
  border-color: rgba(0, 86, 179, 0.28);
  color: var(--navy);
  font-weight: 650;
}
.hint {
  margin-top: -0.45rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.74rem;
}

label.field { display: grid; gap: 0.35rem; margin-bottom: 0.85rem; }
label.field span, .field-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-500);
}

input[type="password"],
input[type="text"],
input[type="number"],
input[type="search"],
textarea,
select {
  width: 100%;
  border-radius: 0.85rem;
  border: 1.5px solid rgba(0, 35, 102, 0.28);
  background: rgba(255, 255, 255, 0.95);
  font: inherit;
  color: inherit;
  padding: 0 0.85rem;
}
input[type="password"],
input[type="text"],
input[type="number"],
input[type="search"],
select { height: 2.75rem; }
textarea {
  min-height: 4.5rem;
  padding: 0.7rem 0.85rem;
  resize: vertical;
}

.status {
  min-height: 1.3rem;
  margin-top: 0.7rem;
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--ink-400);
}
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }

.section-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--royal);
  margin: 0 0 0.55rem;
}

.staff-list {
  max-height: 14rem;
  overflow: auto;
  border-radius: 1rem;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.72);
  margin-bottom: 0.95rem;
}
.staff-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-bottom: 1px solid rgba(0, 35, 102, 0.06);
  background: transparent;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 650;
  color: inherit;
  cursor: pointer;
}
.staff-row:last-child { border-bottom: 0; }
.staff-row:hover, .staff-row.is-on {
  background: rgba(0, 86, 179, 0.1);
}
.staff-row .meta {
  margin-left: auto;
  color: var(--ink-400);
  font-size: 0.74rem;
  font-weight: 600;
  text-align: right;
}

.picked {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.95rem;
  padding: 0.7rem 0.85rem;
  border-radius: 1rem;
  border: 1.5px solid rgba(0, 86, 179, 0.28);
  background: rgba(255, 255, 255, 0.9);
}
.picked strong {
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 1.05rem;
}
.picked p { font-size: 0.78rem; font-weight: 650; color: var(--ink-500); }
.picked .btn { min-height: 2.1rem; font-size: 0.72rem; }

.choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.95rem;
}
.choice {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0.35rem 0.6rem;
  border-radius: 0.9rem;
  border: 1.5px solid rgba(0, 35, 102, 0.16);
  background: rgba(255, 255, 255, 0.8);
  font-size: 0.86rem;
  font-weight: 750;
  cursor: pointer;
}
.choice:has(input:checked) {
  border-color: rgba(0, 86, 179, 0.5);
  background: rgba(0, 86, 179, 0.12);
}
.choice input { accent-color: var(--navy); margin-right: 0.4rem; }

.grid-2 {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
@media (min-width: 560px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 1rem;
}
@media (min-width: 720px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 980px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.stats-legend {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0 0 0.15rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.stats-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ink-400);
}
.stats-legend-item::before {
  content: "";
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 0.2rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.stats-legend-survey::before { background: #059669; }
.stats-legend-order::before { background: #4f46e5; }
.stats-legend-cart::before { background: #d97706; }

.stat {
  padding: 0.7rem 0.8rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.72);
  border: 2px solid var(--border-soft);
  border-left-width: 5px;
}
.stat b {
  display: block;
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.15;
}
.stat span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.stat-hint {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.62rem;
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0.02em;
  text-transform: none;
  opacity: 0.85;
}

/* Survey response */
.stat-survey-ok {
  border-left-color: #059669;
  background: linear-gradient(135deg, rgba(209, 250, 229, 0.95), rgba(255, 255, 255, 0.85));
}
.stat-survey-ok b { color: #047857; }
.stat-survey-ok span { color: #065f46; }

.stat-survey-gap {
  border-left-color: #dc2626;
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.95), rgba(255, 255, 255, 0.85));
}
.stat-survey-gap b { color: #b91c1c; }
.stat-survey-gap span { color: #991b1b; }

/* Purchase / extras */
.stat-order-primary {
  border-left-color: #4f46e5;
  background: linear-gradient(135deg, rgba(224, 231, 255, 0.98), rgba(255, 255, 255, 0.88));
}
.stat-order-primary b { color: #3730a3; font-size: 1.5rem; }
.stat-order-primary span { color: #4338ca; }

.stat-order-secondary {
  border-left-color: #0891b2;
  background: linear-gradient(135deg, rgba(207, 250, 254, 0.95), rgba(255, 255, 255, 0.85));
}
.stat-order-secondary b { color: #0e7490; }
.stat-order-secondary span { color: #155e75; }

.stat-order-gap {
  border-left-color: #7c3aed;
  background: linear-gradient(135deg, rgba(237, 233, 254, 0.98), rgba(255, 255, 255, 0.88));
}
.stat-order-gap b { color: #6d28d9; }
.stat-order-gap span { color: #5b21b6; }
.stat-order-gap .stat-hint { color: #6d28d9; }

/* Cart inventory & confirmations */
.stat-cart-ok {
  border-left-color: #16a34a;
  background: linear-gradient(135deg, rgba(220, 252, 231, 0.9), rgba(255, 255, 255, 0.85));
}
.stat-cart-ok b { color: #15803d; }
.stat-cart-ok span { color: #166534; }

.stat-cart-action {
  border-left-color: #ea580c;
  background: linear-gradient(135deg, rgba(255, 237, 213, 0.98), rgba(255, 255, 255, 0.85));
}
.stat-cart-action b { color: #c2410c; }
.stat-cart-action span { color: #9a3412; }

.stat-cart-meta {
  border-left-color: #64748b;
  background: linear-gradient(135deg, rgba(241, 245, 249, 0.98), rgba(255, 255, 255, 0.85));
}
.stat-cart-meta b { color: #334155; }
.stat-cart-meta span { color: #475569; }

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
}
.filter-chip {
  min-height: 2.1rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1.5px solid rgba(0, 35, 102, 0.16);
  background: rgba(255, 255, 255, 0.88);
  color: var(--navy);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
}
.filter-chip.is-on {
  border-color: rgba(0, 86, 179, 0.45);
  background: rgba(0, 86, 179, 0.12);
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.55rem;
}

.export-actions .btn {
  width: auto;
  min-height: 2.45rem;
  font-size: 0.78rem;
}

.export-note {
  margin-top: -0.35rem;
  margin-bottom: 0.85rem;
  font-size: 0.72rem;
}

.export-note code {
  font-size: 0.68rem;
  font-weight: 650;
}

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 1rem;
  margin-bottom: 0.45rem;
}
.field-inline {
  margin: 0;
  min-width: 8rem;
  flex: 1 1 8rem;
  max-width: 14rem;
}
.field-inline span {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-400);
}
.btn-sm {
  min-height: 2.35rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  flex: 0 0 auto;
  align-self: flex-end;
}
.table-hint {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
}

.table-wrap {
  overflow: auto;
  border-radius: 1rem;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.72);
  max-height: min(40rem, 62vh);
}
table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
th, td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid rgba(0, 35, 102, 0.08);
  vertical-align: middle;
}
th {
  position: sticky;
  top: 0;
  background: rgba(244, 249, 255, 0.96);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-500);
  z-index: 1;
}
th.th-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th.th-sortable:hover {
  background: rgba(219, 234, 254, 0.95);
  color: var(--navy);
}
.th-sort {
  display: inline-block;
  margin-left: 0.2rem;
  font-size: 0.62rem;
  opacity: 0.45;
  vertical-align: middle;
}
.th-sort.is-active {
  opacity: 1;
  color: var(--navy);
  font-weight: 900;
}
.badge {
  display: inline-flex;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
}
.badge-miss { background: #ffe4e8; color: #9f1239; }
.badge-ok { background: #dcfce7; color: #166534; }
.badge-warn { background: #ffedd5; color: #9a3412; }
.badge-info { background: #dbeafe; color: #1e40af; }
.cart-cell { min-width: 7.5rem; line-height: 1.35; }
.cart-cell .badge { display: inline-block; margin-top: 0.2rem; white-space: nowrap; }
.cart-muted { color: #64748b; }
.cart-arrow { color: #64748b; font-size: 0.85em; }
.note-snippet { display: inline-block; max-width: 14rem; font-size: 0.88rem; color: #334155; }

.row-selectable { cursor: pointer; }
.row-selectable:hover td { background: rgba(219, 234, 254, 0.35); }
.row-selectable.is-selected td {
  background: rgba(191, 219, 254, 0.55);
}
.edit-row-btn { min-height: 1.85rem; padding: 0.15rem 0.55rem; font-size: 0.78rem; }

.tech-panel {
  margin: 1rem 0 0.5rem;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  border: 2px solid rgba(79, 70, 229, 0.35);
  background: linear-gradient(180deg, rgba(238, 242, 255, 0.95), rgba(255, 255, 255, 0.92));
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
.tech-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.tech-panel-head h2 {
  margin: 0.15rem 0 0;
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 1.25rem;
}
.tech-form { margin: 0; }
.tech-fieldset {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border-soft);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.65);
}
.tech-fieldset legend {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-400);
  padding: 0 0.25rem;
}
.tech-fieldset .choice {
  display: block;
  margin: 0.35rem 0;
  font-size: 0.88rem;
}
.tech-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.inventory-collapse {
  margin-top: 1.25rem;
  border: 1px solid var(--border-soft);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.55);
  overflow: hidden;
}
.inventory-collapse > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 800;
  font-family: "Outfit", system-ui, sans-serif;
  list-style: none;
}
.inventory-collapse > summary::-webkit-details-marker { display: none; }
.inventory-collapse > summary::before {
  content: "▸";
  margin-right: 0.45rem;
  color: var(--ink-400);
}
.inventory-collapse[open] > summary::before { content: "▾"; }
.inventory-summary {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-400);
}
.inventory-collapse-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid rgba(0, 35, 102, 0.06);
}
.inventory-table-wrap { max-height: min(28rem, 50vh); }

footer.site {
  text-align: center;
  padding: 0.5rem 1rem 1.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(0, 35, 102, 0.72);
}
footer.site a { color: var(--navy); font-weight: 700; text-decoration: none; }

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

.lead-callout {
  padding: 0.8rem 0 0.95rem;
  margin-bottom: 1.15rem;
  border-top: 1px solid rgba(0, 35, 102, 0.12);
  border-bottom: 1px solid rgba(0, 35, 102, 0.12);
  background: transparent;
  color: var(--ink-500);
}
.lead-callout strong {
  color: var(--navy);
  font-weight: 800;
}

.q {
  margin-bottom: 0.75rem;
  padding: 0.85rem 0.95rem 0.95rem 1rem;
  border-radius: 0.7rem;
  background: #fff;
  border: 1px solid rgba(0, 35, 102, 0.12);
  border-left: 3px solid var(--navy);
}
.q .field { margin-bottom: 0; }
.q .choice-row { margin-bottom: 0; }
.q .staff-list {
  margin-bottom: 0;
  border-color: rgba(0, 35, 102, 0.1);
  background: #f7f9fc;
}
.q .hint {
  margin: 0.5rem 0 0;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--ink-400);
}

label.field span.q-title,
.q-title {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  margin: 0 0 0.55rem;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 0.92rem;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1.3;
  text-transform: none;
  color: var(--navy);
}
.q-title em {
  font-style: normal;
  font-weight: 600;
  color: var(--ink-400);
  font-size: 0.8rem;
}
.q-num {
  flex-shrink: 0;
  display: inline;
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  color: var(--ink-400);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.q-num::after { content: "."; }

.q-name { border-left-color: var(--navy); }
.q-cart { border-left-color: #3d5680; }
.cart-code {
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--navy);
  margin: 0 0 0.3rem;
  line-height: 1.2;
}
.q-cart .hint { margin: 0 0 0.7rem; padding: 0; }
.q-cart .choice {
  text-align: center;
  min-height: 2.9rem;
  line-height: 1.25;
}
#cart-mismatch { margin-top: 0.7rem; }
#cart-mismatch .field { margin-bottom: 0; }
.q-count { border-left-color: #0056b3; }
.q-class { border-left-color: #5a7194; }
.q-extras {
  background: #f6f8fc;
  border-color: rgba(0, 35, 102, 0.18);
  border-left-color: var(--navy);
  box-shadow: none;
}
.q-extras .q-num,
.q-extras .q-title,
.q-extras label.field span.q-title { color: var(--navy); }
.q-extras input {
  border-color: rgba(0, 35, 102, 0.35);
  background: #fff;
  font-size: 1.05rem;
  font-weight: 700;
}
.q-notes {
  background: #fafbfc;
  border-left-color: #8a9bb5;
}

.report-page .picked {
  background: #f4f7fb;
  border: 1px solid rgba(0, 35, 102, 0.14);
  color: var(--navy);
}
.report-page .picked p { color: var(--ink-500); }
.report-page .picked .btn {
  background: #fff;
  border-color: rgba(0, 35, 102, 0.2);
  color: var(--navy);
}

.report-page .record {
  background: #f4f7fb;
  border: 1px solid rgba(0, 35, 102, 0.16);
  color: var(--ink-500);
}

.report-page .choice {
  background: #fff;
  border-width: 1.5px;
}
.report-page .choice-yes:has(input:checked),
.report-page .choice-no:has(input:checked) {
  border-color: var(--navy);
  background: rgba(0, 35, 102, 0.07);
  color: var(--navy);
}

.report-page input[type="number"],
.report-page input[type="search"],
.report-page input[type="text"],
.report-page textarea {
  background: #fff;
  border-width: 1.5px;
  border-color: rgba(0, 35, 102, 0.22);
}
.report-page input:focus,
.report-page textarea:focus {
  outline: 2px solid rgba(0, 35, 102, 0.22);
  border-color: var(--navy);
}
