@font-face { font-family: "Bricolage"; src: url("/fonts/BricolageGrotesque.ttf"); font-weight: 200 800; }
@font-face { font-family: "DM Sans"; src: url("/fonts/DMSans.ttf"); font-weight: 100 1000; }
:root { --bg: #0F1A31; --card: #1C2B4D; --inner: #14213D; --line: #2A3B63; --text: #FFF8E7; --muted: #B8C0D4; --gold: #F5B700; --green: #3DDC97; --red: #C0392B; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: "DM Sans", system-ui, sans-serif; }
button { font-family: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
h2 { font-family: "Bricolage", sans-serif; font-weight: 800; font-size: 20px; margin: 0 0 8px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0; }
.wrap { max-width: 1640px; margin: 0 auto; padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 20px; }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.logo { height: 40px; }
.sub { font-size: 18px; color: var(--muted); }
.grow { flex-grow: 1; }
.chip { background: var(--card); border-radius: 999px; padding: 10px 16px; font-size: 14px; }
.chip.alert { background: var(--gold); color: var(--inner); font-weight: 700; }
.stop { min-height: 44px; padding: 0 20px; border-radius: 12px; border: 0; font-size: 15px; font-weight: 700; background: var(--red); color: #fff; }
.stop.on { background: #2F7A55; }
.banner { background: #5C1F1F; border-radius: 12px; padding: 14px 18px; font-size: 15px; }
.main { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.card { background: var(--card); border-radius: 16px; padding: 20px; min-width: 0; }
.left { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.scene-card { padding: 12px; }
.scene-box { overflow-x: auto; border-radius: 8px; }
#scene { display: block; width: 100%; height: auto; image-rendering: pixelated; cursor: pointer; }
.side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 20px; }
.row > .card { flex: 1 1 280px; }
.agent-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.agent-head canvas { width: 64px; height: 64px; border-radius: 10px; image-rendering: pixelated; background: var(--inner); }
.agent-name { font-family: "Bricolage", sans-serif; font-weight: 800; font-size: 22px; }
.agent-room { font-size: 14px; font-weight: 700; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0; font-size: 14px; }
.fact { background: var(--inner); border-radius: 10px; padding: 10px; }
.fact.wide { grid-column: span 2; }
.fact small { display: block; color: var(--muted); font-size: 12px; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { flex: 1 1 120px; min-height: 44px; border-radius: 10px; border: 2px solid #3A4C78; background: transparent; color: var(--text); font-size: 14px; font-weight: 700; }
.btn.on { background: var(--green); color: var(--inner); border-color: var(--green); }
.btn.gold { background: var(--gold); color: var(--inner); border-color: var(--gold); }
.channel { padding: 10px 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.channel-head { flex: 1 1 70px; display: flex; flex-direction: column; }
.channel-head .muted { font-size: 12px; white-space: nowrap; }
.channel .seg { flex: 0 1 auto; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; background: var(--inner); border-radius: 10px; padding: 4px; }
.seg button { min-height: 36px; white-space: nowrap; padding: 0 10px; border: 0; border-radius: 8px; font-size: 14px; font-weight: 700; background: transparent; color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--gold); color: var(--inner); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.stat { background: var(--inner); border-radius: 12px; padding: 14px; }
.stat small { display: block; font-size: 13px; color: var(--muted); }
.stat b { font-size: 28px; }
.item { background: var(--inner); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.item .tag { font-size: 12px; font-weight: 700; letter-spacing: .3px; }
.item .tag.sens { color: var(--gold); }
.item p { margin: 0; font-size: 14px; white-space: pre-wrap; }
.item input { min-height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 0 10px; font: inherit; }
.events { display: flex; flex-direction: column; font-size: 14px; max-height: 360px; overflow-y: auto; }
.ev { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ev time { color: var(--muted); width: 44px; flex-shrink: 0; }
footer { font-size: 12px; }

/* ---------- shared by the other pages ---------- */
.nav { display: flex; flex-wrap: wrap; gap: 4px; background: var(--card); border-radius: 12px; padding: 4px; }
.nav a { color: var(--text); text-decoration: none; font-size: 14px; font-weight: 700; padding: 10px 14px; border-radius: 9px; min-height: 40px; display: inline-flex; align-items: center; }
.nav a:hover { background: var(--inner); }
.nav a[aria-current="page"] { background: var(--gold); color: var(--inner); }
.nav a:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.banner.ok { background: #1F5C43; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 20px; align-items: start; }
.card h3 { font-family: "Bricolage", sans-serif; font-weight: 800; font-size: 18px; margin: 0; }
.status { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--inner); color: var(--muted); }
.status.conectado, .status.aprovado { background: #1F5C43; color: #CFF5E2; }
.status.conectando, .status.pendente { background: #5C4A12; color: #FFE9A8; }
.status.erro, .status.ajustar { background: #5C1F1F; color: #FFD3D3; }
.form { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.form input, .form select, .form textarea, .inline input, .inline select {
  min-height: 42px; border-radius: 8px; border: 1px solid var(--line); background: var(--inner); color: var(--text); padding: 8px 10px; font: inherit; font-size: 14px; }
.form textarea { min-height: 90px; resize: vertical; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline input { flex: 1 1 160px; min-width: 0; max-width: 100%; }
.copy { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--inner); border-radius: 8px; padding: 8px 10px; word-break: break-all; user-select: all; }
.qr { background: #fff; border-radius: 12px; padding: 12px; width: 260px; max-width: 100%; display: block; margin: 8px 0; }
.checks { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; padding: 4px 0; }
.checks label { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--text); min-height: 32px; }
.checks input { width: 18px; height: 18px; accent-color: var(--gold); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 12px; }
.tile { background: var(--card); border-radius: 14px; padding: 16px; }
.tile small { display: block; color: var(--muted); font-size: 13px; }
.tile b { font-family: "Bricolage", sans-serif; font-size: 26px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
td { padding: 8px 4px; border-bottom: 1px solid var(--line); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 8px; }
.bars div { flex: 1 1 0; background: var(--gold); border-radius: 3px 3px 0 0; min-height: 2px; }
.bars-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 6px; }
.media { width: 100%; aspect-ratio: 4 / 5; object-fit: contain; background: #000; border-radius: 10px; display: block; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 2px solid #3A4C78; background: transparent; color: var(--text); font-weight: 700; font-size: 14px; }
.tabs button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--inner); }
.switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
details { border-top: 1px solid var(--line); padding: 10px 0; }
summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 36px; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary b { flex-grow: 1; }
.empty { color: var(--muted); padding: 24px 0; text-align: center; }
.page-title { font-family: "Bricolage", sans-serif; font-weight: 800; font-size: 28px; margin: 0 0 6px; }
.select { min-height: 42px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 0 10px; font: inherit; }
.inline label input, .inline label select { flex: none; }
.form .checks label { flex-direction: row; align-items: center; color: var(--text); font-size: 14px; }
.form .checks input { min-height: 0; width: 18px; height: 18px; flex: none; padding: 0; }
.tbl { overflow-x: auto; }
.login { max-width: 440px; padding-top: 48px; }
.login .logo { height: 48px; align-self: flex-start; }
.login form .btn { flex: none; width: 100%; }
.nav a.out { color: var(--muted); }
.nav a .badge { margin-left: 6px; background: var(--red); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; }
.nav a[aria-current="page"] .badge { background: var(--inner); color: var(--gold); }
.ok-text { color: var(--green); }
.bad-text { color: #FFB4B4; }
.log { font-family: ui-monospace, Menlo, monospace; font-size: 12px; white-space: pre-wrap; word-break: break-word; background: var(--inner); border-radius: 10px; padding: 12px; max-height: 70vh; overflow: auto; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { display: inline-flex; align-items: center; gap: 6px; background: var(--inner); border-radius: 999px; padding: 4px 10px; font-size: 13px; color: var(--text); cursor: pointer; }
.chips input { accent-color: var(--gold); }
.meter { height: 8px; background: var(--inner); border-radius: 999px; overflow: hidden; margin: 6px 0; }
.meter div { height: 100%; background: var(--gold); }
.status.falhou, .status.recusado { background: #5C1F1F; color: #FFD3D3; }
.status.enviado { background: #1F5C43; color: #CFF5E2; }
.status.cancelado { background: var(--inner); color: var(--muted); }
@media (max-width: 640px) { .wrap { padding: 16px 16px 32px; } .nav { width: 100%; } .nav a { padding: 8px 10px; font-size: 13px; } }
