:root {
  --bg: #121212;
  --surface: #1a1a1a;
  --surface-2: #222222;
  --text: #ececec;
  --muted: #a3a3a3;
  --line: #323232;
  --accent: #b8b8b8;
  --success: #4dd08a;
  --danger: #ff6b6b;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1.45;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: min(1160px, 94%);
  margin: 0 auto;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-inner,
.nav-left,
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-inner {
  justify-content: space-between;
}

.nav-left {
  gap: 14px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  margin-bottom: 26px;
  background: var(--bg);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.03em;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(77, 208, 138, 0.15);
}

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

.nav-link {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.nav-link:hover {
  color: var(--text);
  border-color: var(--line);
  text-decoration: none;
}

.nav-link.active {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

main.container {
  padding-bottom: 28px;
  animation: fadeIn 220ms ease-out;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
}

.auth-card {
  max-width: 560px;
  margin-inline: auto;
}

.page-head {
  margin-bottom: 14px;
}

.section-title {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 16px;
  color: var(--text);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card { margin-bottom: 0; }

.stat-label {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.stat-value {
  margin: 6px 0 0;
  font-size: 30px;
  font-weight: 700;
}

h1, h2 {
  margin: 0 0 10px;
  font-size: 22px;
  letter-spacing: 0.01em;
}

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

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

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

th, td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 12px;
  white-space: nowrap;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-weight: 500;
  background: var(--surface-2);
}

.url {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge.up { background: rgba(77, 208, 138, 0.16); color: var(--success); }
.badge.down { background: rgba(255, 107, 107, 0.16); color: var(--danger); }
.badge.unknown { background: rgba(154, 164, 178, 0.2); color: var(--muted); }

.form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 100%;
}

.form > .action-row,
.form > .check-list,
.form > p.meta {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

input, select, button {
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  padding: 0 12px;
  font-family: inherit;
}

input[type='checkbox'] {
  width: 16px;
  height: 16px;
  padding: 0;
  vertical-align: middle;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(184, 184, 184, 0.2);
}

button {
  cursor: pointer;
  background: var(--accent);
  border-color: var(--accent);
  color: #111111;
  font-weight: 700;
}

button.danger {
  background: #b94a4a;
  border-color: #b94a4a;
  color: #fff;
}

.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
  font-size: 14px;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chart {
  width: 100%;
  height: 380px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-2);
}

.meta-list {
  margin: 0;
  padding-left: 18px;
}

.meta-list li { margin-bottom: 6px; }

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

.check-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}

.check-item input[type='checkbox'] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.site-footer {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  background: transparent;
}

.footer-inner {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.footer-inner p { margin: 0; }

.footer-links {
  display: inline-flex;
  gap: 14px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .form,
  .check-list { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .topbar .row-between,
  .topbar-inner,
  .nav-left,
  .nav-right {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav { flex-wrap: wrap; }

  .card { padding: 14px; }

  th, td { font-size: 13px; }

  .stats-grid { grid-template-columns: 1fr; }

  .chart { height: 310px; }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 10px 0;
  }
}
