:root {
  --bg: #0f172a;
  --panel: #111827;
  --panel2: #1f2937;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --line: #374151;
  --good: #22c55e;
  --bad: #ef4444;
  --warn: #f59e0b;
  --blue: #60a5fa;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #1e3a8a 0, #0f172a 28rem);
  color: var(--text);
}

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

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(15,23,42,.84);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand { font-size: 1.05rem; font-weight: 800; }
.subbrand { color: var(--muted); font-size: .82rem; margin-top: .1rem; }

nav { display: flex; align-items: center; gap: 1rem; }

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.25rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat-card, .panel, .login-card {
  background: rgba(17,24,39,.92);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
}

.stat-card {
  padding: 1rem;
}

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

.stat-value {
  font-size: 2.1rem;
  font-weight: 900;
  margin-top: .2rem;
}

.stat-card.good { border-color: rgba(34,197,94,.4); }
.stat-card.bad { border-color: rgba(239,68,68,.4); }

.panel {
  padding: 1rem;
  margin-bottom: 1rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

h1, h2 { margin: 0 0 .75rem; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.05rem; }

.table-wrap {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
}

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

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

th {
  background: rgba(31,41,55,.9);
  color: #cbd5e1;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.url-cell {
  max-width: 420px;
  word-break: break-all;
  color: var(--muted);
}

.error-cell {
  color: #fecaca;
  max-width: 320px;
}

.pill {
  display: inline-flex;
  border-radius: 999px;
  padding: .18rem .55rem;
  font-size: .72rem;
  font-weight: 800;
}

.pill.ok { background: rgba(34,197,94,.15); color: #86efac; }
.pill.bad { background: rgba(239,68,68,.15); color: #fca5a5; }
.pill.unknown { background: rgba(156,163,175,.15); color: #d1d5db; }

.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 11px;
  padding: .65rem .9rem;
  background: #2563eb;
  color: white;
  font-weight: 800;
  cursor: pointer;
  font-size: .88rem;
}

.button.secondary, button.secondary {
  background: #374151;
}

button.danger {
  background: #991b1b;
}

form { margin: 0; }

.check-form {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: .38rem;
  color: #cbd5e1;
  font-size: .86rem;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .72rem .8rem;
  background: #0b1220;
  color: var(--text);
}

textarea { resize: vertical; }

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

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 1rem;
}

.inline {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.inline input {
  width: auto;
}

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

.row-actions {
  justify-content: flex-end;
}

.login-card {
  max-width: 420px;
  margin: 5rem auto;
  padding: 1.3rem;
}

.flash-wrap {
  margin-bottom: 1rem;
}

.flash {
  padding: .75rem .9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel2);
  margin-bottom: .5rem;
}

.flash.error {
  border-color: rgba(239,68,68,.5);
}

.flash.success {
  border-color: rgba(34,197,94,.5);
}

.alert-list {
  display: grid;
  gap: .6rem;
}

.alert-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .75rem;
  background: rgba(31,41,55,.55);
}

.alert-row span {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  margin-top: .2rem;
}

.alert-row p {
  margin: .5rem 0 0;
  color: #fecaca;
}

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

.chart-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  background: rgba(31,41,55,.45);
}

.mini-chart {
  display: flex;
  align-items: end;
  gap: 3px;
  height: 170px;
  padding: .75rem .2rem 0;
}

.bar {
  flex: 1;
  min-width: 5px;
  border-radius: 5px 5px 0 0;
  background: #64748b;
  min-height: 4px;
}

.bar.ok { background: var(--good); }
.bar.bad { background: var(--bad); }

.footer {
  color: var(--muted);
  text-align: center;
  padding: 1rem;
  font-size: .78rem;
}

@media (max-width: 800px) {
  .hero-grid, .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  .topbar {
    flex-direction: column;
  }
}
