:root {
    color-scheme: dark;
    --bg:#080e19;
    --panel:#141e30;
    --panel2:#0e1727;
    --line:#2d3b55;
    --text:#f3f7ff;
    --muted:#93a5c2;
    --pink:#ed174c;
    --blue:#2d8ff0;
    --green:#199b68;
    --yellow:#d59a05;
    --red:#9f2d43;
}
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--text); font:14px/1.4 Arial,sans-serif; }
a { color:inherit; }
.topbar { min-height:72px; padding:12px 22px; background:#101a2a; border-bottom:1px solid #1e2a40; display:flex; align-items:center; justify-content:space-between; gap:16px; }
.brand { display:flex; align-items:center; gap:12px; flex:0 0 auto; }
.brandmark { width:44px; height:44px; background:white; color:#0d1420; display:grid; place-items:center; border-radius:6px; font-weight:900; }
.brand h1 { font-size:18px; margin:0; }
.brand small { color:#22bf84; font-weight:800; }
.nav { display:flex; gap:6px; align-items:center; justify-content:flex-end; flex-wrap:wrap; }
.nav a { text-decoration:none; padding:9px 11px; background:#223049; border-radius:6px; font-weight:800; font-size:10px; }
.nav a.current { outline:2px solid #3f82c8; background:#294469; }
.nav a.danger { background:var(--red); }
.container { width:min(1680px,calc(100% - 32px)); margin:18px auto 40px; }
.grid { display:grid; grid-template-columns:360px minmax(0,1fr); gap:16px; }
.card { background:var(--panel); border:1px solid #1d2a40; border-radius:8px; padding:16px; }
.card h2 { font-size:15px; color:#ffd717; margin:0 0 14px; }
.card-header { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
.card-header h2 { margin:0; }
.field { margin-bottom:12px; }
.field label { display:block; color:var(--muted); font-size:11px; text-transform:uppercase; font-weight:800; margin-bottom:5px; }
.field-help { color:var(--muted); font-size:11px; margin-top:4px; }
input,select,textarea { width:100%; background:#0d1727; color:white; border:1px solid #53617a; border-radius:4px; padding:9px; }
input:disabled,select:disabled { opacity:.55; cursor:not-allowed; }
textarea { min-height:68px; resize:vertical; }
button,.button { display:inline-block; border:0; border-radius:4px; padding:10px 14px; color:white; background:#365f88; font-weight:800; text-decoration:none; cursor:pointer; }
button:hover,.button:hover { filter:brightness(1.08); }
button:disabled { opacity:.5; cursor:not-allowed; }
button.green,.button.green { background:var(--green); }
button.red,.button.red { background:var(--red); }
button.yellow,.button.yellow { background:var(--yellow); }
button.blue,.button.blue { background:#376d9f; }
button.ghost,.button.ghost { background:#24344e; }
button.icon,.button.icon { width:31px; height:29px; display:inline-grid; place-items:center; padding:0; font-size:16px; }
.full { width:100%; }
.stats { display:grid; grid-template-columns:repeat(5,1fr); gap:10px; margin-bottom:16px; }
.stat { background:var(--panel); border:1px solid #1d2a40; border-radius:8px; padding:14px; }
.stat strong { display:block; font-size:24px; }
.stat span { color:var(--muted); font-size:11px; text-transform:uppercase; font-weight:800; }
.filters { display:grid; grid-template-columns:minmax(240px,1.4fr) minmax(150px,.7fr) minmax(150px,.7fr) auto; gap:8px; margin-bottom:12px; }
.type-tabs { display:flex; gap:6px; align-items:center; }
.type-tabs a { text-decoration:none; padding:8px 12px; border-radius:4px; background:#263751; color:#c7d2e6; font-weight:800; font-size:11px; border:1px solid #334865; }
.type-tabs a.active { background:#2f6fa7; color:#fff; border-color:#5fa6e2; }
.header-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.tablewrap { overflow:auto; max-height:690px; border:1px solid var(--line); }
table { width:100%; border-collapse:collapse; white-space:nowrap; font-size:12px; }
th,td { border-bottom:1px solid #38465d; padding:8px 9px; text-align:left; vertical-align:middle; }
th { position:sticky; top:0; background:#e9edf4; color:#111827; z-index:1; }
tr:hover td { background:#19263b; }
.badge { display:inline-block; padding:3px 7px; border-radius:99px; font-weight:800; font-size:10px; }
.available { background:#184e3b; color:#50e1aa; }
.assigned { background:#554315; color:#ffe068; }
.active { background:#113f67; color:#68bdff; }
.blocked,.expired { background:#57182a; color:#ff8da9; }
.inactive { background:#333c4e; color:#bdc7d7; }
.actions { display:flex; gap:5px; align-items:center; }
.actions form { margin:0; }
.actions button,.actions .button { font-size:10px; padding:6px 8px; }
.flash { padding:12px 14px; margin-bottom:14px; border-radius:5px; font-weight:700; }
.flash.success { background:#123f31; border-left:4px solid #25c98e; }
.flash.error { background:#4c1725; border-left:4px solid var(--pink); }
.flash.warning { background:#493d18; border-left:4px solid #e6b91e; }
.batches { max-height:210px; overflow:auto; margin-top:12px; }
.batch { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:8px 0; border-top:1px solid var(--line); font-size:11px; }
.muted { color:var(--muted); }
.notice { padding:10px 12px; border:1px solid #39506f; background:#101a2b; border-radius:5px; margin:10px 0; }
.notice.warning { border-color:#795d16; background:#302712; }
.preview { padding:10px; background:#0c1524; border:1px dashed #53617a; border-radius:4px; font-family:Consolas,monospace; margin-bottom:12px; }
.two-col { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.three-col { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.inline { display:flex; gap:8px; align-items:center; }
.inline > * { flex:1; }
.section-gap { margin-top:16px; }
.code { font-family:Consolas,monospace; }
.product-used { white-space:normal; min-width:115px; }
.refreshing { opacity:.6; pointer-events:none; }
.login { min-height:100vh; display:grid; place-items:center; padding:20px; }
.login .card { width:min(440px,100%); padding:26px; }
.danger-zone { border-color:#743044; }
summary { cursor:pointer; font-weight:800; color:#ffd717; }
@media(max-width:1250px) {
    .topbar { align-items:flex-start; }
    .nav { max-width:760px; }
}
@media(max-width:1000px) {
    .grid { grid-template-columns:1fr; }
    .stats { grid-template-columns:repeat(2,1fr); }
    .filters { grid-template-columns:1fr 1fr; }
    .topbar { flex-direction:column; }
    .nav { justify-content:flex-start; }
}
@media(max-width:650px) {
    .container { width:min(100% - 16px,1680px); }
    .filters,.two-col,.three-col { grid-template-columns:1fr; }
    .stats { grid-template-columns:1fr 1fr; }
    .type-tabs { width:100%; }
    .type-tabs a { flex:1; text-align:center; }
}

.confirm-dialog { width:min(460px,calc(100% - 32px)); border:1px solid #6d3043; border-radius:10px; background:#151f32; color:#f3f7ff; padding:22px; box-shadow:0 24px 70px #000b; }
.confirm-dialog::backdrop { background:#000a; }
.confirm-dialog h3 { margin:0 0 10px; color:#ffcfda; }
.confirm-dialog p { color:#b8c5d9; }
.dialog-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:18px; }

/* RC2: compact code copy and demo extension controls */
.code-line { display:flex; align-items:center; gap:6px; }
.copy-code-button { width:25px; height:23px; display:inline-grid; place-items:center; padding:0; border:1px solid #45617f; border-radius:4px; background:#243b58; color:#fff; font-size:12px; line-height:1; flex:0 0 auto; }
.copy-code-button:hover { background:#31577d; }
.copy-code-button.copied { background:var(--green); border-color:#35c890; }
.extend-demo-dialog { width:min(520px,calc(100% - 32px)); border:1px solid #5d4820; border-radius:10px; background:#151f32; color:#f3f7ff; padding:22px; box-shadow:0 24px 70px #000b; }
.extend-demo-dialog::backdrop { background:#000a; }
.extend-demo-dialog h3 { margin:0 0 8px; color:#ffe082; }
.extend-demo-dialog p { color:#b8c5d9; }
.extend-demo-dialog .inline input { min-width:120px; }
.extend-demo-dialog .inline select { min-width:140px; }

/* v0.2.1 admin license controls */
.filter-check { display:inline-flex; align-items:center; gap:7px; padding:7px 10px; border:1px solid #425570; border-radius:4px; background:#101a2b; color:#d4deee; font-size:11px; font-weight:800; cursor:pointer; user-select:none; }
.filter-check input[type="checkbox"] { width:auto; margin:0; accent-color:#25c98e; }
.product-used { white-space:normal; min-width:115px; max-width:250px; }
.license-detail-grid { grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr); max-width:1180px; margin:auto; }
.license-meta-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.license-meta-grid > div { background:#0f1929; border:1px solid #2c3b53; border-radius:5px; padding:10px; }
.license-meta-grid span,.license-meta-grid strong { display:block; }
.license-meta-grid strong { margin-top:4px; overflow-wrap:anywhere; }
.device-hash-wrap { white-space:normal; overflow-wrap:anywhere; }
.reset-history-item { margin:8px 0; }
.device-reset-dialog,.demo-retry-dialog { width:min(600px,calc(100% - 32px)); }
@media(max-width:1000px) {
    .license-detail-grid { grid-template-columns:1fr; }
}
