/* ================================================================
   LOLM License Server — admin panel styles
   Dark-first, single stylesheet, no framework. Same-origin only
   (matches ContentSecurityPolicy: default-src 'self').
================================================================ */

*,*::before,*::after { box-sizing: border-box; }

:root {
    --bg:            #0b0d12;
    --bg-elev:       #12151d;
    --bg-elev-2:     #1a1e28;
    --border:        #262b36;
    --border-strong: #363c4a;
    --text:          #e6e8ee;
    --text-dim:      #9aa0ac;
    --text-mute:     #6a6f7a;
    --accent:        #7dd3fc;
    --accent-warm:   #fbbf77;
    --danger:        #ff6b6b;
    --success:       #79e0a5;
    --warning:       #ffc94a;
    --mono:          ui-monospace, 'JetBrains Mono', 'Fira Code', Menlo, Consolas, monospace;
    --sans:          -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --radius:        6px;
    --radius-lg:     10px;
    --shadow:        0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.25);
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, kbd, pre, .mono { font-family: var(--mono); }

/* ─── Auth (login / TOTP) ─────────────────────────────── */
.auth-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: radial-gradient(ellipse at top, #14181f 0%, #0b0d12 60%);
}
.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    box-shadow: var(--shadow);
}
.auth-brand {
    text-align: center;
    margin-bottom: 24px;
}
.auth-brand h1 {
    margin: 0;
    font-family: var(--mono);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
}
.auth-brand .sub {
    color: var(--text-mute);
    font-size: 12px;
    margin-top: 4px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-card label {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 6px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.auth-card input[type="text"],
.auth-card input[type="password"],
.auth-card input[type="tel"] {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 12px;
    border-radius: var(--radius);
    font: inherit;
    outline: none;
    transition: border-color .15s;
}
.auth-card input:focus {
    border-color: var(--accent);
}
.auth-card .totp-input {
    font-family: var(--mono);
    font-size: 24px;
    letter-spacing: 0.4em;
    text-align: center;
    padding: 14px 12px;
}
.auth-card button[type="submit"] {
    background: var(--accent);
    color: #06121b;
    border: none;
    padding: 11px 14px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: filter .15s;
    margin-top: 4px;
}
.auth-card button[type="submit"]:hover { filter: brightness(1.1); }
.auth-card button[type="submit"]:active { filter: brightness(.95); }
.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-mute);
    font-size: 12px;
}

/* ─── Flash / alerts ──────────────────────────────────── */
.flash {
    padding: 10px 14px;
    border-radius: var(--radius);
    border-left: 3px solid;
    font-size: 13px;
    margin-bottom: 12px;
}
.flash.error { background: rgba(255,107,107,.08); border-color: var(--danger); color: #ffb0b0; }
.flash.success { background: rgba(121,224,165,.08); border-color: var(--success); color: #b8f0d1; }
.flash.info { background: rgba(125,211,252,.08); border-color: var(--accent); color: #c3e6f8; }

/* ─── Authenticated app shell ─────────────────────────── */
.app {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 100vh;
}
.sidebar {
    background: var(--bg-elev);
    border-right: 1px solid var(--border);
    padding: 20px 12px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar .brand {
    padding: 4px 10px 20px;
    font-family: var(--mono);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.sidebar .brand .dot { color: var(--accent); }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
    padding: 8px 12px;
    border-radius: var(--radius);
    color: var(--text-dim);
    font-size: 13px;
    letter-spacing: 0.01em;
    transition: background .12s, color .12s;
}
.sidebar nav a:hover {
    background: var(--bg-elev-2);
    color: var(--text);
    text-decoration: none;
}
.sidebar nav a.active {
    background: var(--bg-elev-2);
    color: var(--accent);
    box-shadow: inset 2px 0 0 var(--accent);
}
.sidebar .sidebar-footer {
    position: absolute;
    bottom: 20px;
    left: 12px;
    right: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-mute);
}
.sidebar .sidebar-footer form { margin-top: 8px; }
.sidebar .sidebar-footer .logout-btn {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-dim);
    padding: 5px 10px;
    border-radius: var(--radius);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    width: 100%;
}
.sidebar .sidebar-footer .logout-btn:hover {
    color: var(--danger);
    border-color: var(--danger);
}

.main {
    padding: 28px 32px;
    max-width: 1240px;
    width: 100%;
}
.main header.page-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.main .page-header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.main .page-header .sub {
    color: var(--text-mute);
    font-size: 13px;
}

/* Stat tiles */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.stat {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
}
.stat .label {
    font-size: 11px;
    color: var(--text-mute);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.stat .value {
    font-family: var(--mono);
    font-size: 22px;
    color: var(--text);
    font-weight: 600;
}

/* Info panel */
.panel {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 20px;
}
.panel h2 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.01em;
}
.panel .kv {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px 16px;
    font-size: 13px;
}
.panel .kv dt { color: var(--text-mute); }
.panel .kv dd { margin: 0; color: var(--text); font-family: var(--mono); word-break: break-all; }
.panel .kv dd.plain { font-family: var(--sans); }

/* Empty state */
.empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-mute);
    font-style: italic;
}

/* Responsive tweaks */
@media (max-width: 720px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; }
    .sidebar .sidebar-footer { position: static; margin-top: 20px; }
    .main { padding: 20px; }
}

/* ─── Tables ─────────────────────────────────────────── */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}
.table thead th {
    text-align: left;
    padding: 10px 14px;
    color: var(--text-mute);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elev-2);
    position: sticky;
    top: 0;
}
.table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table tbody tr:hover td { background: var(--bg-elev-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table .mute { color: var(--text-mute); }

/* ─── Buttons ────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 7px 14px;
    background: var(--bg-elev-2);
    border: 1px solid var(--border-strong);
    color: var(--text);
    border-radius: var(--radius);
    font: inherit;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
    white-space: nowrap;
}
.btn:hover { background: var(--bg-elev); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #06121b; font-weight: 600; }
.btn-primary:hover { filter: brightness(1.1); background: var(--accent); }
.btn-danger { border-color: rgba(255,107,107,.4); color: var(--danger); }
.btn-danger:hover { background: rgba(255,107,107,.1); border-color: var(--danger); }
.btn-warning { border-color: rgba(255,201,74,.4); color: var(--warning); }
.btn-warning:hover { background: rgba(255,201,74,.1); border-color: var(--warning); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); background: var(--bg-elev-2); }

/* ─── Badges (state, role) ───────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-family: var(--mono);
    letter-spacing: 0.04em;
    background: var(--bg-elev-2);
    border: 1px solid var(--border-strong);
    color: var(--text-dim);
    white-space: nowrap;
}
.badge-active,   .badge-issued  { border-color: rgba(121,224,165,.4); color: var(--success); }
.badge-issued                   { border-color: rgba(125,211,252,.4); color: var(--accent); }
.badge-paused                   { border-color: rgba(255,201,74,.4); color: var(--warning); }
.badge-blocked, .badge-deleted, .badge-disabled { border-color: rgba(255,107,107,.4); color: var(--danger); }
.badge-expired, .badge-archived                 { border-color: var(--border-strong); color: var(--text-mute); }
.badge-root                                     { border-color: rgba(251,191,119,.5); color: var(--accent-warm); }
.badge-admin, .badge-support, .badge-readonly, .badge-suspended, .badge-closed {
    border-color: var(--border-strong); color: var(--text-dim);
}

/* Row action cluster — compact icon buttons on list rows */
.row-actions {
    text-align: right;
    white-space: nowrap;
}
.row-actions form {
    display: inline-block;
    margin: 0 2px;
}
.row-actions .btn {
    padding: 4px 8px;
    font-size: 14px;
    min-width: 32px;
    text-align: center;
}

/* ─── Forms ──────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 16px; }
.form .form-row { display: block; }
.form .form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form label {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 6px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 500;
}
.form label .mute { color: var(--text-mute); text-transform: none; letter-spacing: 0; font-weight: normal; }
.form input[type=text], .form input[type=number], .form input[type=tel],
.form input[type=password], .form input:not([type]),
.form select, .form textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: var(--radius);
    font: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color .15s;
}
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--accent); }
.form select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--text-mute) 50%), linear-gradient(135deg, var(--text-mute) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.form .hint { font-size: 11px; color: var(--text-mute); margin-top: 4px; }
.form .hint a { color: var(--accent); text-decoration: none; }
.form .form-actions { display: flex; gap: 10px; margin-top: 4px; }

/* ─── Filter bar (list pages) ─────────────────────────── */
.filter-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    flex-wrap: wrap;
}
.filter-bar label { font-size: 12px; color: var(--text-mute); }
.filter-bar select, .filter-bar input {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 10px;
    border-radius: var(--radius);
    font: inherit;
    font-size: 13px;
    outline: none;
}
.filter-bar input { min-width: 180px; }

/* ─── Timeline (key state history) ───────────────────── */
.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.timeline li {
    padding: 10px 12px;
    background: var(--bg-elev-2);
    border-left: 2px solid var(--border-strong);
    border-radius: 0 var(--radius) var(--radius) 0;
}
.timeline .ts { font-size: 11px; margin-bottom: 4px; }
.timeline .event { font-size: 13px; }
.timeline .reason { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

/* ─── Notes ──────────────────────────────────────────── */
.note {
    padding: 8px 10px;
    background: var(--bg-elev-2);
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-size: 13px;
}

/* ─── Action grid (key detail) ──────────────────────── */
.action-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.action-grid form { display: block; }
.action-grid button { width: 100%; text-align: left; }

/* ─── Setting card (dashboard-style link) ────────────── */
.setting-card {
    display: block;
    text-decoration: none;
    transition: border-color .12s, background .12s;
}
.setting-card:hover {
    border-color: var(--accent);
    background: var(--bg-elev-2);
    text-decoration: none;
}

/* Utility */
code {
    font-family: var(--mono);
    background: var(--bg-elev-2);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--text);
}
.mute { color: var(--text-mute); }

/* ─── Reseller license workspace ──────────────────────── */
body.seller-shell {
    --bg:            #090d0f;
    --bg-elev:       #111719;
    --bg-elev-2:     #182023;
    --border:        #273135;
    --border-strong: #3a474c;
    --text:          #f1f5f4;
    --text-dim:      #b4c0c0;
    --text-mute:     #7f8c8e;
    --accent:        #51c7d4;
    --accent-strong: #78dce6;
    --danger:        #ff716c;
    --success:       #61d39b;
    --warning:       #f2bd5b;
    --radius:        6px;
    --radius-lg:     8px;
    min-height: 100dvh;
    background: var(--bg);
    letter-spacing: 0;
}

.seller-shell *,
.seller-shell *::before,
.seller-shell *::after { letter-spacing: 0; }

.seller-shell .icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    flex: 0 0 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -3px;
}

.seller-shell :focus-visible {
    outline: 2px solid var(--accent-strong);
    outline-offset: 2px;
}

.skip-link {
    position: fixed;
    z-index: 2000;
    top: 8px;
    left: 8px;
    transform: translateY(-160%);
    padding: 9px 12px;
    color: #061315;
    background: var(--accent-strong);
    border-radius: var(--radius);
    font-weight: 700;
}
.skip-link:focus { transform: translateY(0); }

.seller-mobile-bar,
.seller-mobile-nav { display: none; }

.seller-app {
    grid-template-columns: 252px minmax(0, 1fr);
    min-height: 100dvh;
}

.seller-sidebar {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    padding: 20px 14px 16px;
    background: #0d1214;
}

.seller-brand,
.seller-mobile-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--text);
    text-decoration: none;
}
.seller-brand:hover,
.seller-mobile-brand:hover { text-decoration: none; }

.seller-brand { padding: 0 8px 24px; }
.seller-brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border: 1px solid rgba(81, 199, 212, .55);
    border-radius: 6px;
    color: #071214;
    background: var(--accent);
    font-family: var(--mono);
    font-size: 16px;
    font-weight: 800;
}
.seller-brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.seller-brand-copy strong { font-family: var(--mono); font-size: 16px; }
.seller-brand-copy small {
    margin-top: 4px;
    color: var(--text-mute);
    font-size: 11px;
    text-transform: uppercase;
}

.seller-sidebar nav { gap: 4px; }
.seller-sidebar nav a,
.seller-mobile-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 42px;
    padding: 9px 11px;
    color: var(--text-dim);
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 550;
}
.seller-sidebar nav a:hover,
.seller-mobile-nav a:hover {
    color: var(--text);
    background: var(--bg-elev-2);
    text-decoration: none;
}
.seller-sidebar nav a.active,
.seller-mobile-nav a.active {
    color: var(--accent-strong);
    background: rgba(81, 199, 212, .09);
    border-color: rgba(81, 199, 212, .22);
    box-shadow: inset 3px 0 0 var(--accent);
}

.seller-sidebar .seller-account {
    position: static;
    inset: auto;
    margin-top: auto;
    padding: 16px 4px 0;
    border-top: 1px solid var(--border);
}
.seller-account-name {
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.seller-account-code { margin-top: 2px; color: var(--text-mute); font-size: 11px; }
.seller-balance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    padding: 10px 11px;
    color: var(--text-dim);
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.seller-balance:hover { border-color: var(--border-strong); text-decoration: none; }
.seller-balance span { display: flex; align-items: center; gap: 7px; }
.seller-balance strong { color: var(--success); font-family: var(--mono); }
.seller-sidebar .seller-account form { margin-top: 8px; }
.seller-sidebar .seller-account .logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 10px;
}

.seller-main {
    min-width: 0;
    max-width: 1600px;
    margin: 0 auto;
    padding: 30px 36px 56px;
}

.seller-shell .flash {
    border: 1px solid;
    border-left-width: 3px;
    padding: 11px 14px;
    margin-bottom: 16px;
}

.seller-shell .main header.page-header {
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 18px;
}
.seller-shell .main .page-header h1 {
    font-size: 22px;
    font-weight: 700;
}
.seller-shell .main .page-header .sub { margin-top: 4px; color: var(--text-dim); }
.page-kicker,
.section-step,
.result-eyebrow {
    margin-bottom: 5px;
    color: var(--accent);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.seller-shell .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 13px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    transition: background-color .18s, border-color .18s, color .18s, opacity .18s;
}
.seller-shell .btn:active { transform: none; filter: brightness(.9); }
.seller-shell .btn:disabled { cursor: not-allowed; opacity: .45; }
.seller-shell .btn-primary {
    color: #061315;
    background: var(--accent);
    border-color: var(--accent);
}
.seller-shell .btn-icon {
    width: 38px;
    min-width: 38px;
    padding: 0;
}
.seller-shell .btn-compact { padding-inline: 10px; }
.seller-shell .btn-block { width: 100%; }
.seller-shell .btn-leading { justify-content: flex-start; }
.seller-shell .inline-form { display: inline-flex; }
.align-right { text-align: right !important; }
.sr-only {
    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;
}

.license-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}
.license-header-actions form { display: flex; margin: 0; }

.license-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}
.license-stat {
    min-width: 0;
    padding: 14px 15px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-top: 2px solid var(--border-strong);
    border-radius: var(--radius);
}
.license-stat.is-success { border-top-color: var(--success); }
.license-stat.is-warning { border-top-color: var(--warning); }
.license-stat.is-danger { border-top-color: var(--danger); }
.license-stat-label { display: block; color: var(--text-dim); font-size: 11px; font-weight: 650; }
.license-stat strong {
    display: block;
    margin: 4px 0 2px;
    font-family: var(--mono);
    font-size: 24px;
    line-height: 1.15;
}
.license-stat small {
    display: block;
    overflow: hidden;
    color: var(--text-mute);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.minted-result {
    margin-bottom: 18px;
    padding: 17px;
    background: rgba(81, 199, 212, .07);
    border: 1px solid rgba(81, 199, 212, .4);
    border-radius: var(--radius);
}
.minted-result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 12px;
}
.minted-result h2 { margin: 0; font-size: 16px; }
.minted-result p { margin: 3px 0 0; color: var(--text-dim); font-size: 12px; }
.minted-keys {
    display: block;
    width: 100%;
    min-height: 92px;
    resize: vertical;
    padding: 12px;
    color: var(--warning);
    background: #080c0e;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.6;
}

.license-filter {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 170px 120px auto auto;
    gap: 8px;
    margin-bottom: 14px;
    padding: 11px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.filter-search { position: relative; }
.filter-search .icon {
    position: absolute;
    top: 10px;
    left: 11px;
    color: var(--text-mute);
}
.license-filter input,
.license-filter select,
.product-picker select,
.mint-form-panel input,
.mint-form-panel textarea,
.note-form textarea,
.danger-action-row input {
    width: 100%;
    min-height: 38px;
    padding: 8px 11px;
    color: var(--text);
    background: #0b1012;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font: inherit;
    font-size: 13px;
    outline: none;
}
.license-filter input:focus,
.license-filter select:focus,
.product-picker select:focus,
.mint-form-panel input:focus,
.note-form textarea:focus,
.danger-action-row input:focus { border-color: var(--accent); }
.filter-search input { padding-left: 37px; }

.license-table-shell,
.workspace-panel,
.mint-form-panel,
.mint-summary,
.product-picker,
.danger-zone {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.license-table-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 42px;
    padding: 8px 13px;
    color: var(--text-mute);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
}
.license-table-meta strong { color: var(--text); font-family: var(--mono); }
.license-table-scroll,
.device-table-scroll { overflow-x: auto; }
.license-table { min-width: 930px; }
.seller-shell .table thead th {
    padding: 9px 12px;
    color: var(--text-mute);
    background: #141b1e;
    font-size: 10px;
}
.seller-shell .table tbody td { padding: 11px 12px; }
.seller-shell .table tbody tr:hover td { background: rgba(255, 255, 255, .025); }
.license-id { color: var(--text); font-family: var(--mono); font-size: 12px; font-weight: 700; }
.license-mask { margin-top: 3px; overflow-wrap: anywhere; color: var(--text-mute); font-size: 11px; }
.license-card-head > div { min-width: 0; }
.license-product { color: var(--text); font-size: 12px; font-weight: 650; }
.license-plan { margin-top: 2px; color: var(--text-mute); font-size: 11px; }
.license-date { font-size: 11px; white-space: nowrap; }
.quick-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.quick-actions form { margin: 0; }

.seller-shell .badge {
    padding: 3px 8px;
    border-radius: 999px;
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 700;
}
.seller-shell .badge-active { color: var(--success); background: rgba(97, 211, 155, .08); }
.seller-shell .badge-issued { color: var(--accent-strong); background: rgba(81, 199, 212, .08); }
.seller-shell .badge-paused { color: var(--warning); background: rgba(242, 189, 91, .08); }
.seller-shell .badge-blocked,
.seller-shell .badge-deleted { color: var(--danger); background: rgba(255, 113, 108, .08); }
.slot-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
}
.slot-count.is-full { color: var(--danger); }
.slot-count.is-used { color: var(--warning); }
.slot-count.is-empty { color: var(--success); }
.license-card-list { display: none; }

.license-empty {
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-elev);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    font-style: normal;
}
.license-empty > .icon { width: 30px; height: 30px; color: var(--text-mute); }
.license-empty h2 { margin: 4px 0 0; color: var(--text); font-size: 15px; }
.license-empty p { margin: 0 0 8px; }
.compact-empty { min-height: 150px; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-bottom: 6px;
    color: var(--text-mute);
    font-size: 12px;
}
.back-link:hover { color: var(--accent); text-decoration: none; }
.balance-pill {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 9px 12px;
    color: var(--text-dim);
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.balance-pill:hover { border-color: var(--border-strong); text-decoration: none; }
.balance-pill span { font-size: 10px; }
.balance-pill strong { color: var(--success); font-family: var(--mono); font-size: 14px; }

.product-picker {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    align-items: end;
    gap: 20px;
    margin-bottom: 14px;
    padding: 16px;
}
.product-picker h2,
.mint-form-panel h2,
.mint-summary h2,
.workspace-panel h2,
.danger-zone h2 { margin: 0; font-size: 15px; }
.product-picker form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.icon-forward { width: 14px !important; height: 14px !important; }

.mint-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
    gap: 14px;
}
.mint-form-panel { padding: 18px; }
.section-heading,
.workspace-panel-head,
.danger-zone-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.plan-fieldset { padding: 0; margin: 0; border: 0; }
.plan-fieldset legend,
.mint-form-panel .form-row > label,
.note-form label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 700;
}
.plan-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.plan-option {
    position: relative;
    display: flex;
    gap: 10px;
    min-height: 112px;
    padding: 13px;
    cursor: pointer;
    background: #0d1214;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color .18s, background-color .18s;
}
.plan-option:hover { border-color: var(--border-strong); }
.plan-option:has(input:checked) { background: rgba(81, 199, 212, .06); border-color: var(--accent); }
.plan-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}
.plan-option input:focus-visible + .plan-option-check { outline: 2px solid var(--accent-strong); outline-offset: 3px; }
.plan-option-check {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin-top: 1px;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
}
.plan-option input:checked + .plan-option-check { border-color: var(--accent); }
.plan-option input:checked + .plan-option-check span { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; }
.plan-option-body { min-width: 0; flex: 1; }
.plan-option-head { display: flex; justify-content: space-between; gap: 8px; }
.plan-option-head strong { color: var(--text); font-size: 13px; }
.plan-option-head .mono { color: var(--success); font-size: 11px; white-space: nowrap; }
.plan-option-code { display: block; margin-top: 3px; color: var(--text-mute); font-size: 10px; }
.plan-option-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 12px; color: var(--text-dim); font-size: 11px; }
.plan-option-meta span { display: inline-flex; align-items: center; gap: 5px; }
.plan-option-meta .icon { width: 14px; height: 14px; flex-basis: 14px; }
.mint-input-grid { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 12px; margin-top: 16px; }
.quantity-control { display: grid; grid-template-columns: 40px minmax(70px, 1fr) 40px; }
.quantity-control button {
    display: grid;
    place-items: center;
    color: var(--text-dim);
    background: var(--bg-elev-2);
    border: 1px solid var(--border-strong);
    cursor: pointer;
}
.quantity-control button:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.quantity-control button:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.quantity-control input { border-inline: 0; border-radius: 0; text-align: center; font-family: var(--mono); }
.mint-summary { position: sticky; top: 20px; padding: 18px; }
.mint-summary dl { margin: 14px 0; }
.mint-summary dl div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; color: var(--text-dim); border-bottom: 1px solid var(--border); font-size: 12px; }
.mint-summary dt,
.mint-summary dd { margin: 0; }
.mint-summary dd { color: var(--text); font-family: var(--mono); text-align: right; }
.mint-summary .summary-total { padding: 12px 0; font-weight: 700; }
.mint-summary .summary-total dd { color: var(--accent-strong); font-size: 15px; }
.mint-summary .summary-after { border-bottom: 0; }
.mint-summary output.is-negative { color: var(--danger); }
.mint-once-note { display: flex; gap: 8px; margin: 14px 0; padding: 10px; color: var(--warning); background: rgba(242, 189, 91, .06); border: 1px solid rgba(242, 189, 91, .24); border-radius: var(--radius); font-size: 11px; }
.mint-summary .btn + .btn { margin-top: 8px; }

.key-title-line { display: flex; align-items: center; gap: 10px; }
.key-mask-large { margin-top: 5px; color: var(--text-dim); font-size: 13px; }
.key-primary-actions { display: flex; gap: 8px; }
.key-primary-actions form { margin: 0; }
.key-overview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 14px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.key-overview > div { min-width: 0; padding: 13px 15px; border-right: 1px solid var(--border); }
.key-overview > div:last-child { border-right: 0; }
.key-overview span { display: block; margin-bottom: 4px; color: var(--text-mute); font-size: 10px; }
.key-overview strong { display: block; overflow: hidden; color: var(--text); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.state-text.state-active { color: var(--success); }
.state-text.state-paused { color: var(--warning); }
.state-text.state-blocked,
.state-text.state-deleted { color: var(--danger); }
.state-text.state-issued { color: var(--accent); }

.key-workspace { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .7fr); align-items: start; gap: 14px; }
.workspace-panel { min-width: 0; padding: 17px; }
.device-capacity { color: var(--text-mute); font-family: var(--mono); font-size: 11px; }
.device-capacity strong { color: var(--warning); }
.panel-empty { min-height: 180px; padding: 24px; font-style: normal; }
.panel-empty .icon { width: 26px; height: 26px; }
.panel-empty h3 { margin: 8px 0 3px; color: var(--text); font-size: 14px; }
.panel-empty p { margin: 0; }
.device-table { min-width: 650px; }
.device-card-list { display: none; }
.metadata-list { margin: 0; }
.metadata-list > div { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.metadata-list > div:last-child { border-bottom: 0; }
.metadata-list dt { color: var(--text-mute); font-size: 11px; }
.metadata-list dd { min-width: 0; margin: 0; color: var(--text); font-size: 12px; overflow-wrap: anywhere; }
.metadata-list dd small { display: block; margin-top: 2px; color: var(--text-mute); }
.metadata-list .metadata-danger dd { color: var(--danger); }

.key-secondary-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.count-pill { display: inline-flex; min-width: 22px; justify-content: center; margin-left: 5px; padding: 2px 6px; color: var(--text-dim); background: var(--bg-elev-2); border-radius: 999px; font-family: var(--mono); font-size: 10px; }
.note-form { padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.note-form textarea { display: block; resize: vertical; min-height: 78px; }
.note-form .btn { margin-top: 8px; }
.note-list { margin-top: 12px; max-height: 360px; overflow-y: auto; }
.seller-shell .note { padding: 10px 11px; background: #0d1214; border: 1px solid var(--border); }
.seller-shell .note time { display: block; margin-bottom: 4px; font-size: 10px; }
.empty-inline { margin: 10px 0 0; color: var(--text-mute); font-size: 12px; }
.history-panel .timeline { max-height: 440px; overflow-y: auto; }
.seller-shell .timeline li { position: relative; background: #0d1214; border-left-color: var(--accent); }
.seller-shell .timeline .event { display: flex; justify-content: space-between; gap: 8px; }

.danger-zone { margin-top: 14px; padding: 17px; border-color: rgba(255, 113, 108, .32); }
.danger-zone-head { color: var(--danger); }
.danger-zone-head .icon { width: 22px; height: 22px; }
.danger-action-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 280px) auto;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}
.danger-action-row > div strong { display: block; color: var(--text); font-size: 12px; }
.danger-action-row > div span { display: block; margin-top: 2px; color: var(--text-mute); font-size: 11px; }
.danger-action-row.is-destructive { margin-top: 4px; border-top-color: rgba(255, 113, 108, .35); }

.seller-toast {
    position: fixed;
    z-index: 1800;
    right: 20px;
    bottom: 20px;
    max-width: min(360px, calc(100vw - 32px));
    padding: 11px 14px;
    color: #07120f;
    background: var(--success);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
    font-size: 12px;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity .18s, transform .18s;
}
.seller-toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1180px) {
    .license-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .key-workspace { grid-template-columns: minmax(0, 1fr); }
    .metadata-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
}

@media (max-width: 960px) {
    .seller-mobile-bar {
        position: sticky;
        z-index: 1100;
        top: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 64px;
        padding: 10px 16px;
        background: rgba(9, 13, 15, .97);
        border-bottom: 1px solid var(--border);
    }
    .seller-mobile-brand { font-family: var(--mono); font-size: 14px; font-weight: 700; }
    .seller-mobile-brand small { display: block; color: var(--text-mute); font-family: var(--sans); font-size: 9px; font-weight: 600; text-transform: uppercase; }
    .seller-mobile-actions { display: flex; align-items: center; gap: 8px; }
    .credit-chip {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        min-height: 44px;
        padding: 7px 10px;
        color: var(--success);
        background: var(--bg-elev);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        font-family: var(--mono);
        font-size: 11px;
    }
    .credit-chip:hover { text-decoration: none; }
    .mobile-nav-toggle {
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        padding: 0;
        color: var(--text);
        background: var(--bg-elev);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        cursor: pointer;
    }
    .mobile-nav-toggle .icon-close { display: none; }
    .mobile-nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
    .mobile-nav-toggle[aria-expanded="true"] .icon-close { display: block; }
    .seller-mobile-nav {
        position: fixed;
        z-index: 1050;
        top: 64px;
        right: 0;
        left: 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        padding: 12px 16px 16px;
        background: #0d1214;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
        opacity: 0;
        pointer-events: none;
        transform: translateY(-8px);
        transition: opacity .18s, transform .18s;
    }
    .seller-mobile-nav.is-open { opacity: 1; pointer-events: auto; transform: translateY(0); }
    .seller-mobile-nav a { min-height: 44px; }
    .seller-sidebar { display: none; }
    .seller-app { display: block; min-height: calc(100dvh - 64px); }
    .seller-main { max-width: none; padding: 24px 22px 48px; }
}

@media (max-width: 760px) {
    .seller-main { padding: 18px 14px 40px; }
    .seller-shell .btn { min-height: 44px; }
    .seller-shell .main header.page-header { align-items: stretch; flex-direction: column; gap: 13px; }
    .seller-shell .main .page-header h1 { font-size: 20px; }
    .license-header-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }
    .license-header-actions form,
    .license-header-actions .btn { width: 100%; }
    .license-header-actions .btn { min-height: 44px; justify-content: center; }
    .balance-pill { align-items: flex-start; }
    .license-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .license-stat { padding: 12px; }
    .license-stat strong { font-size: 20px; }
    .license-stat small { white-space: normal; }
    .minted-result-head { align-items: stretch; flex-direction: column; }
    .minted-result-head .btn { width: 100%; min-height: 44px; }
    .license-filter { grid-template-columns: 1fr; }
    .license-filter input,
    .license-filter select,
    .license-filter .btn { min-height: 44px; width: 100%; }
    .filter-search .icon { top: 13px; }
    .license-table-shell { display: none; }
    .license-card-list { display: grid; gap: 8px; }
    .license-card {
        padding: 14px;
        background: var(--bg-elev);
        border: 1px solid var(--border);
        border-radius: var(--radius);
    }
    .license-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
    .license-card-data { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin: 14px 0; padding: 12px 0; border-block: 1px solid var(--border); }
    .license-card-data > div { min-width: 0; }
    .license-card-data dt { color: var(--text-mute); font-size: 10px; }
    .license-card-data dd { margin: 3px 0 0; overflow: hidden; color: var(--text); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
    .license-card-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .license-card-actions form,
    .license-card-actions .btn { width: 100%; }
    .license-card-actions .btn { min-height: 44px; }

    .product-picker { grid-template-columns: 1fr; gap: 12px; }
    .product-picker form { grid-template-columns: 1fr; }
    .product-picker select,
    .product-picker .btn { min-height: 44px; }
    .mint-layout { grid-template-columns: 1fr; }
    .mint-summary { position: static; }
    .plan-options { grid-template-columns: 1fr; }
    .plan-option { min-height: 108px; }
    .mint-input-grid { grid-template-columns: 1fr; }
    .quantity-control button,
    .quantity-control input { min-height: 44px; }
    .mint-summary .btn { min-height: 44px; }

    .key-title-line { align-items: flex-start; flex-direction: column; gap: 7px; }
    .key-primary-actions,
    .key-primary-actions form,
    .key-primary-actions .btn { width: 100%; }
    .key-primary-actions .btn { min-height: 44px; }
    .key-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .key-overview > div:nth-child(2) { border-right: 0; }
    .key-overview > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
    .device-table-scroll { display: none; }
    .device-card-list { display: grid; gap: 8px; }
    .device-card { padding: 12px; background: #0d1214; border: 1px solid var(--border); border-radius: var(--radius); }
    .device-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
    .device-card dl { display: grid; grid-template-columns: 70px 1fr; gap: 8px 10px; margin: 12px 0; }
    .device-card dl div { display: contents; }
    .device-card dt { color: var(--text-mute); font-size: 10px; }
    .device-card dd { margin: 0; color: var(--text-dim); font-size: 11px; text-align: right; }
    .device-card-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .device-card-actions form,
    .device-card-actions .btn { width: 100%; }
    .device-card-actions .btn { min-height: 44px; }
    .metadata-list { display: block; }
    .key-secondary-grid { grid-template-columns: 1fr; }
    .danger-action-row { grid-template-columns: 1fr; gap: 9px; }
    .danger-action-row > span:empty { display: none; }
    .danger-action-row input,
    .danger-action-row .btn { min-height: 44px; width: 100%; }
    .seller-toast { right: 16px; bottom: 16px; left: 16px; max-width: none; }
}

@media (max-width: 420px) {
    .credit-chip .icon { display: none; }
    .seller-mobile-bar { padding-inline: 12px; }
    .seller-mobile-nav { padding-inline: 12px; }
    .license-card-actions,
    .device-card-actions { grid-template-columns: 1fr; }
    .license-stat small { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .seller-shell *,
    .seller-shell *::before,
    .seller-shell *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* Admin operations console */
.admin-shell .admin-app { grid-template-columns: 256px minmax(0, 1fr); }
.admin-sidebar { overflow-y: auto; }
.admin-sidebar > nav { gap: 14px; }
.admin-nav-group { display: grid; gap: 3px; }
.admin-nav-label {
    padding: 0 11px 4px;
    color: var(--text-mute);
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}
.admin-account { flex: 0 0 auto; margin-top: 18px !important; }
.admin-mobile-status,
.system-live,
.admin-scope-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 6px 9px;
    color: var(--success);
    background: rgba(97, 211, 155, .07);
    border: 1px solid rgba(97, 211, 155, .22);
    border-radius: var(--radius);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
}
.admin-mobile-status > span,
.system-live > i { width: 6px; height: 6px; background: var(--success); border-radius: 50%; }
.admin-scope-pill { color: var(--accent-strong); background: rgba(81, 199, 212, .07); border-color: rgba(81, 199, 212, .22); }
.admin-scope-pill .icon { width: 15px; height: 15px; }
.admin-main { max-width: 1680px; }
.admin-shell .panel { max-width: 100%; overflow-x: auto; }
.admin-shell .panel > .table { min-width: 680px; }
.admin-shell .badge-expired,
.admin-shell .badge-inactive { color: var(--text-dim); background: rgba(180, 192, 192, .08); }
.admin-shell .badge-draft { color: var(--warning); background: rgba(242, 189, 91, .08); }

.admin-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.admin-metric {
    position: relative;
    min-width: 0;
    padding: 15px 15px 14px;
    color: var(--text);
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-top: 2px solid var(--border-strong);
    border-radius: var(--radius);
}
a.admin-metric:hover { background: var(--bg-elev-2); border-color: var(--border-strong); text-decoration: none; }
.admin-metric.is-accent { border-top-color: var(--accent); }
.admin-metric.is-success { border-top-color: var(--success); }
.admin-metric-icon {
    position: absolute;
    top: 13px;
    right: 13px;
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    color: var(--text-mute);
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.admin-metric-icon .icon { width: 16px; height: 16px; }
.admin-metric-label { display: block; max-width: calc(100% - 42px); color: var(--text-dim); font-size: 11px; font-weight: 650; }
.admin-metric strong { display: block; margin: 8px 0 2px; font-family: var(--mono); font-size: 27px; line-height: 1; }
.admin-metric small { display: block; overflow: hidden; color: var(--text-mute); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.admin-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, .8fr); gap: 14px; }
.admin-quick-panel,
.admin-health-panel { padding: 17px; }
.admin-quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.admin-quick-grid > a {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 16px;
    align-items: center;
    gap: 10px;
    min-height: 66px;
    padding: 10px 11px;
    color: var(--text-dim);
    background: #0d1214;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.admin-quick-grid > a > .icon:first-child { width: 19px; height: 19px; color: var(--accent); }
.admin-quick-grid > a:hover { color: var(--text); background: var(--bg-elev-2); border-color: var(--border-strong); text-decoration: none; }
.admin-quick-grid strong,
.admin-quick-grid small { display: block; }
.admin-quick-grid strong { color: var(--text); font-size: 12px; }
.admin-quick-grid small { margin-top: 2px; color: var(--text-mute); font-size: 10px; }
.admin-quick-arrow { width: 14px !important; height: 14px !important; color: var(--text-mute); }
.admin-health-panel .metadata-list > div { grid-template-columns: 90px minmax(0, 1fr); padding: 8px 0; }
.admin-health-panel .workspace-panel-head { align-items: flex-start; }
.admin-resource-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 14px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.admin-resource-strip a { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 9px 14px; color: var(--text-dim); border-right: 1px solid var(--border); }
.admin-resource-strip a:last-child { border-right: 0; }
.admin-resource-strip a:hover { color: var(--text); background: var(--bg-elev-2); text-decoration: none; }
.admin-resource-strip strong { color: var(--text); font-family: var(--mono); font-size: 16px; }

.admin-license-filter { grid-template-columns: minmax(180px, 1fr) 190px 160px 120px auto auto; }
.admin-license-table { min-width: 980px; }
.admin-mint-layout { grid-template-columns: minmax(0, 1fr) 300px; }
.admin-batch-summary dl { margin-bottom: 14px; }
.admin-batch-summary dl > div { padding-block: 10px; }
.key-copy-row { display: flex; align-items: center; gap: 7px; max-width: min(720px, 100%); margin-top: 7px; }
.key-copy-row .key-mask-large { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key-reveal-note { margin-top: 4px; color: var(--warning); font-size: 11px; }
.admin-lease-panel { margin-top: 14px; padding: 17px; }
.admin-lease-table { min-width: 720px; }

@media (max-width: 1180px) {
    .admin-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
    .admin-shell .admin-app { display: block; min-height: calc(100dvh - 64px); }
    .admin-mobile-nav { max-height: calc(100dvh - 64px); overflow-y: auto; }
}

@media (max-width: 760px) {
    .admin-mobile-status { display: none; }
    .admin-metric-grid { gap: 8px; }
    .admin-metric { padding: 12px; }
    .admin-metric strong { font-size: 22px; }
    .admin-metric-icon { top: 10px; right: 10px; }
    .admin-quick-grid { grid-template-columns: 1fr; }
    .admin-resource-strip { grid-template-columns: 1fr; }
    .admin-resource-strip a { border-right: 0; border-bottom: 1px solid var(--border); }
    .admin-resource-strip a:last-child { border-bottom: 0; }
    .admin-mint-layout { grid-template-columns: 1fr; }
    .admin-license-filter { grid-template-columns: 1fr; }
    .admin-scope-pill { align-self: flex-start; }
    .key-copy-row { max-width: 100%; }
    .key-copy-row .btn { width: 44px !important; flex: 0 0 44px; }
    .admin-shell .filter-bar { align-items: stretch; }
    .admin-shell .filter-bar input,
    .admin-shell .filter-bar select,
    .admin-shell .filter-bar .btn { width: 100%; min-height: 44px; }
}

@media (max-width: 420px) {
    .license-header-actions { grid-template-columns: 1fr; }
    .admin-metric-grid { grid-template-columns: 1fr; }
    .admin-mobile-nav { grid-template-columns: 1fr 1fr; }
}

/* ─── Mobile Viewport & Overflow Containment Fixes ───────────────────── */
html, body {
    max-width: 100vw;
    overflow-x: hidden !important;
}

.seller-shell,
.admin-shell,
.seller-app,
.admin-app,
.seller-main,
.admin-main {
    max-width: 100vw;
    box-sizing: border-box;
}

.panel {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 20px;
    box-sizing: border-box !important;
    max-width: 100% !important;
    width: 100% !important;
}

.deposit-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.qr-container {
    text-align: center;
    padding: 12px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 240px;
    margin: 0 auto;
    box-sizing: border-box;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.qr-image {
    width: 100%;
    max-width: 210px;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
    aspect-ratio: 1 / 1;
    object-fit: contain;
}

.qr-sub {
    font-size: 12px;
    color: var(--text-mute);
    margin-top: 10px;
    text-align: center;
}

.desktop-only-table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-only-list {
    display: none;
}

.mobile-tx-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    margin-bottom: 8px;
    box-sizing: border-box;
    width: 100%;
}
.mobile-tx-card:last-child {
    margin-bottom: 0;
}

.mobile-tx-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .desktop-only-table {
        display: none !important;
    }
    .mobile-only-list {
        display: flex !important;
        flex-direction: column;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
    }
    .deposit-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }
    .form .form-row-2 {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    .seller-main,
    .admin-main {
        width: 100vw;
        max-width: 100vw;
        padding: 14px 12px 36px !important;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    .panel {
        padding: 14px !important;
        margin-bottom: 14px !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    .panel .kv {
        grid-template-columns: 90px minmax(0, 1fr) !important;
        gap: 6px 8px !important;
    }
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }
    .stat {
        grid-column: span 1 !important;
        padding: 12px !important;
    }
    .qr-container {
        max-width: 220px;
        padding: 10px;
    }
    .qr-image {
        max-width: 190px;
    }
}

@media (max-width: 440px) {
    .panel .kv {
        grid-template-columns: 1fr !important;
        gap: 4px !important;
    }
    .panel .kv dt {
        color: var(--text-mute);
        font-size: 11px;
        margin-top: 6px;
    }
    .stat-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ─── Mobile Logout Button ───────────────────── */
.mobile-logout-form {
    width: 100%;
}
.mobile-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    color: var(--danger);
    background: rgba(255, 107, 107, 0.08);
    border: 1px solid rgba(255, 107, 107, 0.25);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.mobile-logout-btn:hover,
.mobile-logout-btn:active {
    background: rgba(255, 107, 107, 0.16);
    border-color: var(--danger);
}
.mobile-logout-btn .icon {
    width: 16px;
    height: 16px;
}

/* ─── Crash diagnostics ─────────────────────────────────────────── */
.admin-metric-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.admin-metric.is-danger { border-top-color: var(--danger); }

.crash-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.crash-status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 10px 14px;
    color: var(--text-dim);
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border-strong);
    border-radius: var(--radius);
}
.crash-status-item:hover { color: var(--text); background: var(--bg-elev-2); text-decoration: none; }
.crash-status-item strong { color: var(--text); font-family: var(--mono); font-size: 20px; }
.crash-status-item.status-new { border-left-color: var(--danger); }
.crash-status-item.status-reviewing { border-left-color: var(--warning); }
.crash-status-item.status-resolved { border-left-color: var(--success); }

.crash-filter input[type="search"] { flex: 1 1 300px; }
.crash-filter input[type="number"] { min-width: 130px; width: 130px; }
.crash-table-wrap { padding: 0; overflow-x: auto; }
.crash-table { min-width: 1080px; }
.crash-table td { max-width: 300px; }
.crash-report-link { font-weight: 700; }
.table-secondary { display: block; margin-top: 3px; color: var(--text-mute); font-size: 11px; }
.crash-summary-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crash-reason { font-size: 12px; }
.crash-list-note { margin-top: 8px; font-size: 12px; }

.crash-badge.status-new { color: #ffb0b0; background: rgba(255, 107, 107, .1); }
.crash-badge.status-reviewing { color: var(--warning); background: rgba(255, 201, 74, .1); }
.crash-badge.status-resolved { color: var(--success); background: rgba(121, 224, 165, .1); }

.crash-detail-header { gap: 16px; align-items: flex-start !important; }
.crash-detail-header .sub { margin-top: 4px; }
.crash-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.crash-detail-grid .panel { min-width: 0; }
.crash-kv dd { overflow-wrap: anywhere; }
.crash-review-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.crash-review-heading h2 { margin-bottom: 2px; }
.crash-review-heading .sub { color: var(--text-mute); font-size: 12px; }
.crash-review-form { display: grid; grid-template-columns: 180px minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.crash-review-form label { margin: 0; }
.crash-review-form label > span { display: block; margin-bottom: 6px; }
.crash-review-form textarea { min-height: 76px; resize: vertical; }
.crash-review-form .btn { min-height: 38px; }
.crash-reviewed-by { margin-top: 10px; font-size: 11px; }
.crash-user-note > div { color: var(--text-dim); overflow-wrap: anywhere; }
.crash-log-panel pre {
    max-height: 520px;
    margin: 0;
    padding: 14px;
    overflow: auto;
    color: #d6dbe2;
    background: #07090c;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 11px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
    .admin-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
    .crash-detail-grid { grid-template-columns: 1fr; }
    .crash-review-form { grid-template-columns: 1fr; align-items: stretch; }
    .crash-detail-header { flex-direction: column; }
}

@media (max-width: 640px) {
    .admin-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .crash-status-grid { grid-template-columns: 1fr; }
    .crash-filter input[type="number"] { width: 100%; }
    .crash-log-panel pre { max-height: 420px; padding: 10px; }
}

@media (max-width: 420px) {
    .admin-metric-grid { grid-template-columns: 1fr; }
}

