:root {
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #17283d;
  background: #f5f8fc;
  --ink: #17283d;
  --muted: #52647b;
  --blue: #1765cc;
  --navy: #0f2f54;
  --line: #dce4ee;
  --canvas: #f5f8fc;
  --surface: #fff;
  --danger: #ad2432;
  --focus: #1765cc;
  font-size: 14px;
  line-height: 1.55;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
input, select, textarea { color: var(--ink); background: #fff; border: 1px solid #abbacd; border-radius: 6px; padding: 9px 11px; max-width: 100%; }
input::placeholder, textarea::placeholder { color: #5a6c82; opacity: 1; }
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; margin: 0; accent-color: var(--blue); cursor: pointer; }
textarea { resize: vertical; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: 26px; line-height: 1.3; letter-spacing: -.02em; text-wrap: balance; }
h2 { font-size: 18px; line-height: 1.4; text-wrap: balance; }
.subtle { color: var(--muted); margin-top: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 20; background: #fff; color: var(--blue); padding: 10px 14px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; background: #fff; color: var(--blue); font-weight: 800; font-size: 20px; border-radius: 9px; flex: 0 0 auto; }
.brand strong { color: #fff; font-size: 20px; }
.brand span:not(.brand-mark) { display: block; color: #c3d6ee; font-size: 13px; margin-top: 2px; }
.app-shell { display: grid; grid-template-columns: 220px minmax(0,1fr); min-height: 100vh; }
.sidebar { background: var(--navy); color: #fff; padding: 30px 18px 24px; display: flex; flex-direction: column; }
.sidebar .brand { padding: 0 10px 38px; }
.nav-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: #d0dff2; padding: 12px 14px; border-radius: 7px; margin: 4px 0; font-weight: 600; }
.nav-item:hover { background: #204366; color: #fff; }
.nav-item.active { background: #fff; color: var(--navy); }
.sidebar-footer { margin-top: auto; padding: 24px 10px 0; color: #c3d6ee; border-top: 1px solid #3f5d7d; font-size: 13px; }
.sidebar-footer strong { color: #fff; }
.sidebar-footer p { margin-top: 10px; }
.main-shell { min-width: 0; }
.topbar { min-height: 74px; padding: 18px 30px; background: #fff; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.topbar p { white-space: nowrap; }
.topbar-product, .topbar-divider { color: var(--muted); }
.topbar-divider { margin: 0 12px; }
.account-actions, .button-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-name { font-weight: 600; margin-right: 6px; overflow-wrap: anywhere; }
.content { padding: 30px 30px 48px; max-width: 1600px; margin: 0 auto; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.button { border: 1px solid transparent; padding: 9px 14px; border-radius: 6px; line-height: 1.5; font-weight: 600; color: var(--ink); background: #fff; white-space: nowrap; min-height: 40px; transition: background-color .16s ease-out, border-color .16s ease-out; }
.button.primary { background: var(--blue); color: #fff; }
.button.primary:hover:not(:disabled) { background: #0c53b1; }
.button.secondary { border-color: #b9c7d8; background: #fff; }
.button.secondary:hover:not(:disabled) { background: #eef3fa; border-color: #8da4bf; }
.button.quiet { color: var(--blue); background: transparent; }
.button.quiet:hover:not(:disabled) { background: #eaf2ff; }
.button.danger { color: var(--danger); background: #fff0f1; border-color: #db9da4; }
.button.danger:hover:not(:disabled) { background: #fbe0e3; }
.button.small { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.button.wide { width: 100%; }
.summary-strip { display: flex; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.summary-item { flex: 1; min-width: 0; text-align: left; background: transparent; border: 0; border-right: 1px solid var(--line); padding: 16px 20px; color: var(--ink); }
.summary-item:last-child { border-right: 0; }
.summary-item:hover { background: #edf3fc; }
.summary-item span { display: block; color: var(--muted); }
.summary-item strong { display: block; font-size: 28px; line-height: 1.3; margin-top: 5px; font-variant-numeric: tabular-nums; }
.policy-line { padding: 13px 1px 21px; color: var(--muted); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; padding: 18px; border-bottom: 1px solid var(--line); align-items: center; }
.toolbar select { flex: 0 1 auto; }
.search-field { flex: 1; min-width: 200px; }
.search-field input { width: 100%; }
.selection-toolbar { padding: 11px 18px; display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); background: #f9fbfe; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
.card-table { min-width: 910px; }
.audit-table { min-width: 740px; }
th { font-size: 13px; color: var(--muted); font-weight: 600; background: #f6f9fd; padding: 12px 16px; white-space: nowrap; }
td { padding: 14px 16px; border-top: 1px solid #e9eef5; vertical-align: middle; }
tbody tr:hover { background: #f8fbff; }
.check-cell { width: 45px; padding-right: 0; }
.code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.card-id, .table-note { display: block; color: var(--muted); font-size: 12px; }
.table-note { max-width: 260px; overflow-wrap: anywhere; margin-top: 5px; }
.card-code { display: block; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.badge.unused { color: #315577; background: #e9f1fb; }
.badge.active { color: #126344; background: #e4f4eb; }
.badge.expired { color: #874513; background: #fff0dc; }
.badge.disabled { color: #9d2531; background: #ffebed; }
.empty-state { padding: 42px 24px; text-align: center; color: var(--muted); }
.empty-state strong { color: var(--ink); display: block; margin-bottom: 7px; font-size: 16px; }
.skeleton { display: block; height: 17px; width: 78%; background: #e8eef6; border-radius: 3px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding: 14px 18px; color: var(--muted); }
.message { padding: 12px 16px; background: #eaf3ff; color: #194d8a; border: 1px solid #b3cdec; border-radius: 6px; margin-bottom: 20px; overflow-wrap: anywhere; }
.message.error { color: #942331; background: #fff0f1; border-color: #dea6ae; }
.message.success { color: #175f43; background: #eaf6ef; border-color: #9dcbb1; }
.batch-panel { margin-top: 24px; }
.panel-heading { padding: 18px 20px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 1px solid var(--line); }
.batch-body { padding: 20px; }
.batch-body label { display: block; font-weight: 600; margin: 0 0 6px; }
.batch-body select { width: 100%; margin-bottom: 17px; }
.batch-body textarea { width: 100%; background: #f8fbff; }
.batch-footer { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--muted); }
.audit-detail { min-width: 200px; max-width: 500px; font-size: 13px; overflow-wrap: anywhere; white-space: pre-wrap; }
dialog { border: 0; padding: 0; background: #fff; color: var(--ink); border-radius: 10px; width: min(560px,calc(100vw - 32px)); max-height: calc(100dvh - 40px); overflow: auto; box-shadow: 0 18px 60px #0f2f5440; }
dialog::backdrop { background: #142a4690; }
.detail-dialog { width: min(720px,calc(100vw - 32px)); }
.confirm-dialog { width: min(470px,calc(100vw - 32px)); }
.dialog-heading { padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); }
.close-button { padding: 0; border: 0; width: 34px; height: 34px; color: #4e6076; background: transparent; font-size: 25px; line-height: 1; border-radius: 4px; }
.close-button:hover { background: #eaf2ff; color: var(--blue); }
.dialog-body { padding: 22px 24px; }
.dialog-body > label { display: block; font-weight: 600; margin: 18px 0 6px; }
.dialog-body > input, .dialog-body > textarea { width: 100%; }
.dialog-footer { padding: 16px 24px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--line); }
fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
legend { font-weight: 600; margin-bottom: 10px; }
.type-options { display: flex; gap: 9px; }
.type-options label { flex: 1; border: 1px solid #bac8da; padding: 12px 11px; border-radius: 6px; cursor: pointer; }
.type-options label:has(input:checked) { background: #eaf2ff; border-color: var(--blue); }
.type-options strong, .type-options span { display: block; }
.type-options strong { margin-top: 7px; }
.type-options span { color: var(--muted); font-size: 13px; }
.field-help { font-size: 13px; color: var(--muted); margin-top: 7px; }
.form-error { color: #9d2531; background: #fff0f1; border-radius: 5px; padding: 9px 12px; margin-top: 15px; overflow-wrap: anywhere; }
.reveal-area label { display: block; font-weight: 600; margin-bottom: 7px; }
.reveal-row { display: flex; flex-wrap: wrap; gap: 8px; }
.reveal-row input { min-width: 200px; flex: 1 1 250px; }
.detail-feedback { color: #175f43; background: #eaf6ef; padding: 8px 11px; border-radius: 5px; margin-top: 12px; }
.detail-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 26px; margin: 24px 0; }
.detail-fields div { min-width: 0; }
.detail-fields dt { color: var(--muted); margin-bottom: 5px; font-size: 13px; }
.detail-fields dd { margin: 0; overflow-wrap: anywhere; }
.detail-fields .full { grid-column: 1 / -1; }
.login-view { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; }
.login-shell { width: min(420px,100%); }
.login-brand { margin-bottom: 24px; }
.login-brand .brand-mark { color: #fff; background: var(--blue); }
.login-brand strong { color: var(--ink); }
.login-panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 30px; }
.login-panel h1 { font-size: 24px; }
.login-panel label { display: block; margin: 22px 0 7px; font-weight: 600; }
.login-panel input { width: 100%; }
.login-panel .button { margin-top: 24px; }
.login-panel #sessionStatus { font-size: 13px; margin-top: 14px; min-height: 20px; }
.noscript { padding: 15px; color: #942331; background: #fff0f1; text-align: center; }
@media (max-width: 1150px) { .app-shell { grid-template-columns: 185px minmax(0,1fr); }.sidebar { padding-left: 12px; padding-right: 12px; }.topbar { padding: 16px 22px; }.content { padding: 25px 22px 40px; }.summary-item { padding: 14px; }.topbar-product, .topbar-divider { display: none; } }
@media (max-width: 820px) { .app-shell { display: block; }.sidebar { padding: 16px 20px; display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 20px; }.sidebar .brand { padding: 0; }.sidebar nav { display: flex; gap: 6px; }.nav-item { width: auto; margin: 0; padding: 9px 12px; }.sidebar-footer { display: none; }.topbar { padding: 14px 20px; flex-wrap: wrap; }.content { padding: 24px 20px 36px; }.summary-item { padding: 12px 10px; }.summary-item strong { font-size: 25px; }.toolbar { gap: 8px; }.search-field { flex-basis: 100%; }.toolbar select { flex: 1; }.selection-toolbar { flex-wrap: wrap; }.selection-toolbar .button-group { flex: 1 1 auto; justify-content: flex-end; } }
@media (max-width: 520px) { .sidebar { flex-wrap: wrap; gap: 14px; padding: 18px 16px; }.sidebar nav { width: 100%; }.nav-item { flex: 1; text-align: center; }.brand strong { font-size: 18px; }.topbar { padding: 12px 16px; }.account-actions { gap: 6px; }.account-actions .button { padding: 7px 10px; font-size: 13px; }.admin-name { width: 100%; }.content { padding: 22px 16px 30px; }.page-heading { align-items: flex-start; gap: 12px; }.page-heading h1 { font-size: 24px; }.page-heading .subtle { font-size: 13px; }.summary-strip { flex-wrap: wrap; }.summary-item { flex: 1 1 33%; border-bottom: 1px solid var(--line); }.summary-item:nth-child(3) { border-right: 0; }.summary-item:nth-child(4), .summary-item:nth-child(5) { border-bottom: 0; }.policy-line { font-size: 13px; }.toolbar, .selection-toolbar, .pagination { padding-left: 12px; padding-right: 12px; }.selection-toolbar .button-group { justify-content: flex-start; }.pagination { font-size: 13px; flex-wrap: wrap; }.panel-heading { flex-wrap: wrap; padding: 16px; }.batch-body { padding: 16px; }.dialog-heading, .dialog-body { padding: 18px; }.dialog-footer { padding: 14px 18px; }.type-options { flex-wrap: wrap; }.type-options label { flex-basis: 40%; }.detail-fields { grid-template-columns: 1fr; gap: 15px; }.detail-fields .full { grid-column: auto; }.reveal-row input { flex-basis: 100%; }.login-panel { padding: 25px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
