:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #dbe2ea;
  --primary: #2563eb;
  --danger: #b91c1c;
  --success: #15803d;
  --warning: #b45309;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
.container { max-width: 1280px; margin: 0 auto; padding: 24px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; box-shadow: 0 2px 10px rgba(15, 23, 42, .04); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.header { display:flex; justify-content:space-between; align-items:center; margin-bottom:18px; }
.header h1 { margin:0; font-size: 28px; }
.subtitle { color: var(--muted); margin-top: 4px; }
.stats { display:grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border:1px solid var(--border); border-radius: 12px; padding:14px; }
.stat strong { display:block; font-size: 24px; margin-top:6px; }
label { display:block; font-weight:600; margin-bottom:6px; }
input, select, textarea, button { font: inherit; }
input[type=text], input[type=password], input[type=email], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; border:1px solid var(--border); border-radius: 8px; background:#fff;
}
textarea { min-height: 96px; resize: vertical; }
button, .btn {
  display:inline-block; border:none; border-radius: 8px; padding: 10px 14px; cursor:pointer;
  background: var(--primary); color:#fff; font-weight:600;
}
.btn-secondary { background: #475569; }
.btn-danger { background: var(--danger); }
.btn-success { background: var(--success); }
.btn-warning { background: var(--warning); }
.inline-form { display:flex; gap:10px; align-items:flex-end; flex-wrap:wrap; }
.flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; }
.flash-success { background: #ecfdf5; color: #166534; border:1px solid #86efac; }
.flash-error { background: #fef2f2; color: #991b1b; border:1px solid #fecaca; }
.table-wrap { overflow:auto; }
table { width:100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom:1px solid var(--border); text-align:left; vertical-align: top; }
th { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
.badge { display:inline-block; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-ready { background: #eff6ff; color: #1d4ed8; }
.badge-active { background: #ecfdf5; color: #15803d; }
.badge-expired { background: #fff7ed; color: #c2410c; }
.badge-revoked, .badge-disabled, .badge-cancelled { background: #fef2f2; color: #b91c1c; }
.kv { display:grid; grid-template-columns: 220px 1fr; gap: 8px 12px; }
.kv div { padding: 6px 0; border-bottom:1px solid var(--border); }
.mono { font-family: Consolas, Monaco, monospace; }
.top-actions { display:flex; gap:10px; align-items:center; }
@media (max-width: 1024px) {
  .stats, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
}
