:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-strong: #eef4f3;
  --text: #172a36;
  --muted: #667782;
  --line: #dbe4e8;
  --primary: #167c78;
  --primary-dark: #0d5c58;
  --accent: #b65a50;
  --warning: #8f5a18;
  --shadow: 0 18px 55px rgba(23, 42, 54, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  font-size: 16px;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--primary-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0.82rem 0.9rem;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 124, 120, 0.14);
}

label {
  color: #394b55;
  font-weight: 700;
}

label.required::after {
  content: " *";
  color: #b42318;
  font-weight: 900;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
  padding: 0.9rem clamp(1rem, 3vw, 2.5rem);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  font-weight: 800;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-size: 0.82rem;
  letter-spacing: 0;
}

.nav-links,
.account-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links {
  justify-content: center;
}

.account-links {
  justify-content: flex-end;
}

.account-links form {
  margin: 0;
}

.account-links button,
.primary-link,
.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  border: 0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.account-links button,
.secondary-action {
  background: var(--surface-strong);
  color: var(--text);
}

.primary-link,
.primary-action {
  background: var(--primary);
  color: #fff;
}

.primary-link:hover,
.primary-action:hover,
.secondary-action:hover {
  text-decoration: none;
  filter: brightness(0.97);
}

.disabled-action,
.disabled-action:hover {
  cursor: not-allowed;
  opacity: 0.58;
  filter: none;
}

.page-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.compact-hero {
  border: 1px solid rgba(199, 215, 221, 0.9);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: clamp(1.2rem, 2.6vw, 2rem);
}

.compact-hero h1 {
  margin: 0.15rem 0 0.45rem;
  font-size: clamp(1.8rem, 3vw, 2.75rem);
  line-height: 1.05;
}

.compact-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  display: inline-block;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem clamp(1rem, 3vw, 2.5rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.search-band,
.panel,
.auth-panel,
.empty-state,
.service-card,
.quick-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-band {
  display: grid;
  grid-template-columns: minmax(240px, 0.55fr) minmax(520px, 1.45fr);
  gap: 1.5rem;
  align-items: start;
  padding: clamp(1rem, 3vw, 2rem);
  margin-bottom: 1.2rem;
}

.search-band h1,
.panel h1,
.auth-panel h1,
.empty-state h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
}

.panel h2,
.service-card h2,
.empty-state h2,
.quick-card strong {
  margin: 0;
  font-size: 1.15rem;
}

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.muted-line,
.service-meta {
  color: var(--muted);
}

.small-break {
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.search-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.search-copy {
  display: grid;
  gap: 0.65rem;
}

.search-copy .muted-line {
  margin: 0;
}

.search-field {
  display: grid;
  gap: 0.35rem;
}

.search-field label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.search-field-wide {
  grid-column: span 2;
}

.search-actions {
  display: flex;
  align-items: end;
  gap: 0.65rem;
}

.search-actions .primary-action,
.search-actions .secondary-action {
  min-width: 7rem;
}

.results-heading {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65rem;
  color: var(--muted);
}

.results-heading strong {
  color: var(--text);
}

.service-grid,
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.service-card,
.quick-card,
.panel,
.empty-state {
  padding: 1.25rem;
}

.service-card {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
}

.service-card p {
  margin: 0.5rem 0 0;
}

.service-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  color: var(--muted);
  font-weight: 700;
}

.pill {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: #eef4f3;
  color: var(--primary-dark);
  padding: 0.35rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 900;
}

.request-service-summary {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  border: 1px solid rgba(199, 215, 221, 0.9);
  border-radius: 8px;
  background: #fbfdfe;
  padding: 1rem;
}

.request-service-summary h2 {
  margin: 0;
  color: #203541;
}

.request-service-summary dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
}

.request-service-summary dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.request-service-summary dd {
  margin: 0.15rem 0 0;
  font-weight: 800;
}

.contact-card {
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}

.contact-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.contact-lines a,
.contact-lines span {
  overflow-wrap: anywhere;
}

.auth-shell {
  display: grid;
  min-height: calc(100vh - 190px);
  place-items: center;
}

.auth-panel {
  width: min(460px, 100%);
  padding: clamp(1.2rem, 4vw, 2rem);
}

.auth-panel.wide {
  width: min(820px, 100%);
}

.form-grid {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

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

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

.check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.check-row input {
  width: auto;
}

.content-grid {
  display: grid;
  gap: 1rem;
}

.content-grid.narrow {
  width: min(720px, 100%);
  margin-inline: auto;
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.quick-card {
  display: grid;
  gap: 0.4rem;
  color: var(--text);
}

.quick-card span {
  color: var(--muted);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

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

.compact-form {
  margin: 0;
}

.feedback-form {
  display: grid;
  min-width: 260px;
  gap: 0.5rem;
}

.feedback-form textarea {
  min-height: 4.25rem;
}

.status-message,
.validation-summary {
  border: 1px solid rgba(22, 124, 120, 0.24);
  border-radius: 8px;
  background: #edf8f5;
  color: var(--primary-dark);
  padding: 0.85rem 1rem;
}

.status-message.warning,
.validation-summary.validation-summary-errors {
  border-color: rgba(143, 90, 24, 0.26);
  background: #fff6e8;
  color: var(--warning);
}

.field-validation-error {
  color: var(--accent);
  font-size: 0.88rem;
}

.field-validation-valid {
  display: none;
}

.intake-form .panel {
  position: relative;
  overflow: hidden;
  padding: clamp(1.2rem, 2.4vw, 1.7rem);
  border-color: rgba(102, 119, 130, 0.22);
  box-shadow: 0 14px 38px rgba(23, 42, 54, 0.07);
}

.intake-form .panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #d8a85f 58%, transparent);
}

.intake-form .panel h2 {
  margin-bottom: 1.15rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(219, 228, 232, 0.85);
  color: #203541;
}

.intake-form .form-grid {
  gap: 0.8rem 1.1rem;
}

.intake-form .two-columns {
  grid-template-columns: minmax(220px, 285px) minmax(0, 1fr);
  align-items: start;
}

.intake-form label:not(.check-row) {
  align-self: start;
  min-width: 0;
  padding-top: 0.78rem;
  color: #314854;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intake-form input,
.intake-form select,
.intake-form textarea {
  min-height: 2.95rem;
  background: #fbfdfe;
}

.intake-form input:hover,
.intake-form select:hover,
.intake-form textarea:hover {
  border-color: rgba(22, 124, 120, 0.42);
}

.intake-form textarea,
.intake-form select[multiple] {
  align-self: stretch;
}

.intake-form select[multiple] {
  min-height: 10rem;
}

.intake-form .check-row {
  min-height: 2.7rem;
  border: 1px solid rgba(219, 228, 232, 0.92);
  border-radius: 8px;
  background: #fbfdfe;
  padding: 0.7rem 0.85rem;
}

.intake-form .field-validation-error {
  grid-column: 2;
  margin-top: -0.45rem;
  line-height: 1.3;
}

.secret-box {
  border: 1px dashed var(--primary);
  border-radius: 8px;
  background: #f1faf8;
  padding: 1rem;
  overflow-wrap: anywhere;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-weight: 800;
}

.qr-box {
  display: grid;
  width: min(260px, 100%);
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(23, 42, 54, 0.06);
  padding: 1rem;
  margin: 1rem 0;
}

.qr-box svg {
  display: block;
  width: 100%;
  height: auto;
}

.admin-filter-panel {
  padding: 1rem;
}

.admin-filters {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(5, minmax(150px, 1fr)) auto;
  gap: 0.85rem;
  align-items: end;
}

.admin-filters label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.admin-filter-actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.8rem;
}

.metric-card {
  border: 1px solid rgba(199, 215, 221, 0.9);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(23, 42, 54, 0.06);
  padding: 1rem;
  display: grid;
  gap: 0.28rem;
}

.metric-card span,
.metric-card small {
  color: var(--muted);
  font-weight: 700;
}

.metric-card strong {
  color: #1e3440;
  font-size: clamp(1.4rem, 2vw, 2rem);
  line-height: 1;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.6rem;
  border-radius: 999px;
  border: 1px solid rgba(22, 124, 120, 0.25);
  background: #edf8f5;
  color: var(--primary-dark);
  padding: 0.15rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.status-chip.muted {
  border-color: rgba(102, 119, 130, 0.28);
  background: #f3f6f7;
  color: var(--muted);
}

.table-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.table-actions form {
  margin: 0;
}

@media (max-width: 820px) {
  .topbar,
  .search-band,
  .split-grid,
  .two-columns {
    grid-template-columns: 1fr;
  }

  .nav-links,
  .account-links {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

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

  .search-field-wide {
    grid-column: auto;
  }

  .search-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .intake-form label:not(.check-row) {
    padding-top: 0;
    white-space: normal;
  }

  .intake-form .field-validation-error {
    grid-column: 1;
  }

  .admin-filters,
  .admin-metrics {
    grid-template-columns: 1fr;
  }

  .admin-filter-actions {
    justify-content: flex-start;
  }

  .request-service-summary dl {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-direction: column;
  }
}

/* Modern visual refresh: presentation-only overrides. */
:root {
  --bg: #f4f7f8;
  --surface: #ffffff;
  --surface-strong: #e9f1ef;
  --text: #172832;
  --muted: #687a84;
  --line: #d9e3e7;
  --primary: #167c78;
  --primary-dark: #0c5653;
  --accent: #b65a50;
  --warning: #8f5a18;
  --shadow: 0 18px 48px rgba(23, 42, 54, 0.09);
  --shadow-soft: 0 8px 22px rgba(23, 42, 54, 0.06);
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

body {
  background:
    radial-gradient(circle at top left, rgba(22, 124, 120, 0.08), transparent 34rem),
    linear-gradient(180deg, #f9fbfb 0%, var(--bg) 42%, #f7f9fa 100%);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

a {
  text-underline-offset: 0.18em;
}

input,
select,
textarea {
  min-height: 2.9rem;
  border-color: var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #c3d3d8;
  background: #fcfefe;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(22, 124, 120, 0.16);
}

input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

label {
  color: #31444e;
  font-weight: 800;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th {
  background: #f8fbfb;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

tbody tr {
  transition: background-color 160ms ease;
}

tbody tr:hover {
  background: rgba(22, 124, 120, 0.035);
}

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

.topbar {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1.25rem;
  background: rgba(255, 255, 255, 0.88);
  border-bottom-color: rgba(217, 227, 231, 0.9);
  box-shadow: 0 8px 24px rgba(23, 42, 54, 0.045);
}

.brand {
  font-weight: 900;
  white-space: nowrap;
}

.brand-mark {
  width: 2.35rem;
  height: 2.35rem;
  background: linear-gradient(135deg, var(--primary), #2f9d92);
  box-shadow: 0 10px 24px rgba(22, 124, 120, 0.24);
  font-weight: 900;
}

.nav-links {
  flex-wrap: wrap;
}

.nav-links,
.account-links {
  gap: 0.4rem;
}

.nav-links a,
.account-links > a:not(.primary-link) {
  border-radius: 999px;
  color: #31444e;
  padding: 0.55rem 0.8rem;
  font-size: 0.94rem;
  font-weight: 800;
  transition: background-color 160ms ease, color 160ms ease;
}

.nav-links a:hover,
.account-links > a:not(.primary-link):hover {
  background: #e7f5f2;
  color: var(--primary-dark);
  text-decoration: none;
}

.account-links {
  flex-wrap: wrap;
}

.account-name {
  max-width: 14rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 0.48rem 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 800;
}

.account-links button,
.primary-link,
.primary-action,
.secondary-action {
  border-radius: var(--radius-sm);
  line-height: 1.1;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, color 160ms ease;
}

.primary-link,
.primary-action {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 12px 24px rgba(22, 124, 120, 0.18);
}

.account-links button,
.secondary-action {
  box-shadow: inset 0 0 0 1px rgba(195, 211, 216, 0.7);
}

.primary-link:hover,
.primary-action:hover,
.secondary-action:hover,
.account-links button:hover {
  transform: translateY(-1px);
}

.disabled-action,
.disabled-action:hover,
button:disabled:hover {
  transform: none;
}

.page-shell {
  width: min(1240px, calc(100% - 2rem));
  padding-top: clamp(1.2rem, 2.4vw, 2.2rem);
}

.site-footer {
  background: rgba(255, 255, 255, 0.72);
  font-weight: 700;
}

.compact-hero,
.search-band,
.panel,
.auth-panel,
.empty-state,
.service-card,
.quick-card {
  border-color: rgba(217, 227, 231, 0.95);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.94);
}

.compact-hero h1,
.search-band h1,
.panel h1,
.auth-panel h1,
.empty-state h1 {
  color: var(--text);
  font-size: clamp(1.85rem, 3.7vw, 3.1rem);
  line-height: 1.04;
}

.search-band {
  grid-template-columns: minmax(260px, 0.52fr) minmax(520px, 1.48fr);
  gap: clamp(1rem, 2vw, 1.75rem);
  padding: clamp(1.15rem, 3vw, 2.2rem);
}

.search-form {
  border: 1px solid rgba(217, 227, 231, 0.75);
  border-radius: var(--radius-md);
  background: #f8fbfb;
  padding: 0.9rem;
}

.search-field label,
.admin-filters label {
  font-size: 0.76rem;
  letter-spacing: 0.02em;
}

.results-heading {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.76);
  padding: 0.85rem 1rem;
}

.service-grid,
.quick-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.service-card {
  min-height: 270px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.service-card:hover {
  border-color: rgba(22, 124, 120, 0.22);
  box-shadow: 0 26px 70px rgba(23, 42, 54, 0.12);
  transform: translateY(-2px);
}

.service-card h2,
.panel h2,
.empty-state h2,
.quick-card strong {
  color: var(--text);
  line-height: 1.25;
}

.service-footer {
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
  font-weight: 800;
}

.pill {
  border: 1px solid rgba(22, 124, 120, 0.12);
  background: #e7f5f2;
}

.auth-panel {
  box-shadow: 0 26px 70px rgba(23, 42, 54, 0.12);
}

.form-grid {
  gap: 0.72rem;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

.status-message,
.validation-summary {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  font-weight: 700;
}

.field-validation-error {
  color: #b42318;
  font-weight: 700;
}

.request-service-summary,
.secret-box,
.metric-card {
  border-radius: var(--radius-md);
}

.request-service-summary {
  background: #f8fbfb;
}

.metric-card {
  box-shadow: var(--shadow-soft);
}

.status-chip {
  font-weight: 900;
}

@media (max-width: 1060px) {
  .topbar {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .nav-links,
  .account-links {
    justify-content: flex-start;
  }

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

@media (max-width: 820px) {
  .page-shell {
    width: min(100% - 1rem, 1240px);
    padding-top: 1rem;
  }

  .topbar {
    padding: 0.85rem 1rem;
  }

  .nav-links,
  .account-links {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.15rem;
  }

  .nav-links a,
  .account-links > a:not(.primary-link),
  .account-links button,
  .primary-link {
    white-space: nowrap;
  }

  .section-heading,
  .results-heading,
  .service-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
