:root {
  --bg: #0f1115; --panel: #171a21; --panel2: #1e222b; --border: #2a2f3a;
  --text: #e6e9ef; --muted: #9aa4b2; --accent: #4f8cff; --accent2: #2f6fe0;
  --ok: #35c07f; --warn: #e0a52f; --bad: #e5484d; --chip: #262b36;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
a { color: var(--accent); }
header {
  display: flex; align-items: center; gap: 16px; padding: 12px 20px;
  background: var(--panel); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
header .brand { font-weight: 700; letter-spacing: .3px; }
header .brand span { color: var(--accent); }
header .spacer { flex: 1; }
header .whoami { color: var(--muted); font-size: 13px; }
.layout { display: flex; min-height: calc(100vh - 53px); }
nav {
  width: 210px; background: var(--panel); border-right: 1px solid var(--border);
  padding: 12px; display: flex; flex-direction: column; gap: 4px;
}
nav button {
  text-align: left; background: transparent; border: none; color: var(--muted);
  padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
nav button:hover { background: var(--panel2); color: var(--text); }
nav button.active { background: var(--accent); color: #fff; }
main { flex: 1; padding: 22px 26px; max-width: 1100px; }
h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 22px 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.sub { color: var(--muted); margin: 0 0 18px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-bottom: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 12px; }
.metric { background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.metric .v { font-size: 24px; font-weight: 700; }
.metric .k { color: var(--muted); font-size: 12px; margin-top: 4px; }
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea {
  width: 100%; background: var(--panel2); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 9px 11px; font-size: 14px;
}
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 160px; }
button.btn {
  background: var(--accent); color: #fff; border: none; padding: 9px 16px;
  border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px; margin-top: 14px;
}
button.btn:hover { background: var(--accent2); }
button.btn.ghost { background: var(--chip); color: var(--text); }
button.btn.sm { padding: 5px 10px; margin: 0; font-size: 12px; font-weight: 500; }
button.btn.danger { background: var(--bad); }
button.btn.ok { background: var(--ok); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
td.mono, .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; background: var(--chip); color: var(--muted); }
.chip.ok { background: rgba(53,192,127,.15); color: var(--ok); }
.chip.warn { background: rgba(224,165,47,.15); color: var(--warn); }
.chip.bad { background: rgba(229,72,77,.15); color: var(--bad); }
.chip.info { background: rgba(79,140,255,.15); color: var(--accent); }
.toast {
  position: fixed; right: 20px; bottom: 20px; padding: 12px 16px; border-radius: 10px;
  background: var(--panel2); border: 1px solid var(--border); max-width: 380px; z-index: 100;
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
}
.toast.ok { border-color: var(--ok); }
.toast.bad { border-color: var(--bad); }
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth { width: 380px; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tabs button { background: var(--chip); border: none; color: var(--muted); padding: 7px 14px; border-radius: 8px; cursor: pointer; }
.tabs button.active { background: var(--accent); color: #fff; }
.muted { color: var(--muted); }
.hidden { display: none; }
small.hint { color: var(--muted); font-size: 12px; }
