:root {
    --bg: #14110a;
    --panel: #1e1a10;
    --panel2: #272013;
    --line: #3a3017;
    --text: #f3ecd8;
    --muted: #a59a78;
    --accent: #f2c14e;
    --accent-d: #c99a2e;
    --green: #4caf6a;
    --red: #e26d6d;
    --blue: #6da9e2;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }
code { background: var(--panel2); padding: 1px 5px; border-radius: 4px; }

.brand { font-weight: 700; font-size: 17px; }
.brand span { color: var(--accent); font-weight: 600; }

/* login */
.login { position: fixed; inset: 0; display: grid; place-items: center; }
.login-card {
    background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
    padding: 32px; width: 320px; display: flex; flex-direction: column; gap: 12px;
}
.login-card .brand { text-align: center; margin-bottom: 8px; }

/* header */
header {
    display: flex; align-items: center; gap: 24px;
    padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line);
}
header nav { display: flex; gap: 4px; flex: 1; }
header nav button {
    background: none; border: none; color: var(--muted); padding: 8px 14px;
    border-radius: 8px; cursor: pointer; font-size: 14px;
}
header nav button:hover { color: var(--text); background: var(--panel2); }
header nav button.active { color: var(--bg); background: var(--accent); font-weight: 600; }
.who { display: flex; align-items: center; gap: 12px; color: var(--muted); }

main { padding: 24px; max-width: 1100px; margin: 0 auto; }
.tab { display: none; }
.tab.active { display: block; }

h3 { margin: 18px 0 10px; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.card .num { font-size: 30px; font-weight: 700; color: var(--accent); }
.card .lbl { color: var(--muted); margin-top: 4px; }

/* tables */
table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
td .mono, .mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }

/* controls */
input, select, textarea, button {
    font: inherit; color: var(--text); background: var(--panel2);
    border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
}
input:focus, select:focus, textarea:focus { outline: 1px solid var(--accent); }
button {
    background: var(--accent); color: var(--bg); font-weight: 600; cursor: pointer; border: none;
}
button:hover { background: var(--accent-d); }
button.ghost { background: var(--panel2); color: var(--text); border: 1px solid var(--line); font-weight: 500; }
button.ghost:hover { background: var(--line); }
button.danger { background: var(--red); color: #fff; }
.row { display: flex; gap: 10px; align-items: center; }
.row.spread { justify-content: space-between; }
.row.end { justify-content: flex-end; margin-top: 16px; }
.err { color: var(--red); font-size: 13px; min-height: 16px; }

.badge { padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.active { background: rgba(76,175,106,.18); color: var(--green); }
.badge.suspended { background: rgba(242,193,78,.18); color: var(--accent); }
.badge.revoked { background: rgba(226,109,109,.18); color: var(--red); }
.badge.expired { background: rgba(226,109,109,.18); color: var(--red); }

.upload { display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }

textarea { width: 100%; resize: vertical; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 24px; width: 460px; max-width: 92vw; }
.keybox { background: var(--panel2); border: 1px dashed var(--accent); border-radius: 8px; padding: 14px; font-family: ui-monospace, Menlo, monospace; font-size: 16px; word-break: break-all; margin: 12px 0; }

.actions { display: flex; gap: 6px; justify-content: flex-end; }
.actions button { padding: 5px 9px; font-size: 12px; }
