:root {
  --ink: #1e2724;
  --muted: #63716c;
  --line: #dbe3df;
  --paper: #fbfcfa;
  --panel: #ffffff;
  --green: #24795c;
  --teal: #008a94;
  --amber: #c9811c;
  --red: #b54848;
  --blue: #315a8c;
  --shadow: 0 20px 50px rgba(31, 51, 44, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

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

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr auto;
  gap: 18px;
  align-items: center;
  min-height: 72px;
  padding: 12px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 252, 250, 0.94);
  backdrop-filter: blur(12px);
}

.brand,
.main-nav a,
.call-link {
  color: inherit;
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 7px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.main-nav a {
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 700;
}

.main-nav a.is-active,
.main-nav a:hover {
  background: #e8f2ee;
  color: var(--green);
}

.call-link,
.secondary-button,
.ghost-button,
.provider-actions button,
.primary-wide,
.search-card button {
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 800;
}

.call-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  background: var(--ink);
  color: #fff;
}

.icon-phone,
.icon-search {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 16px;
}

.icon-phone::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-left-color: transparent;
  border-radius: 50%;
  transform: rotate(38deg);
}

.icon-search::before {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.icon-search::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 2px;
  right: 1px;
  bottom: 2px;
  background: currentColor;
  transform: rotate(45deg);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.hero {
  position: relative;
  min-height: 610px;
  display: grid;
  align-items: end;
  overflow: hidden;
  background: #101c18;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.74;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(8, 23, 19, 0.88), rgba(8, 23, 19, 0.55), rgba(8, 23, 19, 0.2));
}

.hero-panel {
  position: relative;
  z-index: 1;
  width: min(940px, calc(100% - 32px));
  margin: 0 auto 42px;
  color: #fff;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #91e7db;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 16px;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.97;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.hero-panel > p:not(.eyebrow) {
  max-width: 690px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 18px;
  line-height: 1.5;
}

.search-card {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(170px, 240px) 150px;
  gap: 10px;
  width: min(900px, 100%);
  margin-top: 26px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.search-card label span {
  padding-left: 12px;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.search-card input,
.search-card select {
  border-color: transparent;
  background: #f3f7f5;
}

.search-card button,
.primary-wide {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 0 18px;
  background: var(--green);
  color: #fff;
}

.section-shell,
.content-grid,
.page-intro,
.form-layout,
.metrics-grid,
.staff-grid {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.section-shell {
  padding: 38px 0 24px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading.compact {
  align-items: center;
  margin-bottom: 14px;
}

.ghost-button,
.secondary-button {
  min-height: 40px;
  padding: 0 14px;
}

.ghost-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--green);
}

.secondary-button {
  background: #e8f2ee;
  color: var(--green);
}

.category-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.category-chip {
  min-height: 84px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.category-chip strong,
.category-chip span {
  display: block;
}

.category-chip strong {
  margin-bottom: 8px;
  font-size: 14px;
}

.category-chip span {
  color: var(--muted);
  font-size: 12px;
}

.category-chip.is-active {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}

.content-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  padding: 12px 0 56px;
}

.filters-panel,
.results-panel,
.provider-form,
.process-panel,
.admin-panel,
.callcenter-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.filters-panel {
  position: sticky;
  top: 92px;
  align-self: start;
  display: grid;
  gap: 16px;
  padding: 18px;
}

.filters-panel h2 {
  font-size: 18px;
}

.ad-box {
  display: grid;
  gap: 6px;
  min-height: 170px;
  border-radius: 8px;
  padding: 16px;
  background: #fff6e8;
  color: #5a3a12;
}

.ad-box span {
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.ad-box p {
  margin: 0;
  color: #74531f;
  line-height: 1.45;
}

.results-panel {
  padding: 18px;
}

.provider-list {
  display: grid;
  gap: 12px;
}

.provider-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  min-height: 170px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.provider-card.vip {
  border-color: rgba(201, 129, 28, 0.5);
  background: #fffaf2;
}

.provider-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.avatar {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  background: #e8f2ee;
  color: var(--green);
  font-weight: 900;
}

.provider-title h3 {
  margin: 0 0 4px;
  font-size: 19px;
}

.provider-title p,
.provider-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.badges,
.provider-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.badge,
.provider-meta span,
.status-stack span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  background: #eef4f1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.badge.verified {
  background: #e8f2ee;
  color: var(--green);
}

.badge.vip {
  background: #fff0d9;
  color: var(--amber);
}

.badge.plan {
  background: #eaf0f8;
  color: var(--blue);
}

.provider-meta {
  margin-top: 14px;
}

.provider-actions {
  display: grid;
  align-content: start;
  gap: 8px;
  width: 170px;
}

.provider-actions button {
  min-height: 38px;
  padding: 0 10px;
}

.provider-actions button:first-child {
  background: var(--green);
  color: #fff;
}

.provider-actions button:nth-child(2) {
  background: #eaf0f8;
  color: var(--blue);
}

.provider-actions button:nth-child(3) {
  background: #fff0d9;
  color: #7c4d08;
}

.provider-actions button:nth-child(4) {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.detail-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: var(--panel);
}

.detail-shell[hidden] {
  display: none;
}

.provider-detail {
  display: grid;
  gap: 18px;
}

.detail-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.avatar.large {
  width: 72px;
  height: 72px;
  font-size: 22px;
}

.detail-hero h3 {
  margin: 8px 0 5px;
  font-size: 28px;
}

.detail-hero p {
  margin: 0;
  color: var(--muted);
}

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

.detail-grid section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #f9fbfa;
}

.detail-grid h4 {
  margin: 0 0 12px;
  font-size: 16px;
}

.detail-grid p,
.detail-grid li,
.detail-grid dd {
  color: var(--muted);
  line-height: 1.5;
}

.detail-grid p:last-child {
  margin-bottom: 0;
}

.detail-grid ul {
  margin: 0;
  padding-left: 18px;
}

.detail-grid dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.detail-grid dl div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
}

.detail-grid dt {
  color: var(--ink);
  font-weight: 900;
}

.detail-grid dd {
  margin: 0;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 900;
}

.detail-actions button:first-child {
  background: var(--green);
  color: #fff;
}

.detail-actions button:nth-child(2) {
  background: #eaf0f8;
  color: var(--blue);
}

.detail-actions button:nth-child(3) {
  background: #fff0d9;
  color: #7c4d08;
}

.page-intro {
  padding: 48px 0 22px;
}

.page-intro h1 {
  max-width: 820px;
  color: var(--ink);
  font-size: clamp(34px, 6vw, 58px);
}

.page-intro p {
  max-width: 760px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  padding-bottom: 56px;
}

.provider-form,
.process-panel,
.admin-panel,
.callcenter-panel {
  padding: 20px;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

fieldset {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

legend {
  padding: 0 8px;
  font-weight: 900;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-line input {
  width: 18px;
  min-height: 18px;
}

.process-panel ol {
  margin: 0 0 18px;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
}

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

.staff-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.provider-portal-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.provider-portal-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 56px;
}

.provider-account-card,
.portal-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.provider-account-card {
  position: sticky;
  top: 92px;
  align-self: start;
  display: grid;
  gap: 16px;
  padding: 20px;
}

.account-summary {
  display: grid;
  gap: 10px;
  margin: 0;
}

.account-summary div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.account-summary dt {
  color: var(--muted);
  font-weight: 900;
}

.account-summary dd {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
}

.provider-workspace {
  display: grid;
  gap: 16px;
}

.portal-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.portal-actions button {
  min-height: 46px;
  border: 0;
  border-radius: 7px;
  padding: 0 12px;
  background: #e8f2ee;
  color: var(--green);
  cursor: pointer;
  font-weight: 900;
}

.portal-actions button:first-child {
  background: var(--green);
  color: #fff;
}

.portal-panel {
  padding: 20px;
}

.provider-contact-list,
.provider-ledger-list {
  display: grid;
  gap: 10px;
}

.portal-list-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f9fbfa;
}

.portal-list-item h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.portal-list-item p {
  margin: 0;
  color: var(--muted);
}

.portal-list-item button {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  padding: 0 10px;
  background: #eaf0f8;
  color: var(--blue);
  cursor: pointer;
  font-weight: 800;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metrics-grid article {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
}

.metrics-grid span,
.metrics-grid small {
  color: var(--muted);
}

.metrics-grid strong {
  display: block;
  margin: 8px 0;
  font-size: 34px;
}

.staff-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  padding-bottom: 56px;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.invoice-module,
.payment-module {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.invoice-module p,
.payment-module p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.invoice-list,
.payment-list {
  display: grid;
  gap: 10px;
}

.invoice-item,
.payment-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f9fbfa;
}

.invoice-item h3,
.payment-item h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.invoice-item p,
.payment-item p {
  margin: 0;
  color: var(--muted);
}

.invoice-actions,
.payment-actions {
  display: flex;
  gap: 8px;
}

.invoice-actions button,
.payment-actions button {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  padding: 0 10px;
  cursor: pointer;
  font-weight: 800;
}

.invoice-actions button:first-child,
.payment-actions button:first-child {
  background: #eaf0f8;
  color: var(--blue);
}

.invoice-actions button:last-child,
.payment-actions button:last-child {
  background: #e8f2ee;
  color: var(--green);
}

.admin-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.admin-item h3 {
  margin: 0 0 5px;
}

.admin-item p {
  margin: 0;
  color: var(--muted);
}

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

.admin-actions button {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  padding: 0 10px;
  cursor: pointer;
  font-weight: 800;
}

.admin-actions button:first-child {
  background: #e8f2ee;
  color: var(--green);
}

.admin-actions button:last-child {
  background: #f8e8e8;
  color: var(--red);
}

.callcenter-panel {
  display: grid;
  align-content: start;
  gap: 14px;
}

.ticket-log {
  display: grid;
  gap: 8px;
  min-height: 180px;
  border-radius: 8px;
  padding: 14px;
  background: #f4f7f6;
  color: var(--muted);
}

.ticket-log p {
  margin: 0;
}

.log-entry {
  border-left: 3px solid var(--green);
  padding: 8px 0 8px 10px;
  background: #fff;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(360px, calc(100% - 36px));
  transform: translateY(16px);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 940px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .main-nav {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .call-link {
    justify-self: start;
  }

  .hero {
    min-height: 700px;
  }

  .hero::after {
    background: rgba(8, 23, 19, 0.66);
  }

  .search-card,
  .content-grid,
  .detail-grid,
  .form-layout,
  .provider-portal-grid,
  .staff-grid {
    grid-template-columns: 1fr;
  }

  .filters-panel {
    position: static;
  }

  .provider-account-card {
    position: static;
  }

  .category-strip,
  .metrics-grid,
  .portal-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .topbar {
    padding: 12px;
  }

  .hero {
    min-height: 760px;
  }

  .hero-panel {
    width: calc(100% - 24px);
    margin-bottom: 24px;
  }

  h1 {
    font-size: 40px;
  }

  .section-heading,
  .staff-intro,
  .provider-portal-intro,
  .provider-card,
  .detail-hero,
  .admin-item,
  .invoice-item,
  .payment-item,
  .portal-list-item {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .provider-actions {
    width: 100%;
  }

  .detail-grid dl div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .category-strip,
  .metrics-grid,
  .portal-actions,
  .form-row {
    grid-template-columns: 1fr;
  }

  .account-summary div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}
