:root {
  color-scheme: light;
  --brand: #ff5c00;
  --brand-600: #eb5500;
  --brand-50: #fff1e8;
  --brand-100: #ffe0cc;
  --brand-200: #ffc299;
  --bg: #f2f2f2;
  --surface: #ffffff;
  --surface-2: #f7f7f7;
  --line: #ececec;
  --text: #1a1c1e;
  --text-2: #6b7280;
  --muted: #9ca3af;
  --dark-card: #111827;
  --dark-card-text: #ffffff;
  --ok: #16a34a;     --ok-bg: #e8f7ee;
  --warn: #b45309;   --warn-bg: #fdf3e1;  --warn-fill: #f59e0b;
  --late: #ea580c;   --late-bg: #fff0e6;
  --crit: #dc2626;   --crit-bg: #fdecec;
  --info: #2563eb;   --info-bg: #eaf1fe;
  --violet: #7c3aed; --violet-bg: #f1ebfe;
  --s-cliente: #eb6834;   /* séries (paleta validada: laranja, azul, aqua) */
  --s-atendente: #2a78d6;
  --s-automacao: #1baf7a;
  --grid: #eeeeee;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .04);
  --radius: 16px;
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --brand-50: #2a1a10; --brand-100: #3d2413; --brand-200: #6b3a17;
    --bg: #0f1113; --surface: #181b1f; --surface-2: #1f2328; --line: #2a2f35;
    --text: #f3f4f6; --text-2: #b4bac3; --muted: #8b929c;
    --dark-card: #000000;
    --ok: #4ade80; --ok-bg: #12301f; --warn: #fbbf24; --warn-bg: #33270d; --warn-fill: #f59e0b;
    --late: #fb923c; --late-bg: #3a2210; --crit: #f87171; --crit-bg: #3a1515;
    --info: #60a5fa; --info-bg: #142640; --violet: #a78bfa; --violet-bg: #251a40;
    --s-cliente: #d95926; --s-atendente: #3987e5; --s-automacao: #199e70;
    --grid: #262a30;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand-50: #2a1a10; --brand-100: #3d2413; --brand-200: #6b3a17;
  --bg: #0f1113; --surface: #181b1f; --surface-2: #1f2328; --line: #2a2f35;
  --text: #f3f4f6; --text-2: #b4bac3; --muted: #8b929c;
  --dark-card: #000000;
  --ok: #4ade80; --ok-bg: #12301f; --warn: #fbbf24; --warn-bg: #33270d; --warn-fill: #f59e0b;
  --late: #fb923c; --late-bg: #3a2210; --crit: #f87171; --crit-bg: #3a1515;
  --info: #60a5fa; --info-bg: #142640; --violet: #a78bfa; --violet-bg: #251a40;
  --s-cliente: #d95926; --s-atendente: #3987e5; --s-automacao: #199e70;
  --grid: #262a30;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, select, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }

/* ---------- topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px clamp(16px, 3vw, 40px); background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(255, 92, 0, .35); }
.brand-name { font-weight: 800; font-size: 17px; }
.crumb-sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
.crumb-home, .crumb-chev { color: var(--muted); }
.crumb-current { color: var(--brand); font-weight: 600; font-size: 13px; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.sync { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
  font-size: 12px; color: var(--text-2); white-space: nowrap; }
.sync .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.sync.run .dot { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); animation: pulse 1s infinite alternate; }
.sync.err .dot { background: var(--crit); box-shadow: 0 0 0 3px var(--crit-bg); }
@keyframes pulse { to { opacity: .35; } }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--text-2); }
.icon-btn:hover { color: var(--text); border-color: var(--muted); }

/* ---------- page ---------- */
.page { padding: 24px clamp(16px, 3vw, 40px) 48px; max-width: 1680px; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.title-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
h1 { font-size: 28px; font-weight: 800; }

.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; cursor: pointer; font-weight: 600;
  font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; gap: 8px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--brand); color: #fff; box-shadow: 0 2px 6px rgba(255, 92, 0, .3); }
.seg button b { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-weight: 700; }
.seg button.on b { background: rgba(255, 255, 255, .25); color: #fff; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.select { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 0 4px 0 12px; height: 38px; font-size: 13px; }
.select span { color: var(--muted); font-size: 12px; }
.select select { border: 0; background: transparent; font-weight: 600; height: 100%; cursor: pointer; max-width: 180px; outline: none; }
.multi { position: relative; }
.multi summary { list-style: none; display: flex; align-items: center; gap: 6px; height: 100%; cursor: pointer; padding-right: 8px; }
.multi summary::-webkit-details-marker { display: none; }
.multi summary b { font-weight: 600; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi summary::after { content: "▾"; color: var(--muted); font-size: 11px; }
.multi-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: 280px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.14); padding: 8px; }
.multi-pop input[type=search] { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px;
  background: var(--surface-2); color: inherit; font: inherit; margin-bottom: 6px; }
.multi-lista { max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; }
.multi-lista label { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.multi-lista label:hover { background: var(--surface-2); }
.multi-lista .multi-sem { font-style: italic; border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; margin-bottom: 2px; }
.multi-lista input { accent-color: var(--brand); }
.multi-acoes { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.multi-acoes button { background: none; border: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; padding: 4px 8px; }
.cobertura { font-size: 12px; font-weight: 600; color: var(--warn); background: var(--warn-bg); border-radius: 10px; padding: 0 12px;
  height: 38px; display: inline-flex; align-items: center; }
.check { display: flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; height: 38px; }
.check input { accent-color: var(--brand); }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { position: relative; background: var(--surface); border-radius: var(--radius); padding: 16px 18px 16px 22px;
  box-shadow: var(--shadow); display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; min-height: 96px; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.kpi .lbl { font-size: 12px; color: var(--text-2); font-weight: 500; }
.kpi .val { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin-top: 6px; line-height: 1; }
.kpi .val small { font-size: 14px; font-weight: 600; color: var(--text-2); margin-left: 3px; letter-spacing: 0; }
.kpi .hint { font-size: 11px; color: var(--muted); margin-top: 6px; }
.kpi .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; font-size: 15px; }
.kpi.dark { background: var(--dark-card); color: var(--dark-card-text); }
.kpi.dark::before { display: none; }
.kpi.dark::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ff5c00, #3a1d0b); opacity: .55; }
.kpi.dark .lbl { color: #cbd5e1; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 700; }
.kpi.dark .hint { color: #94a3b8; }
.kpi.dark .ico { background: var(--brand); color: #fff; position: relative; z-index: 1; }
.tone-orange { background: var(--brand-50); color: var(--brand); }
.tone-blue { background: var(--info-bg); color: var(--info); }
.tone-yellow { background: var(--warn-bg); color: var(--warn); }
.tone-green { background: var(--ok-bg); color: var(--ok); }
.tone-red { background: var(--crit-bg); color: var(--crit); }
.tone-violet { background: var(--violet-bg); color: var(--violet); }

/* ---------- board ---------- */
.board-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 0 12px; height: 38px; color: var(--muted); min-width: min(320px, 100%); }
.search input { border: 0; outline: none; background: transparent; flex: 1; color: var(--text); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 14px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 12.5px;
  font-weight: 600; color: var(--text-2); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chip b { font-size: 11px; color: var(--muted); }
.chip.on { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.chip.on b { color: var(--brand); }
.board { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(150px, 1fr)); gap: 12px; overflow-x: auto;
  padding-bottom: 8px; align-items: start; }
.col-head { display: flex; align-items: center; justify-content: space-between; margin: 2px 4px 10px; }
.col-head h4 { margin: 0; font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.col-head .count { font-size: 11px; font-weight: 700; color: var(--text-2); background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 8px; }
.col-head .desc { font-size: 11px; color: var(--muted); }
.col-body { display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 340px); min-height: 120px; overflow-y: auto;
  padding: 2px 2px 8px; }
.empty { border: 1.5px dashed var(--line); border-radius: 14px; padding: 22px; text-align: center; color: var(--muted); font-size: 13px; }

.tcard { background: var(--surface); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); cursor: pointer; text-align: left;
  border: 1px solid transparent; transition: border-color .15s, transform .15s; display: block; width: 100%; }
.tcard:hover { border-color: var(--brand-200); transform: translateY(-1px); }
.tcard .abrir { color: var(--muted); text-decoration: none; display: inline-grid; place-items: center; width: 22px; height: 22px;
  border-radius: 6px; }
.tcard .abrir:hover { color: var(--brand); background: var(--brand-50); }
.btn-clint { display: inline-flex; align-items: center; gap: 6px; background: var(--brand); color: #fff; text-decoration: none;
  font-weight: 700; font-size: 13px; padding: 8px 14px; border-radius: 10px; box-shadow: 0 2px 6px rgba(255, 92, 0, .3); }
.btn-clint:hover { background: var(--brand-600); }
.drawer-actions { display: flex; gap: 8px; align-items: center; }
.tcard.jan-3h { border-color: var(--crit); box-shadow: inset 4px 0 0 var(--crit), var(--shadow); }
.tcard.jan-1h { border-color: var(--crit); background: var(--crit-bg); box-shadow: inset 4px 0 0 var(--crit), 0 0 0 3px rgba(220, 38, 38, .18), var(--shadow); }
.tone-dark { background: var(--text); color: var(--surface); }
.badge.pulsa { animation: pulsa 1.4s ease-in-out infinite; }
@keyframes pulsa { 50% { box-shadow: 0 0 0 4px rgba(220, 38, 38, .25); } }
@media (prefers-reduced-motion: reduce) { .badge.pulsa { animation: none; } }
.aviso-janela { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 0 0 12px;
  padding: 10px 14px; border-radius: 12px; background: var(--crit-bg); color: var(--crit); font-size: 13px; font-weight: 600;
  border: 1px solid var(--crit); }
.aviso-janela button { background: var(--crit); color: #fff; border: 0; border-radius: 8px; padding: 6px 12px; font: inherit;
  font-weight: 700; cursor: pointer; }
.aviso-janela.on button { background: var(--surface); color: var(--crit); }
.tcard:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.tcard .row1 { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.badges { display: flex; flex-wrap: wrap; gap: 5px; }
.badge { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px;
  display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.tcard h5 { margin: 10px 0 4px; font-size: 14px; font-weight: 700; line-height: 1.3; }
.tcard .msg { margin: 0; font-size: 12.5px; color: var(--text-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.tcard .bar { height: 4px; border-radius: 4px; background: var(--surface-2); margin-top: 12px; overflow: hidden; }
.tcard .bar i { display: block; height: 100%; border-radius: 4px; background: var(--brand); }
.tcard .foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.who { display: flex; align-items: center; gap: 6px; min-width: 0; }
.who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 9.5px; font-weight: 800;
  color: #fff; flex: none; }
.avatar.none { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--muted); }
.time { white-space: nowrap; font-weight: 600; }
.phone { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- cards / charts ---------- */
.card { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card h3 { font-size: 16px; font-weight: 700; }
.sub { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr)); gap: 16px; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 + .card, .grid-2 + .grid-2 { margin-top: 16px; }
.chart { position: relative; width: 100%; overflow-x: auto; }
.chart svg { display: block; }
.chart text { font-family: var(--font); fill: var(--muted); font-size: 11px; }
.chart .val-label { fill: var(--text); font-weight: 700; font-size: 11px; }
.chip-meta { font-size: 11px; font-weight: 700; color: var(--brand); background: var(--brand-50); border-radius: 999px; padding: 4px 10px;
  display: inline-flex; gap: 6px; align-items: center; }
.chip-meta::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.table-wrap { overflow-x: auto; }
table.rank { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 760px; }
.rank th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700;
  padding: 0 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rank td.num { white-space: nowrap; }
.rank td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-variant-numeric: tabular-nums; }
.rank tr:last-child td { border-bottom: 0; }
.rank .num { text-align: right; }
.rank .name { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.meter { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.meter .track { flex: 1; height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.meter .track i { display: block; height: 100%; border-radius: 6px; background: var(--brand); }
.meter b { width: 38px; text-align: right; font-size: 12px; }
.pill-num { font-weight: 700; padding: 2px 8px; border-radius: 999px; font-size: 12px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); align-items: center; }
.list li:last-child { border-bottom: 0; }
.list li.click { cursor: pointer; border-radius: 8px; }
.list li.click:hover { background: var(--surface-2); }
.list .l1 { font-weight: 700; font-size: 13px; }
.list .l2 { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.list .r { text-align: right; white-space: nowrap; font-size: 12px; color: var(--text-2); }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(17, 24, 39, .35); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(920px, 100%); background: var(--surface); z-index: 41;
  display: flex; flex-direction: column; box-shadow: -12px 0 40px rgba(0, 0, 0, .12); animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 20px; font-weight: 800; margin-top: 6px; }
.eyebrow { display: flex; gap: 6px; flex-wrap: wrap; }
.drawer-body { flex: 1; display: grid; grid-template-columns: 1fr 280px; min-height: 0; }
.dw-main { display: flex; flex-direction: column; min-height: 0; background: var(--surface-2); }
.tabs { display: flex; gap: 18px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.tabs button { border: 0; background: none; padding: 12px 0; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.dw-scroll { flex: 1; overflow-y: auto; padding: 18px 24px; }
.dw-side { margin: 0; padding: 20px; overflow-y: auto; border-left: 1px solid var(--line); }
.dw-side dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-top: 16px; }
.dw-side dt:first-child { margin-top: 0; }
.dw-side dd { margin: 5px 0 0; font-weight: 600; font-size: 13px; word-break: break-word; }
.dw-side .copy { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 4px 10px; font-size: 12px;
  cursor: pointer; margin-top: 6px; font-weight: 600; }
.dw-side .copy:hover { border-color: var(--brand); color: var(--brand); }
.day-sep { text-align: center; font-size: 11px; color: var(--muted); margin: 14px 0 8px; font-weight: 600; }
.bubble { max-width: 78%; margin: 6px 0; padding: 9px 12px 7px; border-radius: 14px; font-size: 13px; line-height: 1.45;
  white-space: pre-wrap; word-break: break-word; box-shadow: var(--shadow); }
.bubble.cli { background: var(--surface); border-bottom-left-radius: 4px; }
.bubble.us { margin-left: auto; background: var(--brand-50); border-bottom-right-radius: 4px; }
.bubble.auto { margin-left: auto; background: var(--surface); border: 1px dashed var(--line); border-bottom-right-radius: 4px; }
.bubble.ev { max-width: 100%; margin: 6px auto; text-align: center; background: none; box-shadow: none; color: var(--muted); font-size: 11.5px; padding: 2px; }
.bubble.note { margin-left: auto; background: var(--warn-bg); }
.bubble .meta { display: flex; gap: 8px; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.bubble .meta b { font-weight: 700; color: var(--text-2); }
.bubble.ignored { opacity: .6; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; align-items: center; }
.tl .when { color: var(--muted); font-size: 12px; width: 110px; flex: none; font-variant-numeric: tabular-nums; }

.tooltip { position: fixed; z-index: 60; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px; font-size: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); min-width: 110px; }
.tooltip .t-h { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin-bottom: 4px; }
.tooltip .t-v { font-size: 15px; font-weight: 800; }
.tooltip .t-r { display: flex; justify-content: space-between; gap: 14px; }
.tooltip .t-r i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 6px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--dark-card); color: #fff; padding: 10px 16px;
  border-radius: 10px; font-size: 13px; z-index: 70; }

@media (max-width: 1280px) {
  .col-head .desc { display: none; }
  .tcard { padding: 12px; }
}
@media (max-width: 760px) {
  h1 { font-size: 22px; }
  .drawer-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .dw-side { order: -1; border-left: 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; max-height: 38vh; }
  .dw-side dt { margin-top: 10px; }
  .board { grid-template-columns: repeat(var(--cols, 4), 84vw); }
  .col-body { max-height: none; }
  .crumb-sep, .crumb-home, .crumb-chev, .crumb-current { display: none; }
}

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-wrap { width: min(920px, 100%); display: grid; grid-template-columns: 1fr 1fr; background: var(--surface);
  border-radius: 24px; box-shadow: 0 20px 60px rgba(16, 24, 40, .08); overflow: hidden; }
.login-card { padding: clamp(28px, 5vw, 56px); display: flex; flex-direction: column; gap: 6px; }
.login-card .brand { margin-bottom: 28px; }
.login-card h1 { font-size: 28px; font-weight: 800; }
.login-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.field input, .field select { height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; font-size: 14px;
  background: var(--surface); color: var(--text); outline: none; font-weight: 500; }
.field input:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.btn-primary { height: 44px; border: 0; border-radius: 12px; background: var(--brand); color: #fff; font-weight: 700; font-size: 14px;
  cursor: pointer; box-shadow: 0 4px 12px rgba(255, 92, 0, .3); padding: 0 18px; }
.btn-primary:hover { background: var(--brand-600); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-ghost { height: 34px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-weight: 600;
  font-size: 12.5px; padding: 0 12px; cursor: pointer; color: var(--text-2); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.erro { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--crit-bg); color: var(--crit); font-size: 13px; font-weight: 600; }
.login-side { background: linear-gradient(160deg, var(--brand) 0%, #ff8a3d 100%); color: #fff; padding: 48px 40px;
  display: flex; flex-direction: column; justify-content: center; gap: 14px; position: relative; overflow: hidden; }
.login-side::after { content: ""; position: absolute; width: 280px; height: 280px; border-radius: 50%; right: -90px; top: -90px;
  background: rgba(255, 255, 255, .12); }
.side-kpi { background: rgba(255, 255, 255, .95); color: #1a1c1e; border-radius: 16px; padding: 16px 18px; display: flex;
  flex-direction: column; gap: 6px; max-width: 260px; position: relative; z-index: 1; }
.side-kpi span { font-size: 12px; color: #6b7280; font-weight: 600; }
.side-kpi b { font-size: 28px; font-weight: 800; }
.side-kpi small { font-size: 14px; color: #9ca3af; }
.side-kpi.dark { background: #111827; color: #fff; margin-left: 40px; }
.side-kpi.dark span { color: #cbd5e1; letter-spacing: .08em; font-size: 11px; }
.login-side p { font-size: 15px; line-height: 1.5; font-weight: 500; max-width: 320px; margin: 10px 0 0; position: relative; z-index: 1; }
@media (max-width: 760px) { .login-wrap { grid-template-columns: 1fr; } .login-side { display: none; } }

/* ---------- menu do usuário ---------- */
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 4px 12px 4px 4px; cursor: pointer; font-weight: 600; font-size: 13px; }
.user-btn .avatar { width: 26px; height: 26px; font-size: 10px; }
.user-drop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .12); min-width: 190px; padding: 6px; z-index: 30; }
.user-drop button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 8px;
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-2); }
.user-drop button:hover { background: var(--surface-2); color: var(--text); }
.user-drop .who-am-i { padding: 8px 10px; font-size: 11.5px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; }

/* ---------- acessos ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.form-grid .check { height: 44px; }
.tag-admin { font-size: 10px; font-weight: 800; letter-spacing: .05em; padding: 2px 7px; border-radius: 6px; background: var(--brand-50); color: var(--brand); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.inline-senha { display: flex; gap: 6px; align-items: center; }
.inline-senha input { height: 34px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: var(--surface); color: var(--text); width: 150px; }
.ok-msg { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--ok-bg); color: var(--ok); font-size: 13px; font-weight: 600; }
dialog.modal { border: 0; border-radius: 18px; padding: 24px; width: min(420px, calc(100% - 32px)); background: var(--surface); color: var(--text);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .2); }
dialog.modal::backdrop { background: rgba(17, 24, 39, .4); }
dialog.modal form { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }

/* ---------- usuários ---------- */
.users-toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.user-list { display: flex; flex-direction: column; }
.user-row { display: grid; grid-template-columns: minmax(200px, 2fr) .8fr 1.4fr .8fr 1fr 190px; gap: 12px; align-items: center;
  padding: 14px 6px; border-bottom: 1px solid var(--line); }
.user-row:last-child { border-bottom: 0; }
.user-row.off { opacity: .55; }
.user-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.user-id .avatar { width: 38px; height: 38px; font-size: 13px; }
.user-id b { display: block; font-size: 14px; }
.user-id small { color: var(--muted); font-size: 12px; }
.user-meta { font-size: 12.5px; color: var(--text-2); }
.user-meta small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin-bottom: 3px; }
.voce { font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 6px; background: var(--info-bg); color: var(--info); margin-left: 6px; }
@media (max-width: 860px) {
  .user-row { grid-template-columns: 1fr auto; }
  .user-row .user-meta { display: none; }
}
.modal-lg { width: min(520px, calc(100% - 32px)); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal-head h3 { font-size: 20px; font-weight: 800; margin-top: 4px; }
.hint { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.input-prefix { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.input-prefix:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.input-prefix b { padding-left: 14px; color: var(--muted); }
.input-prefix input { border: 0 !important; box-shadow: none !important; flex: 1; padding-left: 4px !important; }
.input-pass { display: flex; gap: 6px; }
.input-pass input { flex: 1; min-width: 0; }
.input-pass .btn-ghost { height: 44px; white-space: nowrap; }
.strength { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 2px; }
.strength i { display: block; height: 100%; width: 0; border-radius: 4px; transition: width .2s, background .2s; }
.perfil-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.perfil { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; }
.perfil:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.perfil input { accent-color: var(--brand); margin-top: 3px; }
.perfil b { display: block; font-size: 13px; color: var(--text); }
.perfil small { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.sucesso-ico { width: 52px; height: 52px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center;
  font-size: 24px; font-weight: 800; margin: 8px auto 12px; }
.credenciais { background: var(--surface-2); border: 1px dashed var(--line); border-radius: 12px; padding: 14px 16px; font-size: 13px;
  line-height: 1.7; white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); margin: 14px 0; }
.menu-acoes { position: relative; }
.menu-acoes .user-drop { min-width: 180px; }
.modal-actions .btn-ghost { height: 44px; padding: 0 16px; }

/* ---------------- avaliação de atendimento ---------------- */
.tone-gray { background: var(--surface-2); color: var(--text-2); }
.aviso-ia { background: var(--brand-50); border: 1px dashed var(--brand); border-radius: 12px; padding: 12px 16px; font-size: 13px; margin-bottom: 16px; line-height: 1.5; }
.aviso-ia b { color: var(--brand); }
.aviso-ia code { font-size: 12px; background: var(--surface); padding: 1px 6px; border-radius: 5px; }
.funil { display: grid; gap: 10px; }
.funil-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 96px; gap: 12px; align-items: center; font-size: 13px; }
.funil-track { background: var(--surface-2); border-radius: 8px; height: 28px; position: relative; overflow: hidden; }
.funil-fill { position: absolute; inset: 0 auto 0 0; background: var(--brand); border-radius: 8px; display: flex; align-items: center;
  padding-left: 10px; color: #fff; font-weight: 700; font-size: 12px; }
.funil-t { text-align: right; color: var(--text-2); font-size: 12px; }
.funil-t b { color: var(--text); display: block; font-size: 13px; }
.chip .dot-c { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 2px; }
.deals td { white-space: nowrap; }
.deals td.motivo { white-space: normal; min-width: 200px; color: var(--text-2); font-size: 12.5px; }
.deals .deal-row { cursor: pointer; }
.deals .deal-row:hover td { background: var(--surface-2); }
.deals .deal-row.open td { background: var(--brand-50); border-bottom-color: transparent; }
.deals .deal-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.deals td.chev { color: var(--muted); font-size: 12px; text-align: right; }
.deals .deal-row.open td.chev { color: var(--brand); }
.deals .deal-exp > td { white-space: normal; padding: 0 12px 18px; background: var(--brand-50); }
.exp-in { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; }
.exp-in .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 0 0 8px; }
.exp-acoes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.av-chat { background: var(--surface-2); border-radius: 12px; padding: 14px; display: grid; gap: 8px; max-height: 520px; overflow-y: auto; align-content: start; }
.av-chat .msg { max-width: 85%; border-radius: 12px; padding: 8px 11px; font-size: 13px; line-height: 1.45; display: grid; gap: 3px; white-space: pre-wrap; overflow-wrap: anywhere; }
.av-chat .msg small { font-size: 10.5px; font-weight: 700; color: var(--muted); display: flex; gap: 10px; justify-content: space-between; white-space: normal; }
.av-chat .msg.cli { background: var(--surface); border: 1px solid var(--line); justify-self: start; border-bottom-left-radius: 4px; }
.av-chat .msg.hum { background: var(--info-bg); justify-self: end; border-bottom-right-radius: 4px; }
.av-chat .msg.aut { background: var(--ok-bg); justify-self: end; border-bottom-right-radius: 4px; }
.av-chat .msg.flag { outline: 2px solid var(--crit); outline-offset: 1px; }
.av-chat .sysline { justify-self: center; font-size: 11.5px; color: var(--text-2); background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 10px; text-align: center; }
.rec { display: grid; gap: 16px; align-content: start; min-width: 0; }
.verdict { display: flex; gap: 12px; align-items: center; }
.verdict p { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.verdict p b { color: var(--text); }
.ring { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 19px; flex: none; }
.tempos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tempos div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; display: grid; gap: 2px; }
.tempos small { font-size: 11px; color: var(--muted); font-weight: 600; }
.tempos b { font-size: 14px; font-variant-numeric: tabular-nums; }
.crit { display: grid; gap: 8px; }
.crit > div { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: start; font-size: 13px; }
.crit .ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.crit p { margin: 2px 0 0; color: var(--text-2); font-size: 12px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bubble { border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble small { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; white-space: normal; }
.bubble.real { background: var(--surface-2); border: 1px solid var(--line); }
.bubble.real small { color: var(--text-2); }
.bubble.ideal { background: var(--ok-bg); border: 1px solid var(--ok); }
.bubble.ideal small { color: var(--ok); }
.bubble .copiar-rec { display: block; margin-top: 8px; font-size: 12px; }
@media (max-width: 900px) {
  .exp-in, .compare { grid-template-columns: 1fr; }
  .tempos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .funil-row { grid-template-columns: 96px minmax(0, 1fr) 76px; }
}
.deals .lead-cel { display: flex; align-items: center; gap: 6px; max-width: 190px; }
.deals .lead-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.deals th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.deals th.sortable:hover, .deals th.sortable.on { color: var(--brand); }
.deals th.sortable:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.chip-alerta { border-color: var(--crit); color: var(--crit); }
.chip-alerta b { color: var(--crit); }
.chip-alerta.on { background: var(--crit-bg); border-color: var(--crit); color: var(--crit); }
.deals td.origem-cel { max-width: 150px; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); font-size: 12.5px; }
.deals .lig { font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.deals .lig-op { color: var(--info); font-weight: 700; }
.av-chat .sysline.call { border-color: var(--info); color: var(--info); }
.av-chat .sysline.call.missed { border-color: var(--crit); color: var(--crit); background: var(--crit-bg); }
.tempos { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.aviso-lig { margin: 0 0 12px; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.aviso-lig b { color: var(--text); }
.aviso-lig.vazio { background: var(--info-bg); border: 1px solid var(--info); border-radius: 10px; padding: 10px 14px; }
.aviso-lig.vazio b { color: var(--info); }

/* ---------- Atendimento VIP ---------- */
#vip-motivos { display: grid; gap: 10px; }
.motivo-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 130px; gap: 12px; align-items: center; font-size: 13px; }
.motivo-row .funil-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.funil-fill.tom-claro { background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand); }
.vip-pontos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 18px; padding: 6px 4px; }
ul.pontos { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; line-height: 1.45; }
ul.pontos small { color: var(--muted); }
.tone-txt-green li::marker { color: var(--ok); }
.tone-txt-yellow li::marker { color: var(--warn); }
.tone-txt-red li::marker { color: var(--crit); }
.tone-txt-blue li::marker { color: var(--info); }
.var-pct { font-size: 11px; font-weight: 700; }
.var-pct.up { color: var(--crit); }
.var-pct.down { color: var(--info); }
.msg .citada { display: block; font-size: 11px; color: var(--muted); border-left: 2px solid var(--line); padding-left: 6px; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.motivos-mini { display: flex; flex-wrap: wrap; gap: 6px; }
.motivos-mini span { background: var(--surface-2); border-radius: 999px; padding: 4px 10px; font-size: 12px; }
#tabela-vip-pend .origem-cel { max-width: 220px; }
#tabela-vip-pend .motivo { max-width: 420px; }
#busca-vip { min-width: 200px; }
@media (max-width: 720px) {
  .motivo-row { grid-template-columns: 110px minmax(0, 1fr) 96px; }
}
#tabela-vip-pend tr.atrasada td:first-child { box-shadow: inset 3px 0 0 var(--crit); }
details.diag-card > summary { cursor: pointer; list-style: none; display: flex; flex-direction: column; gap: 2px; }
details.diag-card > summary::-webkit-details-marker { display: none; }
details.diag-card > summary h3 { margin: 0; }
details.diag-card > summary h3::before { content: "▸ "; color: var(--muted); }
details.diag-card[open] > summary h3::before { content: "▾ "; }
details.diag-card[open] > summary { margin-bottom: 14px; }
ol.regra { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 6px; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.av-chat .msg.fora { opacity: .55; }
.av-chat .sysline.periodo { color: var(--brand); font-weight: 600; }
.areas-opts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 4px; }

/* ---------- Suporte ---------- */
.exp-in:has(> .sup-exp) { display: block; }
.sup-exp { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 860px) { .sup-exp { grid-template-columns: 1fr; } }
.av-chat .msg.nota { background: var(--warn-bg); border: 1px dashed var(--warn); justify-self: end; }
.av-chat .msg a { color: var(--brand); font-weight: 600; }

/* Suporte · regras do Gabriel IA */
.sup-abas { margin-bottom: 16px; }
.regras-barra { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.rg-hist { margin-top: 10px; font-size: 13px; }
.rg-hist summary { cursor: pointer; color: var(--text-2); font-weight: 600; }
.rg-id { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.rg-tab > tbody > tr > td { vertical-align: top; }
.rg-tab > tbody > tr > td:first-child { width: 38%; min-width: 220px; }
.rg-tab > tbody > tr > td:nth-child(2) { min-width: 240px; }
.rg-tab > tbody > tr > td:last-child { width: 1%; }
.rg-tab > tbody > tr.rg-mudou > td { background: var(--brand-50); }
.rg-desc { margin: 4px 0 0; }
.rg-origem { display: block; margin-top: 4px; font-family: ui-monospace, Menlo, monospace; font-size: 11px; word-break: break-all; }
.rg-conflito { margin: 6px 0 0; padding: 6px 10px; border-radius: 8px; background: var(--crit-bg); color: var(--crit); font-size: 12.5px; }
.rg-lim { display: block; margin-top: 4px; }
.rg-texto { white-space: pre-wrap; max-width: 60ch; }
.rg-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.rg-chips > * { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.rg-chips > a:hover { border-color: var(--brand); color: var(--brand); }
.rank .rg-kv, .rg-kv { width: auto; min-width: 0; border-collapse: collapse; font-size: 12.5px; }
.rank .rg-kv th, .rank .rg-kv td, .rg-kv th, .rg-kv td { padding: 3px 10px 3px 0; border: 0; text-align: left; vertical-align: top; text-transform: none; letter-spacing: 0; background: none; }
.rg-kv th { color: var(--muted); font-weight: 600; white-space: nowrap; font-size: 12.5px; }
.rg-cat { display: grid; gap: 8px; }
.rg-alertas { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.rg-alertas .badge { min-width: 70px; justify-content: center; }
.rg-antes { margin-top: 8px; font-size: 12.5px; }
.rg-antes summary { cursor: pointer; color: var(--muted); }
.rg-antes > :not(summary) { margin-top: 4px; opacity: .75; }
.rg-json { margin: 0; font-size: 11.5px; white-space: pre-wrap; max-height: 240px; overflow: auto; }

/* Atendentes: lista dos clientes esperando, aberta pelo número */
.pill-btn { border: 0; cursor: pointer; font: inherit; font-weight: 700; }
.pill-btn:hover, .pill-btn.on { filter: brightness(.95); box-shadow: 0 0 0 2px currentColor inset; }
.rank tr.fila-exp > td { background: var(--surface-2); padding: 12px 16px; }
.fila-lista .lbl { margin: 0 0 8px; }
.fila-lista .list { max-height: 420px; overflow-y: auto; }
.fila-lista li.jan-1h, .fila-lista li.jan-3h { box-shadow: inset 3px 0 0 var(--crit); }

/* Assistente: bolha no canto inferior direito e painel de chat */
.ast { position: fixed; right: 20px; bottom: 20px; z-index: 35; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.ast-bolha { width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer; background: var(--brand); color: #fff;
  display: grid; place-items: center; box-shadow: 0 8px 24px rgba(255, 92, 0, .35); transition: transform .15s; }
.ast-bolha:hover { transform: scale(1.06); }
.ast-bolha.on { background: var(--text); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.ast-painel { width: min(400px, calc(100vw - 32px)); height: min(600px, calc(100vh - 110px)); background: var(--surface);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 48px rgba(0, 0, 0, .18); display: flex; flex-direction: column; overflow: hidden; }
.ast-topo { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ast-topo b { display: block; font-size: 14px; }
.ast-topo small { color: var(--muted); font-size: 11.5px; }
.ast-acoes { display: flex; gap: 4px; }
.ast-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.ast-msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; word-break: break-word; }
.ast-msg.eu { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.ast-msg.ia { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ast-msg.erro { color: var(--crit); background: var(--crit-bg); border-color: transparent; }
.ast-msg p { margin: 0 0 6px; } .ast-msg p:last-child { margin: 0; }
.ast-msg ul, .ast-msg ol { margin: 4px 0 6px; padding-left: 18px; } .ast-msg li { margin: 2px 0; }
.ast-msg code { font-size: 12px; background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }
.ast-tab { overflow-x: auto; margin: 4px 0 6px; }
.ast-tab table { border-collapse: collapse; font-size: 12.5px; }
.ast-tab th, .ast-tab td { border-bottom: 1px solid var(--line); padding: 4px 8px; text-align: left; white-space: nowrap; }
.ast-tab th { color: var(--muted); font-weight: 700; }
.ast-vazio { color: var(--text-2); font-size: 13px; }
.ast-vazio p { margin: 0 0 10px; }
.ast-sug { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.ast-sug .chip { text-align: left; }
.digitando { display: flex; gap: 4px; padding: 12px 14px; }
.digitando i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: ast-pulo 1s infinite ease-in-out; }
.digitando i:nth-child(2) { animation-delay: .15s; } .digitando i:nth-child(3) { animation-delay: .3s; }
@keyframes ast-pulo { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ast-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); align-items: flex-end; }
.ast-form textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; font: inherit; font-size: 13.5px;
  background: var(--surface); color: var(--text); max-height: 120px; }
.ast-form textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.ast-form .btn-primary { height: 38px; min-width: 42px; padding: 0 12px; }
@media (max-width: 520px) { .ast { right: 12px; bottom: 12px; } .ast-painel { height: calc(100vh - 96px); } }

/* Filtro de período: duas datas */
.select.datas { gap: 10px; }
.select.datas label { display: flex; align-items: center; gap: 6px; height: 100%; }
.select.datas input[type=date] { border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--text); height: 100%;
  outline: none; cursor: pointer; color-scheme: light dark; min-width: 0; }

/* ---------- Qualificação dos leads ---------- */
.qbar { display: flex; gap: 2px; height: 34px; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.qseg { border: 0; padding: 0 8px; min-width: 6px; color: #fff; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .15s; }
.qbar:has(.qseg.on) .qseg:not(.on) { opacity: .35; }
.qseg:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; }
.chips-lbl { font-size: 12px; color: var(--muted); font-weight: 600; align-self: center; }
.qcel { display: grid; gap: 4px; min-width: 130px; }
.qmeter { min-width: 0; gap: 6px; }
.qmeter .track { height: 4px; }
.qmeter b { width: auto; font-size: 11px; color: var(--text-2); }
.qbox { border: 1px solid var(--line); border-left-width: 4px; border-radius: 12px; padding: 12px; display: grid; gap: 12px; }
.qbox-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; }
.qbox-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.qcheck { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 8px; }
.qcheck > div { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; font-size: 12.5px; align-items: start; }
.qcheck .ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.qcheck .ok .ic { background: var(--ok-bg); color: var(--ok); }
.qcheck .falta .ic { background: var(--surface-2); color: var(--muted); }
.qcheck p { margin: 2px 0 0; color: var(--text-2); font-size: 12px; overflow-wrap: anywhere; }
.qcheck .falta p { color: var(--muted); font-style: italic; }
.av-chat .msg.qflag { outline: 2px solid var(--ok); outline-offset: 1px; }
.av-chat .sysline.qmarco { color: var(--ok); font-weight: 700; }
.qfalta { font-size: 11px; color: var(--text-2); white-space: nowrap; }
.qkey { font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--brand); background: var(--brand-50); border-radius: 4px; padding: 1px 4px; margin-left: 4px; }
