/* Semantic tokens shared by all admin screens. */
:root {
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  font-synthesis: none;
  color-scheme: light;
  --bg: #f3f6f8; --surface: #ffffff; --surface-muted: #f6f8fa;
  --text: #192b35; --muted: #526570; --border: #d3dfe5;
  --accent: #08776b; --accent-hover: #065d54; --on-accent: #ffffff;
  --accent-soft: #e4f4ef; --accent-border: #a5cfc1;
  --danger: #a83228; --danger-soft: #fff0ed; --danger-border: #e8b9b1;
  --focus: #08776b; --backdrop: #11232fa6; --shadow: 0 4px 20px #18374706;
  background: var(--bg); color: var(--text);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10191f; --surface: #19252d; --surface-muted: #202f38;
  --text: #e9f0f4; --muted: #adbec9; --border: #425562;
  --accent: #65dbc0; --accent-hover: #8ae8d1; --on-accent: #102c27;
  --accent-soft: #193b33; --accent-border: #376e5f;
  --danger: #ffb3a8; --danger-soft: #422824; --danger-border: #895249;
  --focus: #65dbc0; --backdrop: #000000ad; --shadow: none;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; line-height: 1.55; }
a { color: inherit; }
header { min-height: 88px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px max(24px, 5vw); }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 750; font-size: 22px; text-decoration: none; white-space: nowrap; }
.brand small { font-size: 12px; color: var(--muted); border-left: 1px solid var(--border); padding-left: 14px; font-weight: 500; }
.mark { background: var(--accent); color: var(--on-accent); padding: 6px 13px; border-radius: 10px; }
.account { display: flex; gap: 16px; align-items: center; font-size: 13px; min-width: 0; }
#account { overflow-wrap: anywhere; }
.theme-control { margin: 0; display: flex; align-items: center; gap: 10px; white-space: nowrap; font-size: 12px; }
.theme-control select { width: 126px; margin: 0; }
main { max-width: 1320px; margin: 0 auto; padding: 40px 24px 64px; }
h1 { font-size: 32px; line-height: 1.25; letter-spacing: -.7px; margin: 8px 0 28px; }
h2 { font-size: 18px; line-height: 1.4; margin: 0 0 12px; }
p { line-height: 1.65; }
.eyebrow { font-size: 11px; color: var(--accent); font-weight: 750; letter-spacing: 1.6px; }
.welcome { max-width: 620px; margin: 7vh auto; padding: 48px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.welcome h1 { font-size: 42px; }
.welcome p { color: var(--muted); margin-bottom: 32px; }
.page-heading, .section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.section-heading { margin-bottom: 18px; }
.section-heading h2 { margin: 0; }
.badge { color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 20px; padding: 8px 14px; font-size: 12px; white-space: nowrap; }
nav { display: flex; gap: 8px; margin: 0 0 28px; border-bottom: 1px solid var(--border); }
button { font: inherit; font-weight: 600; cursor: pointer; min-height: 44px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 10px 16px; transition: background .18s, border-color .18s; }
button:hover { background: var(--surface-muted); border-color: var(--muted); }
button:disabled { opacity: .55; cursor: not-allowed; }
button[aria-busy="true"] { cursor: progress; }
.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: 14px 20px; color: var(--muted); }
.tab.active { border-bottom-color: var(--accent); color: var(--accent); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow); min-width: 0; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.muted, .hint { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.hint { font-size: 13px; margin-top: 22px; }
.actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
label { display: block; font-size: 13px; font-weight: 600; margin: 18px 0; color: var(--muted); }
input, select { display: block; width: 100%; min-height: 46px; margin-top: 8px; border: 1px solid var(--border); background: var(--surface-muted); border-radius: 8px; padding: 11px 12px; font: inherit; font-size: 14px; color: var(--text); }
select { cursor: pointer; appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23526570' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
[data-theme="dark"] select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23adbec9' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
input[readonly], input:disabled { color: var(--muted); background: var(--bg); }
input::placeholder { color: var(--muted); opacity: 1; }
:where(button, input, select, a):focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.table-scroll { overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
table { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 13px; text-align: left; }
th { font-weight: 600; color: var(--muted); background: var(--surface-muted); padding: 14px 16px; white-space: nowrap; }
td { border-bottom: 1px solid var(--border); padding: 16px; max-width: 280px; overflow-wrap: anywhere; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-muted); }
td small { display: block; color: var(--muted); margin-top: 5px; }
.pill { display: inline-block; padding: 4px 10px; border-radius: 20px; white-space: nowrap; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pill.expired, .pill.revoked { background: var(--danger-soft); color: var(--danger); }
.pill.pending { background: var(--surface-muted); color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px; }
.key-card { background: var(--accent-soft); border-color: var(--accent-border); }
code { display: block; overflow-wrap: anywhere; background: var(--surface); border: 1px dashed var(--accent-border); border-radius: 8px; padding: 18px; font-size: 16px; }
#notice, #dialog-notice { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-border); padding: 14px 16px; border-radius: 8px; font-size: 14px; }
#notice.success, #dialog-notice.success { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }
.inline-form { display: flex; gap: 16px; align-items: end; flex-wrap: wrap; }
.inline-form label:first-child { flex: 1; min-width: 200px; }
.inline-form button { margin-bottom: 18px; }
.stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.stats strong { display: block; font-size: 30px; margin-top: 12px; }
dialog { color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 30px; width: 580px; max-width: 94vw; max-height: 90vh; overflow: auto; }
dialog::backdrop { background: var(--backdrop); }
.dialog-close { float: right; font-size: 22px; border: 0; padding: 4px 12px; }
dl { font-size: 14px; line-height: 1.6; }
dt { font-size: 12px; color: var(--muted); margin-top: 12px; }
dd { margin: 4px 0; overflow-wrap: anywhere; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
footer { text-align: center; font-size: 12px; color: var(--muted); padding: 20px; }
[id^="more-"] { margin-top: 18px; }
[hidden] { display: none !important; }
@media(max-width: 1000px) { .brand small { display: none; } .theme-control { display: block; font-size: 11px; } .theme-control select { margin-top: 4px; } }
@media(max-width: 760px) {
  header { padding: 16px; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
  .brand { font-size: 20px; } .account { flex-wrap: wrap; gap: 10px; flex: 1; justify-content: flex-end; }
  #account { flex-basis: 100%; text-align: right; order: 3; font-size: 12px; }
  main { padding: 28px 16px; } .grid, .stats { grid-template-columns: 1fr; gap: 0; }
  .page-heading { display: block; } .badge { display: inline-block; margin-bottom: 24px; }
  h1 { font-size: 27px; } .welcome { padding: 28px; margin: 30px 0; } .welcome h1 { font-size: 34px; }
  nav { overflow: auto; } .tab { white-space: nowrap; padding: 12px; }
  .inline-form { display: block; } .card { padding: 20px; } dialog { padding: 22px; }
  .empty { text-align: left; padding: 24px; }
}
@media(prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media(forced-colors: active) { select { appearance: auto; background-image: none; } }

.license-key-section { margin: 24px 0; }
.license-key-section h3 { font-size: 14px; margin-bottom: 10px; }
.license-key-section button { margin-top: 12px; }
