/* BooM Admin Console — self-contained dark operations theme.
   Shares the visual language of the seller portal (styles.css) with a denser,
   data-first console layout. No frameworks, no external assets. */

:root {
  color-scheme: dark;
  --bg: #090d13;
  --bg-deep: #070a10;
  --sidebar: #0c1119;
  --surface: #101721;
  --surface-raised: #141d29;
  --surface-hover: #182332;
  --surface-inset: #0c121b;
  --border: #222d3c;
  --border-strong: #304056;
  --border-soft: rgba(34, 45, 60, .7);
  --text: #edf2f8;
  --text-soft: #c1ccda;
  --muted: #8290a3;
  --faint: #5d6b7e;
  --accent: #f5a524;
  --accent-hover: #ffb83e;
  --accent-ink: #211608;
  --blue: #6ea8fe;
  --green: #4fd1a5;
  --red: #ff7a86;
  --purple: #b69cff;
  --teal: #57d6de;
  --pink: #f38bd6;
  --slate: #9fb0c6;
  --shadow: 0 18px 50px rgba(0, 0, 0, .3);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, .22);
  --radius: 12px;
  --radius-small: 8px;
  --radius-tiny: 6px;
  --sidebar-width: 248px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(1100px 520px at 12% -12%, rgba(110, 168, 254, .07), transparent 60%), var(--bg); color: var(--text); font-size: 13px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
a { color: var(--blue); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; line-height: 1.2; letter-spacing: -.035em; }
h2 { font-size: 15px; line-height: 1.35; letter-spacing: -.015em; }
h3 { font-size: 13px; line-height: 1.35; letter-spacing: -.01em; }
[hidden] { display: none !important; }
::selection { background: rgba(245, 165, 36, .28); color: #fff; }
code, .mono { font-family: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; z-index: 200; top: 10px; left: 10px; padding: 9px 14px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); font-weight: 700; transform: translateY(-160%); transition: transform .15s; }
.skip-link:focus { transform: translateY(0); }

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.icon { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(110, 168, 254, .12); outline: none; }
input[readonly] { color: var(--text-soft); background: #0d131c; }
input:disabled, select:disabled, textarea:disabled, button:disabled { cursor: not-allowed; opacity: .55; }

/* ---------- boot / gate ---------- */
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.boot-card, .gate-card { width: min(100%, 430px); text-align: center; }
.boot-card { display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--muted); }
.boot-card h1 { color: var(--text); font-size: 20px; }
.boot-card p { font-size: 13px; }
.gate-card { padding: 36px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.gate-card h1 { margin: 8px 0 12px; }
.gate-card > p:not(.eyebrow) { margin: 0 auto 24px; color: var(--muted); max-width: 340px; }
.gate-icon { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 14px; color: var(--red); background: rgba(255, 122, 134, .09); border: 1px solid rgba(255, 122, 134, .2); }
.gate-icon .icon { width: 25px; height: 25px; }

/* ---------- shell ---------- */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 14px 14px; border-right: 1px solid var(--border); background: var(--sidebar); z-index: 6; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; background: linear-gradient(145deg, var(--accent-hover), var(--accent)); color: var(--accent-ink); box-shadow: 0 6px 20px rgba(245, 165, 36, .16); }
.brand-mark .icon { width: 20px; height: 20px; stroke-width: 2; }
.brand-mark-large { width: 50px; height: 50px; border-radius: 14px; margin-bottom: 8px; }
.brand-mark-large .icon { width: 25px; height: 25px; }
.brand strong { display: block; font-size: 14px; letter-spacing: -.01em; }
.brand span { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; }
.nav-label, .eyebrow { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.nav-label { padding: 0 10px; margin-bottom: 8px; }
.nav-tabs { display: flex; flex-direction: column; gap: 3px; }
.nav-tab { width: 100%; min-height: 39px; display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); text-align: left; font-weight: 600; font-size: 12px; transition: color .15s, background .15s, border-color .15s; }
.nav-tab:hover { color: var(--text-soft); background: var(--surface); }
.nav-tab.is-active { color: var(--text); border-color: #2b3543; background: var(--surface-raised); }
.nav-tab.is-active .icon { color: var(--accent); }
.nav-tab .icon { width: 17px; height: 17px; }
.nav-badge { margin-left: auto; padding: 1px 6px; border: 1px solid var(--border); border-radius: 4px; color: var(--faint); font-size: 8px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

.account-card { margin-top: auto; padding: 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.account-heading { display: flex; align-items: center; gap: 9px; padding-bottom: 12px; margin-bottom: 10px; border-bottom: 1px solid var(--border); }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: rgba(110, 168, 254, .12); color: var(--blue); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.account-identity { min-width: 0; }
.account-identity strong { display: block; overflow: hidden; color: var(--text-soft); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.account-identity > span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
#account-role { text-transform: capitalize; }
.dot { padding: 0 4px; color: var(--faint); }
.quota-heading, .quota-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.quota-heading { color: var(--muted); font-size: 10px; }
.quota-heading strong { color: var(--text-soft); font-size: 11px; }
.quota-meta { margin-top: 6px; color: var(--faint); font-size: 9px; }
progress { width: 100%; height: 5px; display: block; margin-top: 8px; overflow: hidden; border: 0; border-radius: 10px; background: #242e3b; appearance: none; }
progress::-webkit-progress-bar { border-radius: 10px; background: #242e3b; }
progress::-webkit-progress-value { border-radius: 10px; background: var(--accent); }
progress::-moz-progress-bar { border-radius: 10px; background: var(--accent); }
progress.is-exhausted::-webkit-progress-value { background: var(--red); }
progress.is-exhausted::-moz-progress-bar { background: var(--red); }
.sidebar-footer { display: flex; align-items: flex-start; gap: 8px; padding: 14px 6px 2px; color: var(--faint); font-size: 9px; line-height: 1.5; }
.sidebar-footer .icon { width: 13px; height: 13px; margin-top: 1px; }

.main-content { min-width: 0; width: 100%; max-width: 1620px; margin: 0 auto; padding: 24px 28px 44px; }
.topbar { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.topbar-copy { min-width: 0; }
.topbar .eyebrow { margin-bottom: 4px; }
.page-description { margin-top: 5px; color: var(--muted); font-size: 12px; max-width: 720px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.role-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border: 1px solid var(--border); border-radius: 999px; background: rgba(130, 144, 163, .05); color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.role-chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.role-chip-owner { color: var(--purple); border-color: rgba(182, 156, 255, .28); background: rgba(182, 156, 255, .07); }
.role-chip-admin { color: var(--blue); border-color: rgba(110, 168, 254, .28); background: rgba(110, 168, 254, .07); }
.role-chip-seller { color: var(--green); border-color: rgba(79, 209, 165, .24); background: rgba(79, 209, 165, .06); }
.role-chip-unknown { color: var(--faint); }

.page-panel { display: flex; flex-direction: column; gap: 18px; }
.card, .stat-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.card { min-width: 0; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 17px 20px; border-bottom: 1px solid var(--border); }
.card-heading p { margin-top: 4px; color: var(--muted); font-size: 11px; }
.compact-card-heading { padding-bottom: 14px; }
.table-heading { align-items: center; }
.heading-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.count-label { color: var(--muted); font-size: 10px; white-space: nowrap; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.compact-heading { margin-bottom: 10px; }
.compact-heading .eyebrow { margin-bottom: 2px; }
.section-status { color: var(--muted); font-size: 10px; text-align: right; }
.section-status.is-error { color: var(--red); }

/* ---------- buttons ---------- */
.button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 13px; border: 1px solid transparent; border-radius: 7px; font-size: 11px; font-weight: 700; line-height: 1.2; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, transform .1s; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button .icon { width: 15px; height: 15px; }
.button-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.button-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.button-secondary { background: var(--surface-raised); color: var(--text-soft); border-color: var(--border-strong); }
.button-secondary:hover:not(:disabled), .button-ghost:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); border-color: #40516a; }
.button-ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.button-danger { background: rgba(255, 122, 134, .12); color: #ff9aa4; border-color: rgba(255, 122, 134, .32); }
.button-danger:hover:not(:disabled) { background: rgba(255, 122, 134, .2); }
.button-small { min-height: 30px; padding: 6px 9px; font-size: 10px; }
.button-group { display: flex; align-items: center; gap: 7px; }
.icon-button { width: 32px; height: 32px; display: inline-grid; place-items: center; flex: 0 0 auto; padding: 0; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface-raised); color: var(--muted); transition: color .15s, border-color .15s, background .15s; }
.icon-button:hover:not(:disabled) { color: var(--text); border-color: #40516a; background: var(--surface-hover); }
.icon-button .icon { width: 15px; height: 15px; }
.button.is-loading .icon, .icon-button.is-loading .icon { animation: spin .8s linear infinite; }

/* ---------- alerts / pills / states ---------- */
.alert { padding: 10px 12px; border: 1px solid; border-radius: 7px; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.alert-error { color: #ffb0b7; border-color: rgba(255, 122, 134, .24); background: rgba(255, 122, 134, .07); }
.alert-warning { color: #f7cc85; border-color: rgba(245, 165, 36, .25); background: rgba(245, 165, 36, .07); }
.alert-info { color: #bcd7ff; border-color: rgba(110, 168, 254, .24); background: rgba(110, 168, 254, .07); }
.alert-success { color: var(--green); border-color: rgba(79, 209, 165, .24); background: rgba(79, 209, 165, .07); }
#global-alert { margin: -6px 0 18px; }
#dashboard-warnings, #blacklist-warning, #logs-warning, #settings-warning { margin: 14px 20px 0; }
#blacklist-warning { margin: 14px 20px 0; }
.warning-list { margin: 0; padding-left: 18px; }
.warning-list li + li { margin-top: 4px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); background: rgba(130, 144, 163, .05); font-size: 9px; font-weight: 700; letter-spacing: .03em; text-transform: capitalize; white-space: nowrap; }
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill-good { color: var(--green); border-color: rgba(79, 209, 165, .22); background: rgba(79, 209, 165, .06); }
.pill-bad { color: var(--red); border-color: rgba(255, 122, 134, .22); background: rgba(255, 122, 134, .06); }
.pill-warn { color: var(--accent); border-color: rgba(245, 165, 36, .22); background: rgba(245, 165, 36, .06); }
.pill-info { color: var(--blue); border-color: rgba(110, 168, 254, .22); background: rgba(110, 168, 254, .06); }
.pill-neutral { color: var(--muted); }
.pill-muted { color: var(--faint); }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 36px 20px; color: var(--muted); text-align: center; }
.empty-state h3 { margin: 12px 0 5px; color: var(--text-soft); }
.empty-state p { max-width: 380px; font-size: 11px; }
.empty-icon { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-raised); color: var(--faint); }
.compact-empty { min-height: 240px; border: 0; }
.state-inline { display: inline-flex; align-items: center; gap: 9px; padding: 14px 0; color: var(--muted); font-size: 11px; }
.spinner { width: 19px; height: 19px; display: inline-block; flex: 0 0 auto; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.spinner-small { width: 13px; height: 13px; }
.loading-line { display: inline-flex; align-items: center; justify-content: center; gap: 9px; }

/* ---------- dashboard ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat-card { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 15px; }
.stat-icon { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid; border-radius: 9px; }
.stat-icon .icon { width: 17px; height: 17px; }
.stat-icon-blue { color: var(--blue); border-color: rgba(110, 168, 254, .18); background: rgba(110, 168, 254, .08); }
.stat-icon-green { color: var(--green); border-color: rgba(79, 209, 165, .18); background: rgba(79, 209, 165, .08); }
.stat-icon-orange { color: var(--accent); border-color: rgba(245, 165, 36, .18); background: rgba(245, 165, 36, .08); }
.stat-icon-red { color: var(--red); border-color: rgba(255, 122, 134, .18); background: rgba(255, 122, 134, .08); }
.stat-icon-purple { color: var(--purple); border-color: rgba(182, 156, 255, .18); background: rgba(182, 156, 255, .08); }
.stat-icon-teal { color: var(--teal); border-color: rgba(87, 214, 222, .18); background: rgba(87, 214, 222, .08); }
.stat-icon-pink { color: var(--pink); border-color: rgba(243, 139, 214, .18); background: rgba(243, 139, 214, .08); }
.stat-icon-slate { color: var(--slate); border-color: rgba(159, 176, 198, .18); background: rgba(159, 176, 198, .08); }
.stat-body { min-width: 0; display: grid; grid-template-columns: 1fr auto; align-items: baseline; flex: 1; column-gap: 8px; }
.stat-body span { color: var(--muted); font-size: 10px; font-weight: 600; }
.stat-body strong { grid-row: span 2; color: var(--text); font-size: 23px; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat-body small { overflow: hidden; margin-top: 3px; color: var(--faint); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-layout { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(280px, .95fr); gap: 18px; align-items: start; }
.dashboard-side { display: flex; flex-direction: column; gap: 18px; }
.quick-actions { display: flex; flex-direction: column; gap: 6px; padding: 12px; }
.quick-action { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 11px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text); text-align: left; transition: background .15s, border-color .15s; }
.quick-action:hover { background: var(--surface-hover); border-color: var(--border); }
.quick-icon { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; background: rgba(245, 165, 36, .09); color: var(--accent); border: 1px solid rgba(245, 165, 36, .16); }
.quick-icon .icon { width: 15px; height: 15px; }
.quick-action > span:last-child { min-width: 0; }
.quick-action strong { display: block; font-size: 11px; }
.quick-action small { display: block; margin-top: 1px; color: var(--muted); font-size: 9px; }
.mini-detail { margin: 0; padding: 8px 20px 18px; }
.mini-detail > div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px solid var(--border-soft); }
.mini-detail > div:last-child { border-bottom: 0; }
.mini-detail dt { color: var(--muted); font-size: 10px; }
.mini-detail dd { margin: 0; color: var(--text-soft); font-size: 11px; text-align: right; overflow-wrap: anywhere; }

/* ---------- forms ---------- */
.form-card form { padding: 20px; }
.form-grid { display: grid; gap: 14px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-columns { grid-template-columns: 1fr 1.4fr 1.4fr; }
.field { min-width: 0; margin-bottom: 15px; }
.form-grid .field { margin-bottom: 0; }
.field:last-child { margin-bottom: 0; }
.form-grid + .field { margin-top: 15px; }
.field label, .label-row > label { display: block; margin-bottom: 6px; color: var(--text-soft); font-size: 11px; font-weight: 600; }
.field label > span[aria-hidden] { color: var(--accent); }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.label-row > span { margin-bottom: 6px; color: var(--faint); font-size: 9px; }
.field small { display: block; margin-top: 6px; color: var(--faint); font-size: 9px; line-height: 1.45; }
input, select, textarea { width: 100%; min-height: 37px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface-inset); color: var(--text); transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: #566477; opacity: 1; }
textarea { min-height: 70px; resize: vertical; line-height: 1.5; }
select { padding-right: 28px; }
.input-suffix, .input-action { display: flex; align-items: stretch; }
.input-suffix input { border-radius: 7px 0 0 7px; }
.input-suffix > span { display: flex; align-items: center; padding: 0 11px; border: 1px solid var(--border-strong); border-left: 0; border-radius: 0 7px 7px 0; background: var(--surface-raised); color: var(--muted); font-size: 10px; white-space: nowrap; }
.input-action input { min-width: 0; border-radius: 7px 0 0 7px; font-size: 10px; }
.input-action .icon-button { width: 39px; height: auto; min-height: 37px; border-left: 0; border-radius: 0 7px 7px 0; }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; top: 50%; left: 10px; width: 15px; height: 15px; color: var(--faint); transform: translateY(-50%); pointer-events: none; }
.input-icon input { padding-left: 32px; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 4px; }
.form-actions p { max-width: 300px; color: var(--faint); font-size: 9px; }
.checkbox-field > label { margin-bottom: 6px; }
.checkbox-control { min-height: 37px; display: flex !important; align-items: center; gap: 8px; margin: 0 !important; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface-inset); cursor: pointer; }
.checkbox-control input { width: 14px; min-height: 14px; height: 14px; margin: 0; padding: 0; accent-color: var(--accent); }
.checkbox-control span { color: var(--text-soft); font-size: 10px; }

.filter-bar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 11px; padding: 14px 20px; border-bottom: 1px solid var(--border); background: #0e141d; }
.filter-bar .field { margin-bottom: 0; }
.filter-search { flex: 3 1 230px; min-width: 190px; }
.filter-level { flex: 0 1 120px; min-width: 96px; }
.filter-rows { flex: 0 0 88px; }
.filter-actions { display: flex; align-items: center; gap: 7px; margin-bottom: 1px; }
.filter-bar select { min-width: 120px; }

/* ---------- tables ---------- */
.table-scroll { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
caption { text-align: left; }
th { height: 37px; padding: 8px 14px; border-bottom: 1px solid var(--border); background: #0e141d; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; white-space: nowrap; }
td { max-width: 300px; padding: 10px 14px; border-bottom: 1px solid var(--border-soft); color: var(--text-soft); font-size: 11px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr[data-row]:hover { background: rgba(24, 35, 50, .5); }
#licenses-table { min-width: 1040px; }
#users-table { min-width: 980px; }
#recent-events-table { min-width: 720px; }
#security-table { min-width: 1040px; }
#tiers-table { min-width: 940px; }
#subscriptions-table { min-width: 620px; }
#blacklist-table { min-width: 760px; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--border); background: rgba(14, 20, 29, .55); }
.range-label { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.cell-primary { display: block; color: var(--text); font-weight: 600; }
.cell-secondary { display: block; margin-top: 2px; color: var(--faint); font-size: 9px; }
.key-cell { min-width: 218px; max-width: 340px; }
.key-inline { display: flex; align-items: center; gap: 6px; }
.key-inline .icon-button { width: 25px; height: 25px; background: transparent; border-color: transparent; }
.key-value { color: #dce8f7; font-size: 10px; overflow-wrap: anywhere; }
.mono-cell { color: var(--text-soft); font-family: "Cascadia Code", Consolas, monospace; font-size: 10px; overflow-wrap: anywhere; }
.truncate-cell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-cell { min-width: 120px; max-width: 240px; overflow-wrap: anywhere; color: var(--muted); }
.date-cell { min-width: 132px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.actions-column { width: 1%; text-align: right; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.row-actions .button { min-height: 28px; }
.row-actions .icon-button { width: 28px; height: 28px; }
.table-state { height: 180px; padding: 28px; text-align: center; color: var(--muted); }
.table-state-content { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; max-width: 400px; }
.table-state-content strong { color: var(--text-soft); font-size: 12px; }
.table-state-content p { margin: 0; font-size: 10px; }
.table-state-content .button { margin-top: 4px; }
.table-footnote { margin: 0; padding: 11px 20px 14px; color: var(--faint); font-size: 9px; }
.table-footnote-inline { color: var(--faint); font-size: 9px; white-space: nowrap; }
.clipboard-helper { position: fixed; top: 0; left: 0; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); }
.pager-label { color: var(--muted); font-size: 10px; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- generate ---------- */
.generate-layout { display: grid; grid-template-columns: minmax(330px, .9fr) minmax(360px, 1.1fr); gap: 18px; align-items: start; }
.results-card { min-height: 420px; }
.results-heading { align-items: center; }
.generated-output { padding: 16px 20px 20px; }
.success-banner { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 9px 11px; border: 1px solid rgba(79, 209, 165, .2); border-radius: 7px; background: rgba(79, 209, 165, .07); color: var(--green); font-size: 10px; }
.success-banner .icon { width: 15px; height: 15px; }
.key-list { max-height: 420px; display: flex; flex-direction: column; gap: 7px; margin: 0; padding: 0; overflow: auto; list-style: none; counter-reset: generated-key; }
.key-item { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-inset); counter-increment: generated-key; }
.key-item::before { content: counter(generated-key, decimal-leading-zero); color: var(--faint); font-family: "Cascadia Code", Consolas, monospace; font-size: 9px; }
.key-item code { min-width: 0; flex: 1; color: var(--text-soft); font-size: 11px; overflow-wrap: anywhere; }
.key-item .icon-button { width: 28px; height: 28px; background: transparent; }

/* ---------- logs ---------- */
.logs-list { display: flex; flex-direction: column; gap: 10px; padding: 16px 20px 20px; }
.log-card { border: 1px solid var(--border); border-radius: 9px; background: var(--surface-inset); overflow: hidden; }
.log-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: rgba(20, 29, 41, .7); }
.log-card-head strong { color: var(--text-soft); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.log-card-head span { color: var(--faint); font-size: 9px; }
.log-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0; padding: 4px 12px 10px; }
.log-item { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; border-bottom: 1px dashed rgba(34, 45, 60, .55); min-width: 0; }
.log-item dt { flex: 0 0 auto; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.log-item dd { margin: 0; min-width: 0; color: var(--text-soft); font-size: 10px; overflow-wrap: anywhere; }

/* ---------- settings ---------- */
.settings-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(270px, .8fr); gap: 18px; align-items: start; }
.settings-form { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.settings-card-body { padding: 20px; }
.settings-card-body .field:last-child { margin-bottom: 0; }
.settings-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 4px; }
.settings-actions p { color: var(--faint); font-size: 10px; }
.danger-card { border-color: rgba(255, 122, 134, .22); }
.danger-card .card-heading { border-bottom-color: rgba(255, 122, 134, .16); }
.pause-body { padding: 18px 20px 20px; }
.pause-status { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--text-soft); font-size: 11px; font-weight: 600; }
.pause-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--faint); box-shadow: 0 0 10px rgba(130, 144, 163, .4); }
.pause-status.is-paused .pause-dot { background: var(--red); box-shadow: 0 0 10px rgba(255, 122, 134, .5); }
.pause-status.is-running .pause-dot { background: var(--green); box-shadow: 0 0 10px rgba(79, 209, 165, .5); }
.pause-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.pause-actions .button { width: 100%; }
.pause-body .table-footnote { padding: 12px 0 0; }

/* ---------- dialogs / drawers ---------- */
dialog { width: min(calc(100% - 32px), 560px); max-height: calc(100vh - 40px); padding: 0; overflow: auto; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(3, 6, 10, .78); backdrop-filter: blur(3px); }
.dialog-form { padding: 20px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.dialog-heading .eyebrow { margin-bottom: 4px; }
.dialog-heading h2 { font-size: 17px; }
.dialog-description { margin-top: 5px; color: var(--muted); font-size: 11px; }
.dialog-close { margin: -5px -5px 0 0; border-color: transparent; background: transparent; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.dialog-form .alert { margin-bottom: 15px; }

.drawer-dialog { position: fixed; inset: 0 0 0 auto; width: min(100%, 640px); height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 16px 0 0 16px; border-right: 0; overflow: hidden; }
.drawer-dialog[open] { display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex: 0 0 auto; padding: 20px 22px 16px; border-bottom: 1px solid var(--border); background: var(--sidebar); }
.drawer-title { min-width: 0; }
.drawer-title .eyebrow { margin-bottom: 4px; }
.drawer-title h2 { font-size: 18px; }
.drawer-head-actions { display: flex; align-items: center; gap: 6px; margin-top: -3px; }
.key-line { display: flex; align-items: center; gap: 7px; margin-top: 8px; min-width: 0; }
.key-line code { min-width: 0; color: var(--text-soft); font-size: 11px; overflow-wrap: anywhere; }
.key-line .icon-button { width: 26px; height: 26px; background: transparent; border-color: transparent; }
.drawer-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 18px 22px 28px; }
.drawer-body .alert { margin-bottom: 14px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0 0 20px; padding: 0; border: 1px solid var(--border); border-radius: 9px; background: var(--border); overflow: hidden; }
.detail-item { background: var(--surface); padding: 10px 12px; min-width: 0; }
.detail-item dt { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 4px; }
.detail-item dd { margin: 0; color: var(--text-soft); font-size: 11px; overflow-wrap: anywhere; }
.detail-wide { grid-column: 1 / -1; }
.drawer-section { padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--border); }
.drawer-section h3 { margin-bottom: 8px; color: var(--text); }
.drawer-section .compact-heading h3 { margin-bottom: 0; }
.drawer-section form { margin-top: 10px; }
.drawer-section .alert { margin: 8px 0 12px; }
.drawer-section .table-scroll { border: 1px solid var(--border); border-radius: 8px; }
.drawer-section table { min-width: 420px; }
.drawer-section th { background: #0e141d; }
.drawer-section .form-actions { padding-top: 2px; }
.drawer-section .form-actions p { max-width: 240px; }

/* ---------- toast ---------- */
.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: min(440px, calc(100vw - 32px)); display: flex; align-items: center; gap: 9px; padding: 10px 10px 10px 13px; border: 1px solid rgba(79, 209, 165, .25); border-radius: 9px; background: #121d20; color: #a4e9d2; box-shadow: var(--shadow); font-size: 11px; animation: toast-in .18s ease-out; }
.toast > .icon { width: 16px; height: 16px; }
.toast > span { min-width: 0; overflow-wrap: anywhere; }
.toast .icon-button { width: 26px; height: 26px; margin-left: 5px; border-color: transparent; background: transparent; color: inherit; }
.toast-error { color: #ffb0b7; border-color: rgba(255, 122, 134, .28); background: #24171c; }
.toast-info { color: #bcd7ff; border-color: rgba(110, 168, 254, .28); background: #131c2a; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes drawer-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: translateX(0); } }
.drawer-dialog[open] { animation: drawer-in .18s ease-out; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-layout { grid-template-columns: minmax(0, 1.55fr) minmax(260px, .9fr); }
}
@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 216px minmax(0, 1fr); }
  .main-content { padding-inline: 20px; }
  .settings-layout { grid-template-columns: 1fr; }
  .three-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .dashboard-layout { grid-template-columns: 1fr; }
  .generate-layout { grid-template-columns: 1fr; }
  .results-card { min-height: 0; }
  .key-list { max-height: 340px; }
}
@media (max-width: 840px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 13px 16px; border-right: 0; border-bottom: 1px solid var(--border); overflow: visible; }
  .brand { padding: 0; }
  .primary-nav { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
  .nav-label { display: none; }
  .nav-tabs { flex-direction: row; gap: 5px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
  .nav-tab { width: auto; min-width: max-content; min-height: 34px; padding: 6px 10px; font-size: 11px; }
  .nav-badge { display: none; }
  .account-card { min-width: 210px; margin: 0; padding: 8px 10px; }
  .account-heading { padding-bottom: 7px; margin-bottom: 7px; }
  .account-card .quota-meta { display: none; }
  .account-card progress { margin-top: 6px; }
  .avatar { width: 29px; height: 29px; }
  .sidebar-footer { display: none; }
  .main-content { padding: 20px 16px 34px; }
  .topbar { margin-bottom: 18px; align-items: flex-start; }
  .drawer-dialog { width: min(100%, 560px); }
  .settings-actions { flex-direction: column; align-items: stretch; gap: 10px; }
  .settings-actions .button { width: 100%; }
}
@media (max-width: 620px) {
  h1 { font-size: 21px; }
  .sidebar { grid-template-columns: 1fr; gap: 10px; padding: 12px; }
  .account-card { grid-row: 2; min-width: 0; }
  .account-identity strong { white-space: normal; overflow-wrap: anywhere; }
  .primary-nav { grid-row: 3; }
  .main-content { padding: 16px 12px 28px; }
  .topbar { gap: 10px; }
  .topbar-actions { gap: 7px; }
  .role-chip { display: none; }
  .topbar .button span { display: none; }
  .topbar .button { width: 36px; padding: 0; }
  .page-description { max-width: 300px; font-size: 11px; }
  .stats-grid { gap: 8px; }
  .stat-card { gap: 9px; padding: 11px 10px; }
  .stat-icon { width: 30px; height: 30px; }
  .stat-icon .icon { width: 15px; height: 15px; }
  .stat-body { display: block; }
  .stat-body span { display: block; margin-bottom: 4px; }
  .stat-body strong { font-size: 20px; }
  .stat-body small { display: none; }
  .card-heading { padding: 14px; flex-wrap: wrap; }
  .form-card form { padding: 15px; }
  .settings-card-body { padding: 15px; }
  .filter-bar { padding: 12px 14px; }
  .filter-search, .filter-level, .filter-rows { flex: 1 1 100%; min-width: 0; }
  .filter-actions { width: 100%; }
  .filter-actions .button { flex: 1; }
  .two-columns, .three-columns { grid-template-columns: 1fr; }
  .form-grid { gap: 0; }
  .form-grid + .field { margin-top: 15px; }
  .form-actions { align-items: stretch; flex-direction: column; gap: 10px; }
  .form-actions p { max-width: none; }
  .form-actions .button { width: 100%; }
  .results-heading { align-items: flex-start; flex-direction: column; }
  .button-group { width: 100%; }
  .button-group .button { flex: 1; }
  .table-toolbar { padding: 10px 14px; flex-wrap: wrap; }
  .pager { padding: 12px 14px; }
  .pager .button span { display: none; }
  .pager .button { width: 34px; padding: 0; }
  .pager-label { font-size: 9px; }
  .drawer-head { padding: 16px 15px 13px; }
  .drawer-body { padding: 14px 15px 22px; }
  .detail-grid { grid-template-columns: 1fr; }
  .dialog-form { padding: 16px; }
  .toast { right: 12px; bottom: 12px; left: 12px; max-width: none; }
  .section-status { display: none; }
  .dashboard-side { order: 2; }
}
@media (max-width: 420px) {
  .nav-tab { flex: 1; justify-content: center; }
  .nav-tab .icon { width: 15px; height: 15px; }
  .nav-tab span:not(.nav-badge) { display: none; }
  .stat-body strong { font-size: 18px; }
  .toast { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---- standalone administrator login (ported from boom-licensing) ---- */
.login-page{background:#0d0f11;min-height:100vh}
.xl-login{min-height:100vh;min-height:100dvh;display:flex;align-items:center;justify-content:center;padding:24px;font-family:Inter,system-ui,sans-serif;box-sizing:border-box}
.xl-card{box-sizing:border-box;width:min(380px,100%);background:#14171a;border:1px solid rgba(115,122,133,.55);border-radius:11px;padding:18px;box-shadow:0 18px 50px rgba(0,0,0,.55)}
.xl-head{display:flex;align-items:center;gap:12px;min-height:40px;margin:0 0 16px;padding:0 0 13px;border-bottom:1px solid rgba(115,122,133,.28)}
.xl-logo{display:grid;place-items:center;width:34px;height:34px;border-radius:7px;background:linear-gradient(145deg,#7d99ff,#4968d8);color:#fff;font-weight:800;font-size:17px}
.xl-name{display:block;font-weight:600;font-size:15px;letter-spacing:.02em;color:#f2eee0}
.xl-sub{display:block;font-size:11.5px;color:#9e9682;margin-top:1px}
.xl-field{display:grid;gap:6px;margin:0 0 12px}
.xl-field span{font-size:11.5px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:#9e9682}
.xl-field input{height:38px;box-sizing:border-box;padding:0 11px;background:#101315;border:1px solid rgba(115,122,133,.45);border-radius:5px;color:#f2eee0;font:500 14px/1 Inter,system-ui,sans-serif;outline:none;transition:border-color .12s,background .12s;width:100%}
.xl-field input:focus{border-color:#949ca6;background:#12161a;box-shadow:0 0 0 3px rgba(148,156,166,.12)}
.xl-btn{width:100%;height:39px;margin-top:2px;background:#737a85;color:#0f1112;font:600 14px Inter,system-ui,sans-serif;border:1px solid rgba(148,156,166,.5);border-radius:5px;cursor:pointer;transition:background .12s}
.xl-btn:hover{background:#949ca6}
.xl-btn:disabled{opacity:.55;cursor:wait}
.xl-error{margin:0 0 12px;padding:8px 10px;border:1px solid rgba(224,107,97,.45);background:rgba(224,107,97,.08);border-radius:5px;color:#e06b61;font-size:12.5px;line-height:1.45}
.xl-foot{margin:15px 0 0;text-align:center;font-size:10.5px;letter-spacing:.07em;text-transform:uppercase;color:#6f6757}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media (max-width:480px){.xl-login{padding:16px}.xl-card{padding:14px}.xl-field input{font-size:16px}}
.signout-button{width:100%;margin-top:12px}
.xl-logo-image{width:38px;height:38px;border-radius:7px;object-fit:contain;background:#0d0f11}
