:root {
  color-scheme: dark;
  font-family: "Microsoft YaHei UI", "Segoe UI", system-ui, sans-serif;
  background: #10131a;
  color: #edf2f7;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #10131a; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; font-weight: 650; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; }
.muted { color: #9ca9bb; font-size: 13px; }
.brand-mark, .eyebrow { color: #7dd3fc; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.topbar { min-height: 80px; padding: 16px clamp(20px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #283244; background: #151b25; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.dashboard { max-width: 1440px; margin: 0 auto; padding: 28px clamp(20px, 5vw, 72px) 48px; display: grid; gap: 22px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stats article, .panel, .login-card { border: 1px solid #2a3547; background: #171e29; border-radius: 8px; }
.stats article { padding: 16px 18px; display: grid; gap: 8px; }
.stats span { color: #9ca9bb; font-size: 13px; }
.stats strong { font-size: 25px; font-variant-numeric: tabular-nums; }
.panel { padding: 22px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-heading > div { display: grid; gap: 4px; }
.section-heading.compact { align-items: center; margin: 0 0 8px; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 14px; }
label { display: grid; gap: 7px; color: #c4cedb; font-size: 13px; }
input, select, textarea { width: 100%; border: 1px solid #3b4860; border-radius: 6px; background: #101722; color: #eef4fb; padding: 9px 10px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: #38bdf8; box-shadow: 0 0 0 2px #38bdf833; }
textarea { resize: vertical; line-height: 1.5; }
.wide { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; gap: 12px; }
.primary, .secondary { border: 1px solid transparent; border-radius: 6px; padding: 8px 12px; min-height: 36px; white-space: nowrap; }
.primary { background: #0e7490; color: white; border-color: #22b4da; }
.primary:hover { background: #0c839f; }
.secondary { background: #222d3e; border-color: #3a485e; color: #d9e4f2; }
.secondary:hover { background: #2b3a50; }
.form-message { min-height: 18px; color: #f5c36b; font-size: 13px; }
.generated { margin-top: 18px; border-top: 1px solid #2a3547; padding-top: 18px; }
.hidden { display: none; }
.licenses-heading { align-items: flex-end; }
.filters { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.filters input { width: 270px; }
.table-wrap { overflow-x: auto; border: 1px solid #29364a; border-radius: 6px; }
table { width: 100%; min-width: 880px; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid #29364a; vertical-align: top; white-space: pre-line; }
th { color: #aebbd0; font-weight: 600; background: #1c2533; }
tbody tr:last-child td { border-bottom: 0; }
.status { display: inline-block; border-radius: 999px; padding: 3px 8px; font-size: 12px; }
.status.active { color: #86efac; background: #14532d; }
.status.expired { color: #fcd34d; background: #713f12; }
.status.disabled { color: #fda4af; background: #7f1d1d; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 200px; }
.actions .secondary { min-height: 30px; padding: 4px 8px; font-size: 12px; }
dialog { width: min(720px, calc(100vw - 32px)); max-height: min(720px, calc(100vh - 32px)); padding: 20px; border: 1px solid #3b4860; border-radius: 8px; background: #171e29; color: #edf2f7; }
dialog::backdrop { background: #030712aa; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.events-list { display: grid; gap: 9px; max-height: 540px; overflow: auto; }
.events-list article { padding: 12px; border: 1px solid #2c3a4f; border-radius: 6px; background: #121923; }
.events-list p { color: #aebbd0; font-size: 13px; margin-top: 5px; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, #143d54, transparent 35%), #10131a; }
.login-card { width: min(410px, 100%); padding: 32px; }
.login-card h1 { margin-top: 8px; }
.login-card .muted { margin-top: 10px; }
.stack { display: grid; gap: 16px; margin-top: 25px; }
.stack .primary { width: 100%; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); } }
@media (max-width: 600px) { .topbar { align-items: flex-start; flex-direction: column; } .topbar-actions { width: 100%; justify-content: space-between; } .stats, .form-grid { grid-template-columns: 1fr; } .section-heading, .licenses-heading { align-items: flex-start; flex-direction: column; } .filters { width: 100%; } .filters input { width: 100%; } .panel { padding: 16px; } }
