:root {
  --bg: #0d1117;
  --panel: #151b23;
  --panel2: #1f2630;
  --text: #eef2ff;
  --muted: #9ca3af;
  --line: rgba(255,255,255,.09);
  --accent: #ff4fd8;
  --good: #4ade80;
  --bad: #fb7185;
  --warn: #facc15;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(255,79,216,.12), transparent 30%),
    radial-gradient(circle at top right, rgba(96,165,250,.12), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

a { color: #93c5fd; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: rgba(13,17,23,.78);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
}

.brand {
  font-weight: 800;
  color: var(--text);
  margin-right: .8rem;
}

nav {
  display: flex;
  gap: 1rem;
}

.container {
  width: min(1360px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

h1, h2, h3 { margin: 0 0 .6rem; line-height: 1.1; }
h1 { font-size: clamp(2rem, 4vw, 3.3rem); }
h2 { font-size: 1.25rem; }

.muted { color: var(--muted); }
.good { color: var(--good); }
.bad { color: var(--bad); }

.grid {
  display: grid;
  gap: 1rem;
}

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

.cards {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.card {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02)), var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.22);
  margin-bottom: 1rem;
}

.stats .card strong {
  display: block;
  font-size: 2rem;
  margin-top: .3rem;
}

.label {
  color: var(--muted);
  font-size: .9rem;
}

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

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

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

th {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 700;
}

.pill {
  display: inline-flex;
  padding: .25rem .55rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: .78rem;
  border: 1px solid var(--line);
  background: var(--panel2);
}

.pill.ok { color: var(--good); }
.pill.fail { color: var(--bad); }
.pill.warn { color: var(--warn); }

button, .button-link {
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: white;
  padding: .75rem 1rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  text-decoration: none;
}

button:hover, .button-link:hover {
  filter: brightness(1.05);
  text-decoration: none;
}

pre {
  white-space: pre-wrap;
  overflow-x: auto;
  background: #090c12;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
}

code {
  color: #f0abfc;
}

.audit-list {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: .6rem 1rem;
}

.audit-list dt {
  color: var(--muted);
  font-weight: 800;
}

.audit-list dd {
  margin: 0;
}

.issues li {
  margin-bottom: .4rem;
}

.site-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.login-body {
  display: grid;
  place-items: center;
  padding: 1rem;
}

.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: 0 25px 80px rgba(0,0,0,.35);
}

.login-card form {
  display: grid;
  gap: .75rem;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0b0f16;
  color: var(--text);
  padding: .85rem;
}

label {
  color: var(--muted);
  font-weight: 700;
}

.alert {
  background: rgba(251,113,133,.12);
  color: var(--bad);
  border: 1px solid rgba(251,113,133,.3);
  padding: .75rem;
  border-radius: 14px;
  margin: 1rem 0;
}

@media (max-width: 980px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
  .hero, .topbar { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  nav { flex-wrap: wrap; }
}

.add-site-card {
  margin-bottom: 1.5rem;
}

.add-site-form {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.add-site-form input {
  flex: 1;
  min-width: 260px;
  padding: .8rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.22);
  color: var(--text);
}

.add-site-form button {
  padding: .8rem 1rem;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
}

.notice {
  margin: 1rem 0;
  padding: .85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
}

.notice.ok {
  background: rgba(45, 212, 191, .12);
}

.notice.fail {
  background: rgba(248, 113, 113, .13);
}

.code-help {
  margin-top: 1rem;
}

.code-help pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: 14px;
  background: rgba(0,0,0,.32);
}

.site-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  margin-top: .8rem;
}

.danger-button {
  background: linear-gradient(135deg, #fb7185, #be123c);
}

.danger-zone {
  border-color: rgba(251,113,133,.45);
}

.checkbox-line {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  margin: .75rem 0 1rem;
}

.checkbox-line input {
  width: auto;
  margin-top: .2rem;
}

.notice.info {
  background: rgba(96,165,250,.12);
  color: #bfdbfe;
  border: 1px solid rgba(96,165,250,.28);
  padding: .75rem;
  border-radius: 14px;
  margin: 1rem 0;
}

.snippet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.snippet-panel {
  background: rgba(255,255,255,.025);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
}

.snippet-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.small-button {
  padding: .55rem .75rem;
  border-radius: 12px;
  font-size: .85rem;
}

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