/* Hedroom admin: small, dense, light and dark. No external fonts, no inline styles (CSP style-src 'self'). */
:root {
  color-scheme: light dark;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #15181d;
  --muted: #5a6472;
  --line: #d9dde3;
  --accent: #1f5fd6;
  --accent-text: #ffffff;
  --ok: #17663a;
  --ok-bg: #e3f4ea;
  --warn: #7a4b00;
  --warn-bg: #fff1d6;
  --err: #8f1d1d;
  --err-bg: #fde5e5;
  --focus: #b45309;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --panel: #1a1e24;
    --text: #e8ebef;
    --muted: #9aa4b2;
    --line: #2d343d;
    --accent: #6ea0ff;
    --accent-text: #0b1220;
    --ok: #7bd9a1;
    --ok-bg: #12301f;
    --warn: #f3c776;
    --warn-bg: #33270d;
    --err: #ff9d9d;
    --err-bg: #3a1717;
    --focus: #fbbf24;
  }
}
* { box-sizing: border-box; }
html { font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
code.json { word-break: break-word; font-size: 12px; }
h1 { font-size: 1.4rem; margin: 0.6rem 0; }
h2 { font-size: 1.05rem; margin: 0 0 0.6rem; }
h3 { font-size: 0.95rem; margin: 0 0 0.4rem; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: static; display: block; padding: 0.5rem 1rem; background: var(--panel); }

.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: 0.6rem 1rem; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { margin-right: 0.5rem; }
.bar nav { display: flex; gap: 0.25rem; flex: 1; flex-wrap: wrap; }
.bar nav a { padding: 0.45rem 0.7rem; border-radius: 6px; text-decoration: none; color: var(--text); }
.bar nav a:hover { background: var(--bg); }
.bar nav a[aria-current="page"] { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.who { display: flex; align-items: center; gap: 0.6rem; margin: 0; color: var(--muted); }
main { max-width: 1180px; margin: 0 auto; padding: 0.5rem 1rem 3rem; }
.narrow { max-width: 420px; margin: 3rem auto; }

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-bottom: 1rem; align-items: start; }
.grid.actions { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }
.grid > .card { margin-bottom: 0; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 0.4rem 0.55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
tfoot th, tfoot td { border-bottom: 0; font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }
.muted { color: var(--muted); font-size: 13px; }

.facts { display: grid; grid-template-columns: minmax(130px, 40%) 1fr; gap: 0.25rem 0.8rem; margin: 0 0 0.6rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; word-break: break-word; }

.badge { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.s-active { background: var(--ok-bg); color: var(--ok); }
.s-trialing { background: var(--ok-bg); color: var(--ok); border-style: dashed; }
.s-past_due, .s-canceled { background: var(--warn-bg); color: var(--warn); }
.s-expired, .s-disabled { background: var(--err-bg); color: var(--err); }

.alert { padding: 0.55rem 0.8rem; border-radius: 6px; border: 1px solid var(--line); margin: 0.6rem 0; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert.err { background: var(--err-bg); color: var(--err); }

label { display: block; font-size: 13px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], select, textarea {
  display: block; width: 100%; margin-top: 0.2rem; padding: 0.5rem 0.6rem; min-height: 40px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
}
.check { display: flex; gap: 0.5rem; align-items: flex-start; color: var(--text); font-size: 14px; margin: 0.4rem 0; }
.check input { margin-top: 0.3rem; width: 18px; height: 18px; }
fieldset { border: 1px solid var(--line); border-radius: 6px; padding: 0.6rem 0.8rem; }
.stack { display: grid; gap: 0.6rem; align-content: start; }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 0.6rem; align-items: end; margin-bottom: 0.4rem; }
.inline { display: flex; gap: 0.6rem; align-items: end; margin-bottom: 0.8rem; flex-wrap: wrap; }
.buttons { display: flex; gap: 1rem; align-items: center; }
.pager { display: flex; gap: 1rem; align-items: center; margin: 0.8rem 0; }

button { font: inherit; min-height: 40px; padding: 0.4rem 0.9rem; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); cursor: pointer; font-weight: 600; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.plain { background: transparent; color: var(--accent); border-color: var(--line); }
button.danger { background: transparent; color: var(--err); border-color: var(--err); }
button.primary { background: var(--accent); }

@media (max-width: 720px) {
  .filters { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .facts dt { margin-top: 0.4rem; }
  main { padding: 0.5rem 0.7rem 2rem; }
}
