:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #18202a;
  --muted: #6a7280;
  --line: #d9dee7;
  --accent: #176b87;
  --ok: #1b7f45;
  --warn: #9a6700;
  --bad: #b42318;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--accent); text-decoration: none; }
main { max-width: 1240px; margin: 0 auto; padding: 24px; }
.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 24px;
  background: #101820;
  color: white;
}
.brand { color: white; font-weight: 700; font-size: 17px; }
.topbar nav { display: flex; gap: 16px; flex: 1; }
.topbar nav a { color: #d7e1ea; }
.topbar form { margin-left: auto; }
button, .button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
}
input, select {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  background: white;
}
.panel, .login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 20px;
}
.login-panel { max-width: 420px; margin: 70px auto; }
.login-panel form { display: grid; gap: 14px; }
.login-panel label { display: grid; gap: 6px; color: var(--muted); }
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}
h1 { margin: 0 0 14px; font-size: 20px; }
.panel-head h1 { margin: 0; }
.search { display: flex; gap: 8px; min-width: min(560px, 100%); }
.search input { flex: 1; }
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.metrics div {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.metrics span { display: block; font-size: 28px; font-weight: 700; }
.metrics label { color: var(--muted); }
table { width: 100%; border-collapse: collapse; }
th, td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.status {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  background: #edf1f5;
  color: #394351;
  font-size: 12px;
  font-weight: 700;
}
.status.ENROLLED, .status.Acknowledged { background: #e7f6ed; color: var(--ok); }
.status.PENDING, .status.AUTHENTICATED_WAITING_TOKENUPDATE { background: #fff5d6; color: var(--warn); }
.status.DISABLED, .status.Error { background: #fde8e7; color: var(--bad); }
.details { display: grid; grid-template-columns: 150px 1fr; gap: 10px 18px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.actions form { display: flex; gap: 8px; }
.flash {
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 14px;
}
.flash.ok { background: #e7f6ed; color: var(--ok); }
.flash.error { background: #fde8e7; color: var(--bad); }

@media (max-width: 760px) {
  main { padding: 14px; }
  .topbar { height: auto; min-height: 56px; flex-wrap: wrap; padding: 12px 14px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-head, .search, .actions, .actions form { display: grid; width: 100%; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
}
