:root {
  color-scheme: dark;
  --bg: #0b0b0d;
  --panel: #16161a;
  --line: #2a2a31;
  --text: #ececf1;
  --muted: #9a9aa6;
  --accent: #0a84ff;
  --gold: #ffb743;
  --green: #30d158;
  --red: #ff453a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
main { padding: 16px; max-width: 1400px; margin: 0 auto; }
h1 { font-size: 20px; margin: 8px 0 16px; }
h2 { font-size: 15px; margin: 24px 0 10px; }
h2 small, .note, footer, td small { color: var(--muted); font-weight: normal; }
td small { display: block; font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.id { font-size: 15px; word-break: break-all; }
.bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.brand { color: var(--text); font-weight: 600; font-size: 16px; }
.brand span { color: var(--gold); font-weight: 500; }
footer { text-align: center; padding: 24px 16px; font-size: 12px; }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px;
}
.card h2 { margin-top: 0; }
.login { max-width: 360px; margin: 12vh auto 0; display: grid; gap: 10px; }
.login h1 { margin: 0 0 6px; }
input {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%;
}
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button {
  font: inherit; font-weight: 600; cursor: pointer;
  background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 9px 14px;
}
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); font-weight: 500; }
button.danger { background: var(--red); }
.error { color: var(--red); margin: 0; }
.saved { color: var(--green); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.tile b { display: block; font-size: 20px; }
.tile span { color: var(--muted); font-size: 12px; }
.toolbar { margin-bottom: 10px; }
.toolbar input { max-width: 420px; }
.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; white-space: nowrap; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
th { background: var(--panel); color: var(--muted); font-weight: 500; font-size: 12px; position: sticky; top: 0; }
table.sortable th { cursor: pointer; user-select: none; }
th[aria-sort="ascending"]::after { content: " ▲"; }
th[aria-sort="descending"]::after { content: " ▼"; }
tbody tr:hover { background: #1c1c22; }
.empty { color: var(--muted); text-align: center; padding: 24px; }
.params { white-space: normal; }
.params span { display: inline-block; margin-right: 12px; color: var(--muted); }
.params b { color: var(--text); font-weight: 500; }
.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px;
  font-weight: 600; background: #26262d; color: var(--muted);
}
.pill.purchased, .pill.lifetime { background: rgba(255, 183, 67, .16); color: var(--gold); }
.pill.trial { background: rgba(10, 132, 255, .16); color: var(--accent); }
.pill.expired { background: rgba(255, 69, 58, .14); color: var(--red); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 14px; }
dt { color: var(--muted); }
dd { margin: 0; word-break: break-word; }
form { margin: 0; }
.card form + form, .card form.inline { margin-top: 10px; }
form.inline { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
form.inline label { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }

/* Inline controls in the users table: small, on one line. */
.row-form { display: flex; gap: 6px; align-items: center; margin: 0; white-space: nowrap; }
.row-form input[type="number"] { width: 64px; padding: 5px 8px; font-size: 13px; }
.row-form button { padding: 5px 10px; font-size: 13px; }
th.nosort { cursor: default; }
p.saved { margin: 0 0 12px; }
