:root {
  --bg: #f4f7fa;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #16202a;
  --muted: #647385;
  --line: #dbe4ec;
  --accent: #0b7f8f;
  --accent-dark: #24584e;
  --accent-soft: #e7f4f5;
  --good: #18724c;
  --warn: #a76800;
  --danger: #a33a3a;
  --shadow: 0 18px 50px rgba(22, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #ffffff;
  border-right: 1px solid var(--line);
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.brand {
  color: var(--text);
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  min-height: 46px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--accent), var(--accent-dark));
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  letter-spacing: 0;
}

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

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-link {
  align-items: center;
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  gap: 10px;
  min-height: 42px;
  padding: 9px 10px;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.nav-icon {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: inherit;
}

.sidebar-card {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel-soft);
}

.sidebar-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 18px;
}

.sidebar-card p {
  color: var(--muted);
  margin: 0 0 14px;
  line-height: 1.4;
}

.main {
  padding: 28px;
  min-width: 0;
}

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

.topbar h1 {
  margin: 5px 0 0;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: 0;
}

.topbar-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.eyebrow {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.search {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  min-width: 280px;
}

input,
select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  height: 42px;
  padding: 0 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 127, 143, 0.12);
}

.primary-button,
.secondary-button,
.ghost-button {
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 700;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
}

.secondary-button {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--text);
}

.ghost-button {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--accent-dark);
}

.full-width {
  width: 100%;
}

.company-strip,
.metrics-grid,
.content-grid,
.section-layout,
.option-grid,
.journey-grid {
  display: grid;
  gap: 16px;
}

.company-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.company-strip strong {
  display: block;
  margin-top: 6px;
}

.status-good {
  color: var(--good);
}

.view {
  display: none;
}

.view.is-visible {
  display: grid;
  gap: 16px;
}

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

.metric-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 150px;
  padding: 20px;
}

.metric-card strong {
  display: block;
  font-size: 34px;
  margin: 12px 0 8px;
  letter-spacing: 0;
}

.metric-card p,
.panel p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.content-grid {
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
}

.section-layout {
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
}

.decision-hero {
  align-items: stretch;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  overflow: hidden;
  padding: 28px;
}

.decision-copy {
  align-content: center;
  display: grid;
  gap: 16px;
  max-width: 760px;
}

.decision-copy h2 {
  font-size: 36px;
  line-height: 1.08;
  letter-spacing: 0;
  margin: 0;
}

.decision-copy p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
  margin: 0;
}

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

.onboarding-preview {
  background: var(--accent-soft);
  border: 1px solid #b8dadd;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  padding: 18px;
}

.phone-frame {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 18px;
}

.phone-frame strong {
  font-size: 22px;
  line-height: 1.15;
}

.phone-frame p,
.phone-frame small {
  color: var(--muted);
  line-height: 1.45;
}

.phone-code {
  border: 1px dashed var(--accent);
  border-radius: 8px;
  color: var(--accent-dark);
  font-weight: 900;
  letter-spacing: 0;
  padding: 12px;
  text-align: center;
}

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

.option-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  padding: 18px;
}

.option-card.is-featured {
  border-color: var(--accent);
  box-shadow: 0 20px 55px rgba(11, 127, 143, 0.15);
}

.option-card h3 {
  font-size: 22px;
  letter-spacing: 0;
  line-height: 1.15;
  margin: 0;
}

.option-card p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.option-card ul {
  color: var(--text);
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

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

.journey-grid-vertical {
  grid-template-columns: 1fr;
}

.journey-step {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 9px;
  padding: 16px;
}

.journey-step span {
  align-items: center;
  background: var(--accent);
  border-radius: 50%;
  color: #ffffff;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.journey-step strong {
  font-size: 17px;
}

.start-actions {
  margin-top: 16px;
}

.integration-map {
  display: grid;
  gap: 12px;
}

.handoff-row {
  align-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
  padding: 16px;
}

.handoff-row strong {
  display: block;
  font-size: 18px;
  margin: 6px 0;
}

.route-tag {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
  padding: 10px 12px;
}

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

.panel-wide {
  min-height: 320px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.panel h2 {
  margin: 5px 0 0;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

.segmented {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.segmented button {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.segmented button.is-selected {
  background: var(--accent);
  color: #ffffff;
}

.chart {
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 18px 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 12px;
  background: linear-gradient(180deg, #ffffff, #f7fbfc);
}

.chart span {
  display: block;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  min-height: 18px;
}

.chart-line span {
  background: linear-gradient(180deg, #6b9a78, var(--accent-dark));
}

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

.action-list button {
  min-height: 50px;
  text-align: left;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 8px;
  color: var(--text);
  font-weight: 700;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

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

th {
  background: #eef5f8;
  color: #394958;
  font-size: 13px;
}

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

.pill {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  min-height: 26px;
  padding: 0 10px;
}

.pill.good {
  background: #e8f5ee;
  color: var(--good);
}

.pill.warn {
  background: #fff5df;
  color: var(--warn);
}

.pill.muted {
  background: #eef1f4;
  color: var(--muted);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.price-card {
  text-align: left;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.price-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 127, 143, 0.1);
}

.price-card strong {
  font-size: 20px;
}

.price-card span {
  color: var(--muted);
  line-height: 1.4;
}

.price-card b {
  margin-top: 8px;
  font-size: 22px;
}

.quota {
  display: grid;
  gap: 14px;
}

.quota-track {
  background: #edf2f5;
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.quota-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.quota-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.quota-row:last-child {
  border-bottom: 0;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.filters label,
.settings-form label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 7px;
}

.filters label {
  min-width: 220px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.analytics-grid div {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.analytics-grid span,
.analytics-grid strong {
  display: block;
}

.analytics-grid span {
  color: var(--muted);
  font-size: 13px;
}

.analytics-grid strong {
  font-size: 26px;
  margin-top: 8px;
}

.check-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.settings-panel {
  max-width: 760px;
}

.settings-form {
  display: grid;
  gap: 14px;
}

dialog {
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(22, 32, 42, 0.22);
  width: min(480px, calc(100% - 32px));
}

dialog::backdrop {
  background: rgba(22, 32, 42, 0.46);
}

dialog form {
  padding: 24px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
}

dialog h2 {
  margin: 6px 0 10px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.screen {
  display: grid;
  gap: 18px;
}

.nav-caption {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  padding: 0 10px 4px;
  text-transform: uppercase;
}

.nav-list-admin {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.admin-mode .sidebar {
  background: #111827;
  border-right: 0;
}

.admin-mode .brand,
.admin-mode .brand small {
  color: #ffffff;
}

.admin-mode .brand small,
.admin-mode .nav-caption,
.admin-mode .nav-link {
  color: #9ca3af;
}

.admin-mode .nav-link.is-active,
.admin-mode .nav-link:hover {
  background: #1f2937;
  color: #ffffff;
}

.admin-mode .nav-icon {
  border-color: #374151;
}

.admin-mode .sidebar-card {
  background: #1f2937;
  border-color: #374151;
  color: #ffffff;
}

.admin-mode .sidebar-card p {
  color: #9ca3af;
}

.flow {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 16px;
}

.flow-step {
  align-items: center;
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  gap: 10px;
  min-height: 54px;
  padding: 0 12px;
}

.flow-step.is-selected {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.flow-step span {
  align-items: center;
  background: #eef1f4;
  border-radius: 50%;
  display: inline-flex;
  font-weight: 800;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.flow-step.is-selected span {
  background: var(--accent);
  color: #ffffff;
}

.notice-row,
.rules-box,
.impact-box,
.invite-card,
.contract-card,
.mini-list,
.dropzone {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.notice-row {
  align-items: center;
  background: var(--panel-soft);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
}

.notice-row strong {
  display: block;
  margin-bottom: 6px;
}

.order-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.summary-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 42px;
}

.field {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 8px;
}

.form-panel {
  min-height: 720px;
}

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

.input-like {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 12px;
}

.input-like em,
.input-like small {
  color: var(--warn);
  font-style: normal;
  font-size: 12px;
}

.rules-box,
.impact-box {
  background: var(--panel-soft);
  display: grid;
  gap: 11px;
  padding: 16px;
}

.check-row {
  align-items: center;
  display: flex;
  gap: 10px;
}

.check-row span {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 5px;
  display: inline-flex;
  height: 20px;
  justify-content: center;
  width: 20px;
}

.check-row span.is-checked {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: auto;
}

.invite-card {
  background: var(--accent-soft);
  border-color: var(--accent);
  display: grid;
  gap: 12px;
  padding: 18px;
}

.invite-card strong {
  font-size: 24px;
}

.large-icon {
  align-items: center;
  background: #ffffff;
  border-radius: 8px;
  color: var(--accent);
  display: inline-flex;
  font-size: 14px;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  width: 46px;
}

.warning-text {
  color: var(--warn) !important;
}

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

.stack {
  display: grid;
  gap: 16px;
}

.mini-list {
  background: var(--panel-soft);
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 12px;
}

.mini-list span {
  color: var(--warn);
  font-size: 12px;
}

.dropzone {
  align-items: center;
  background: var(--panel-soft);
  display: grid;
  justify-items: center;
  min-height: 190px;
  padding: 18px;
  text-align: center;
}

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

.contract-card {
  background: var(--panel-soft);
  display: grid;
  gap: 8px;
  padding: 16px;
}

.contract-card strong {
  font-size: 20px;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .sidebar-card {
    margin-top: 0;
  }

  .topbar,
  .panel-header {
    flex-direction: column;
  }

  .topbar-actions,
  .search {
    width: 100%;
  }
}

@media (max-width: 820px) {
  .main {
    padding: 16px;
  }

  .company-strip,
  .metrics-grid,
  .content-grid,
  .section-layout,
  .pricing-grid,
  .analytics-grid,
  .decision-hero,
  .option-grid,
  .journey-grid {
    grid-template-columns: 1fr;
  }

  .handoff-row {
    grid-template-columns: 1fr;
  }

  .nav-list {
    grid-template-columns: 1fr 1fr;
  }

  .topbar h1 {
    font-size: 28px;
  }
}

@media (max-width: 520px) {
  .nav-list {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    align-items: stretch;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }
}
