:root {
  --bg: #07111f;
  --panel: #0d1b2d;
  --panel-2: #10243b;
  --line: #203851;
  --text: #f5f8fb;
  --muted: #9fb0c3;
  --accent: #28d7c0;
  --accent-2: #47a8ff;
  --good: #3ddc97;
  --warn: #f6c453;
  --bad: #ff6b6b;
  --shadow: 0 16px 40px rgba(0,0,0,.25);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(71,168,255,.12), transparent 32rem),
    linear-gradient(180deg, #07111f 0%, #091522 100%);
  color: var(--text);
  min-height: 100vh;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.5rem 4vw 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.topbar > div:first-child {
  min-width: 0;
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .7rem;
  margin-bottom: 1.2rem;
}
.brand-logo-wrap {
  display: inline-flex;
  align-items: center;
  min-height: 72px;
  padding: .35rem 0;
}
.brand-logo {
  display: block;
  width: min(330px, 72vw);
  height: auto;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.28));
}
.brand-subline {
  display: flex;
  align-items: center;
  gap: .72rem;
  margin: 0;
  color: #d7dbe1;
  font-size: .82rem;
  font-weight: 750;
  letter-spacing: .12em;
  line-height: 1.35;
  text-transform: uppercase;
}
.brand-accent {
  display: inline-block;
  width: 30px;
  height: 3px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #f12127;
  box-shadow: 0 0 12px rgba(241,33,39,.35);
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: .5rem;
  font-size: clamp(2rem, 3.4vw, 3.35rem);
  line-height: 1.08;
  overflow-wrap: break-word;
  text-wrap: balance;
}
h2 { font-size: 1.35rem; margin-bottom: 0; }
h3 { font-size: 1.05rem; }
.subtitle, .muted { color: var(--muted); }
.eyebrow {
  color: var(--accent);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .14em;
  margin-bottom: .6rem;
}
.status-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .6rem;
}
.status-pill {
  border-radius: 999px;
  padding: .55rem .9rem;
  font-size: .82rem;
  font-weight: 800;
}
.status-good { background: rgba(61,220,151,.14); color: var(--good); }
.status-warning { background: rgba(246,196,83,.14); color: var(--warn); }
.status-bad { background: rgba(255,107,107,.14); color: var(--bad); }
main { width: min(1500px, 94vw); margin: 0 auto; padding: 2rem 0 3rem; }
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.metric-card, .panel {
  background: linear-gradient(180deg, rgba(16,36,59,.96), rgba(13,27,45,.96));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.metric-card { padding: 1.25rem; }
.metric-label { display:block; color: var(--muted); font-size:.82rem; margin-bottom:.7rem; }
.metric-value { display:block; font-size:2.2rem; line-height:1; margin-bottom:.65rem; }
.metric-value.small { font-size:1.35rem; line-height:1.2; }
.metric-note { color: var(--muted); font-size:.8rem; }
.two-column {
  display:grid;
  grid-template-columns:minmax(0, 2.4fr) minmax(290px, .9fr);
  gap:1rem;
  margin-top:1rem;
}
.panel { padding:1.25rem; }
.panel-heading { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:1rem; }
button {
  background: linear-gradient(90deg, var(--accent), #5be7d5);
  color:#06201c;
  border:0;
  border-radius:10px;
  padding:.72rem 1rem;
  font-weight:800;
  cursor:pointer;
}
button:disabled { opacity:.55; cursor:not-allowed; }
.table-wrap { overflow:auto; max-height:540px; }
table { width:100%; border-collapse:collapse; min-width:900px; }
th, td { padding:.82rem .75rem; border-bottom:1px solid var(--line); text-align:left; font-size:.84rem; }
th { color:#c9d5e2; position:sticky; top:0; background:var(--panel-2); }
td { color:#e6edf5; }
.empty { color:var(--muted); text-align:center; padding:2rem; }
.tag-cell { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size:.78rem; }
.health-list { display:grid; gap:.7rem; margin:1rem 0 1.25rem; }
.health-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  background:rgba(255,255,255,.035);
  border:1px solid rgba(255,255,255,.06);
  border-radius:12px;
  padding:.78rem .85rem;
}
.dot { width:10px; height:10px; border-radius:50%; display:inline-block; margin-right:.5rem; }
.dot.good { background:var(--good); box-shadow:0 0 12px rgba(61,220,151,.8); }
.dot.warn { background:var(--warn); }
.dot.bad { background:var(--bad); }
.value-panel {
  border-top:1px solid var(--line);
  padding-top:1rem;
}
.value-panel ul { color:var(--muted); padding-left:1.1rem; line-height:1.55; }
.architecture { margin-top:1rem; }
.flow {
  display:flex;
  flex-wrap:wrap;
  gap:.75rem;
  align-items:center;
  margin-top:1rem;
}
.flow span {
  background:rgba(40,215,192,.08);
  border:1px solid rgba(40,215,192,.25);
  color:#dffcf7;
  border-radius:10px;
  padding:.65rem .8rem;
  font-size:.84rem;
  font-weight:700;
}
.flow b { color:var(--accent-2); }
footer { text-align:center; color:var(--muted); padding:0 1rem 2rem; font-size:.78rem; }
@media (max-width: 1000px) {
  .metrics-grid { grid-template-columns:repeat(2, 1fr); }
  .two-column { grid-template-columns:1fr; }
}
@media (max-width: 640px) {
  .topbar { flex-direction:column; padding:1.5rem 1rem 1rem; }
  .brand-logo { width: min(290px, 82vw); }
  .brand-subline { font-size: .72rem; letter-spacing: .09em; }
  .status-block { align-items:flex-start; }
  .metrics-grid { grid-template-columns:1fr; }
  main { width:min(94vw, 100%); }
}

.auth-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .65rem;
  flex-wrap: wrap;
}

.signed-in-user {
  color: var(--muted);
  font-size: .78rem;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-button {
  padding: .55rem .8rem;
  font-size: .78rem;
}

.auth-button.secondary {
  color: var(--text);
  background: rgba(255,255,255,.07);
  border: 1px solid var(--line);
}

@media (max-width: 640px) {
  .auth-controls {
    justify-content: flex-start;
  }
}
/* Separate locate and tag-read summary cards */
@media (min-width: 1280px) {
  .metrics-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.tag-read-card {
  border-color: rgba(51, 214, 193, .28);
}
