:root {
  --bg: #0f1419;
  --card: #1a222c;
  --line: #2b3642;
  --text: #e8eef4;
  --muted: #8b9aab;
  --accent: #3d8bfd;
  --ok: #3dd68c;
  --err: #ff6b6b;
  --warn: #f5c542;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font: 15px/1.5 "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.layout { display: flex; min-height: 100vh; }
.side { width: 220px; background: #12181f; border-right: 1px solid var(--line); padding: 20px 14px; flex-shrink: 0; }
.side h1 { font-size: 16px; margin: 0 0 20px; letter-spacing: .04em; }
.side nav a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); margin-bottom: 4px; }
.side nav a:hover, .side nav a.active { background: #223042; text-decoration: none; }
.side .who { margin-top: 24px; color: var(--muted); font-size: 12px; }
.main { flex: 1; padding: 24px 32px; overflow-x: auto; }
h2 { margin: 0 0 16px; font-size: 22px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.card .label { color: var(--muted); font-size: 12px; }
.card .value { font-size: 28px; font-weight: 650; margin-top: 4px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot.ok { background: var(--ok); }
.dot.err { background: var(--err); }
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13px; }
th { color: var(--muted); font-weight: 600; background: #151c24; }
form.inline { display: inline; }
input, select, button, textarea {
  font: inherit; color: var(--text); background: #12181f; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px;
}
button, .btn { background: var(--accent); border: 0; color: #fff; cursor: pointer; padding: 8px 14px; border-radius: 8px; }
button.danger { background: var(--err); }
button.ghost, .btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.flash { padding: 10px 12px; border-radius: 8px; margin-bottom: 16px; }
.flash.ok { background: #143323; color: var(--ok); }
.flash.err { background: #3a1515; color: var(--err); }
.toolbar { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-box { width: 360px; background: var(--card); padding: 28px; border-radius: 16px; border: 1px solid var(--line); }
.login-box h1 { margin: 0 0 8px; }
.login-box p { color: var(--muted); margin: 0 0 20px; }
.login-box label { display: block; margin: 12px 0 6px; color: var(--muted); font-size: 13px; }
.login-box input { width: 100%; }
.login-box button { width: 100%; margin-top: 18px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 8px; }
.grid-form { display: grid; grid-template-columns: 220px 1fr; gap: 10px 14px; align-items: center; max-width: 720px; }
@media (max-width: 720px) {
  .layout { display: block; }
  .side { width: auto; }
  .grid-form { grid-template-columns: 1fr; }
}

.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mt-8 { margin-top: 8px; }
.mt-6 { margin-top: 6px; }
.w-40 { width: 40%; }
.value-lg { font-size: 18px; }
.max-720 { max-width: 720px; }
.totp-secret { font-family: ui-monospace, monospace; letter-spacing: 0.04em; word-break: break-all; }
.totp-qr { width: 180px; height: 180px; background: #fff; padding: 8px; }
