:root {
  --bg: #0f1420;
  --surface: #171d2c;
  --border: #2a3247;
  --text: #e4e8f1;
  --text-dim: #8b93a7;
  --accent: #4f8cff;
  --warn: #e0a634;
  --danger: #e0524f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.brand { color: var(--text); text-decoration: none; font-weight: 600; }
.brand span { color: var(--text-dim); font-weight: 400; }
nav { display: flex; align-items: center; gap: 1.25rem; }
nav a { color: var(--text-dim); text-decoration: none; font-size: 0.92rem; }
nav a:hover, nav a.active { color: var(--text); }
.link-btn {
  background: none; border: none; color: var(--text-dim); font-size: 0.92rem;
  cursor: pointer; padding: 0; font-family: inherit;
}
.link-btn:hover { color: var(--text); }

.content { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
h1 { margin: 0 0 1.25rem; }
h2 { margin: 2.5rem 0 1rem; font-size: 1.05rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }

.lead { color: var(--text-dim); max-width: 65ch; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.stat-label { color: var(--text-dim); font-size: 0.85rem; }
.stat-value { font-size: 1.9rem; font-variant-numeric: tabular-nums; font-weight: 600; }
.stat-card.stat-warn .stat-value { color: var(--warn); }
.stat-card.stat-danger .stat-value { color: var(--danger); }

.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th, .data-table td {
  text-align: left; padding: 0.65rem 0.9rem; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.data-table th { color: var(--text-dim); font-weight: 500; background: var(--surface); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table td.empty { color: var(--text-dim); text-align: center; white-space: normal; }
.cell-warn { color: var(--warn); font-weight: 600; }
.cell-danger { color: var(--danger); font-weight: 600; }
.actions a { color: var(--accent); text-decoration: none; margin-right: 1rem; font-size: 0.85rem; }
.actions a:hover { text-decoration: underline; }

.action-list { line-height: 1.7; }
.action-list code {
  background: var(--surface); border: 1px solid var(--border); border-radius: 4px;
  padding: 0.1rem 0.35rem; font-size: 0.88em;
}
.hint { color: var(--text-dim); font-size: 0.9rem; margin-top: 2rem; }
.hint a { color: var(--accent); }

.login-body {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
}
.login-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 2.25rem; width: 100%; max-width: 340px;
  display: flex; flex-direction: column; gap: 1rem;
}
.login-box h1 { font-size: 1.15rem; margin: 0 0 0.5rem; }
.login-box label { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.88rem; color: var(--text-dim); }
.login-box input {
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 0.55rem 0.7rem; color: var(--text); font-size: 0.95rem;
}
.login-box button {
  background: var(--accent); border: none; border-radius: 6px; color: #fff;
  padding: 0.65rem; font-size: 0.95rem; cursor: pointer; margin-top: 0.4rem;
}
.login-box .error { color: var(--danger); font-size: 0.88rem; margin: 0; }

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f6fb; --surface: #ffffff; --border: #dde2ee; --text: #1a2233; --text-dim: #667085;
  }
}
