:root {
    color-scheme: dark;
    --bg: #0b1018;
    --panel: #131b27;
    --panel-2: #192435;
    --text: #edf3fb;
    --muted: #9eacc0;
    --line: #2a3a50;
    --accent: #f3b33d;
    --accent-dark: #34250c;
    --good: #55d69e;
    --warn: #ffd166;
    --bad: #ff7b7b;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--accent); }
.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.site-header { border-bottom: 1px solid var(--line); background: rgba(11, 16, 24, .96); }
.header-row { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { color: var(--text); text-decoration: none; font-size: 1.12rem; font-weight: 800; letter-spacing: .01em; }
.brand span { color: var(--accent); }
.nav { display: flex; align-items: center; gap: 12px; }
main { padding: 36px 0 64px; }
h1, h2, h3 { line-height: 1.18; margin: 0 0 16px; }
h1 { font-size: clamp(1.8rem, 5vw, 2.7rem); }
h2 { margin-top: 4px; font-size: 1.3rem; }
p { margin: 0 0 16px; }
.muted { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 22px; }
.span-4 { grid-column: span 4; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: 0 16px 50px rgba(0,0,0,.18); }
.shell > .card, .shell > .grid { margin-bottom: 22px; }
.stat { font-size: 2rem; font-weight: 800; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; justify-content: space-between; margin-bottom: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
label { font-weight: 700; }
input, select, textarea { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: #0d1520; color: var(--text); font: inherit; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.button, button { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; border: 1px solid var(--accent); border-radius: 9px; padding: 9px 15px; background: var(--accent); color: #171006; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; }
.button.secondary, button.secondary { background: transparent; color: var(--accent); }
.button.danger, button.danger { border-color: var(--bad); background: transparent; color: var(--bad); }
.button.small, button.small { min-height: 34px; padding: 5px 10px; font-size: .86rem; }
.inline-form { display: inline-flex; gap: 7px; align-items: center; margin: 3px; }
.inline-form input[type="number"] { width: 86px; min-height: 34px; padding: 4px 8px; }
.notice { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 14px 16px; margin-bottom: 20px; background: var(--panel-2); }
.notice.good { border-left-color: var(--good); }
.notice.bad { border-left-color: var(--bad); }
.secret { display: block; padding: 14px; overflow-wrap: anywhere; border: 1px dashed var(--accent); border-radius: 9px; color: var(--accent); background: var(--accent-dark); font-size: 1.05rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 9px; background: #27354a; color: var(--text); font-size: .78rem; font-weight: 800; }
.badge.active { background: #113a2c; color: var(--good); }
.badge.grace { background: #3a3012; color: var(--warn); }
.badge.expired, .badge.revoked { background: #3b1d25; color: var(--bad); }
.badge.unused { color: var(--muted); }
.mono, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.footer { padding: 24px 0 38px; color: var(--muted); border-top: 1px solid var(--line); font-size: .86rem; }
.login { width: min(480px, calc(100% - 32px)); margin: 8vh auto 0; }
.steps { padding-left: 22px; color: var(--muted); }
.requirements { display: grid; gap: 8px; margin: 18px 0; }
.requirement { display: flex; justify-content: space-between; gap: 16px; padding: 9px 11px; background: #0d1520; border-radius: 8px; }
.ok { color: var(--good); }
.no { color: var(--bad); }
.empty { text-align: center; padding: 38px 18px; color: var(--muted); }

@media (max-width: 820px) {
    .span-4, .span-8 { grid-column: span 12; }
    .form-grid { grid-template-columns: 1fr; }
    .header-row { align-items: flex-start; flex-direction: column; padding: 17px 0; }
    .nav { width: 100%; justify-content: space-between; }
}
