/* CRM Pansudo — identidade PANSUDO (11/11/2026): claro "Marca" e escuro "Comando", menu lateral marinho, laranja da marca. Feito para computador. */
:root {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f9fafb; --surface-3: #f1f3f6;
  --border: #e5e7eb; --border-strong: #d4d8de;
  --text: #0f172a; --text-2: #475569; --muted: #8590a2;
  --accent: #2563eb; --accent-hover: #1d4ed8; --accent-weak: #eef3ff; --accent-text: #1d4ed8;
  --good: #15803d; --good-weak: #e9f7ee; --warn: #b45309; --warn-weak: #fdf3e2; --bad: #c62828; --bad-weak: #fdecec;
  --ia: #6d28d9; --ia-weak: #f3edff;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 1px rgba(15, 23, 42, .03);
  --radius: 8px; --radius-lg: 12px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d1117; --surface: #151a22; --surface-2: #1a2029; --surface-3: #212835;
  --border: #262e3b; --border-strong: #333c4b;
  --text: #e6eaf0; --text-2: #aab3c0; --muted: #7b8595;
  --accent: #4f8cff; --accent-hover: #6b9dff; --accent-weak: #18243b; --accent-text: #8fb4ff;
  --good: #4ade80; --good-weak: #12281b; --warn: #f5b04c; --warn-weak: #2c2212; --bad: #f87171; --bad-weak: #2d1618;
  --ia: #b69cff; --ia-weak: #221a37;
  --shadow: none;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; min-width: 1100px; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 13px; font-weight: 600; margin: 0 0 8px; color: var(--text-2); }
small, .muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* layout */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; min-width: 0; }
.side * { min-width: 0; }
.nav a span.lbl, .nav a { white-space: nowrap; }
.nav a { overflow: hidden; text-overflow: ellipsis; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 650; font-size: 15px; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.nav-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: var(--text-2); font-weight: 500; }
.nav a:hover { background: var(--surface-3); text-decoration: none; color: var(--text); }
.nav a.on { background: var(--accent-weak); color: var(--accent-text); }
.nav svg { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav .count { margin-left: auto; background: var(--bad); color: #fff; font-size: 11px; font-weight: 600; border-radius: 10px; padding: 0 7px; line-height: 18px; }
.nav .count.blue { background: var(--accent); }
.side-foot { margin-top: auto; padding: 12px 4px 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.who { font-size: 13px; }
.who { padding: 0 6px; }
.who b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.side-foot .row .btn, .side-foot .row form { width: 100%; }
.side-foot .row .btn { justify-content: center; padding: 0 4px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.main { padding: 24px 32px 48px; max-width: 1480px; width: 100%; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* cartões e grades */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow); }
.card + .card, .grid + .card, .card + .grid, .grid + .grid { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } .g-21 { grid-template-columns: 2fr 1fr; } .g-12 { grid-template-columns: 1fr 2fr; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .lbl { font-size: 12.5px; color: var(--text-2); display: flex; justify-content: space-between; gap: 8px; }
.kpi .val { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.good .val { color: var(--good); } .kpi.warn .val { color: var(--warn); } .kpi.bad .val { color: var(--bad); }
.d { font-size: 11.5px; font-weight: 600; }
.d.good { color: var(--good); } .d.bad { color: var(--bad); } .d.flat { color: var(--muted); }

/* tabelas */
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-2); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
.table th:first-child { border-top-left-radius: 8px; } .table th:last-child { border-top-right-radius: 8px; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num { text-align: right; }
.table tr.total td { font-weight: 600; background: var(--surface-2); }
.table tr.click { cursor: pointer; }
.table a.row-link { color: var(--text); font-weight: 500; }
td.good, span.good { color: var(--good); } td.warn, span.warn { color: var(--warn); } td.bad, span.bad { color: var(--bad); }
.ellipsis { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* selos */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.good { background: var(--good-weak); color: var(--good); } .badge.warn { background: var(--warn-weak); color: var(--warn); }
.badge.bad { background: var(--bad-weak); color: var(--bad); } .badge.blue { background: var(--accent-weak); color: var(--accent-text); }
.badge.ia { background: var(--ia-weak); color: var(--ia); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.conectado { background: var(--good); } .dot.desconectado { background: var(--bad); } .dot.conectando { background: var(--warn); }

/* botões e formulários */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 500 13px var(--font); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--bad); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
form.inline { display: inline; }
label.f { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); font: 14px var(--font); }
textarea { height: auto; padding: 8px 10px; min-height: 80px; resize: vertical; line-height: 1.45; }
textarea.code { font-family: var(--mono); font-size: 12.5px; min-height: 360px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
input.short { width: 110px; } input.tiny { width: 80px; }
.check { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 10px; }
.check input { margin-top: 3px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-actions { display: flex; gap: 8px; margin-top: 8px; }
.filters { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.filters .field { margin: 0; }
.filters select, .filters input { width: auto; min-width: 150px; }

/* segmentado (período, abas) */
.seg { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 3px; gap: 2px; }
.seg a { padding: 5px 11px; border-radius: 7px; color: var(--text-2); font-weight: 500; font-size: 13px; }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs a { padding: 9px 14px; color: var(--text-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--accent-text); border-bottom-color: var(--accent); }
.tabs .n { font-size: 11.5px; background: var(--surface-3); border-radius: 9px; padding: 0 6px; margin-left: 4px; color: var(--text-2); }

/* avisos */
.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; font-weight: 500; }
.flash.ok { background: var(--good-weak); color: var(--good); } .flash.erro { background: var(--bad-weak); color: var(--bad); }
.note { padding: 10px 14px; border-radius: var(--radius); background: var(--accent-weak); color: var(--accent-text); font-size: 13px; }
.note.warn { background: var(--warn-weak); color: var(--warn); }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* gráfico de barras e mapa de calor */
.bars { width: 100%; height: 170px; display: block; }
.bars rect.b { fill: var(--accent); opacity: .85; } .bars rect.b:hover { opacity: 1; }
.bars text { fill: var(--muted); font-size: 10.5px; font-family: var(--font); }
.bars line { stroke: var(--border); }
.hbar { display: grid; grid-template-columns: 90px 1fr 50px; gap: 8px; align-items: center; font-size: 12.5px; margin-bottom: 6px; }
.hbar .t { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.hbar .t i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.heat { display: grid; grid-template-columns: 36px repeat(24, 1fr); gap: 2px; font-size: 10.5px; color: var(--muted); }
.heat .c { height: 18px; border-radius: 3px; background: var(--surface-3); }
.heat .c.l1 { background: #d7f0df; } .heat .c.l2 { background: #fbe7c1; } .heat .c.l3 { background: #f7c9c4; } .heat .c.l4 { background: #ef9a92; }
:root[data-theme="dark"] .heat .c.l1 { background: #1d4a2c; } :root[data-theme="dark"] .heat .c.l2 { background: #5a4415; } :root[data-theme="dark"] .heat .c.l3 { background: #6b2a26; } :root[data-theme="dark"] .heat .c.l4 { background: #8f2f2a; }

/* fila "Agora" */
.queue { display: flex; flex-direction: column; gap: 8px; }
.qrow { display: grid; grid-template-columns: 6px 1fr 160px 110px; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px 10px 0; color: var(--text); }
.qrow:hover { text-decoration: none; border-color: var(--border-strong); }
.qrow .bar { align-self: stretch; border-radius: 10px 0 0 10px; background: var(--good); }
.qrow.warn .bar { background: var(--warn); } .qrow.bad .bar { background: var(--bad); }
.qrow .who { font-weight: 600; } .qrow .txt { color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow .timer { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.qrow.warn .timer { color: var(--warn); } .qrow.bad .timer { color: var(--bad); }
.conn-strip { display: flex; flex-wrap: wrap; gap: 6px; }

/* conversa */
.conv { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.timeline { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 72%; padding: 8px 12px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--border); word-break: break-word; }
.msg .body { white-space: pre-wrap; }
.msg.team { align-self: flex-end; background: var(--accent-weak); border-color: transparent; }
.msg.ia { align-self: flex-end; background: var(--ia-weak); border-color: transparent; }
.msg.auto { align-self: flex-end; background: var(--surface-2); color: var(--text-2); border-style: dashed; }
.msg .meta { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; display: flex; gap: 8px; justify-content: space-between; white-space: normal; }
.msg .meta b { color: var(--text-2); font-weight: 600; }
.msg .media { font-size: 12.5px; color: var(--text-2); font-style: italic; }
.wait { align-self: center; font-size: 11.5px; padding: 2px 10px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.wait.warn { background: var(--warn-weak); color: var(--warn); } .wait.bad { background: var(--bad-weak); color: var(--bad); }
.sysline { align-self: center; font-size: 11.5px; color: var(--muted); }
.state-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; background: var(--ia-weak); color: var(--ia); font-weight: 500; }
.state-bar.paused { background: var(--warn-weak); color: var(--warn); } .state-bar.held { background: var(--accent-weak); color: var(--accent-text); } .state-bar.handoff { background: var(--bad-weak); color: var(--bad); }
.composer { margin-top: 14px; display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { min-height: 64px; }
dl.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 10px; margin: 0; font-size: 13px; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; }
.list { display: flex; flex-direction: column; }
.list .it { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 11px 4px; border-bottom: 1px solid var(--border); color: var(--text); }
.list .it:hover { background: var(--surface-2); text-decoration: none; }
.list .it:last-child { border-bottom: 0; }
.qr { display: block; width: 280px; height: 280px; image-rendering: pixelated; background: #fff; padding: 10px; border-radius: 10px; border: 1px solid var(--border); }
.login { min-height: 100vh; display: grid; place-items: center; }
.login .card { width: 380px; padding: 28px; }
.pager { display: flex; gap: 6px; justify-content: flex-end; margin-top: 12px; }
@media print {
  .side, .no-print, .toolbar { display: none !important; }
  .shell { display: block; } body { min-width: 0; background: #fff; } .main { padding: 0; }
  .card, .kpi { box-shadow: none; break-inside: avoid; }
}
/* utilitários (a CSP não aceita style="" inline) */
.btn.block { width: 100%; justify-content: center; }
.brand.flush { padding-left: 0; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; }
.narrow { max-width: 520px; } .mid { max-width: 760px; }
.right { text-align: right; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.flex { display: flex; gap: 8px; align-items: center; } .flex.between { justify-content: space-between; } .flex.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.big { font-size: 15px; font-weight: 600; }
.mini { width: 100%; height: 8px; display: block; }
.mini rect.bg { fill: var(--surface-3); } .mini rect.fg { fill: var(--accent); }
.mini rect.fg.good { fill: var(--good); } .mini rect.fg.warn { fill: var(--warn); } .mini rect.fg.bad { fill: var(--bad); }
.stack > * + * { margin-top: 12px; }
.toolbar input[type=date], .toolbar input[type=search], .toolbar select { width: auto; }
.grid > .card, .grid > .stack, .grid > form { margin-top: 0; }

/* barras de rolagem discretas (Firefox e Chrome/Edge) */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: transparent; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
:hover::-webkit-scrollbar-thumb, *:hover > ::-webkit-scrollbar-thumb { background-color: var(--border-strong); }
::-webkit-scrollbar-thumb:hover { background-color: var(--muted); }
::-webkit-scrollbar-corner { background: transparent; }
/* verificação em 2 etapas */
.steps { margin: 0 0 12px; padding-left: 18px; color: var(--text-2); }
.steps li { margin-bottom: 4px; }
.qr-2fa { display: block; background: #fff; padding: 8px; border-radius: 10px; border: 1px solid var(--border); }
details summary { cursor: pointer; }
/* tabelas largas rolam dentro do próprio cartão, nunca a página inteira */
.card { min-width: 0; }
.card:has(> .table), .card:has(> table) { overflow-x: auto; }
.page-head { flex-wrap: wrap; }
.grid > * { min-width: 0; }


/* Modo simulação (só no ambiente de teste) */
.sim-flag { margin: -10px 10px 14px; padding: 4px 8px; border-radius: 6px; background: var(--warn-weak); color: var(--warn); font-size: 11.5px; font-weight: 600; text-align: center; border: 1px dashed currentColor; }
.sim-card { border-style: dashed; }
.sim-tips { margin: 6px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.7; }
.sim-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sim-quick form { margin: 0; }
.sim-quick .btn.ghost { border: 1px solid var(--border); font-weight: 500; }

/* ---------- Conversas: lista + conversa na mesma tela, estilo WhatsApp (11/11/2026) ---------- */
:root { --chat-bg: #efeae2; --bubble-in: #ffffff; --bubble-out: #d9fdd3; --bubble-ia: #ece5ff; --bubble-auto: #f3f4f6; --tick-read: #34b7f1; }
:root[data-theme="dark"] { --chat-bg: #0b141a; --bubble-in: #202c33; --bubble-out: #005c4b; --bubble-ia: #2c2547; --bubble-auto: #1f2630; --tick-read: #53bdeb; }
.page-head.compact { margin-bottom: 12px; }
.filters.compact { margin-bottom: 12px; }
.filters.compact input[type="search"] { min-width: 260px; }
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100vh - 210px); min-height: 480px; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.inbox-list { border-right: 1px solid var(--border); overflow-y: auto; min-width: 0; }
.inbox-list .empty { padding: 24px; }
.inbox-row { display: flex; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--border); color: inherit; cursor: pointer; min-width: 0; }
.inbox-row:hover { background: var(--surface-3); text-decoration: none; }
.inbox-row.on { background: var(--accent-weak); }
.inbox-row.waiting .inbox-time { color: var(--warn); font-weight: 600; }
.avatar { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-weak); color: var(--accent-text); font-weight: 650; font-size: 14px; }
.avatar.group { background: var(--surface-3); color: var(--text-2); }
.inbox-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.inbox-top, .inbox-bottom { display: flex; align-items: center; gap: 6px; min-width: 0; }
.inbox-top b { flex: 1; font-weight: 600; }
.inbox-bottom .ellipsis { flex: 1; font-size: 13px; }
.inbox-time { font-size: 11.5px; color: var(--muted); flex: none; }
.inbox-num { font-size: 11.5px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.inbox-list .pager { padding: 10px; justify-content: center; }
.inbox > * { min-height: 0; }
.inbox-chat { min-width: 0; display: flex; flex-direction: column; background: var(--chat-bg); overflow: hidden; }
.chat-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--text-2); }
.chat { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
.chat-back { display: none; font-size: 20px; }
.chat-title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-title b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-title .muted { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chat-info { position: relative; }
.chat-info > summary { list-style: none; }
.chat-info > summary::-webkit-details-marker { display: none; }
.chat-info-panel { position: absolute; right: 0; top: 36px; z-index: 20; width: 360px; max-height: 70vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: 0 10px 30px rgba(15, 23, 42, .18); }
.chat .state-bar { border-radius: 0; margin: 0; padding: 8px 14px; font-size: 13px; }
.chat-body { flex: 1; overflow-y: auto; padding: 14px 6% 18px; display: flex; flex-direction: column; gap: 4px; min-height: 0; }
.day-sep { align-self: center; margin: 10px 0 6px; }
.day-sep span { background: var(--surface); color: var(--text-2); font-size: 11.5px; padding: 3px 10px; border-radius: 8px; box-shadow: var(--shadow); }
.chat-body .sysline { align-self: center; background: var(--surface); color: var(--muted); font-size: 11.5px; padding: 2px 10px; border-radius: 8px; margin: 4px 0; }
.chat-body .sysline.warn { color: var(--warn); } .chat-body .sysline.bad { color: var(--bad); }
.bubble { position: relative; max-width: min(75%, 560px); padding: 6px 9px 4px; border-radius: 8px; background: var(--bubble-in); color: var(--text); box-shadow: 0 1px .5px rgba(11, 20, 26, .13); word-break: break-word; margin-top: 2px; }
.bubble.in { align-self: flex-start; border-top-left-radius: 2px; }
.bubble.out { align-self: flex-end; background: var(--bubble-out); border-top-right-radius: 2px; }
.bubble.out.ia { background: var(--bubble-ia); }
.bubble.out.auto { background: var(--bubble-auto); color: var(--text-2); }
.bubble-who { font-size: 12px; font-weight: 600; color: var(--accent-text); margin-bottom: 2px; display: flex; align-items: center; gap: 6px; }
.bubble.out.ia .bubble-who { color: var(--ia); }
.bubble-who .badge { padding: 0 6px; font-size: 10.5px; }
.bubble-text { white-space: pre-wrap; font-size: 14px; line-height: 1.38; }
.bubble-media { font-size: 13px; color: var(--text-2); font-style: italic; }
.bubble-meta { font-size: 11px; color: var(--muted); text-align: right; margin-top: 2px; white-space: nowrap; }
.tick { letter-spacing: -3px; margin-left: 2px; }
.tick.lida { color: var(--tick-read); }
.tick.erro { color: var(--bad); letter-spacing: 0; }
.chat-composer { display: flex; gap: 8px; align-items: flex-end; padding: 10px 14px; background: var(--surface); border-top: 1px solid var(--border); }
.chat-composer textarea { flex: 1; min-height: 40px; max-height: 160px; resize: none; border-radius: 20px; padding: 9px 14px; }
.chat-composer .btn { height: 40px; border-radius: 20px; }
.chat-sim { margin: 0; border-radius: 0; border-top: 1px solid var(--border); padding: 8px 14px; background: var(--surface); }
.chat-sim > summary { cursor: pointer; font-weight: 600; font-size: 13px; }
@media (max-width: 900px) {
  .inbox { grid-template-columns: 1fr; height: calc(100vh - 170px); }
  .inbox.has-chat .inbox-list { display: none; }
  .inbox:not(.has-chat) .inbox-chat { display: none; }
  .chat-back { display: inline-flex; }
  .chat-info-panel { width: min(360px, 92vw); }
}

/* ---------- Agora: conversas em andamento ---------- */
.live-list { display: flex; flex-direction: column; }
.live-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--border); color: inherit; }
.live-row:last-child { border-bottom: 0; }
.live-row:hover { background: var(--surface-3); text-decoration: none; }
.live-row .txt { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-row .when { font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; }
.small { font-size: 12.5px; }

/* =====================================================================================================
   Identidade PANSUDO (dono, 11/11/2026: "3 Marca + escuro", docs/visual/3-marca.png e 2-comando.png)
   Claro = Marca: fundo quente, lateral marinho com os raios do site, laranja da marca, placar em Barlow Condensed.
   Escuro = Comando: preto azulado, bordas finas, o mesmo laranja com brilho. Fontes do site (OFL) em /static/fonts.
   ===================================================================================================== */
@font-face { font-family: "Geist"; src: url(../fonts/geist-400-800-normal-latin.woff2) format("woff2"); font-weight: 400 800; font-display: optional; }
@font-face { font-family: "Barlow Condensed"; src: url(../fonts/barlow-condensed-700-normal-latin.woff2) format("woff2"); font-weight: 700; font-display: optional; }
@font-face { font-family: "Barlow Condensed"; src: url(../fonts/barlow-condensed-700-italic-latin.woff2) format("woff2"); font-weight: 700; font-style: italic; font-display: optional; }
:root {
  --bg: #f6f4f1; --surface: #ffffff; --surface-2: #faf9f7; --surface-3: #f1eee9;
  --border: #e8e3db; --border-strong: #d9d2c7;
  --text: #151923; --text-2: #4a5266; --muted: #8a909e;
  --accent: #ff4015; --accent-hover: #e8340c; --accent-weak: #ffede7; --accent-text: #d2330f;
  --navy: #151923; --navy-2: #1f2533; --navy-3: #2a3142; --navy-text: #c5cbd8; --navy-muted: #7b8396;
  --ia: #5b3cc4; --ia-weak: #eee7ff;
  --good: #15803d; --good-weak: #e6f6ec; --warn: #b45309; --warn-weak: #fff3dc; --bad: #d2330f; --bad-weak: #ffece6;
  --kpi-bg: var(--navy); --kpi-text: #fff; --kpi-label: #9aa3b8; --kpi-good: #4ade80; --kpi-warn: #f5b04c; --kpi-bad: #ff6a45;
  --shadow: 0 1px 2px rgba(21, 25, 35, .05), 0 10px 28px -16px rgba(21, 25, 35, .18);
  --radius: 10px; --radius-lg: 16px;
  --font: "Geist", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --display: "Barlow Condensed", "Geist", "Arial Narrow", sans-serif;
}
:root[data-theme="dark"] {
  --bg: #08090d; --surface: #0f1218; --surface-2: #12151c; --surface-3: #181c25;
  --border: #1c202a; --border-strong: #2a303c;
  --text: #e8eaf0; --text-2: #a3aab8; --muted: #6f7787;
  --accent: #ff4015; --accent-hover: #ff5a33; --accent-weak: #2a140d; --accent-text: #ff8a6a;
  --navy: #0c0e13; --navy-2: #12151c; --navy-3: #1c212c; --navy-text: #a3aab8; --navy-muted: #596072;
  --ia: #b69cff; --ia-weak: #1e1838;
  --good: #4ade80; --good-weak: #0f2a1c; --warn: #f5b04c; --warn-weak: #2c2212; --bad: #ff6a45; --bad-weak: #2d1510;
  --kpi-bg: linear-gradient(180deg, #11141b, #0d1015);
  --shadow: none;
  --chat-bg: #0a0d12; --bubble-in: #181c25; --bubble-out: #12352c; --bubble-ia: #241d40;
}
body { font-family: var(--font); letter-spacing: -.005em; }
a { color: var(--accent-text); }
:focus-visible { outline-color: var(--accent); }
h1 { font: 700 34px/1.05 var(--display); text-transform: uppercase; letter-spacing: .01em; }
h2 { font: 700 19px/1.2 var(--display); text-transform: uppercase; letter-spacing: .03em; }
.page-head p { font-size: 13.5px; }

/* lateral: marinho com os raios do site no topo, nos dois temas */
.side { background: var(--navy); color: var(--navy-text); border-right: 1px solid var(--navy); padding-top: 16px; }
:root[data-theme="dark"] .side { border-right-color: var(--border); }
.brand { color: #fff; font: italic 700 25px/1 var(--display); letter-spacing: .02em; padding: 2px 8px 22px; text-transform: uppercase; }
.brand small { font: 600 11px var(--font); letter-spacing: .14em; color: var(--navy-muted); align-self: flex-end; margin-bottom: 2px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: #fff; color: var(--accent); font: italic 700 21px/1 var(--display); }
.side .nav-sec { color: var(--navy-muted); font-weight: 600; letter-spacing: .1em; }
.side .nav a { color: var(--navy-text); border-radius: 9px; padding: 8px 10px; }
.side .nav a:hover { background: var(--navy-2); color: #fff; }
.side .nav a.on { background: var(--accent); color: #fff; box-shadow: 0 6px 18px -8px rgba(255, 64, 21, .8); }
:root[data-theme="dark"] .side .nav a.on { background: var(--navy-3); box-shadow: inset 3px 0 0 var(--accent); }
.side .nav .count, .side .nav .count.blue { background: var(--accent); }
.side .nav a.on .count { background: #fff; color: var(--accent); }
.side .side-foot { border-top-color: var(--navy-3); }
.side .who b { color: #fff; } .side .who .muted { color: var(--navy-muted); }
.side .btn.ghost { color: var(--navy-text); } .side .btn.ghost:hover { background: var(--navy-2); color: #fff; }
.side .sim-flag { background: rgba(245, 176, 76, .12); color: #f5b04c; margin: -14px 8px 14px; }

/* cartões e indicadores (placar) */
.card { border-radius: var(--radius-lg); border-color: var(--border); box-shadow: var(--shadow); }
:root:not([data-theme="dark"]) .card { border-color: transparent; }
.kpis { gap: 14px; }
.kpi { position: relative; overflow: hidden; background: var(--kpi-bg); color: var(--kpi-text); border: 1px solid transparent; border-radius: var(--radius-lg); padding: 16px 18px 14px 22px; box-shadow: var(--shadow); }
:root[data-theme="dark"] .kpi { border-color: var(--border); }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--accent); }
:root[data-theme="dark"] .kpi::before { width: auto; right: 0; bottom: auto; height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 64, 21, .7), transparent); }
.kpi .lbl { color: var(--kpi-label); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.kpi .val { font: 700 44px/1 var(--display); letter-spacing: .01em; margin: 8px 0 6px; color: #fff; }
:root[data-theme="dark"] .kpi .val { color: var(--text); }
.kpi .sub { color: var(--kpi-label); }
.kpi.good .val { color: var(--kpi-good); } .kpi.warn .val { color: var(--kpi-warn); } .kpi.bad .val { color: var(--kpi-bad); }
.kpi .d.good { color: var(--kpi-good); } .kpi .d.bad { color: var(--kpi-bad); } .kpi .d.flat { color: var(--kpi-label); }
.kpi a { color: #ffb59f; }

/* botões, segmentado, abas, formulários */
.btn { border-radius: var(--radius); font-weight: 600; }
.btn.primary { box-shadow: 0 6px 16px -8px rgba(255, 64, 21, .9); }
.seg { background: var(--surface); border: 1px solid var(--border); border-radius: 11px; }
.seg a.on { background: var(--navy); color: #fff; }
:root[data-theme="dark"] .seg a.on { background: var(--navy-3); }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs .n { background: var(--accent-weak); color: var(--accent-text); }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px rgba(255, 64, 21, .16); }

/* tabelas */
.table th { background: transparent; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); border-bottom: 1px solid var(--border); }
.table tr.total td { background: var(--surface-3); }

/* selos */
.badge { font-weight: 700; }
.badge.blue { background: var(--surface-3); color: var(--text-2); }

/* gráficos */
.bars rect.b { fill: var(--accent); opacity: .9; }
.bars text { font-family: var(--font); }
.bars line { stroke: var(--border-strong); }
.hbar .t i { background: var(--accent); }
.mini rect.fg { fill: var(--accent); }

/* fila "Agora": tempo em placar */
.qrow { border-radius: 14px; border-color: var(--border); box-shadow: var(--shadow); }
:root:not([data-theme="dark"]) .qrow { border-color: transparent; }
.qrow .timer { font: 700 30px/1 var(--display); letter-spacing: .01em; }
.qrow.bad { box-shadow: 0 0 0 1px rgba(255, 64, 21, .35), 0 10px 26px -14px rgba(255, 64, 21, .7); }
.qrow.bad .timer { color: var(--accent); }

/* conversas */
.inbox { border-radius: var(--radius-lg); border-color: var(--border); box-shadow: var(--shadow); }
.inbox-row.on { background: var(--accent-weak); box-shadow: inset 3px 0 0 var(--accent); }
.avatar { background: var(--navy); color: #fff; font-weight: 700; }
:root[data-theme="dark"] .avatar { background: var(--navy-3); color: var(--text); }
.chat-head .avatar { background: var(--accent); color: #fff; }
.bubble-who { color: var(--accent-text); }
.chat-composer .btn.primary { padding: 0 18px; }

/* login com a marca */
.login { background: var(--navy); position: relative; overflow: hidden; }
.login::before { content: ""; position: absolute; left: -120px; top: -60px; width: 1700px; height: 900px; background: url(../img/raios.svg) 0 0 / 1700px auto no-repeat; opacity: .85; }
.login::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(21, 25, 35, .1) 0%, var(--navy) 62%); }
.login .card { position: relative; z-index: 1; border: 0; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); }
.login .brand { color: var(--text); padding: 0 0 18px; }
.login .brand small { color: var(--muted); }
.login .brand-mark { background: var(--accent); color: #fff; }
.table th a { color: inherit; }
.table th a:hover { color: var(--text); text-decoration: none; }
.table td:first-child { white-space: nowrap; }
.table td.num, .table td.mono, .table td.muted, .table td .dot + * { white-space: nowrap; }
.table td .muted { white-space: nowrap; }
.mono { font-family: var(--mono); }

/* ---------- ajustes de 11/11/2026 (pedido do dono + auditoria pelas Web Interface Guidelines) ---------- */
/* menu fixo ao rolar: overflow "hidden" no html/body cria um contêiner de rolagem e desliga o sticky; "clip" não */
html, body { overflow-x: clip; }
.side { position: sticky; top: 0; height: 100vh; padding: 0 12px 14px; }
/* topo do menu: um bloco próprio com a logo do site sobre o escuro e as faixas da marca à direita, separado do menu */
.side-head { position: relative; display: flex; align-items: flex-end; gap: 8px; margin: 0 -12px 12px; padding: 22px 18px 16px; min-height: 92px;
  background: var(--navy); border-bottom: 1px solid var(--navy-3); overflow: hidden; color: #fff; text-decoration: none; }
.side-head::before { content: ""; position: absolute; top: -18px; right: -70px; width: 230px; height: 130px; background: url(../img/raios.svg) 0 0 / 230px auto no-repeat; opacity: .95; }
.side-head::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--navy) 38%, rgba(21, 25, 35, .55) 70%, rgba(21, 25, 35, .15)); }
:root[data-theme="dark"] .side-head::after { background: linear-gradient(90deg, var(--navy) 38%, rgba(12, 14, 19, .55) 70%, rgba(12, 14, 19, .15)); }
.side-head:hover { text-decoration: none; }
.side-head img { position: relative; z-index: 1; height: 30px; width: auto; display: block; }
.side-head span { position: relative; z-index: 1; font: 700 11px var(--font); letter-spacing: .16em; color: var(--navy-text); padding-bottom: 3px; }
.side .sim-flag { margin: 0 4px 12px; }
/* conversas: a conversa ocupa a tela toda (sem limite de largura, cabeçalho mais baixo) */
body[data-inbox] .main { max-width: none; padding-top: 16px; padding-bottom: 16px; height: 100vh; display: flex; flex-direction: column; }
body[data-inbox] .main > .inbox { flex: 1; height: auto; min-height: 420px; }
body[data-inbox] .page-head { margin-bottom: 10px; }
body[data-inbox] .page-head h1 { font-size: 28px; }
body[data-inbox] .filters.compact { margin-bottom: 10px; }
.inbox { height: calc(100vh - 160px); min-height: 520px; grid-template-columns: 360px minmax(0, 1fr); }
.chat-body { padding: 16px 3% 20px; }
.bubble { max-width: min(72%, 680px); }
/* login: a logo do site em cima do cartão */
.login { align-content: center; gap: 22px; }
.login-logo { position: relative; z-index: 1; height: 46px; width: auto; justify-self: center; }
/* acessibilidade */
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 8px; text-decoration: none; }
.main:focus { outline: none; }
.btn:focus-visible, .seg a:focus-visible, .nav a:focus-visible, .inbox-row:focus-visible, .qrow:focus-visible, .live-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid transparent; }
.btn:active { transform: translateY(1px); }
select { color-scheme: inherit; }
:root[data-theme="dark"] select option { background: var(--surface); color: var(--text); }
/* tabelas largas: títulos podem quebrar em duas linhas em vez de criar rolagem lateral */
.table th { white-space: normal; line-height: 1.25; vertical-align: bottom; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
/* troca de tela sem piscar: transição entre páginas do próprio CRM, com o menu parado (Chrome/Edge 126+) */
@view-transition { navigation: auto; }
.side { view-transition-name: menu; }
::view-transition-group(menu), ::view-transition-old(menu), ::view-transition-new(menu) { animation: none; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .12s; }

/* ---------- barras de rolagem no visual da marca (11/11/2026) ----------
   O menu mexia ao passar o mouse: a barra só existia no :hover (scrollbar-width none → thin) e roubava largura.
   Agora o espaço dela é reservado sempre (scrollbar-gutter: stable) e no hover só a COR muda, nunca a largura.
   Cores: no menu marinho, um laranja translúcido da marca; no conteúdo, o tom das bordas, que vira laranja ao passar. */
:root { --scroll-thumb: #d3cbbf; --scroll-thumb-hover: #ff4015; --scroll-track: transparent; --scroll-side: rgba(255, 64, 21, .5); --scroll-side-hover: rgba(255, 64, 21, .85); }
:root[data-theme="dark"] { --scroll-thumb: #2a303c; --scroll-thumb-hover: #ff4015; --scroll-side: rgba(255, 64, 21, .45); --scroll-side-hover: rgba(255, 64, 21, .8); }
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) var(--scroll-track); }
html { scrollbar-gutter: stable; scrollbar-color: var(--scroll-thumb) var(--bg); }
.side, .side:hover { scrollbar-width: thin; scrollbar-gutter: stable; scrollbar-color: transparent transparent; }
.side:hover, .side:focus-within { scrollbar-color: var(--scroll-side) transparent; }
.inbox-list:hover, .chat-body:hover, .chat-info-panel:hover, .card:hover { scrollbar-color: var(--scroll-thumb-hover) var(--scroll-track); }
/* navegadores que ainda usam ::-webkit-scrollbar (Safari): mesma ideia, largura fixa e só a cor muda */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background-color: var(--scroll-thumb); border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--scroll-thumb-hover); }
.side::-webkit-scrollbar { width: 6px; }
.side::-webkit-scrollbar-thumb { background-color: transparent; }
.side:hover::-webkit-scrollbar-thumb { background-color: var(--scroll-side); }
