:root {
  --bg: #14101c; --panel: #1d1727; --line: #3a2b4d; --input: #120e19; --text: #f3eefa;
  --muted: #9a8fb0; --accent: #ff6fa5; --accent-text: #2a0a1a; --link: #ff8fb8;
  --good: #4ade80; --warn: #fbbf24; --bad: #f87171; --hover: #2a2138;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #fbf7fc; --panel: #ffffff; --line: #e4d7ee; --input: #f6f0fa; --text: #241a30;
  --muted: #6f6282; --accent: #e0457f; --accent-text: #ffffff; --link: #c2306a;
  --good: #15803d; --warn: #b45309; --bad: #dc2626; --hover: #f1e8f7;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.hidden { display: none !important; }
.brand { font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--link); }
h1 { margin: 0 0 14px; font-size: 26px; }
h2 { margin: 0 0 8px; font-size: 18px; }
.muted { color: var(--muted); font-size: 13px; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.big { font-size: 20px; font-weight: 700; }

.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.narrow { width: min(92vw, 380px); }

.layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 20px 12px; position: sticky; top: 0; height: 100vh; }
.logo { padding: 0 10px 18px; }
nav { display: flex; flex-direction: column; gap: 4px; }
nav button { text-align: left; background: transparent; color: var(--text); border: 0; border-radius: 10px; padding: 11px 12px; font-size: 15px; cursor: pointer; }
nav button:hover { background: var(--hover); }
nav button.active { background: var(--accent); color: var(--accent-text); font-weight: 700; }
.content { padding: 28px; max-width: 1100px; width: 100%; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin: 0 0 16px; max-width: 100%; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 18px 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.stat b { display: block; font-size: 28px; }
.stat span { color: var(--muted); font-size: 13px; }
.steps { margin: 8px 0 0; padding-left: 20px; line-height: 1.7; color: var(--muted); }

.btn { display: inline-block; padding: 10px 16px; border: 1px solid transparent; border-radius: 10px; background: var(--accent); color: var(--accent-text); font-weight: 700; cursor: pointer; text-decoration: none; font-size: 14px; text-align: center; }
.btn.wide { display: block; width: 100%; }
.btn.small { padding: 6px 10px; font-size: 12px; }
.btn.ghost { background: transparent; color: var(--link); border-color: var(--line); }
.btn.ghost.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.danger { background: var(--bad); color: #fff; }
input { background: var(--input); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0; }
.row input { flex: 1; min-width: 220px; }

.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid currentColor; }
.st-ready, .st-offline { color: var(--muted); }
.st-in-use, .st-online, .ok { color: var(--good); }
.st-expired { color: var(--warn); }
.st-revoked, .bad { color: var(--bad); }
.actions { white-space: nowrap; }

.profile { display: flex; gap: 16px; align-items: center; }
.avatar { width: 84px; height: 84px; border-radius: 50%; background: var(--input); object-fit: cover; }

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px; }
  .logo { padding-bottom: 10px; }
  nav { flex-direction: row; overflow-x: auto; }
  nav button { white-space: nowrap; }
  .content { padding: 16px; }
}