:root {
  color-scheme: dark;
  --bg: #101318;
  --panel: #181d25;
  --raised: #202731;
  --hover: #252f3d;
  --text: #edf2f9;
  --muted: #a4afbf;
  --dim: #7f8a9b;
  --line: #2b3442;
  --blue: #a6ceff;
  --blue-ink: #132b48;
  --danger: #ffb1ad;
  --radius: 16px;
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  background: var(--bg);
  color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 14px; line-height: 1.6; }
body:has(dialog[open]) { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { touch-action: manipulation; }
button:disabled, fieldset:disabled button { cursor: not-allowed; opacity: .46; }
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
button, input, select, textarea { border-radius: 9px; }
input, select, textarea { width: 100%; background: #11161d; color: var(--text); border: 1px solid #3a4555; padding: 11px 13px; min-height: 44px; }
input::placeholder, textarea::placeholder { color: var(--dim); opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
textarea { resize: vertical; min-height: 94px; }
label { display: block; color: #d9e1ee; font-weight: 500; margin: 17px 0 7px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset:disabled input, fieldset:disabled textarea, fieldset:disabled select { opacity: .6; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; font-weight: 600; }
h1 { font-size: 32px; letter-spacing: -.9px; line-height: 1.3; }
h2 { font-size: 20px; letter-spacing: -.35px; line-height: 1.4; }
h3 { font-size: 15px; }
p { text-wrap: pretty; }
small, .field-note { display: block; color: var(--muted); font-size: 12px; margin-top: 7px; }
code { font-family: "SFMono-Regular", Consolas, monospace; }
.muted { color: var(--muted); }
.eyebrow { color: var(--dim); font-size: 10px; font-weight: 600; letter-spacing: 1.5px; margin-bottom: 12px; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.svg-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 10px; left: 16px; z-index: 100; padding: 10px 16px; background: var(--blue); color: var(--blue-ink); border-radius: 8px; transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.topbar { height: 80px; max-width: 1440px; margin: auto; padding: 0 48px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 13px; font-size: 21px; letter-spacing: -.5px; font-weight: 650; white-space: nowrap; }
.brand-symbol { display: grid; grid-template-columns: 10px 10px; gap: 4px; transform: rotate(-9deg); }
.brand-symbol i { width: 10px; height: 10px; border-radius: 3px; background: var(--blue); }
.brand-symbol i:nth-child(2) { opacity: .55; }
.brand-symbol i:nth-child(3) { opacity: .75; }
.brand-divider { color: #465264; margin: 0 17px; font-weight: 400; }
.brand-caption { font-size: 13px; letter-spacing: .4px; font-weight: 400; color: var(--muted); }
.session-actions { display: flex; align-items: center; gap: 22px; }
.session-user { display: flex; align-items: center; gap: 8px; color: #c9d4e3; max-width: 200px; overflow-wrap: anywhere; }
.status-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: #9fd5bd; flex-shrink: 0; }
.button { min-height: 42px; padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 550; border: 1px solid transparent; line-height: 1.35; white-space: nowrap; background: transparent; transition: background-color 120ms ease-out, color 120ms ease-out, opacity 120ms ease-out; }
.button-primary { background: var(--blue); color: var(--blue-ink); box-shadow: 0 1px 0 rgb(255 255 255 / .18) inset; }
.button-primary:hover:not(:disabled) { background: #c0dcff; }
.button-secondary { background: var(--raised); border-color: #3b4657; color: #e3ebf8; }
.button-secondary:hover:not(:disabled), .button-quiet:hover:not(:disabled) { background: var(--hover); }
.button-quiet { color: var(--muted); }
.button-quiet:hover:not(:disabled) { color: var(--text); }
.button-danger { background: #352226; color: var(--danger); border-color: #634047; }
.button-danger:hover:not(:disabled) { background: #4b2b31; }
.button-wide { width: 100%; }
.icon-button { width: 44px; height: 44px; padding: 10px; color: var(--muted); }
.icon-button:hover { background: var(--raised); color: var(--text); }
.boot-view { min-height: 60vh; display: flex; gap: 10px; align-items: center; justify-content: center; color: var(--muted); }
.login-view { max-width: 1030px; padding: 96px 48px 64px; margin: 0 auto; display: grid; grid-template-columns: 1fr 390px; gap: 104px; align-items: center; }
.login-intro h1 { font-size: 44px; line-height: 1.42; letter-spacing: -1.4px; }
.login-intro .eyebrow { color: var(--blue); margin-bottom: 22px; letter-spacing: 2px; }
.login-description { color: var(--muted); font-size: 16px; line-height: 1.9; margin-top: 24px; }
.login-note { margin-top: 48px; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--dim); }
.login-panel { background: var(--panel); padding: 32px; border-radius: 22px; box-shadow: 0 0 0 1px rgb(255 255 255 / .07), 0 20px 70px rgb(0 0 0 / .16); }
.login-icon { width: 28px; height: 28px; color: var(--blue); margin-bottom: 20px; }
.login-panel > .muted { margin-top: 8px; margin-bottom: 25px; }
.login-panel .button { margin-top: 24px; min-height: 46px; }
.login-help { border-top: 1px solid var(--line); margin-top: 26px; padding-top: 20px; font-size: 12px; color: var(--dim); text-align: center; }
.dashboard { max-width: 1360px; margin: auto; padding: 40px 48px 30px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.page-heading .muted { margin-top: 9px; }
.page-heading .eyebrow { margin-bottom: 9px; }
#dashboard-title:focus { outline: none; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 28px; }
.stat-card { padding: 20px 22px; border-radius: var(--radius); background: var(--panel); box-shadow: 0 0 0 1px rgb(255 255 255 / .07); }
.stat-label { display: flex; justify-content: space-between; gap: 12px; align-items: center; color: #c3cddc; font-size: 13px; }
.stat-label .icon { color: #8ea4bf; width: 18px; height: 18px; }
.stat-card strong { display: block; font-size: 32px; line-height: 1.2; margin: 17px 0 9px; letter-spacing: -1px; font-weight: 550; }
.stat-card > span { color: var(--dim); font-size: 11px; }
.list-panel { border: 1px solid var(--line); border-radius: var(--radius); background: #151a22; overflow: hidden; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; padding: 23px 24px 18px; gap: 20px; }
.panel-heading > div { display: flex; align-items: baseline; gap: 13px; }
.panel-heading h2 { font-size: 17px; }
.panel-heading .muted { font-size: 12px; }
.filter-form { display: flex; gap: 10px; padding: 0 24px 23px; }
.search-field { display: flex; position: relative; width: 350px; max-width: 100%; }
.search-field .icon { position: absolute; left: 13px; top: 13px; width: 18px; height: 18px; color: var(--dim); pointer-events: none; }
.search-field input { padding-left: 40px; }
.filter-form select { width: 140px; }
.filter-form .button { min-width: 70px; }
.table-container { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
thead { background: #1c222c; color: #97a7bc; font-size: 12px; }
th { font-weight: 500; padding: 13px 15px; white-space: nowrap; }
td { padding: 20px 15px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13px; }
th:first-child, td:first-child { padding-left: 24px; }
th:last-child, td:last-child { padding-right: 24px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #1a212b; }
.license-code { display: block; font-size: 13px; letter-spacing: .1px; color: #e1ebfb; overflow-wrap: anywhere; max-width: 290px; }
.license-note { color: var(--dim); font-size: 12px; margin-top: 7px; overflow-wrap: anywhere; max-width: 280px; }
.cell-secondary { font-size: 11px; color: var(--dim); margin-top: 4px; overflow-wrap: anywhere; }
.batch-cell { max-width: 145px; color: var(--muted); overflow-wrap: anywhere; font-size: 12px; }
.row-detail { color: var(--blue); min-width: 62px; }
.badge { font-size: 11px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; font-weight: 500; background: #273140; color: #bbd6fb; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-used, .badge-active { background: #1c342d; color: #a6d9c2; }
.badge-disabled, .badge-revoked { background: #38272d; color: #e6adaf; }
.badge-expired { background: #393023; color: #dec29b; }
.pagination { border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 13px 18px 13px 24px; color: var(--muted); font-size: 12px; }
.pagination > div { display: flex; align-items: center; gap: 8px; }
#page-indicator { min-width: 48px; text-align: center; }
.empty-state { min-height: 280px; padding: 55px 24px; text-align: center; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 9px; }
.empty-state p { color: var(--muted); font-size: 13px; }
.empty-icon { width: 31px; height: 31px; color: #7794b7; margin-bottom: 10px; }
.dashboard-footnote { font-size: 11px; color: var(--dim); text-align: center; margin-top: 23px; }
.message { margin-top: 16px; padding: 12px 14px; border-radius: 8px; background: #213529; color: #b8dfc8; font-size: 13px; overflow-wrap: anywhere; }
.message-error { color: #f6bfbb; background: #35242a; border: 1px solid #604046; }
.panel-message { margin: 0 24px 20px; }
#stats-error { margin: -10px 0 22px; }
dialog { background: var(--panel); color: var(--text); border: 1px solid #3d4757; padding: 0; border-radius: 20px; width: min(570px, calc(100% - 32px)); max-height: calc(100dvh - 48px); box-shadow: 0 28px 90px rgb(0 0 0 / .45); overflow: auto; }
dialog::backdrop { background: rgb(4 7 12 / .76); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 26px 20px; border-bottom: 1px solid var(--line); }
.dialog-heading .eyebrow { margin-bottom: 5px; font-size: 9px; }
.dialog-body { padding: 24px 26px; }
.dialog-body > .muted { margin-bottom: 7px; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.optional { font-size: 11px; color: var(--dim); font-weight: 400; margin-left: 4px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; padding-top: 21px; border-top: 1px solid var(--line); }
.success-mark { color: #b4e2c7; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: #234333; font-size: 23px; margin-bottom: 15px; }
#issued-title { font-size: 22px; margin-bottom: 8px; }
.code-output { font-family: Consolas, monospace; font-size: 13px; line-height: 1.85; }
.detail-dialog { width: min(690px, calc(100% - 32px)); }
.detail-code-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
#detail-code { font-size: 17px; color: #d6e8ff; letter-spacing: .4px; overflow-wrap: anywhere; min-width: 0; }
.detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 17px 24px; margin: 24px 0; }
.detail-meta > div { min-width: 0; }
.detail-meta dt { font-size: 11px; color: var(--dim); margin-bottom: 4px; }
.detail-meta dd { margin: 0; overflow-wrap: anywhere; font-size: 13px; }
.detail-section { border-top: 1px solid var(--line); padding-top: 21px; margin-top: 22px; }
.detail-section > .muted { font-size: 12px; margin-top: 7px; }
.section-heading { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-heading .muted { font-size: 12px; }
.activation-card { border: 1px solid var(--line); border-radius: 11px; padding: 15px; margin-top: 10px; background: #141a22; }
.activation-card-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.activation-card dl { display: grid; grid-template-columns: 64px 1fr; gap: 6px 12px; font-size: 12px; margin: 13px 0 0; }
.activation-card dt { color: var(--dim); }
.activation-card dd { margin: 0; overflow-wrap: anywhere; color: #cad5e4; }
.activation-card dd.device-id { font-family: Consolas, monospace; font-size: 11px; }
.empty-devices { color: var(--muted); background: #141a22; border-radius: 9px; padding: 21px 16px; text-align: center; font-size: 13px; }
.inline-controls { display: flex; gap: 10px; }
.inline-controls input { width: 125px; }
.extend-form { margin-top: 15px; }
.extend-form label { font-size: 12px; }
.danger-zone { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.danger-zone p { font-size: 12px; margin-top: 6px; }
.danger-zone h3 { font-size: 14px; }
.confirm-dialog { max-width: 430px; }
.confirm-symbol { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--danger); background: #412b2f; font-size: 22px; margin-bottom: 18px; }
#confirm-description { color: #bac6d7; margin-top: 13px; font-size: 13px; white-space: pre-line; overflow-wrap: anywhere; }
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); padding: 13px 20px; background: #dceafd; color: #1b304c; border-radius: 11px; box-shadow: 0 7px 30px rgb(0 0 0 / .3); max-width: calc(100vw - 32px); z-index: 10; font-size: 13px; }
.noscript { margin: 50px auto; max-width: 500px; padding: 20px; color: var(--danger); }
@media (max-width: 1100px) {
  .topbar { padding: 0 28px; }
  .dashboard { padding: 30px 28px; }
  .login-view { gap: 48px; grid-template-columns: 1fr 360px; }
  .login-intro h1 { font-size: 37px; }
  .stats-grid { gap: 12px; }
  .stat-card { padding: 18px; }
  table { min-width: 840px; }
}
@media (max-width: 680px) {
  .topbar { height: 72px; padding: 0 20px; gap: 12px; }
  .brand { font-size: 19px; gap: 10px; }
  .brand-divider, .brand-caption { display: none; }
  .session-actions { gap: 6px; }
  .session-user { max-width: 94px; font-size: 11px; }
  .session-actions .button { padding: 10px; font-size: 12px; }
  .button { min-height: 44px; }
  .dashboard { padding: 27px 18px; }
  .page-heading { align-items: flex-start; margin-bottom: 25px; gap: 12px; }
  .page-heading h1 { font-size: 27px; }
  .page-heading .muted { font-size: 12px; max-width: 180px; }
  .page-heading .eyebrow { font-size: 8px; letter-spacing: 1px; }
  #issue-open { margin-top: 22px; padding: 11px 12px; font-size: 12px; gap: 5px; }
  #issue-open .icon { width: 17px; height: 17px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 22px; }
  .stat-card { padding: 16px; border-radius: 13px; }
  .stat-card strong { font-size: 29px; margin: 12px 0 7px; }
  .stat-label { font-size: 12px; }
  .stat-card > span { font-size: 11px; }
  .panel-heading { padding: 19px 16px 15px; }
  .panel-heading > div { gap: 9px; }
  .filter-form { display: grid; grid-template-columns: 1fr 76px; padding: 0 16px 18px; gap: 9px; }
  .search-field { grid-column: 1 / -1; width: 100%; }
  .filter-form select { width: 100%; }
  table { min-width: 0; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tbody { display: block; padding: 0 16px; }
  tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 10px; padding: 19px 0; border-top: 1px solid var(--line); }
  tbody tr:hover { background: transparent; }
  td, td:first-child, td:last-child { display: block; padding: 0; border: 0; min-width: 0; }
  td:first-child { grid-column: 1 / -1; }
  td::before { content: attr(data-label); display: block; font-size: 10px; color: var(--dim); margin-bottom: 6px; }
  td:first-child::before, td:last-child::before { display: none; }
  td:last-child { display: flex; justify-content: flex-end; align-items: flex-end; grid-column: 2; }
  .license-code { max-width: none; font-size: 13px; color: var(--blue); }
  .license-note { max-width: none; margin-top: 5px; }
  .batch-cell { max-width: none; }
  .row-detail { background: var(--raised); border: 1px solid var(--line); min-width: 85px; }
  .pagination { padding: 13px 12px; flex-wrap: wrap; justify-content: center; gap: 7px; }
  .pagination > span { width: 100%; text-align: center; }
  .pagination > div { width: 100%; justify-content: space-between; }
  .pagination .button { font-size: 12px; }
  .dashboard-footnote { line-height: 1.8; padding: 0 10px; }
  .login-view { padding: 36px 22px; display: block; max-width: 470px; }
  .login-intro h1 { font-size: 30px; line-height: 1.4; }
  .login-intro h1 br { display: none; }
  .login-intro .eyebrow { margin-bottom: 10px; font-size: 9px; }
  .login-description, .login-note { display: none; }
  .login-panel { margin-top: 27px; padding: 25px 24px; border-radius: 18px; }
  .login-icon { width: 24px; height: 24px; margin-bottom: 13px; }
  dialog { max-height: calc(100dvh - 26px); width: calc(100% - 24px); border-radius: 17px; }
  .dialog-heading { padding: 20px 19px 17px; }
  .dialog-body { padding: 20px 19px; }
  .form-grid { gap: 0 12px; }
  .form-grid label { font-size: 12px; }
  .form-grid input { min-width: 0; }
  .detail-dialog { width: calc(100% - 24px); }
  #detail-code { font-size: 14px; }
  .detail-meta { gap: 15px; }
  .danger-zone { display: block; }
  .danger-zone > .button { margin-top: 14px; }
  .dialog-actions .button { flex: 1; }
  .panel-message { margin-left: 16px; margin-right: 16px; }
  .toast { bottom: 18px; width: max-content; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
