:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --text: #080808;
  --muted: #5a5a5a;
  --border: #d8d8d8;
  --blue: #146ef5;
  --green: #00d722;
  --orange: #ff6b00;
  --purple: #7a3dff;
  --pink: #ed52cb;
  --shadow: rgba(0, 0, 0, 0) 0 84px 24px, rgba(0, 0, 0, 0.01) 0 54px 22px, rgba(0, 0, 0, 0.04) 0 30px 18px, rgba(0, 0, 0, 0.08) 0 13px 13px, rgba(0, 0, 0, 0.09) 0 3px 7px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

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

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  padding: 28px 20px;
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.brand strong {
  display: block;
  font-size: 18px;
}

.brand small,
.muted,
small {
  color: var(--muted);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: var(--shadow);
}

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

.nav a {
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 15px;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.nav a:hover,
.nav a.active {
  transform: translateX(6px);
  border-color: var(--border);
  background: white;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.content {
  padding: 32px;
}

.topbar {
  margin-bottom: 24px;
}

.topbar h1,
.login-card h1 {
  margin: 4px 0 8px;
  font-size: 42px;
  line-height: 1.05;
  letter-spacing: -0.8px;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-size: 12px;
  color: var(--blue);
  font-weight: 700;
}

.stats-grid,
.panel-grid,
.health-grid {
  display: grid;
  gap: 16px;
}

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

.panel-grid {
  grid-template-columns: 1.4fr .9fr;
}

.stat-card,
.panel,
.login-card,
.health-grid article {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 18px;
  min-height: 136px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-card span {
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-size: 11px;
  font-weight: 700;
}

.stat-card strong {
  font-size: 34px;
}

.stat-card.blue { border-top: 4px solid var(--blue); }
.stat-card.green { border-top: 4px solid var(--green); }
.stat-card.orange { border-top: 4px solid var(--orange); }
.stat-card.purple { border-top: 4px solid var(--purple); }

.panel {
  padding: 22px;
}

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

.panel-head h2 {
  margin: 0;
  font-size: 24px;
}

.badge,
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  background: rgba(20, 110, 245, .1);
  color: var(--blue);
}

.pill.good,
.dot.good { color: #0c7d20; background: rgba(0, 215, 34, .1); }
.pill.bad,
.dot.bad { color: #b42318; background: rgba(238, 29, 54, .12); }

.list {
  display: grid;
  gap: 12px;
}

.list-row {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

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

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(171, 171, 171, .35);
  margin-top: 6px;
}

.health-stack,
.health-grid {
  gap: 12px;
}

.health-stack span,
.health-grid article {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.health-grid article {
  padding: 18px;
  border-bottom: 0;
}

.table-wrap {
  overflow: auto;
}

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

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

th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

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

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-card {
  width: min(460px, calc(100vw - 32px));
  padding: 28px;
}

.login-brand {
  margin-bottom: 28px;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: var(--muted);
}

.login-form input {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: white;
}

.login-form button {
  margin-top: 8px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  padding: 14px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease;
}

.login-form button:hover {
  transform: translateX(6px);
  background: #0055d4;
}

.alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(238, 29, 54, .1);
  color: #b42318;
  border: 1px solid rgba(238, 29, 54, .25);
}

.notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(20, 110, 245, .25);
  background: rgba(20, 110, 245, .08);
  border-radius: 8px;
  color: var(--text);
}

.notice.strong {
  border-color: var(--blue);
}

code {
  font-family: Inconsolata, ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #f2f5fb;
  padding: 2px 5px;
  border-radius: 4px;
}

.inline-form {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.inline-form input {
  min-width: 180px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}

.inline-form button,
.ghost-button {
  border: 1px solid var(--border);
  background: white;
  border-radius: 8px;
  padding: 9px 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease;
}

.inline-form button {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.inline-form button:hover,
.ghost-button:hover {
  transform: translateX(6px);
  border-color: var(--blue);
}

.table-link {
  display: inline-block;
}

.table-link:hover {
  color: var(--blue);
}

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

.detail-grid article {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: white;
}

.detail-grid span {
  display: block;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}

.raw-block {
  overflow: auto;
  max-height: 320px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  white-space: pre-wrap;
  word-break: break-word;
}

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

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .stats-grid,
  .panel-grid,
  .health-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
