:root {
  --bg: #0b1020;
  --panel: #141b2f;
  --panel-2: #1a2340;
  --text: #e8ecf8;
  --muted: #8f9bb8;
  --line: #26304f;
  --primary: #4f7cff;
  --ok: #1f9d63;
  --warn: #b7791f;
  --danger: #c0392b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 10% -10%, #1b2a55 0%, var(--bg) 55%);
  color: var(--text);
  font: 14px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}
.shell { width: min(1180px, 94vw); margin: 0 auto; padding: 28px 0 60px; }
h1 { font-size: 22px; margin: 0 0 6px; }
h2 { font-size: 16px; margin: 0 0 10px; }
p { margin: 0 0 12px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
code { background: #0f1730; border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin: 16px 0;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
}
.login { max-width: 420px; margin: 12vh auto 0; }
label { display: block; color: var(--muted); margin-bottom: 8px; }
input, textarea {
  width: 100%;
  background: #0d1530;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  margin-top: 6px;
  font: inherit;
}
textarea { resize: vertical; min-height: 120px; }
button {
  background: #222c4b;
  color: var(--text);
  border: 1px solid #33406a;
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  font: inherit;
}
button:hover { filter: brightness(1.15); }
button.primary { background: var(--primary); border-color: var(--primary); }
button.warn { background: var(--warn); border-color: var(--warn); }
button.danger { background: var(--danger); border-color: var(--danger); }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.counts { display: flex; gap: 12px; color: var(--muted); font-size: 12px; }
.flash { border-radius: 10px; padding: 10px 12px; margin: 12px 0; border: 1px solid var(--line); }
.flash.ok { background: rgba(31, 157, 99, .14); border-color: rgba(31, 157, 99, .5); }
.flash.error { background: rgba(192, 57, 43, .14); border-color: rgba(192, 57, 43, .5); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
td.key { max-width: 260px; overflow-wrap: anywhere; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions form { margin: 0; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); }
.badge-pending { color: #c9d2ea; }
.badge-available { color: #7ef0b2; border-color: rgba(31,157,99,.6); }
.badge-unavailable, .badge-failed { color: #ff9b90; border-color: rgba(192,57,43,.6); }
.badge-listed { color: #9db7ff; border-color: rgba(79,124,255,.7); }
.badge-unlisted { color: #c9b07a; border-color: rgba(183,121,31,.6); }
@media (max-width: 720px) {
  .topbar, .section-head { flex-direction: column; align-items: stretch; }
  .counts { flex-wrap: wrap; }
}
