:root {
  --black: #050706;
  --deep: #08120d;
  --green: #009b3a;
  --green-bright: #22c55e;
  --gold: #fed100;
  --gold-soft: #ffe169;
  --white: #f8fbf7;
  --muted: #bac5bd;
  --line: rgba(255, 255, 255, 0.13);
  --panel: rgba(7, 13, 9, 0.86);
  --panel-strong: rgba(12, 23, 15, 0.94);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--white);
  background:
    linear-gradient(135deg, transparent 0 43%, rgba(254, 209, 0, 0.30) 43% 46%, transparent 46% 100%),
    linear-gradient(45deg, transparent 0 43%, rgba(254, 209, 0, 0.22) 43% 46%, transparent 46% 100%),
    linear-gradient(90deg, rgba(0, 155, 58, 0.24) 0 14%, transparent 14% 86%, rgba(0, 155, 58, 0.18) 86% 100%),
    linear-gradient(rgba(254, 209, 0, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 155, 58, 0.055) 1px, transparent 1px),
    var(--black);
  background-size: auto, auto, auto, 72px 72px, 72px 72px, auto;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 72% 9%, rgba(254, 209, 0, 0.13), transparent 34rem);
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: 278px;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgba(5, 7, 6, 0.92);
  backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  font-weight: 950;
}

.brand-logo {
  width: 148px;
  height: 42px;
  flex: 0 0 auto;
  background: url("../img/careflow-logo.png") left center / contain no-repeat;
}

.brand span:last-child {
  display: none;
}

.app-sidebar nav {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.app-sidebar nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 850;
}

.app-sidebar nav a.active,
.app-sidebar nav a:hover,
.app-sidebar nav a:focus-visible {
  color: var(--gold);
  border-color: rgba(254, 209, 0, 0.28);
  background: rgba(254, 209, 0, 0.08);
}

.sidebar-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(0, 155, 58, 0.34);
  border-radius: 8px;
  background: rgba(0, 155, 58, 0.08);
}

.sidebar-card span,
.eyebrow,
.metrics-grid span,
.panel small {
  color: var(--gold-soft);
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar-card strong {
  display: block;
  margin: 8px 0;
  font-size: 1.35rem;
  line-height: 1.05;
}

.sidebar-card small,
p,
small,
.timeline span,
.roadmap span,
.asset-grid span,
.subaccount-grid small,
.module-list span {
  color: var(--muted);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: calc(100% - 278px);
  margin-left: 278px;
  padding: 22px;
}

.topbar,
.panel,
.metrics-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 22px;
}

.topbar h1,
.panel h2,
.call-card h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  max-width: 920px;
  font-size: clamp(2.1rem, 5vw, 4.9rem);
  line-height: 0.92;
}

.topbar p {
  max-width: 920px;
  margin: 12px 0 0;
  font-size: 1.02rem;
  line-height: 1.6;
}

.topbar-actions,
.form-actions,
.panel-header,
.segmented,
.dash-modules {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.primary-button,
.ghost-button,
.icon-button,
.segmented button,
.dash-modules button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  font-weight: 900;
}

.primary-button {
  padding: 0 18px;
  border: 1px solid transparent;
  color: #05170c;
  background: linear-gradient(145deg, var(--gold), #cba800);
}

.ghost-button,
.icon-button,
.segmented button,
.dash-modules button {
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: var(--white);
  background: rgba(255, 255, 255, 0.055);
}

.ghost-button {
  padding: 0 16px;
}

.icon-button {
  width: 42px;
  padding: 0;
}

.menu-button {
  display: none;
}

.menu-button span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--gold);
}

.metrics-grid,
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.metrics-grid article {
  min-width: 0;
  padding: 18px;
}

.metrics-grid strong {
  display: block;
  margin: 8px 0 4px;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  line-height: 1;
}

.gold-card {
  background: linear-gradient(140deg, rgba(254, 209, 0, 0.20), rgba(0, 155, 58, 0.13));
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(330px, 0.75fr);
  gap: 14px;
  margin-top: 14px;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-header {
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel h2 {
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.segmented {
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.segmented button {
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
}

.segmented button.active,
.dash-modules button.active {
  color: #06170c;
  border-color: transparent;
  background: var(--gold);
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline article {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.timeline article.hidden {
  display: none;
}

.timeline b {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: var(--gold);
  background: rgba(254, 209, 0, 0.10);
}

.timeline strong {
  display: block;
  margin-bottom: 4px;
}

.timeline em,
.status-chip,
.readiness-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--gold);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 950;
  background: rgba(254, 209, 0, 0.09);
}

.checklist {
  display: grid;
  gap: 9px;
}

.checklist label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 38px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.checklist input {
  accent-color: var(--gold);
  transform: translateY(2px);
}

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

.roadmap,
.module-list,
.asset-grid {
  display: grid;
  gap: 10px;
}

.roadmap div,
.module-list div,
.asset-grid div,
.automation-lanes div {
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.roadmap strong,
.module-list b,
.asset-grid strong {
  display: block;
  margin-bottom: 5px;
}

.dash-preview {
  padding: 0;
  overflow: hidden;
}

.client-cover {
  min-height: 152px;
  padding: 18px;
  background:
    linear-gradient(130deg, rgba(0, 155, 58, 0.76), rgba(5, 7, 6, 0.30) 47%),
    linear-gradient(35deg, transparent 42%, rgba(254, 209, 0, 0.90) 42% 47%, transparent 47%),
    url("../img/careflow-logo.png") right 18px bottom 18px / 160px auto no-repeat,
    #050706;
}

.client-cover span {
  color: var(--gold-soft);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.client-cover strong {
  display: block;
  max-width: 260px;
  margin-top: 12px;
  font-size: 2rem;
  line-height: 1;
}

.dash-modules {
  flex-wrap: wrap;
  padding: 14px 14px 0;
}

.dash-modules button {
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
}

.module-list {
  padding: 14px;
}

.automation-lanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.automation-lanes div {
  display: grid;
  gap: 8px;
}

.automation-lanes b {
  color: var(--gold);
}

.automation-lanes span {
  padding: 8px;
  border-radius: 6px;
  color: var(--muted);
  background: rgba(0, 155, 58, 0.08);
}

.subaccount-panel {
  margin-top: 14px;
}

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

.subaccount-grid label {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 132px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.045);
  text-transform: none;
}

.subaccount-grid input {
  width: auto;
  min-height: auto;
  margin: 2px 0 0;
  accent-color: var(--gold);
}

.subaccount-grid strong {
  display: block;
  color: var(--white);
  font-size: 0.98rem;
  line-height: 1.2;
}

.subaccount-grid small {
  display: block;
  margin-top: 7px;
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.45;
  text-transform: none;
}

.lower-layout {
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.9fr);
}

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

label {
  color: var(--gold-soft);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

input,
select,
textarea {
  display: block;
  width: 100%;
  margin-top: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.055);
}

input,
select {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 94px;
  padding: 12px;
  resize: vertical;
}

select option {
  color: #09120d;
}

.form-actions {
  justify-content: space-between;
  flex-wrap: wrap;
  margin-top: 14px;
}

pre {
  min-height: 390px;
  margin: 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  color: var(--white);
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.call-card ol {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.welcome-card p {
  margin: 12px 0 0;
  line-height: 1.65;
}

.asset-panel {
  margin-top: 14px;
}

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

@media (max-width: 1180px) {
  .metrics-grid,
  .dashboard-grid,
  .asset-grid,
  .subaccount-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-layout,
  .lower-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 840px) {
  .app-sidebar {
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .app-sidebar.open {
    transform: translateX(0);
  }

  .app-shell {
    width: 100%;
    margin-left: 0;
    padding: 14px;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .topbar-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .menu-button {
    display: inline-grid;
    gap: 4px;
  }

  .metrics-grid,
  .dashboard-grid,
  .asset-grid,
  .subaccount-grid,
  .field-grid,
  .automation-lanes {
    grid-template-columns: 1fr;
  }

  .topbar h1 {
    font-size: clamp(2rem, 12vw, 3.2rem);
  }

  .timeline article {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .timeline em {
    grid-column: 2;
    width: fit-content;
  }
}

@media (max-width: 520px) {
  .topbar,
  .panel,
  .metrics-grid article {
    padding: 14px;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
  }
}
