:root {
  --bg: #eef1f8;
  --panel: #ffffff;
  --panel-2: #f5f7fc;
  --border: #e0e5f0;
  --text: #131a2b;
  --muted: #5b667e;
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --ok: #0f9d6b;
  --ok-bg: #e2f6ee;
  --bad: #d13445;
  --bad-bg: #fbe4e6;
  --warn: #b5730a;
  --warn-bg: #fbefd6;
  --shadow: 0 1px 2px rgba(19,26,43,.06), 0 8px 24px rgba(19,26,43,.06);
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0e17; --panel: #121a28; --panel-2: #0f1622; --border: #23304a;
    --text: #eaeefb; --muted: #97a3bd; --brand: #8b8bff; --brand-2: #b98cff;
    --ok: #46d19a; --ok-bg: #10322a; --bad: #ff8592; --bad-bg: #3a1720;
    --warn: #ecc15a; --warn-bg: #33290e; --shadow: none;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif; line-height: 1.5;
}
a { color: var(--brand); }
h1, h2, h3 { margin: 0; line-height: 1.15; }
button { font: inherit; cursor: pointer; }
.mono { font-family: "Cascadia Code", Consolas, monospace; }
.muted { color: var(--muted); }

/* top bar */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.85rem 1.5rem; background: var(--panel);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 800; font-size: 1.1rem; letter-spacing: -0.01em; }
.brand span { color: var(--brand); }
.account { display: flex; gap: 0.75rem; align-items: center; color: var(--muted); font-size: 0.9rem; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

/* hero */
.hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff; border-radius: 20px; padding: 1.9rem 2rem; margin-bottom: 1.25rem;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px;
  background: rgba(255,255,255,.12); border-radius: 50%;
}
.hero .eyebrow { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.72rem; opacity: 0.85; font-weight: 700; margin-bottom: 0.4rem; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); letter-spacing: -0.02em; }
.hero .hero-meta { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.9rem; align-items: center; position: relative; }
.pill { display: inline-flex; align-items: center; gap: 0.35rem; background: rgba(255,255,255,.2); color: #fff; padding: 0.28rem 0.7rem; border-radius: 999px; font-size: 0.82rem; font-weight: 700; }
.pill.ok { background: rgba(255,255,255,.95); color: var(--ok); }

/* grid + cards */
.grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(12, 1fr); }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.3rem 1.4rem; box-shadow: var(--shadow);
}
.card h2 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 1rem; }
.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
@media (max-width: 800px) { .col-8, .col-6, .col-4 { grid-column: span 12; } }

/* site cards */
.sites { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .sites { grid-template-columns: 1fr; } }
.site {
  border: 1px solid var(--border); border-radius: 14px; padding: 1.2rem; background: var(--panel-2);
  display: flex; flex-direction: column; gap: 0.6rem;
}
.site.prod { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.site-top { display: flex; justify-content: space-between; align-items: center; }
.site-env { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 800; color: var(--muted); }
.site-url { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; word-break: break-all; }
.site-cdn { font-size: 0.78rem; color: var(--muted); }
.site-actions { display: flex; gap: 0.5rem; margin-top: auto; padding-top: 0.4rem; }
.btn { display: inline-flex; align-items: center; gap: 0.35rem; border: 1px solid var(--border); background: var(--panel); color: var(--text); padding: 0.5rem 0.9rem; border-radius: 10px; font-weight: 700; text-decoration: none; font-size: 0.9rem; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:hover { filter: brightness(1.08); }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.18rem 0.6rem; border-radius: 999px; font-size: 0.76rem; font-weight: 700; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.neutral { background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.ok { background: var(--ok); } .dot.bad { background: var(--bad); } .dot.neutral { background: var(--muted); }

/* credit meter */
.credit-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.5rem; }
.credit-num { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; }
.meter { height: 10px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 999px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1rem; margin-top: 1rem; }
.kv dt { color: var(--muted); font-size: 0.9rem; }
.kv dd { margin: 0; font-weight: 600; text-align: right; }

/* health list */
.checks { display: grid; gap: 0.45rem; }
.check { display: flex; align-items: center; gap: 0.55rem; font-size: 0.92rem; }
.check .label { flex: 1; text-transform: capitalize; }

/* website chips */
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; padding: 0.25rem 0.7rem; font-size: 0.82rem; font-weight: 600; }

/* table */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* activity timeline */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.timeline li { display: flex; gap: 0.7rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: 0; }
.timeline .tl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-top: 0.45rem; flex: 0 0 auto; }
.timeline .tl-body { flex: 1; }
.timeline .tl-when { color: var(--muted); font-size: 0.8rem; }

/* edit requests */
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; gap: 1rem; }
.card-head h2 { margin: 0; }
.edit-form { display: grid; gap: 0.7rem; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; margin-bottom: 1rem; }
.edit-form label { display: grid; gap: 0.3rem; font-weight: 700; font-size: 0.85rem; }
.edit-form input, .edit-form textarea { font: inherit; padding: 0.6rem 0.7rem; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); color: var(--text); }
.edit-form input:focus, .edit-form textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.edit-form-actions { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.note { padding: 0.6rem 0.8rem; border-radius: 10px; margin: 0 0 1rem; font-size: 0.9rem; }
.note.bad { background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad); }
.edit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.edit-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.edit-list li:last-child { border-bottom: 0; }
.edit-title { font-weight: 600; }
.edit-meta { display: flex; gap: 0.6rem; align-items: center; white-space: nowrap; }

/* login */
.login { max-width: 420px; margin: 4rem auto; text-align: center; }
.login .card { padding: 2.4rem; }
.login h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
