* { box-sizing: border-box; }
body {
  margin: 0;
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #f2f4f7;
  color: #1c2733;
}
body.centered {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #14212e;
  color: #e8edf2;
  padding: 0 20px;
  height: 52px;
}
nav { display: flex; align-items: center; gap: 18px; }
nav .brand { font-weight: 700; margin-right: 10px; letter-spacing: .3px; }
nav a { color: #b8c4d0; text-decoration: none; padding: 4px 2px; }
nav a:hover, nav a.active { color: #fff; border-bottom: 2px solid #4da3ff; }
.user { display: flex; align-items: center; gap: 10px; }
.user .email { color: #b8c4d0; }

main { max-width: 1180px; margin: 24px auto; padding: 0 20px; }
h1 { font-size: 22px; margin: 8px 0 16px; }
h2 { font-size: 15px; margin: 0 0 12px; color: #33465a; }

.card {
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.login-card { max-width: 380px; text-align: center; padding: 34px 30px; }
.login-card h1 { font-size: 20px; }

table.data { width: 100%; border-collapse: collapse; }
table.data th {
  text-align: left; font-weight: 600; color: #5a6b7d;
  border-bottom: 2px solid #e4e9ef; padding: 8px 10px; white-space: nowrap;
}
table.data td { border-bottom: 1px solid #eef1f5; padding: 8px 10px; vertical-align: top; }
table.data tr:hover td { background: #f8fafc; }
table.data a { color: #0b62c4; text-decoration: none; font-weight: 600; }
table.data a:hover { text-decoration: underline; }

.row-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #5a6b7d; }
.row-form label.grow { flex: 1 1 180px; }
.row-form label.check { flex-direction: row; align-items: center; font-size: 13px; color: #33465a; }
input, select {
  border: 1px solid #c8d2dc; border-radius: 6px; padding: 7px 9px;
  font: inherit; min-width: 110px; background: #fff;
}
input:focus, select:focus { outline: 2px solid #9ec9ff; border-color: #4da3ff; }

.btn {
  border: 1px solid #c8d2dc; background: #fff; color: #1c2733;
  border-radius: 6px; padding: 7px 14px; font: inherit; cursor: pointer;
}
.btn:hover { background: #f0f4f8; }
.btn-primary { background: #0b62c4; border-color: #0b62c4; color: #fff; }
.btn-primary:hover { background: #0a55aa; }
.btn-danger { color: #b3261e; border-color: #e4b6b3; }
.btn-danger:hover { background: #fdf1f0; }
.btn-danger.armed { background: #b3261e; border-color: #b3261e; color: #fff; }
.btn-ghost { background: transparent; border-color: #3d5165; color: #d6dee6; }
.btn-ghost:hover { background: #1f3242; }
.btn-google { display: inline-flex; align-items: center; gap: 10px; margin: 18px 0 8px; }
.btn-sm { padding: 3px 9px; font-size: 12px; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 10px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
}
.badge-admin { background: #ffe2e0; color: #a1211a; }
.badge-operator { background: #fff0d4; color: #8a5b00; }
.badge-readonly { background: #e2ecf7; color: #144e8c; }
.badge-ok { background: #ddf3e4; color: #14652f; }
.badge-warn { background: #fff0d4; color: #8a5b00; }
.badge-bad { background: #ffe2e0; color: #a1211a; }

.muted { color: #7d8b99; }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, "JetBrains Mono", Menlo, monospace; font-size: 12px; }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.detail-grid .kv .k { font-size: 11px; text-transform: uppercase; color: #7d8b99; letter-spacing: .4px; }
.detail-grid .kv .v { font-weight: 600; word-break: break-word; }

.secret-box {
  margin-top: 12px; padding: 12px; border: 1px dashed #d0a13c; border-radius: 6px;
  background: #fff9ec;
}
.secret-box code { font-size: 13px; word-break: break-all; }

#flash {
  position: fixed; bottom: 20px; right: 20px; display: flex;
  flex-direction: column; gap: 8px; z-index: 50;
}
.flash-msg {
  background: #14212e; color: #fff; border-radius: 6px; padding: 10px 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,.25); max-width: 420px;
}
.flash-msg.err { background: #8c1d16; }

details.payload { margin-top: 10px; }
details.payload pre {
  background: #f6f8fa; border: 1px solid #e4e9ef; border-radius: 6px;
  padding: 10px; overflow-x: auto; font-size: 12px;
}
