:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1b1f24;
  --muted: #5f6b7a;
  --line: #e2e5ea;
  --accent: #e0661b;
  --accent-text: #ffffff;
  --ok: #1f9d55;
  --bad: #c62828;
  --chip: #eef0f3;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --card: #1a1e24;
    --text: #e8eaed;
    --muted: #98a2b0;
    --line: #2b313a;
    --accent: #f07a2f;
    --chip: #252a32;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
[hidden] { display: none !important; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 15px; margin: 0 0 10px; }
.bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.tag { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; background: var(--chip); color: var(--muted); padding: 2px 6px; border-radius: 4px; }
.who { display: flex; gap: 12px; align-items: center; color: var(--muted); }
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.narrow { max-width: 380px; margin: 40px auto; }
.layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
@media (max-width: 760px) { .layout { grid-template-columns: 1fr; } }
label { display: block; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
label input { margin-top: 4px; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); }
textarea { margin-top: 8px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
button { padding: 8px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--chip); cursor: pointer; white-space: nowrap; }
button:hover { border-color: var(--muted); }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.danger { color: var(--bad); }
button.link { background: none; border: none; padding: 0; color: var(--muted); text-decoration: underline; }
button.link.danger { color: var(--bad); }
small { display: block; margin-top: 4px; }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; }
.tab { flex: 1; background: none; }
.tab.on { background: var(--chip); border-color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; }
.row input, .row select { flex: 1; min-width: 0; }
.row.between { justify-content: space-between; }
.title-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.muted { color: var(--muted); }
.error { color: var(--bad); margin: 10px 0 0; }
.msg { margin: 10px 0 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: none; }
#printers li { cursor: pointer; padding: 8px; border-radius: 7px; border: none; }
#printers li.on { background: var(--chip); }
.pill { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--chip); }
.pill.online { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.pill.offline { color: var(--muted); }
.role { text-transform: capitalize; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
@media (max-width: 500px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stats div { background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.k { display: block; font-size: 12px; color: var(--muted); }
.v { font-weight: 600; text-transform: capitalize; }
.job { background: var(--bg); border-radius: 8px; padding: 10px; margin-bottom: 10px; }
.progress { height: 6px; background: var(--line); border-radius: 3px; margin: 8px 0; overflow: hidden; }
.progress div { height: 100%; background: var(--accent); width: 0; transition: width .4s; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.audit { width: 100%; border-collapse: collapse; font-size: 13px; }
.audit td { padding: 6px 4px; border-top: 1px solid var(--line); }
.audit .bad { color: var(--bad); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); max-width: min(560px, calc(100% - 32px)); background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 8px; font-size: 14px; white-space: pre-wrap; word-break: break-word; max-height: 50vh; overflow: auto; }
.toast.bad { background: var(--bad); color: #fff; }
