:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #172033;
  --muted: #687086;
  --line: #e4e8f0;
  --primary: #3457d5;
  --primary-dark: #2747bd;
  --success: #16794b;
  --danger: #bd2c3a;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; }
button, input { font: inherit; }
button { cursor: pointer; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 0, #e8ecff, var(--bg) 48%); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 30px rgba(38, 49, 86, .06); }
.login-card { width: min(420px, 100%); padding: 38px; }
.brand-mark, .brand-small { display: inline-grid; place-items: center; color: white; background: var(--primary); font-weight: 800; }
.brand-mark { width: 48px; height: 48px; border-radius: 13px; font-size: 24px; }
.brand-small { width: 30px; height: 30px; border-radius: 8px; margin-right: 10px; }
h1 { margin: 18px 0 6px; font-size: 28px; }
h2 { margin: 0; font-size: 17px; }
p { margin: 6px 0; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 18px; margin-top: 26px; }
label { display: grid; gap: 8px; color: #30394d; font-weight: 600; }
input { width: 100%; padding: 11px 12px; border: 1px solid #ccd2df; border-radius: 9px; color: var(--ink); background: white; outline: none; }
input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(52, 87, 213, .12); }
.primary, .secondary, .ghost { border-radius: 9px; padding: 10px 16px; border: 0; font-weight: 650; }
.primary { color: white; background: var(--primary); }
.primary:hover { background: var(--primary-dark); }
.secondary { background: #edf0f7; color: #28324a; }
.ghost { background: transparent; color: var(--muted); }
.topbar { height: 62px; padding: 0 max(24px, calc((100vw - 1180px) / 2)); background: white; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.topbar > div { display: flex; align-items: center; font-size: 16px; }
.container { width: min(1180px, calc(100% - 40px)); margin: 36px auto; }
.page-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.page-heading h1 { margin: 0; }
.table-card { overflow: hidden; }
.table-title { display: flex; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.table-title span { color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 12px; letter-spacing: .02em; background: #fafbfc; }
tbody tr:last-child td { border-bottom: 0; }
code { font-family: "Cascadia Code", Consolas, monospace; }
.badge { display: inline-block; border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 650; }
.active { color: #0b7445; background: #e9f8f0; }
.expired { color: #795b16; background: #fff5da; }
.revoked { color: #9f2834; background: #fdecef; }
.danger-link { border: 0; background: transparent; color: var(--danger); padding: 0; }
.empty { text-align: center; padding: 60px; color: var(--muted); }
.alert { border-radius: 12px; padding: 14px 16px; margin: 16px 0; }
.error { color: #9b2230; border: 1px solid #f3c5cb; background: #fff0f2; }
.success { color: var(--success); border: 1px solid #bce5ce; background: #edfbf3; }
.key-result { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 18px; }
.key-result code { color: #183529; background: white; border: 1px dashed #8bc6a5; border-radius: 8px; padding: 10px; font-size: 14px; }
dialog { width: min(620px, calc(100% - 32px)); border: 0; border-radius: 16px; padding: 0; box-shadow: 0 24px 80px rgba(10, 20, 50, .3); }
dialog::backdrop { background: rgba(18, 25, 44, .55); backdrop-filter: blur(2px); }
.dialog-form { padding: 26px; display: grid; gap: 20px; }
.dialog-heading { display: flex; justify-content: space-between; }
.dialog-heading p { color: var(--muted); font-size: 13px; }
.icon-button { border: 0; background: transparent; font-size: 26px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.quick-row { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.quick-row button { border: 1px solid var(--line); background: white; border-radius: 7px; padding: 6px 9px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
@media (max-width: 680px) {
  .container { width: min(100% - 24px, 1180px); margin-top: 22px; }
  .page-heading { align-items: flex-start; }
  .form-grid, .key-result { grid-template-columns: 1fr; }
  .quick-row { flex-wrap: wrap; }
  .login-card { padding: 26px; }
}
