:root {
  --blue: #145c9e;
  --blue-dark: #0e3553;
  --green: #15803d;
  --red: #c62828;
  --amber: #b7791f;
  --bg: #f5f7fb;
  --line: #d7e0ea;
  --text: #172033;
  font-family: "Microsoft YaHei", Arial, sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

a { color: #0b5cad; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
}

.brand { font-weight: 800; color: var(--blue-dark); }
.nav a { margin-left: 16px; font-size: 14px; }

.page {
  max-width: 1160px;
  margin: 24px auto;
  padding: 0 18px;
}

.admin-layout {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 210px 1fr;
  min-height: calc(100vh - 56px);
}

.sidebar {
  background: #10283d;
  padding: 22px 16px;
  color: #e8f3ff;
}

.sidebar a {
  display: block;
  color: #e8f3ff;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 6px;
}

.sidebar a:hover { background: rgba(255,255,255,.1); text-decoration: none; }
.admin-main { padding: 24px; }

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(24, 47, 78, .06);
  padding: 22px;
  margin-bottom: 18px;
}

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.metric {
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.metric strong { display: block; font-size: 28px; color: var(--blue-dark); }
.metric span { color: #667085; font-size: 13px; }

label { display: block; font-weight: 700; margin: 14px 0 6px; }
input, select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #b8c5d2;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 15px;
  background: #fff;
}

textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #b8c5d2;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
  font-family: Consolas, "Microsoft YaHei", monospace;
  resize: vertical;
}

button, .button {
  display: inline-block;
  border: 0;
  border-radius: 6px;
  padding: 10px 16px;
  background: var(--blue);
  color: white;
  font-weight: 700;
  cursor: pointer;
  margin-top: 14px;
}

.link-button {
  display: inline;
  border: 0;
  background: transparent;
  color: #0b5cad;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 400;
  cursor: pointer;
}
.link-button:hover { text-decoration: underline; }

.button.secondary { background: #46566a; }
.button.green, button.green { background: var(--green); }
.button.red, button.red { background: var(--red); }
.button.ghost { background: #eef4fb; color: var(--blue-dark); }

.msg, .ok, .bad, .warn, .info {
  border-left: 5px solid;
  padding: 12px 14px;
  border-radius: 6px;
  margin: 14px 0;
  background: #f8fafc;
}
.ok { border-color: var(--green); background: #ecfdf3; }
.bad { border-color: var(--red); background: #fff1f1; }
.warn { border-color: var(--amber); background: #fff8e6; }
.info { border-color: var(--blue); background: #edf6ff; }

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  margin-top: 12px;
}
th, td {
  border: 1px solid var(--line);
  padding: 8px 9px;
  font-size: 13px;
  vertical-align: top;
}
th { background: #e8f2fb; text-align: left; }

.status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #edf2f7;
}
.status.success { background: #dcfce7; color: #166534; }
.status.deny, .status.locked { background: #fee2e2; color: #991b1b; }
.status.challenge, .status.ready, .status.running { background: #dbeafe; color: #1e3a8a; }
.status.account_takeover { background: #fee2e2; color: #991b1b; }
.status.password_hit_but_mfa_blocked,
.status.new_device_mfa_required,
.status.known_password_totp_denied,
.status.totp_guess_locked,
.status.passkey_origin_rejected,
.status.origin_bound { background: #fef3c7; color: #92400e; }
.status.password_not_found,
.status.phishing_captured,
.status.totp_guess_denied { background: #e0f2fe; color: #075985; }
.status.relay_success { background: #fee2e2; color: #991b1b; }

.qr {
  width: 220px;
  height: 220px;
  image-rendering: pixelated;
  border: 1px solid var(--line);
  padding: 8px;
  background: white;
}

.secret-details {
  margin: 12px 0;
  color: #475467;
}
.secret-details summary {
  cursor: pointer;
  font-weight: 700;
}

.attacker-topbar {
  background: #111827;
  border-bottom-color: #111827;
}
.attacker-topbar .brand,
.attacker-topbar .nav a { color: #f9fafb; }

.sso-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #eef4fb 0%, #f8fafc 52%, #e9f2ff 100%);
}
.sso-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.sso-login {
  width: min(430px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(24, 47, 78, .14);
  padding: 28px;
}
.sso-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--blue-dark);
  margin-bottom: 22px;
}
.sso-brand strong { font-size: 24px; }
.sso-brand span { color: #667085; font-size: 13px; }
.sso-login h1 { margin: 0 0 18px; color: var(--blue-dark); }
.sso-login h2 { margin: 20px 0 4px; color: var(--blue-dark); font-size: 18px; }
.sso-divider { border-top: 1px solid var(--line); margin: 20px 0 4px; }

.evidence-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.evidence-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.evidence-item strong { display: block; margin-bottom: 4px; }

pre {
  white-space: pre-wrap;
  background: #101828;
  color: #e6edf7;
  border-radius: 8px;
  padding: 12px;
  overflow: auto;
}

.hero-title { margin-top: 0; color: var(--blue-dark); }
.muted { color: #667085; }
.danger-text { color: var(--red); font-weight: 800; }
.ok-text { color: var(--green); font-weight: 800; }

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
