:root { color-scheme: light; --ink:#22352d; --muted:#58685f; --line:#d6dfd6; --paper:#ffffff; --bg:#f3f5ef; --green:#255740; --yellow:#f0c755; --red:#963824; font-family: "Segoe UI","Microsoft YaHei",system-ui,sans-serif; color:var(--ink); background:var(--bg); }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; min-height:100vh; }
.shell { width:min(1480px,100%); padding-inline:clamp(16px,4vw,64px); margin:auto; }
.topbar { background:var(--paper); border-bottom:1px solid var(--line); }
.topbar-inner, .section-heading, .dialog-title, .pagination { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.topbar-inner { min-height:68px; }
.brand { display:flex; align-items:center; gap:12px; font-size:18px; font-weight:700; }
.brand-icon { width:35px; height:35px; display:grid; place-items:center; border-radius:8px; background:var(--yellow); color:#413714; font-size:19px; }
.brand-divider { margin:0 10px; color:#b5bfb4; font-weight:400; }
.brand-meta { font-weight:500; color:var(--muted); font-size:14px; }
h1,h2,p { margin:0; }
h1 { font-size:clamp(25px,3vw,34px); font-weight:650; }
h2 { font-size:20px; }
.muted, #page-info, #loading { color:var(--muted); font-size:14px; }
#loading { margin-top:32px; }
.section-heading { margin:36px 0 22px; }
.section-heading .muted { margin-top:5px; }
.panel, dialog { border:1px solid var(--line); border-radius:12px; background:var(--paper); }
.panel { overflow:hidden; }
.login { max-width:420px; padding:32px; margin:clamp(40px,10vh,112px) auto; }
.login h1 { font-size:25px; margin-bottom:24px; }
label,.stack { display:grid; }
.stack { gap:18px; }
label { gap:7px; min-width:0; align-content:start; font-size:13px; font-weight:600; color:#405247; }
input,select,textarea,button { font:inherit; }
input,select,textarea { width:100%; min-width:0; padding:9px 10px; border:1px solid #b9c6ba; border-radius:6px; background:#fff; color:var(--ink); font-size:14px; }
input,select { height:40px; }
input[readonly],textarea[readonly] { background:#f5f7f2; }
textarea { resize:vertical; overflow-wrap:anywhere; font-family:ui-monospace,Consolas,monospace; }
button { min-height:38px; padding:8px 14px; border-radius:6px; border:1px solid #b9c6ba; color:var(--ink); background:#fff; cursor:pointer; font-size:14px; white-space:nowrap; }
button:hover:not(:disabled) { background:#edf3ec; }
button.primary { background:var(--green); color:#fff; border-color:var(--green); }
button.primary:hover:not(:disabled) { background:#18422f; }
button.quiet { background:transparent; border-color:transparent; color:var(--muted); }
button.danger { background:var(--red); border-color:var(--red); color:white; }
button.danger:hover:not(:disabled) { background:#722f25; }
button:disabled { opacity:.48; cursor:default; }
:focus-visible { outline:3px solid #5f9575; outline-offset:2px; }
.actions { display:flex; align-items:center; gap:8px; }
.filters { padding:20px; display:grid; grid-template-columns:minmax(160px,1.45fr) minmax(110px,1fr) repeat(2,minmax(145px,1fr)) auto; gap:14px; align-items:end; }
.table-wrap { width:100%; overflow:auto; }
table { width:100%; border-collapse:collapse; text-align:left; }
th,td { padding:13px 12px; border-bottom:1px solid var(--line); font-size:13px; }
th { border-top:1px solid var(--line); font-weight:600; color:var(--muted); background:#f4f6f1; white-space:nowrap; }
td { font-variant-numeric:tabular-nums; }
th:first-child,td:first-child { padding-left:20px; }
th:last-child,td:last-child { padding-right:20px; }
.order-value { min-width:110px; max-width:220px; overflow-wrap:anywhere; }
.when { white-space:nowrap; }
.device { min-width:96px; max-width:155px; font-size:12px; overflow-wrap:anywhere; }
.badge { padding:4px 8px; border-radius:5px; font-weight:600; font-size:12px; white-space:nowrap; }
.issued { color:#705411; background:#fff1c9; }
.activated { color:#235436; background:#e1f1e4; }
.revoked { color:#824d43; background:#f4e8e4; }
.row-actions { display:flex; gap:5px; }
.row-actions button { padding:4px 6px; min-height:30px; font-size:12px; border-color:transparent; color:var(--green); }
.row-actions .revoke { color:var(--red); }
.pagination { padding:14px 20px; }
.empty { padding:40px 16px; text-align:center; }
.empty h2 { font-size:17px; margin-bottom:8px; }
.message:not(:empty),.notice { margin:12px 0; padding:10px 12px; border-radius:6px; background:#edf3ec; color:#26513b; font-size:14px; }
.message.error:not(:empty),.notice { color:#793b2a; background:#faf0e9; }
dialog { width:min(470px,calc(100% - 28px)); max-height:90dvh; overflow:auto; padding:24px; color:var(--ink); }
dialog::backdrop { background:#182c2199; }
.dialog-title { margin-bottom:22px; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
@media (max-width:1000px) { .filters { grid-template-columns:repeat(3,minmax(0,1fr)); } .filters .search { grid-column:span 2; } }
@media (max-width:640px) {
  .topbar-inner { min-height:58px; }
  .section-heading { margin:24px 0 14px; gap:10px; flex-wrap:wrap; }
  .filters { padding:15px; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
  .filters .search { grid-column:span 1; }
  .filters .actions { grid-column:span 2; }
  .list-actions,.pagination { flex-wrap:wrap; }
  table,tbody { display:block; }
  thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  tr { display:grid; grid-template-columns:1fr 1fr; gap:8px 12px; border-top:1px solid var(--line); padding:16px; }
  td, td:first-child, td:last-child { display:block; border:0; padding:0; min-width:0; max-width:none; }
  td::before { display:block; content:attr(data-label); font-size:11px; color:var(--muted); margin-bottom:4px; }
  td.order-value { font-weight:650; }
  td.device,td.actions-cell { grid-column:1 / -1; }
  .when { white-space:normal; }
  .row-actions button { min-height:34px; }
  .pagination { border-top:1px solid var(--line); }
}
