:root {
    color-scheme: dark;
    --ink: #101214;
    --panel: #1a1d20;
    --panel-2: #22262a;
    --line: #383d42;
    --gold: #d8b65b;
    --gold-soft: #f0d98c;
    --pearl: #f2f0e9;
    --ash: #a5a8aa;
    --green: #70c18c;
    --red: #df716c;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--ink);
    color: var(--pearl);
    font: 15px/1.5 Rubik, Inter, system-ui, -apple-system, sans-serif;
    letter-spacing: 0;
}
a { color: inherit; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    padding: 6px 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(16, 18, 20, .96);
}
.brand { display: flex; align-items: center; text-decoration: none; color: var(--gold); }
.brand-logo { display: block; width: auto; object-fit: contain; }
.brand-logo-header { height: 60px; }
.brand-logo-login { width: 150px; height: auto; margin-bottom: 22px; }
.page { width: min(1180px, calc(100% - 40px)); margin: 34px auto 72px; }
.section-head, .band-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.section-head { margin-bottom: 24px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(25px, 4vw, 38px); line-height: 1.15; }
h2 { margin-bottom: 0; font-size: 18px; }
.eyebrow { margin-bottom: 7px; color: var(--gold); font-size: 11px; font-weight: 700; }
.muted, .empty, .band-head > span, label span { color: var(--ash); }
.status-dot, .pill { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; font-size: 12px; }
.status-dot, .pill.active { color: var(--green); }
.pill.available { color: var(--gold-soft); }
.pill.paused { color: var(--ash); }
.pill.expired, .pill.used { color: var(--red); }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.metric { min-height: 104px; padding: 18px; border: 1px solid var(--line); background: var(--panel); }
.metric span { display: block; color: var(--ash); font-size: 12px; }
.metric strong { display: block; margin-top: 8px; color: var(--gold-soft); font-size: 27px; }
.band { margin-top: 16px; padding: 20px; border: 1px solid var(--line); background: var(--panel); }
.band-head { margin-bottom: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--ash); font-size: 11px; font-weight: 500; }
td small { display: block; margin-top: 2px; color: var(--ash); }
code { color: var(--gold-soft); font: 600 14px ui-monospace, SFMono-Regular, Menlo, monospace; }
.text-link, .back-link { color: var(--gold); text-decoration: none; }
.back-link { display: inline-block; margin-bottom: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 6px; color: var(--ash); font-size: 12px; }
label span { font-weight: 400; }
input, textarea, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 11px 12px;
    background: #111315;
    color: var(--pearl);
    font: inherit;
    resize: vertical;
}
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--red); }
.confirm-check { display: flex; grid-template-columns: none; align-items: center; gap: 9px; color: var(--pearl); }
input:focus, textarea:focus, select:focus, a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.wide, .form-actions { grid-column: 1 / -1; }
button { border: 0; border-radius: 4px; padding: 10px 15px; font: inherit; font-weight: 600; cursor: pointer; }
.primary { background: var(--gold); color: var(--ink); }
.secondary { border: 1px solid var(--gold); background: transparent; color: var(--gold-soft); }
.quiet { padding: 7px 10px; background: transparent; color: var(--ash); }
.danger { background: var(--red); color: #1a0c0b; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.danger-zone { border-color: rgba(223, 113, 108, .55); }
.notice { width: min(1180px, calc(100% - 40px)); margin: 18px auto; padding: 13px 16px; border: 1px solid var(--line); background: var(--panel-2); }
.notice.success { border-color: rgba(112, 193, 140, .5); color: #b9e6c9; }
.notice.error { border-color: rgba(223, 113, 108, .5); color: #f0aaa6; }
.details { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.license-dates { margin: 20px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.details div { min-width: 0; }
dt { color: var(--ash); font-size: 11px; }
dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.fine-print { margin: 16px 0 0; font-size: 12px; }
.login-shell { display: grid; min-height: calc(100vh - 44px); place-items: center; padding: 24px; }
.login-panel { width: min(430px, 100%); border: 1px solid var(--line); padding: 30px; background: var(--panel); }
footer { padding: 14px; color: var(--gold); font-size: 9px; font-weight: 300; text-align: center; }

.admin-layout { display: grid; grid-template-columns: 245px minmax(0, 1fr); min-height: calc(100vh - 76px); }
.admin-main { min-width: 0; }
.sidebar { position: sticky; top: 76px; align-self: start; min-height: calc(100vh - 76px); padding: 26px 16px; border-right: 1px solid var(--line); background: var(--panel); }
.sidebar nav { display: grid; gap: 8px; }
.sidebar nav a { display: block; padding: 13px 14px; text-decoration: none; border-radius: 8px; color: var(--ash); font-size: 15px; overflow-wrap: anywhere; }
.sidebar nav a[aria-current="page"] { background: var(--panel-2); color: var(--gold-soft); box-shadow: inset 3px 0 var(--gold); }
.sidebar nav a:hover { background: var(--panel-2); color: var(--pearl); }
.sidebar .fine-print { margin: 30px 14px; font-size: 14px; }
.dashboard-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dashboard-link { padding: 20px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; font-size: 17px; }
.dashboard-link span { display: block; color: var(--gold); font-size: 14px; margin-top: 20px; }
.admin-main label, .admin-main th, .admin-main dt, .admin-main .metric span { font-size: 14px; }
.admin-main .fine-print { font-size: 14px; }
@media (max-width: 1050px) {
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-links { grid-template-columns: 1fr; }
}
@media (max-width: 850px) {
    .admin-layout { display: block; }
    .sidebar { position: static; min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px; }
    .sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sidebar .fine-print { display: none; }
}

@media (max-width: 760px) {
    .topbar { padding: 0 16px; }
    .brand-logo-header { height: 54px; }
    .page { width: min(100% - 24px, 1180px); margin-top: 22px; }
    .section-head { align-items: flex-start; flex-direction: column; }
    .metrics, .two-column, .form-grid, .details { grid-template-columns: 1fr; }
    .wide, .form-actions { grid-column: auto; }
    .band { padding: 16px; }
}
