:root {
  --ink-950: #071426;
  --ink-900: #0a1f38;
  --ink-800: #102b4b;
  --ink-700: #183a62;
  --text: #081832;
  --muted: #5e708a;
  --subtle: #8a9ab0;
  --line: #dbe5ef;
  --line-soft: #edf2f7;
  --surface: #ffffff;
  --canvas: #f4f8fb;
  --teal: #12a889;
  --teal-dark: #087e69;
  --teal-soft: #e6f8f4;
  --blue: #2563eb;
  --blue-soft: #e9f1ff;
  --amber: #d87906;
  --amber-soft: #fff4df;
  --red: #dc3f3f;
  --red-soft: #fff0f0;
  --purple: #7058d8;
  --purple-soft: #f0edff;
  --shadow-soft: 0 18px 45px rgba(5, 31, 56, 0.08);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1120px;
  min-height: 100vh;
  color: var(--text);
  background: var(--ink-950);
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
  color: #d8e7f7;
  background:
    linear-gradient(180deg, rgba(30, 76, 119, 0.22), rgba(7, 20, 38, 0)),
    var(--ink-950);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  padding: 0 8px 22px;
}

.brand-mark,
.avatar,
.site-mark {
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  color: white;
  background: var(--teal);
  box-shadow: inset 0 -8px 16px rgba(0, 0, 0, 0.12);
}

.brand strong,
.team-switch strong {
  display: block;
  color: white;
  font-size: 14px;
}

.brand span,
.team-switch span {
  display: block;
  margin-top: 2px;
  color: #90a8c2;
  font-size: 12px;
}

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

.nav-button {
  width: 100%;
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 9px;
  align-items: center;
  border: 0;
  border-radius: 7px;
  padding: 9px 10px;
  color: #c6d9ec;
  background: transparent;
  text-align: left;
  font-size: 13px;
}

.nav-button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: white;
}

.nav-button.active {
  color: white;
  background: rgba(31, 112, 180, 0.36);
  box-shadow: inset 3px 0 0 var(--teal);
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 10px;
  font-weight: 800;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.health-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: #cfe3f8;
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(18, 168, 137, 0.16);
}

.team-switch {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.avatar {
  width: 34px;
  height: 34px;
  color: white;
  background: #506a8a;
}

.workspace {
  min-width: 0;
  margin: 12px 12px 12px 0;
  padding: 22px 24px 28px;
  border-radius: 14px;
  background: var(--canvas);
  box-shadow: -24px 0 80px rgba(0, 0, 0, 0.18);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 6px 0 18px;
  background: color-mix(in srgb, var(--canvas) 92%, transparent);
  backdrop-filter: blur(14px);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal-dark);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 800;
}

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

h1 {
  margin-bottom: 5px;
  font-size: 26px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 2px;
  font-size: 18px;
}

h3 {
  margin-bottom: 6px;
  font-size: 14px;
}

.topbar p,
.section-heading p,
.rail-heading p,
.small-muted {
  color: var(--muted);
}

.topbar p {
  margin-bottom: 0;
  font-size: 14px;
}

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

.select-label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

select,
.search-input,
.text-input {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 11px;
  color: var(--text);
  background: white;
  outline: none;
}

select:focus,
.search-input:focus,
.text-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(18, 168, 137, 0.14);
}

.ghost-button,
.primary-button,
.text-button,
.row-button {
  border-radius: 7px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink-800);
  font-weight: 700;
  min-height: 36px;
  padding: 0 13px;
}

.primary-button {
  border-color: var(--teal);
  color: white;
  background: var(--teal);
}

.primary-button:hover {
  background: var(--teal-dark);
}

.text-button {
  min-height: 28px;
  padding: 0 8px;
  color: var(--blue);
  border-color: transparent;
  background: transparent;
}

.row-button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

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

.metric:last-child {
  border-right: 0;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 3px;
  font-size: 24px;
}

.delta {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 800;
}

.delta.good {
  color: var(--teal-dark);
}

.delta.warn {
  color: var(--amber);
}

.delta.bad {
  color: var(--red);
}

.mini-spark {
  width: 74px;
  height: 32px;
  align-self: end;
}

.content-stage {
  display: grid;
  gap: 14px;
}

.data-note {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #bfe9df;
  border-radius: var(--radius);
  color: var(--teal-dark);
  background: var(--teal-soft);
  font-size: 12px;
}

.data-note span {
  color: #315d55;
  flex: 1;
}

.data-note code {
  padding: 4px 7px;
  border-radius: 6px;
  color: var(--ink-900);
  background: white;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 14px;
  align-items: start;
}

.section,
.action-rail,
.report-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.section {
  overflow: hidden;
}

.section-header,
.rail-heading,
.table-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.section-heading p,
.rail-heading p {
  margin: 3px 0 0;
  font-size: 12px;
}

.table-toolbar {
  padding: 10px 12px;
  background: #fbfdff;
}

.table-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.table-wrap {
  overflow: auto;
}

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

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

.overview-grid th,
.overview-grid td {
  padding: 9px 8px;
  font-size: 12px;
}

.overview-grid .site-cell {
  min-width: 188px;
}

.overview-grid .site-domain {
  max-width: 168px;
  overflow: hidden;
  text-overflow: ellipsis;
}

th {
  position: sticky;
  top: 0;
  z-index: 3;
  color: var(--muted);
  background: #fbfdff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

tbody tr {
  transition: background 150ms ease;
}

tbody tr:hover {
  background: #f7fbff;
}

.clickable-row {
  cursor: pointer;
}

.site-cell {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  align-items: center;
  min-width: 230px;
}

.site-mark {
  width: 30px;
  height: 30px;
  color: white;
  font-size: 11px;
}

.site-name {
  display: block;
  font-weight: 800;
}

.site-domain {
  display: block;
  margin-top: 2px;
  color: var(--subtle);
  font-size: 11px;
}

.sparkline {
  width: 82px;
  height: 28px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 800;
}

.badge.good {
  color: var(--teal-dark);
  background: var(--teal-soft);
  border-color: #bdeee3;
}

.badge.stable {
  color: #2557a6;
  background: var(--blue-soft);
  border-color: #cfe0ff;
}

.badge.warn {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: #ffdf9f;
}

.badge.bad {
  color: var(--red);
  background: var(--red-soft);
  border-color: #ffc7c7;
}

.badge.neutral {
  color: var(--muted);
  background: #f2f5f9;
  border-color: var(--line);
}

.muted-dash {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 800;
}

.setup-needed {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #ffdf9f;
  border-radius: 999px;
  color: var(--amber);
  background: var(--amber-soft);
  font-size: 11px;
  font-weight: 800;
}

.inline-code {
  display: inline-block;
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  padding: 4px 6px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  color: var(--ink-800);
  background: #f7fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
}

.install-table td:last-child {
  min-width: 420px;
  max-width: 560px;
}

.score {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 26px;
  border-radius: 6px;
  font-weight: 900;
}

.score.good {
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.score.warn {
  color: var(--amber);
  background: var(--amber-soft);
}

.score.bad {
  color: var(--red);
  background: var(--red-soft);
}

.action-rail {
  position: sticky;
  top: 128px;
  overflow: hidden;
}

.queue-list {
  display: grid;
}

.queue-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  align-items: center;
}

.queue-item:last-child {
  border-bottom: 0;
}

.queue-item strong {
  display: block;
  font-size: 13px;
}

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

.chevron {
  color: var(--subtle);
  font-weight: 900;
}

.band-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.75fr);
  gap: 14px;
}

.chart-band {
  padding: 14px 16px 12px;
}

.chart {
  width: 100%;
  height: 220px;
  margin-top: 8px;
}

.chart-gridline {
  stroke: #e8eef5;
  stroke-width: 1;
}

.chart-label {
  fill: var(--muted);
  font-size: 11px;
}

.insight-list {
  display: grid;
}

.insight-row {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  align-items: center;
}

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

.color-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

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

.detail-hero {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

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

.stat-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid var(--line-soft);
}

.stat {
  padding: 12px 14px;
  border-right: 1px solid var(--line-soft);
}

.stat:last-child {
  border-right: 0;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.75fr);
  gap: 14px;
}

.segmented {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7fafc;
}

.segment {
  border: 0;
  border-radius: 5px;
  min-height: 28px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.segment.active {
  color: var(--text);
  background: white;
  box-shadow: 0 1px 3px rgba(5, 31, 56, 0.12);
}

.funnel {
  padding: 14px 16px;
}

.funnel-row {
  display: grid;
  grid-template-columns: 150px 1fr 70px;
  gap: 12px;
  align-items: center;
  margin-bottom: 11px;
  font-size: 13px;
}

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

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.source-list {
  padding: 14px 16px;
}

.source-row {
  display: grid;
  grid-template-columns: 1fr 70px;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
}

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

.report-card {
  padding: 14px;
}

.report-card p {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 12px;
}

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

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

.form-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.side-summary {
  display: grid;
  gap: 10px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}

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

.metadata-list {
  display: grid;
}

.metadata-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  align-items: start;
  font-size: 12px;
}

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

.metadata-row span {
  color: var(--muted);
  font-weight: 800;
}

.metadata-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.metadata-row a {
  color: var(--blue);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 24px;
  text-align: center;
}

.empty-state p {
  max-width: 480px;
  color: var(--muted);
}

.code-box {
  margin: 14px 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #d8e7f7;
  background: var(--ink-900);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  overflow: auto;
}

@media (max-width: 1180px) {
  body {
    min-width: 960px;
  }

  .app-shell {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .brand {
    grid-template-columns: 1fr;
    justify-items: center;
    padding-inline: 0;
  }

  .brand div:not(.brand-mark),
  .nav-button span:not(.nav-icon),
  .sidebar-footer {
    display: none;
  }

  .nav-button {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .workspace {
    padding-inline: 18px;
  }
}

@media (max-width: 860px) {
  body {
    min-width: 0;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 10px;
  }

  .brand {
    display: flex;
    padding: 0 8px 0 0;
  }

  .nav-list {
    display: flex;
    min-width: max-content;
  }

  .nav-button {
    grid-template-columns: 22px auto;
  }

  .nav-button span:not(.nav-icon),
  .brand div:not(.brand-mark) {
    display: block;
  }

  .workspace {
    margin: 0;
    border-radius: 0;
  }

  .topbar,
  .overview-grid,
  .band-grid,
  .split-detail,
  .two-col,
  .settings-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .metric-strip,
  .stat-strip,
  .report-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .metric,
  .stat {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .action-rail {
    position: static;
  }
}
