:root {
  --bg: #060a12;
  --surface: rgba(16, 22, 40, 0.72);
  --surface-strong: #0f1525;
  --surface-soft: rgba(255, 255, 255, 0.05);
  --line: rgba(100, 160, 255, 0.15);
  --line-strong: rgba(0, 212, 255, 0.38);
  --accent: #00d4ff;
  --accent-soft: rgba(0, 212, 255, 0.1);
  --ink: #e8ecf4;
  --muted: #8a94a8;
  --faint: #556074;
  --green: #00e676;
  --amber: #ffe88a;
  --rose: #ff8a9a;
  --radius: 8px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

.app-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 95% 60% at 18% 0%, rgba(0, 212, 255, 0.08), transparent 55%),
    radial-gradient(ellipse 85% 55% at 90% 20%, rgba(59, 130, 246, 0.07), transparent 58%),
    linear-gradient(rgba(0, 212, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.025) 1px, transparent 1px);
  background-size: auto, auto, 56px 56px, 56px 56px;
  mask-image: radial-gradient(ellipse at center, black 35%, transparent 92%);
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgba(6, 10, 18, 0.76);
  backdrop-filter: blur(24px);
}

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

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), #2563eb);
  color: #00131a;
}

.brand-mark svg,
.nav-item svg,
.button svg,
.icon-button svg,
.panel-head svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.25;
}

.brand strong,
.brand small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong {
  font-size: 0.98rem;
  font-weight: 900;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.side-nav {
  display: grid;
  gap: 7px;
}

.nav-item,
.button,
.icon-button {
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 9px 10px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 800;
}

.nav-item:hover,
.nav-item.is-active {
  border-color: var(--line-strong);
  background: var(--accent-soft);
  color: var(--ink);
}

.sidebar-footer {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: var(--surface-soft);
  color: var(--ink);
  border-color: var(--line);
}

.main {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 28px;
}

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

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3vw, 3.2rem);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.35rem;
  line-height: 1.15;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: 0;
}

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

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(0, 230, 118, 0.22);
  border-radius: 999px;
  background: rgba(0, 230, 118, 0.08);
  color: #b9ffd4;
  font-size: 0.84rem;
  font-weight: 900;
  white-space: nowrap;
}

.live-pill span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(0, 230, 118, 0.12);
}

.live-pill[data-state="warning"] {
  border-color: rgba(255, 232, 138, 0.28);
  background: rgba(255, 232, 138, 0.08);
  color: #fff2af;
}

.live-pill[data-state="warning"] span {
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(255, 232, 138, 0.12);
}

.live-pill[data-state="error"] {
  border-color: rgba(255, 138, 154, 0.3);
  background: rgba(255, 138, 154, 0.08);
  color: #ffc4cc;
}

.live-pill[data-state="error"] span {
  background: var(--rose);
  box-shadow: 0 0 0 5px rgba(255, 138, 154, 0.12);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 13px;
  color: var(--ink);
  font-weight: 850;
}

.button.secondary {
  border-color: var(--line);
  background: var(--surface-soft);
}

.button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.status-line {
  min-height: 22px;
  margin-bottom: 18px;
  color: var(--muted);
  font-weight: 750;
}

.status-line[data-state="error"] {
  color: var(--rose);
}

.view {
  display: none;
}

.view.is-active {
  display: grid;
  gap: 18px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-top: 4px;
}

.section-heading p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
}

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

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(24px);
}

.metric {
  display: grid;
  gap: 8px;
  min-height: 136px;
  padding: 18px;
}

.metric span,
.metric small {
  color: var(--muted);
  font-weight: 750;
}

.metric strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 1.58rem;
  line-height: 1.1;
  font-weight: 900;
}

.metric small {
  align-self: end;
  font-size: 0.8rem;
}

.content-grid {
  display: grid;
  gap: 12px;
}

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

.panel {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head svg {
  color: var(--accent);
}

.checklist,
.timeline,
.stack,
.details,
.knowledge {
  display: grid;
  gap: 10px;
}

.check-row,
.timeline-row,
.empty,
.stack-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.check-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 11px;
}

.check-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 232, 138, 0.1);
  color: var(--amber);
}

.check-row.is-complete .check-icon {
  background: rgba(0, 230, 118, 0.1);
  color: var(--green);
}

.check-row strong,
.timeline-row strong,
.stack-card strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 0.94rem;
}

.check-row span:not(.check-icon),
.timeline-row span,
.stack-card span,
.empty {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.badge {
  min-width: 88px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(255, 232, 138, 0.08);
  color: #fff0a3;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.badge.is-complete {
  background: rgba(0, 230, 118, 0.1);
  color: #b9ffd4;
}

.timeline-row,
.stack-card {
  padding: 12px;
}

.timeline-row {
  display: grid;
  gap: 4px;
}

.table {
  overflow-x: auto;
}

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

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

td {
  color: var(--ink);
  font-weight: 700;
}

.details {
  grid-template-columns: minmax(120px, 0.42fr) minmax(0, 1fr);
  margin: 0;
}

.details dt,
.details dd {
  min-width: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.details dt {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.details dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 750;
}

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

.empty {
  padding: 18px;
}

@media (max-width: 980px) {
  .dashboard-app {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .sidebar {
    padding: 16px 12px;
  }

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

  .nav-item {
    justify-content: center;
  }

  .metric-grid,
  .two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .dashboard-app {
    display: block;
  }

  .sidebar {
    position: sticky;
    z-index: 10;
    top: 0;
    height: auto;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand,
  .sidebar-footer {
    display: none;
  }

  .side-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-item {
    flex: 0 0 44px;
    width: 44px;
    height: 42px;
    min-height: 42px;
    padding: 0;
  }

  .main {
    padding: 18px 12px 28px;
  }

  .topbar,
  .section-heading {
    display: grid;
    align-items: start;
  }

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

  .metric-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  .check-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .badge {
    grid-column: 2;
    width: max-content;
    max-width: 100%;
  }

  .details {
    grid-template-columns: 1fr;
  }

  .details dt {
    padding-bottom: 0;
    border-bottom: 0;
  }
}
