:root {
  --bg: #0f1420;
  --panel: #171d2b;
  --border: #2a3244;
  --text: #e6e9ef;
  --muted: #8b93a7;
  --accent: #4f7cff;
  --accent-hover: #6b8fff;
  --danger: #e5484d;
  --danger-hover: #ff6166;
  --success: #30a46c;
  --radius: 8px;
}

* { box-sizing: border-box; }

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

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

header.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

header.topbar .brand { font-weight: 700; font-size: 1.1rem; }
header.topbar nav a { margin-left: 20px; color: var(--muted); font-size: 0.92rem; }
header.topbar nav a:hover { color: var(--text); }

main { max-width: 1100px; margin: 0 auto; padding: 32px 24px; }

h1 { font-size: 1.5rem; margin-bottom: 4px; }
h2 { font-size: 1.15rem; margin-top: 28px; }
.subtitle { color: var(--muted); margin-bottom: 24px; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.stats-row { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  flex: 1;
  min-width: 160px;
}
.stat .value { font-size: 1.6rem; font-weight: 700; }
.stat .label { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }

.progress { height: 8px; border-radius: 4px; background: #232a3b; overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; background: var(--accent); }
.progress.warn > div { background: #d4a72c; }
.progress.danger > div { background: var(--danger); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr:hover td { background: rgba(255,255,255,0.02); }

.btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  border: none;
  padding: 9px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
}
.btn:hover { background: var(--accent-hover); color: white; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: var(--danger-hover); }
.btn.secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.small { padding: 5px 10px; font-size: 0.82rem; }

form.inline { display: inline; }

label { display: block; margin-bottom: 6px; font-size: 0.85rem; color: var(--muted); }
input[type=text], input[type=password], select {
  width: 100%;
  padding: 10px 12px;
  background: #0d1119;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 16px;
}
input[type=checkbox] { margin-right: 8px; }
.checkbox-row { display: flex; align-items: center; margin-bottom: 16px; }
.checkbox-row label { margin: 0; color: var(--text); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge.ok { background: rgba(48,164,108,0.15); color: var(--success); }
.badge.off { background: rgba(139,147,167,0.15); color: var(--muted); }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 0.9rem; }
.alert.error { background: rgba(229,72,77,0.12); border: 1px solid rgba(229,72,77,0.3); color: #ff9a9d; }
.alert.success { background: rgba(48,164,108,0.12); border: 1px solid rgba(48,164,108,0.3); color: #6fe3a5; }

.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { width: 340px; }

code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88rem; }

.creds-box {
  background: #0d1119;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  margin-top: 16px;
}
.creds-box .row { display: flex; justify-content: space-between; padding: 4px 0; }
.creds-box .row .k { color: var(--muted); }
