/* Shared look of the administration console: fluid, no fixed widths, light and dark, large touch targets. */
:root {
  color-scheme: light dark;
  --bg: #f6f7f9; --panel: #ffffff; --ink: #14181f; --muted: #5a6472; --line: #d8dde5;
  --accent: #0b5cad; --accent-ink: #ffffff; --ok: #176b3a; --warn: #8a5a00; --bad: #a61b1b; --focus: #ffb000;
  --radius: 0.6rem; --gap: clamp(0.6rem, 1.5vw, 1rem);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #11151b; --panel: #1a2029; --ink: #e8ecf2; --muted: #9aa5b4; --line: #2f3946;
          --accent: #5aa4ee; --accent-ink: #08121f; --ok: #5fd08a; --warn: #f0b54a; --bad: #ff8585; }
}
* { box-sizing: border-box; }
html { font-size: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body.center { min-height: 100vh; display: grid; place-items: center; padding: var(--gap); }
h1 { font-size: 1.25rem; margin: 0; }
h2 { font-size: 1.1rem; margin: 0 0 0.5rem; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: var(--gap); top: var(--gap); background: var(--panel); padding: 0.5rem; z-index: 10; }
button, .button, input, select { font: inherit; color: inherit; min-height: 2.75rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); padding: 0.4rem 0.9rem; }
button, .button { cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; }
button:hover, .button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--bad); border-color: var(--bad); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
input, select { width: 100%; }
label { display: block; font-weight: 600; margin: 0.8rem 0 0.25rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1rem, 3vw, 1.75rem); width: min(100%, 28rem); }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap); padding: 0.6rem var(--gap); background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.tabs { display: flex; gap: 0.25rem; flex: 1 1 auto; }
.tabs button { border-color: transparent; background: transparent; }
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.who { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); max-width: 40vw; }
main { padding: var(--gap); max-width: 80rem; margin: 0 auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--gap); margin-bottom: var(--gap); }
.toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: var(--gap); }
.toolbar input[type="search"] { flex: 1 1 12rem; width: auto; }
.toolbar select { width: auto; flex: 0 1 12rem; }
.grow { flex: 1 1 auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.cards .panel { margin: 0; }
.big { font-size: 1.15rem; font-weight: 700; }
.muted { color: var(--muted); }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 0.9rem; }
td.num { white-space: nowrap; }
.chip { display: inline-block; font-size: 0.8rem; padding: 0.1rem 0.5rem; border-radius: 999px; border: 1px solid var(--line); margin-right: 0.25rem; }
.chip.ok { border-color: var(--ok); } .chip.warn { border-color: var(--warn); } .chip.bad { border-color: var(--bad); } .chip.accent { border-color: var(--accent); color: var(--accent); }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink); padding: clamp(1rem, 3vw, 1.5rem); width: min(100% - 2rem, 32rem); }
dialog::backdrop { background: rgb(0 0 0 / 0.5); }
dialog .actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; justify-content: flex-end; }
dialog .stack { display: grid; gap: 0.5rem; }
.toast { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); max-width: calc(100% - 2rem); background: var(--ink); color: var(--bg); padding: 0.6rem 1rem; border-radius: var(--radius); opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 20; }
.toast.show { opacity: 1; }
pre { overflow-x: auto; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem; margin: 0.5rem 0; }
.message { padding: 0.5rem 0.75rem; border: 1px solid var(--bad); border-radius: var(--radius); color: var(--bad); }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: var(--gap); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (max-width: 40rem) {
  table.stack-sm thead { position: absolute; left: -999px; }
  table.stack-sm tr { display: block; border-bottom: 1px solid var(--line); padding: 0.5rem 0; }
  table.stack-sm td { display: block; border: 0; padding: 0.15rem 0.6rem; }
  table.stack-sm td::before { content: attr(data-label) ": "; color: var(--muted); }
}
