:root {
  --bg: #0f1420; --panel: #171d2b; --panel2: #1e2637; --line: #2a3346;
  --text: #e6ebf5; --muted: #93a0b8; --brand: #3b82f6; --brand-d: #2563eb;
  --ok: #22c55e; --err: #ef4444; --warn: #f59e0b;
}
* { box-sizing: border-box; }
img { max-width: 100%; height: auto; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 'Segoe UI', system-ui, Roboto, sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.nav { display: flex; align-items: center; gap: 20px; padding: 10px 20px;
  background: var(--panel); border-bottom: 1px solid var(--line); }
.nav .brand { display: flex; align-items: center; gap: 10px; }
.nav .brand:hover { text-decoration: none; }
.brand-logo { width: 36px; height: 36px; object-fit: contain; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.05; }
.brand-txt b { font-size: 14px; font-weight: 700; color: var(--text); }
.brand-txt small { font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.brand-center { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 18px; }
.brand-center .brand-txt { align-items: center; }
.brand-logo-lg { width: 64px; height: 64px; object-fit: contain; }
.brand-center .brand-txt b { font-size: 18px; }
.brand-center .brand-txt small { font-size: 12px; }
.nav nav { display: flex; gap: 16px; }
.nav nav a { color: var(--muted); }
.nav nav a:hover { color: var(--text); text-decoration: none; }
.nav .logout { margin-left: auto; }

.wrap { max-width: 1000px; margin: 24px auto; padding: 0 20px; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 24px 0 12px; }
.muted { color: var(--muted); }
.mono { font-family: 'Cascadia Code', Consolas, monospace; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 640px) { .cols-2, .cols-4 { grid-template-columns: 1fr; } }

label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea { width: 100%; padding: 9px 11px; background: var(--panel2);
  border: 1px solid var(--line); border-radius: 8px; color: var(--text); font: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); }
textarea { min-height: 70px; resize: vertical; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border: 0;
  border-radius: 8px; background: var(--brand); color: #fff; font: inherit; font-weight: 600;
  cursor: pointer; }
.btn:hover { background: var(--brand-d); text-decoration: none; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.ghost:hover { background: var(--panel2); }
.btn.danger { background: var(--err); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:hover td { background: var(--panel2); }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.active { background: rgba(34,197,94,.15); color: var(--ok); }
.pill.revoked { background: rgba(239,68,68,.15); color: var(--err); }
.pill.suspended { background: rgba(245,158,11,.15); color: var(--warn); }
.pill.expired { background: rgba(239,68,68,.15); color: var(--err); }
.pill.grey { background: var(--panel2); color: var(--muted); }

.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; font-weight: 500; }
.flash.ok { background: rgba(34,197,94,.12); color: var(--ok); border: 1px solid rgba(34,197,94,.3); }
.flash.err { background: rgba(239,68,68,.12); color: var(--err); border: 1px solid rgba(239,68,68,.3); }

.keybox { font-family: 'Cascadia Code', Consolas, monospace; font-size: 16px; letter-spacing: 1px;
  background: var(--panel2); border: 1px dashed var(--line); border-radius: 8px; padding: 12px 14px;
  word-break: break-all; }
.stat { text-align: center; }
.stat .n { font-size: 30px; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 12px; }
.center-page { max-width: 380px; margin: 8vh auto; }
.inline { display: inline; }
