:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --panel-soft: #f8faf7;
  --line: #dde4ec;
  --text: #17202a;
  --muted: #6b7684;
  --accent: #ff7a1a;
  --accent-soft: #fff1e8;
  --blue: #2f6df6;
  --teal: #18b7a0;
  --red: #d64545;
  --shadow: 0 18px 40px rgba(31, 45, 61, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

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

button {
  font: inherit;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 24px;
  border-right: 1px solid var(--line);
  background: #fffdf9;
}

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

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #2f6df6);
  font-weight: 800;
}

.brand h1,
.topbar h2,
.section-head h3,
.next-grid h3 {
  margin: 0;
  letter-spacing: 0;
}

.brand h1 {
  font-size: 22px;
}

.brand p,
.side-panel small,
.metric span,
.next-grid p {
  margin: 0;
  color: var(--muted);
}

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

.nav-list a {
  padding: 11px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 650;
}

.nav-list a.active,
.nav-list a:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.side-panel {
  display: grid;
  gap: 5px;
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.label,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

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

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

.topbar h2 {
  margin-top: 8px;
  font-size: 30px;
  line-height: 1.22;
}

.health {
  min-width: 112px;
  padding: 10px 14px;
  border: 1px solid rgba(24, 183, 160, 0.28);
  border-radius: 8px;
  color: #087866;
  background: rgba(24, 183, 160, 0.09);
  text-align: center;
  font-weight: 750;
}

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

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

.metric {
  padding: 18px;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 32px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 30px 0 14px;
}

.section-head.compact {
  margin: 0 0 14px;
}

.section-head h3 {
  margin-top: 5px;
  font-size: 22px;
}

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

.filter {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel);
  cursor: pointer;
}

.filter.active {
  border-color: rgba(255, 122, 26, 0.42);
  color: var(--text);
  background: var(--accent-soft);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 14px;
}

.service-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.service-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.service-card h4 {
  margin: 0;
  font-size: 18px;
}

.service-card p {
  min-height: 44px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.status {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}

.status.online {
  color: #087866;
  background: rgba(24, 183, 160, 0.12);
}

.status.planned {
  color: #8a5a00;
  background: rgba(255, 188, 66, 0.18);
}

.status.external {
  color: #264fa3;
  background: rgba(47, 109, 246, 0.12);
}

.service-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 2px;
}

.check-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.check-line small {
  color: var(--muted);
}

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

.open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 122, 26, 0.35);
  border-radius: 8px;
  color: var(--accent);
  background: #fff;
  font-weight: 750;
}

.panel {
  margin-top: 18px;
  padding: 18px;
}

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

.e2e-panel {
  scroll-margin-top: 18px;
}

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

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

.e2e-grid span,
.e2e-meta {
  color: var(--muted);
}

.e2e-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
}

.e2e-meta {
  margin: 8px 0 12px;
  line-height: 1.55;
}

.e2e-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.e2e-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.e2e-list span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

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

.matrix th,
.matrix td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.matrix th {
  color: var(--muted);
  font-size: 13px;
}

.tag {
  display: inline-flex;
  min-width: 82px;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}

.tag.core,
.tag.online {
  color: #087866;
  background: rgba(24, 183, 160, 0.12);
}

.tag.partial {
  color: #264fa3;
  background: rgba(47, 109, 246, 0.12);
}

.tag.pending {
  color: #8a5a00;
  background: rgba(255, 188, 66, 0.18);
}

.tag.invalid {
  color: #9f2f2f;
  background: rgba(214, 69, 69, 0.11);
}

.tag.not_required {
  color: var(--muted);
  background: #eef2f5;
}

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

.audit-strip > div {
  min-height: 58px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.audit-strip .health {
  display: grid;
  place-items: center;
  min-width: 0;
}

.audit-strip span {
  color: var(--muted);
}

.audit-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.audit-list {
  margin-bottom: 14px;
}

.next-grid {
  margin-top: 18px;
}

.next-grid article {
  padding: 18px;
}

.step {
  display: inline-grid;
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
}

.next-grid h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

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

  .sidebar {
    position: static;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .nav-list {
    grid-auto-flow: column;
    overflow-x: auto;
  }

  .side-panel {
    margin-left: auto;
    margin-top: 0;
  }

  .cards,
  .summary-grid,
  .next-grid,
  .e2e-grid,
  .audit-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .content,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar h2 {
    font-size: 24px;
  }

  .cards,
  .summary-grid,
  .next-grid,
  .e2e-grid,
  .audit-strip {
    grid-template-columns: 1fr;
  }

  .side-panel {
    width: 100%;
    margin-left: 0;
  }
}
