/* Audivoy admin. Tokens first; dark mode redefines tokens only. */
:root {
  --bg: #f5f6f8; --panel: #ffffff; --fg: #16191f; --muted: #5c6472; --line: #dfe2e8;
  --accent: #2a4dd0; --accent-fg: #ffffff; --accent-soft: #e6ebfb;
  --ok: #1d7a4a; --ok-bg: #e3f3ea; --bad: #b3261e; --bad-bg: #fbe5e3; --warn: #8a5a00; --warn-bg: #fbefd9;
  --radius: 10px;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111318; --panel: #1a1d24; --fg: #e8eaef; --muted: #9aa2b1; --line: #2c313b;
    --accent: #8aa2ff; --accent-fg: #0d1020; --accent-soft: #232b4a;
    --ok: #6fd39d; --ok-bg: #173225; --bad: #ff8a80; --bad-bg: #3a1d1b; --warn: #f0c060; --warn-bg: #3a2e14;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--body); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { font-size: 17px; } .brand span { color: var(--muted); font-size: 13px; margin-left: 4px; }
nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
nav button { background: none; border: 0; padding: 6px 12px; border-radius: 999px; color: var(--muted); cursor: pointer; font: 500 14px var(--body); }
nav button:hover { color: var(--fg); background: var(--accent-soft); }
nav button[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.tools { display: flex; gap: 10px; align-items: center; margin-left: auto; }
main { max-width: 1040px; margin: 0 auto; padding: 24px 20px 64px; display: flex; flex-direction: column; gap: 18px; }
main:focus { outline: none; }
h1 { font-size: 22px; margin: 0; } h2 { font-size: 17px; margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.narrow { max-width: 420px; width: 100%; margin: 40px auto 0; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
form.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
form.grid .full { grid-column: 1 / -1; }
form.stack { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; font-size: 14px; }
label small { font-weight: 400; color: var(--muted); }
input, select { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); min-width: 0; }
input:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; gap: 16px; flex-wrap: wrap; }
fieldset legend { font-weight: 500; font-size: 14px; margin-bottom: 4px; padding: 0; }
fieldset label { flex-direction: row; align-items: center; font-weight: 400; gap: 6px; }
.btn { font: 600 14px var(--body); border: 0; border-radius: 999px; padding: 8px 16px; cursor: pointer; background: var(--accent); color: var(--accent-fg); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid var(--bad); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.errors { color: var(--bad); white-space: pre-wrap; font-size: 14px; min-height: 0; }
.table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); width: 100%; min-width: 0; }
textarea.mono, .mono { font-family: var(--mono); font-size: 13px; }
pre { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; overflow: auto; max-height: 360px; font: 12px var(--mono); }
details summary { cursor: pointer; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }
tr.link { cursor: pointer; } tr.link:hover td { background: var(--accent-soft); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent); margin: 1px 2px 1px 0; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.bad { background: var(--bad-bg); color: var(--bad); }
.secret { font: 15px var(--mono); padding: 10px 12px; background: var(--warn-bg); color: var(--warn); border-radius: 8px; word-break: break-all; user-select: all; }
#toast { position: fixed; right: 20px; bottom: 20px; background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; }
#toast.show { opacity: 1; }
@media (max-width: 640px) { form.grid { grid-template-columns: 1fr; } .top { padding: 10px 16px; } main { padding: 18px 16px 48px; } }
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }
.qr { display: block; width: 220px; height: 220px; margin: 12px auto; image-rendering: pixelated; background: #fff; padding: 8px; border-radius: 8px; }
