/* CRM Rayo. Cores por papel; o tema escuro troca so as variaveis. */
:root {
  color-scheme: light;
  --bg: #f7f7f8;
  --col: #eff0f2;
  --chrome: #ffffff;
  --surface: #ffffff;
  --surface-2: #f0f1f4;
  --surface-3: #e6e8ec;
  --border: #dfe1e6;
  --text: #1f2129;
  --text-2: #4d5562;
  --muted: #747c89;
  --rail: #1d1e26;
  --rail-text: #b9bcc6;
  --rail-active: #801199;
  --primary: #801199;
  --primary-hover: #6a0e80;
  --on-primary: #ffffff;
  --accent: #2468c9;
  --danger: #c92f2b;
  --danger-bg: #fdeceb;
  --good: #0a7a3f;
  --good-bg: #e5f4ec;
  --warn: #b77400;
  --warn-bg: #fdf3dc;
  --shadow: 0 1px 2px rgba(20, 22, 30, .08), 0 4px 16px rgba(20, 22, 30, .08);
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --grid: #e6e8ec;
  --tag-0: #2a78d6; --tag-1: #eb6834; --tag-2: #1baf7a; --tag-3: #eda100; --tag-4: #e87ba4; --tag-5: #008300; --tag-6: #6250d6; --tag-7: #e34948;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a0b0d; --surface: #24262c; --surface-2: #2e3138; --surface-3: #3c4049; --col: #121316; --chrome: #0e0f12;
    --border: #363a43; --text: #f2f3f5; --text-2: #cdd0d7; --muted: #9da3ae;
    --rail: #07080a; --rail-text: #b0b4be; --rail-active: #9224ae;
    --primary: #9224ae; --primary-hover: #a636c3; --on-primary: #ffffff;
    --accent: #77aaf5; --danger: #f0716c; --danger-bg: #3a1f1f;
    --good: #45c486; --good-bg: #173326; --warn: #e3ad3f; --warn-bg: #3a2f14;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .45);
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --grid: #2c2e37;
    --tag-0: #3987e5; --tag-1: #d95926; --tag-2: #199e70; --tag-3: #c98500; --tag-4: #d55181; --tag-5: #0ca30c; --tag-6: #9085e9; --tag-7: #e66767;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0b0d; --surface: #24262c; --surface-2: #2e3138; --surface-3: #3c4049; --col: #121316; --chrome: #0e0f12;
  --border: #363a43; --text: #f2f3f5; --text-2: #cdd0d7; --muted: #9da3ae;
  --rail: #07080a; --rail-text: #b0b4be; --rail-active: #9224ae;
  --primary: #9224ae; --primary-hover: #a636c3; --on-primary: #ffffff;
  --accent: #77aaf5; --danger: #f0716c; --danger-bg: #3a1f1f;
  --good: #45c486; --good-bg: #173326; --warn: #e3ad3f; --warn-bg: #3a2f14;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .45);
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --grid: #2c2e37;
    --tag-0: #3987e5; --tag-1: #d95926; --tag-2: #199e70; --tag-3: #c98500; --tag-4: #d55181; --tag-5: #0ca30c; --tag-6: #9085e9; --tag-7: #e66767;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: auto;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; }
.boot { padding: 48px; color: var(--muted); }
.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ── Estrutura ─────────────────────────────────────────── */
.shell { display: flex; height: 100vh; }
.rail {
  width: 52px; flex: none; background: var(--rail); display: flex; flex-direction: column;
  align-items: center; padding: 8px 0 10px; gap: 4px; border-right: 1px solid var(--border);
}
.rail .logo {
  width: 32px; height: 32px; border-radius: 8px; display: block; margin-bottom: 12px;
}
.rail a.item {
  position: relative; width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center;
  color: var(--rail-text); transition: background .12s, color .12s;
}
.rail a.item .icon-svg { width: 20px; height: 20px; stroke-width: 1.75; }
.rail a.item:hover { background: rgba(255, 255, 255, .09); color: #fff; text-decoration: none; }
.rail a.item.active { background: var(--rail-active); color: #fff; box-shadow: 0 2px 8px rgba(146, 36, 174, .45); }
.rail a.item .count {
  position: absolute; top: -6px; right: -9px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: #e5484d; color: #fff; font-size: 11px; line-height: 16px; text-align: center; border: 2px solid var(--rail); box-sizing: content-box;
}
.rail a.item .tip {
  display: none; position: absolute; left: 46px; top: 7px; z-index: 50; background: #000; color: #fff;
  padding: 3px 8px; border-radius: 4px; font-size: 13px; font-weight: 600; white-space: nowrap; pointer-events: none;
}
.rail a.item:hover .tip { display: block; }
.rail .spacer { flex: 1; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 40px; flex: none; background: var(--chrome); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; padding: 0 12px;
}
.topbar h1 { font-size: 15px; flex: 1; }
.topbar .tools { flex: 1; display: flex; justify-content: flex-end; align-items: center; gap: 4px; }
.page { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.toolbar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; flex-wrap: wrap; }
.toolbar .sep { flex: 1; }

/* ── Controles ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 4px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; white-space: nowrap; font-weight: 600; font-size: 14px;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.good { background: #17834a; border-color: #17834a; color: #fff; }
.btn.good:hover { background: #1c9a55; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.icon { width: 28px; padding: 0; justify-content: center; }
.btn.sm { height: 24px; padding: 0 6px; font-size: 13px; }
.btn.round { border-radius: 50%; }
.btn.active { background: var(--surface-3); }
.group { display: inline-flex; }
.group .btn { border-radius: 0; margin-left: -1px; }
.group .btn:first-child { border-radius: 4px 0 0 4px; margin-left: 0; }
.group .btn:last-child { border-radius: 0 4px 4px 0; }
.group .btn.active { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); z-index: 1; }
.input, select.input, textarea.input {
  height: 28px; padding: 0 8px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface);
  width: 100%; outline: none; font-size: 14px;
}
textarea.input { height: auto; padding: 6px 8px; resize: vertical; min-height: 72px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
select.input { width: auto; padding-right: 26px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field-row { display: flex; gap: 12px; }
.field-row > .field { flex: 1; min-width: 0; }
.avatar.lg { width: 24px; height: 24px; font-size: 11px; }
.avatar {
  width: 18px; height: 18px; border-radius: 50%; background: var(--surface-3); color: var(--text-2);
  display: inline-grid; place-items: center; font-size: 8px; font-weight: 700; flex: none;
}
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 13px; font-weight: 600; }
.badge.won { background: var(--good-bg); color: var(--good); }
.badge.lost { background: var(--danger-bg); color: var(--danger); }
.badge.open { background: var(--surface-3); color: var(--text-2); }
.icon-svg { width: 16px; height: 16px; flex: none; }
.empty { padding: 48px 16px; text-align: center; color: var(--muted); }

/* ── Busca global e menus ──────────────────────────────── */
.search { position: relative; width: 270px; flex: none; }
.search .input { padding-left: 30px; border-radius: 16px; height: 30px; background: transparent; border-color: var(--border); }
.search .icon-svg { position: absolute; left: 10px; top: 7px; color: var(--muted); }
.pop {
  position: absolute; z-index: 60; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow); min-width: 200px; padding: 4px; max-height: 360px; overflow: auto;
}
.pop .opt { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px; cursor: pointer; color: var(--text); }
.pop .opt:hover, .pop .opt.hl { background: var(--surface-2); text-decoration: none; }
.pop .head { padding: 6px 10px 2px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pop .hint { padding: 7px 10px; color: var(--muted); font-size: 14px; }
.rel { position: relative; }

/* ── Kanban ────────────────────────────────────────────── */
.board { flex: 1; min-height: 0; display: flex; gap: 0; padding: 0 12px 0; overflow-x: auto; }
.col { flex: 1 0 200px; min-width: 200px; display: flex; flex-direction: column; background: var(--col); margin-right: 3px; }
.col:first-child { border-radius: 6px 0 0 0; }
.col.over { outline: 2px solid var(--accent); outline-offset: -2px; }
.col-head { position: relative; padding: 9px 14px 9px 10px; margin-right: -3px; }
.col-head::after {   /* seta entre as etapas, como no Pipedrive */
  content: ""; position: absolute; right: -4px; top: 0; bottom: 0; width: 12px; z-index: 2; background: var(--bg);
  clip-path: polygon(0 0, 3px 0, 100% 50%, 3px 100%, 0 100%, 9px 50%);
}
.col:last-child .col-head::after { display: none; }
.col-head .name { font-weight: 700; font-size: 14px; }
.col-head .sum { font-size: 12px; color: var(--muted); margin-top: 2px; }
.col-body { flex: 1; overflow-y: auto; padding: 2px 6px 6px; display: flex; flex-direction: column; gap: 4px; min-height: 80px; }
.card {
  background: var(--surface); border: 1px solid transparent; border-radius: 4px; padding: 7px 30px 7px 8px; cursor: pointer;
  display: block; color: var(--text); box-shadow: 0 1px 1px rgba(0, 0, 0, .12);
}
.card:hover { background: var(--surface-2); text-decoration: none; }
.card.dragging { opacity: .4; }
.card .title { font-weight: 700; font-size: 13px; line-height: 1.3; }
.card .sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.card .foot { display: flex; align-items: center; gap: 5px; margin-top: 5px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.card .state { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.card .foot .avatar { width: 14px; height: 14px; font-size: 7px; }
.card { position: relative; }
.state { width: 14px; height: 14px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; }
.state.overdue { background: var(--danger); color: #fff; }
.state.today { background: var(--good); color: #fff; }
.state.future { background: var(--text-2); color: var(--surface); }
.state.none { color: var(--warn); }
.state .icon-svg { width: 10px; height: 10px; stroke-width: 3; }
.state.none .icon-svg { width: 15px; height: 15px; stroke-width: 2; }
.dropbar {
  position: fixed; left: 52px; right: 0; bottom: 0; z-index: 40; display: flex; gap: 8px; padding: 10px 16px;
  background: var(--surface); border-top: 1px solid var(--border); box-shadow: var(--shadow);
}
.dropbar .zone {
  flex: 1; height: 44px; border: 2px dashed var(--border); border-radius: 8px; display: grid; place-items: center;
  font-weight: 700; letter-spacing: .04em; color: var(--muted);
}
.dropbar .zone.over.del { background: var(--surface-3); color: var(--text); border-color: var(--text-2); }
.dropbar .zone.over.lost { background: var(--danger); color: #fff; border-color: var(--danger); }
.dropbar .zone.over.won { background: var(--good); color: #fff; border-color: var(--good); }

/* ── Tabelas ───────────────────────────────────────────── */
.table-wrap { margin: 0 12px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: auto; }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th {
  text-align: left; font-size: 13px; font-weight: 700; color: var(--text-2); padding: 7px 12px;
  border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; background: var(--surface);
}
table.grid td { padding: 6px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid tbody tr:hover { background: var(--surface-2); }
table.grid tr.click { cursor: pointer; }
table.grid td.right, table.grid th.right { text-align: right; }
.check {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--muted); background: transparent; cursor: pointer;
  display: inline-grid; place-items: center; padding: 0; color: transparent; flex: none;
}
.check:hover { border-color: var(--good); color: var(--good); }
.check.on { background: var(--good); border-color: var(--good); color: #fff; }
.check .icon-svg { width: 12px; height: 12px; }
.done-text { text-decoration: line-through; color: var(--muted); }
.due.overdue { color: var(--danger); font-weight: 600; }
.due.today { color: var(--good); font-weight: 600; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 16px; }
.tabs .tab { padding: 8px 10px; font-size: 14px; cursor: pointer; border: 0; background: none; border-bottom: 2px solid transparent; color: var(--text-2); font-weight: 500; }
.tabs .tab:hover { color: var(--text); }
.tabs .tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { height: 26px; padding: 0 9px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .icon-svg { width: 14px; height: 14px; }

/* ── Modal ─────────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(10, 12, 18, .5); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow: auto; }
.modal { background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); width: 520px; max-width: 100%; display: flex; flex-direction: column; }
.modal.wide { width: 680px; }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 17px; flex: 1; }
.modal-body { padding: 16px 18px 4px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
.modal-foot .left { margin-right: auto; }
.stage-pick { display: flex; gap: 3px; }
.stage-pick button { flex: 1; height: 26px; border: 0; background: var(--surface-3); cursor: pointer; padding: 0; }
.stage-pick button:first-child { border-radius: 4px 0 0 4px; }
.stage-pick button:last-child { border-radius: 0 4px 4px 0; }
.stage-pick button.on { background: var(--primary); }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); max-width: 380px; }
.toast.error { background: var(--danger); color: #fff; }

/* ── Detalhe ───────────────────────────────────────────── */
.detail-head { background: var(--surface); border-bottom: 1px solid var(--border); padding: 14px 20px; }
.detail-head .line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-head h2 { font-size: 18px; }
.stagebar { display: flex; gap: 3px; margin-top: 12px; }
.stagebar button {
  flex: 1; min-width: 0; height: 28px; border: 0; cursor: pointer; background: var(--surface-3); color: var(--text-2);
  font-size: 13px; font-weight: 600; padding: 0 8px; clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%, 9px 50%);
}
.stagebar button:first-child { clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%); border-radius: 4px 0 0 4px; }
.stagebar button.on { background: var(--primary); color: #fff; }
.stagebar.won button { background: var(--good); color: #fff; }
.stagebar.lost button.on { background: var(--danger); }
.stagebar button:hover { filter: brightness(1.08); }
.detail { display: flex; gap: 16px; padding: 16px 20px; align-items: flex-start; }
.side { width: 320px; flex: none; display: flex; flex-direction: column; gap: 12px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.panel > h3 { font-size: 14px; padding: 10px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.panel > .body { padding: 10px 14px; }
.kv { display: flex; gap: 8px; padding: 5px 0; align-items: baseline; }
.kv .k { width: 110px; flex: none; color: var(--muted); font-size: 14px; }
.kv .v { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.editable { cursor: text; border-radius: 4px; padding: 1px 4px; margin: -1px -4px; display: inline-block; min-width: 40px; }
.editable:hover { background: var(--surface-2); }
.editable.blank { color: var(--muted); }
.feed { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.composer .tabs { padding: 0 8px; }
.composer .body { padding: 12px 14px; }
.type-pick { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.item { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.item:last-child { border-bottom: 0; }
.item .ico { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; flex: none; color: var(--text-2); }
.item .ico .icon-svg { width: 15px; height: 15px; }
.item .meta { font-size: 13px; color: var(--muted); }
.item .note { white-space: pre-wrap; overflow-wrap: anywhere; }
.item.note-item { background: color-mix(in srgb, var(--warn-bg) 60%, var(--surface)); }
.item .actions { visibility: hidden; display: flex; gap: 2px; }
.item:hover .actions { visibility: visible; }

/* ── Insights ──────────────────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; padding: 0 16px 12px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.tile .label { font-size: 13px; color: var(--text-2); }
.tile .value { font-size: 22px; font-weight: 600; margin-top: 2px; }
.tile .sub { font-size: 13px; color: var(--muted); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 12px; padding: 0 16px 16px; }
.chart { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; min-width: 0; }
.chart h3 { font-size: 15px; }
.chart .desc { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 32%) 1fr; column-gap: 10px; row-gap: 8px; align-items: center; }
.hbar .lab { font-size: 14px; color: var(--text-2); text-align: right; }
.hbar .track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hbar .bar { height: 16px; background: var(--series-1); border-radius: 0 4px 4px 0; min-width: 2px; flex: none; }
.hbar .track:hover .bar { filter: brightness(1.12); }
.hbar .val { font-size: 13px; color: var(--text); white-space: nowrap; }
.hbar .val small { color: var(--muted); font-size: 13px; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }
.colchart { position: relative; }
.colchart svg { display: block; width: 100%; height: auto; }
.colchart text { fill: var(--muted); font-size: 12px; }
.tooltip {
  position: absolute; z-index: 5; pointer-events: none; background: var(--text); color: var(--bg); padding: 6px 9px;
  border-radius: 6px; font-size: 13px; white-space: nowrap; transform: translate(-50%, -100%);
}

/* ── WhatsApp ──────────────────────────────────────────── */
.wa { flex: 1; min-height: 0; display: flex; }
.wa-side { width: 320px; flex: none; display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--chrome); min-height: 0; }
.wa-top { display: flex; align-items: center; gap: 6px; padding: 8px; }
.wa-filter { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; }
.wa-tag { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; font-size: 12px; font-weight: 600; color: var(--text-2);
  padding: 1px 7px 1px 5px; border-radius: 9px; background: var(--surface-3); border: 0; white-space: nowrap; }
.wa-tag i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.wa-tag.pick { cursor: pointer; padding: 3px 8px 3px 6px; border-radius: 11px; }
.wa-tag.pick.off { opacity: .45; text-decoration: line-through; }
.wa-tag.pick.dim { opacity: .5; }
.wa-tag.pick.sel { outline: 2px solid var(--primary); outline-offset: -1px; color: var(--text); }
.wa-tag b { background: #e5484d; color: #fff; border-radius: 7px; padding: 0 5px; font-size: 11px; }
.wa-list { flex: 1; overflow-y: auto; overflow-x: hidden; border-top: 1px solid var(--border); }
.wa-row .grow, .wa-row .row { min-width: 0; }
.wa-row .wa-tag { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; display: inline-block; }
.wa-row .wa-tag i { display: inline-block; margin-right: 5px; }
.wa-top .chip { flex: none; }
.wa-row { display: flex; padding: 8px 10px; border-bottom: 1px solid var(--border); cursor: pointer; }
.wa-row:hover { background: var(--surface-2); }
.wa-row.open { background: var(--surface); box-shadow: inset 3px 0 0 var(--accent); }
.wa-row .when { font-size: 12px; color: var(--muted); flex: none; }
.wa-row .last { font-size: 13px; color: var(--muted); margin: 1px 0 4px; }
.wa-unread { background: var(--primary); color: #fff; border-radius: 9px; min-width: 18px; padding: 0 5px; font-size: 12px; font-weight: 700; text-align: center; flex: none; }
.wa-panels { flex: 1; min-width: 0; min-height: 0; display: grid; gap: 6px; padding: 6px; grid-auto-rows: minmax(0, 1fr); }
.wa-wait.lv0 { color: var(--good); background: var(--good-bg); }
.wa-wait.lv1 { color: var(--warn); background: var(--warn-bg); }
.wa-wait.lv2 { color: var(--danger); background: var(--danger-bg); }
.wa-wait.lv3 { color: #fff; background: #9c1414; animation: wa-alert 1.2s ease-in-out infinite; }
.wa-wait .icon-svg { width: 11px; height: 11px; vertical-align: -1px; margin-right: 3px; }
@keyframes wa-alert { 50% { background: #d02626; } }
@media (prefers-reduced-motion: reduce) { .wa-wait.lv3 { animation: none; } }
.wa-row.q { box-shadow: inset 4px 0 0 var(--lv); }
.wa-row.q.open { background: var(--surface); }
.wa-row.lv0, .wa-panel.lv0 { --lv: var(--good); }
.wa-row.lv1, .wa-panel.lv1 { --lv: var(--warn); }
.wa-row.lv2, .wa-panel.lv2 { --lv: var(--danger); }
.wa-row.lv3, .wa-panel.lv3 { --lv: #9c1414; }
.wa-panel.locked { border-color: var(--lv); border-top-color: var(--tag); }
.wa-panel.locked.lv3 { box-shadow: 0 0 0 1px #9c1414; }
.wa-legend { display: flex; gap: 4px; padding: 8px 8px 4px; flex-wrap: wrap; }
.wa-legend .wa-wait { animation: none; }
.wa-summary { padding: 0 8px 8px; font-size: 12px; color: var(--muted); }
.wa-filter .chip { height: 22px; font-size: 12px; }
.wa-wait.paused { opacity: .75; }
.wa-top .wa-wait { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
.wa-wait { flex: none; font-size: 12px; font-weight: 700; color: var(--warn); background: var(--warn-bg); border-radius: 9px; padding: 2px 8px; white-space: nowrap; }
.wa-panel { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--surface); border: 1px solid var(--border);
  border-top: 3px solid var(--tag); border-radius: 6px; overflow: hidden; }
.wa-panel header { display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 10px; border-bottom: 1px solid var(--border); }
.wa-panel header .sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.wa-panel header .grow { min-width: 0; }
.wa-msgs { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 4px; background: var(--col); }
.wa-day { align-self: center; font-size: 12px; color: var(--muted); background: var(--surface-2); border-radius: 8px; padding: 1px 8px; margin: 4px 0; }
.bubble { max-width: 80%; padding: 6px 9px 4px; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.in { align-self: flex-start; background: var(--surface-2); border-top-left-radius: 2px; }
.bubble.out { align-self: flex-end; background: color-mix(in srgb, var(--primary) 28%, var(--surface)); border-top-right-radius: 2px; }
.bubble .t { font-size: 11px; color: var(--muted); text-align: right; margin-top: 1px; }
.wa-ack { display: inline-flex; vertical-align: -1px; margin-left: 4px; color: var(--muted); }
.wa-ack.read { color: #4fb6ec; }
.wa-panel footer { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--border); align-items: flex-end; }
.wa-panel footer textarea.input { min-height: 28px; height: 28px; max-height: 120px; resize: none; scrollbar-width: none; line-height: 1.3; }
.wa-note { background: var(--warn-bg); color: var(--text); border-radius: 6px; padding: 8px 10px; margin: 0 0 12px; font-size: 13px; }
.wa-color { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.wa-color.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface) inset; }

/* ── Fila de atendimento (janela flutuante) ────────────── */
.ring { position: relative; flex: none; display: grid; place-items: center; --lv: var(--good); }
.ring.lv1 { --lv: var(--warn); } .ring.lv2 { --lv: var(--danger); } .ring.lv3 { --lv: #c21f1f; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring circle { fill: none; stroke-linecap: round; }
.ring .track { stroke: var(--surface-3); }
.ring .prog { stroke: var(--lv); transition: stroke-dasharray .9s linear; }
.ring .spin { stroke: var(--lv); opacity: .55; transform-origin: 50% 50%; animation: ring-spin 2.4s linear infinite; }
.ring.lv1 .spin { animation-duration: 1.7s; } .ring.lv2 .spin { animation-duration: 1.1s; }
.ring.lv3 .spin { animation-duration: .65s; opacity: .9; }
.ring.paused .spin { animation-play-state: paused; opacity: .25; }
.ring .num { position: relative; font-weight: 700; color: var(--text); line-height: 1; }
.ring.lv3 .num { color: var(--lv); }
@keyframes ring-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ring .spin { animation: none; } }
.queue-btn b { background: var(--surface-3); border-radius: 8px; padding: 0 6px; font-size: 12px; }
.queue-btn.alert { border-color: #c21f1f; }
.queue-btn.alert b { background: #c21f1f; color: #fff; }
.queue {
  position: fixed; top: 46px; right: 10px; z-index: 70; width: 350px; max-height: calc(100vh - 60px); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden;
}
.queue.pop { animation: queue-pop .6s ease-out 4; }
@keyframes queue-pop { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 55%, transparent), var(--shadow); } }
.queue > header { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.queue-next { display: flex; align-items: center; gap: 10px; padding: 12px; border-bottom: 1px solid var(--border); border-left: 4px solid var(--good); }
.queue-next.lv1 { border-left-color: var(--warn); } .queue-next.lv2 { border-left-color: var(--danger); }
.queue-next.lv3 { border-left-color: #c21f1f; background: color-mix(in srgb, #c21f1f 12%, var(--surface)); }
.queue-next .kind { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.queue-next .title { font-size: 15px; font-weight: 700; }
.queue .sub { font-size: 12px; color: var(--muted); }
.queue .grow { min-width: 0; }
.queue-list { overflow-y: auto; padding-bottom: 6px; }
.queue-group .head { display: flex; align-items: center; gap: 6px; padding: 8px 12px 4px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.queue-group .head .n { width: 16px; height: 16px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-size: 11px; }
.queue-row { display: flex; align-items: center; gap: 8px; padding: 5px 12px; cursor: pointer; }
.queue-row:hover { background: var(--surface-2); }
.queue-list .more { padding: 2px 12px 4px 54px; font-size: 12px; color: var(--muted); }
.queue-row .ring { font-size: 8.5px !important; }
.queue-side .sub, .queue-work .sub { font-size: 12px; color: var(--muted); }

/* ── Tela da fila de atendimento ───────────────────────── */
.queue-page { flex: 1; min-height: 0; display: flex; }
.queue-side { width: 290px; flex: none; overflow-y: auto; border-right: 1px solid var(--border); background: var(--chrome); }
.queue-hours { padding: 10px 12px 0; font-size: 12px; color: var(--muted); }
.queue-side .queue-list { overflow: visible; }
.queue-side .queue-row { cursor: default; }
.queue-side .queue-row.pick { cursor: pointer; }
.mark { flex: none; border-radius: 50%; background: var(--surface-3); color: var(--text-2); display: grid; place-items: center; }
.mark .icon-svg { width: 45%; height: 45%; }
.mark.late { box-shadow: inset 0 0 0 2px var(--danger); }
.queue-next.plain { border-left-color: var(--border); }
.queue-phone { display: inline-flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 700; color: var(--text); padding: 0 6px; white-space: nowrap; }
.queue-startchat { margin: auto; padding: 16px; width: 100%; }
.queue-row.later, .queue-side .queue-row.later { opacity: .62; cursor: default; }   /* hora marcada que ainda nao chegou: so para ver */
.queue-row.later:hover { background: none; }
.queue-list .more.later-head { padding: 8px 12px 2px; font-weight: 600; }
.queue-row.current {background: var(--surface); box-shadow: inset 3px 0 0 var(--primary); }
.queue-work { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.queue-start { margin: auto; width: 460px; max-width: 90%; text-align: center; }
.queue-start h2 { font-size: 21px; margin-bottom: 6px; }
.queue-start .queue-next { text-align: left; border: 1px solid var(--border); border-left-width: 4px; border-radius: 8px; margin-top: 16px; background: var(--surface); }
.queue-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 12px 0 0; background: var(--surface); border-bottom: 1px solid var(--border); }
.queue-bar .queue-next { border-bottom: 0; }
.queue-bar .grow { min-width: 0; }
.queue-bar > .grow { flex: 1 1 300px; }   /* com o chat aberto ao lado, os botoes descem em vez de espremer o titulo */
.ring-done { width: 64px; height: 64px; border-radius: 50%; background: var(--good-bg); color: var(--good); display: grid; place-items: center; flex: none; }
.ring-done .icon-svg { width: 28px; height: 28px; }
.queue-warn { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--warn-bg); color: var(--text); border-bottom: 1px solid var(--border); font-size: 13px; }
.queue-warn .icon-svg { color: var(--warn); }
.queue-body { flex: 1; min-height: 0; display: flex; }
.queue-main { flex: 1; min-width: 0; overflow-y: auto; display: flex; flex-direction: column; }
.queue-chat { width: 370px; flex: none; display: flex; padding: 6px; border-left: 1px solid var(--border); }
.queue-solo { flex: 1; min-height: 0; display: flex; padding: 6px; max-width: 720px; width: 100%; margin: 0 auto; }
.queue-chat .wa-panel, .queue-solo .wa-panel { flex: 1; }

/* ── Login ─────────────────────────────────────────────── */
.login { height: 100vh; display: grid; place-items: center; }
.login form { width: 320px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 24px; }
.login h1 { font-size: 21px; margin-bottom: 16px; }
.login .err { color: var(--danger); margin-bottom: 10px; font-size: 14px; }

@media (max-width: 900px) {
  .detail { flex-direction: column; }
  .side { width: 100%; }
  .charts { grid-template-columns: 1fr; }
}

/* Conexao do WhatsApp por QR code */
.wa-qr { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.wa-qr img, .wa-qr-wait { width: 220px; height: 220px; flex: none; border-radius: 8px; background: #fff; }
.wa-qr-wait { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 12px;
  background: var(--surface-2, var(--bg)); border: 1px dashed var(--border); color: var(--muted); font-size: 14px; }
.wa-qr-wait.ok { color: var(--primary); font-weight: 600; }
.wa-code { font: 700 34px/1.2 ui-monospace, Menlo, monospace; letter-spacing: 4px; padding: 22px 12px; text-align: center; user-select: all; }
.wa-qr ol { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.6; }
@media (max-width: 560px) { .wa-qr { flex-direction: column; } }

/* Vinculo com o Pipedrive e campos personalizados */
.pd-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); padding: 3px 8px; border: 1px solid var(--border); border-radius: 999px; white-space: nowrap; }
.pd-chip i { width: 7px; height: 7px; border-radius: 50%; background: #2fa84f; }
.pd-chip.bad { color: #d9342b; border-color: #d9342b; }
.pd-chip.bad i { background: #d9342b; }
.cf-long { max-height: 120px; overflow: auto; white-space: pre-wrap; font-size: 14px; }

/* Telefone da fila (VoIP) */
.call-box { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 8px; white-space: nowrap; }
.call-box.on { border-color: #2fa84f; }
.call-dot { width: 8px; height: 8px; border-radius: 50%; background: #2fa84f; animation: call-pulse 1s infinite alternate; }
@keyframes call-pulse { from { opacity: .3; } to { opacity: 1; } }

/* Arquivos, audio e emojis no chat */
.wa-media { display: block; max-width: 100%; max-height: 260px; border-radius: 6px; margin-bottom: 4px; }
.wa-media.sticker { max-height: 120px; }
.wa-audio { display: block; width: 240px; max-width: 100%; height: 36px; margin-bottom: 2px; }
.wa-doc { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 4px; color: inherit; text-decoration: none; max-width: 260px; }
.wa-emojis { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px 8px; border-top: 1px solid var(--border); max-height: 96px; overflow: auto; }
.wa-emojis button { border: 0; background: none; font-size: 20px; line-height: 1; padding: 3px; cursor: pointer; border-radius: 4px; }
.wa-emojis button:hover { background: var(--surface-2); }
.wa-panel footer.rec { align-items: center; font-size: 14px; }
.wa-panel footer .btn.on { color: var(--primary); }

/* ── Acabamento dos textos (tela do negocio e paineis). Pedido do Luiz em 20/11/2026: estava "grosseiro". ── */
body { font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; line-height: 1.45; letter-spacing: 0; text-rendering: optimizeLegibility;  }
.num { font-variant-numeric: tabular-nums; }
.detail-head { padding: 16px 24px 14px; }
.detail-head h2 { font-size: 21px; font-weight: 600; letter-spacing: -0.005em; line-height: 1.25; }
.stagebar { margin-top: 14px; }
.btn.move-funnel { font-size: 12px; height: 22px; padding: 0 6px; margin-left: -6px; color: inherit; border-color: var(--border, rgba(128,128,128,.35)); }
.btn.move-funnel .caret { font-size: 10px; opacity: .7; }
.stagebar button { height: 30px; font-size: 13px; font-weight: 500; letter-spacing: 0; }
.stagebar button.on { font-weight: 600; }
.detail { gap: 20px; padding: 20px 24px; }
.side { width: 340px; gap: 14px; }
.panel { border-radius: 10px; }
.panel > h3 { font-size: 13px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); padding: 11px 16px; }
.panel > h3 .icon-svg { width: 14px; height: 14px; }
.panel > .body { padding: 8px 16px 12px; }
.kv { padding: 7px 0; gap: 12px; border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }
.kv:last-of-type { border-bottom: 0; }
.kv .k { width: 118px; font-size: 13px; line-height: 1.5; }
.kv .v { font-size: 14px; line-height: 1.5; color: var(--text); }
.editable.blank { font-size: 13px; opacity: .8; }
.phone-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.add-person { width: 100%; justify-content: center; margin-bottom: 12px; border: 1px dashed var(--border); }
.phone-line .num { font-weight: 500; margin-right: 2px; }
.call-box.wrap { flex-wrap: wrap; white-space: normal; }
.feed { gap: 14px; }
.item { gap: 12px; padding: 12px 16px; }
.item .note, .item .grow { font-size: 14px; line-height: 1.55; }
.item .meta { font-size: 12px; margin-top: 3px; letter-spacing: 0; }
.item.note-item { background: color-mix(in srgb, var(--warn-bg) 35%, var(--surface)); }
.tabs .tab { font-size: 14px; padding: 10px 12px; }
.composer textarea.input { font-size: 14px; line-height: 1.5; }

/* Faixa "sem resposta" acima do campo de mensagem, com o botao de marcar como atendida */
.wa-resolve { display: flex; align-items: center; gap: 10px; padding: 7px 10px; font-size: 13px; border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--warn-bg) 55%, var(--surface)); }
.wa-row-ok { color: var(--good); }
.wa-row-ok:hover { background: var(--good-bg); }

.wa-panel footer .only-text { display: none; }
.wa-panel footer.has-text .only-text { display: inline-flex; }
.wa-panel footer.has-text .only-empty { display: none; }

/* Janelinha de acentos (tecla segurada) */
.accent-pop { position: fixed; z-index: 1000; display: flex; gap: 2px; padding: 4px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
.accent-pop button { border: 0; background: none; color: var(--text); width: 34px; padding: 4px 0 3px; border-radius: 6px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; font-size: 19px; line-height: 1.1; }
.accent-pop button small { font-size: 11px; color: var(--muted); }
.accent-pop button.on, .accent-pop button:hover { background: var(--primary); color: #fff; }
.accent-pop button.on small, .accent-pop button:hover small { color: #fff; opacity: .8; }

/* Conversa sem negocio no CRM */
.wa-nodeal { display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 13px; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, #e8590c 16%, var(--surface)); }
.wa-nodeal .icon-svg { width: 15px; height: 15px; color: #e8590c; flex: none; }
.wa-nodeal-tag { font-size: 11px; font-weight: 600; color: #e8590c; border: 1px solid color-mix(in srgb, #e8590c 55%, transparent); border-radius: 9px; padding: 0 6px; white-space: nowrap; margin-left: 4px; }

/* Gaveta lateral com a conversa de WhatsApp */
.wa-drawer { position: fixed; top: 48px; right: 0; bottom: 0; width: 420px; max-width: 100vw; z-index: 40; display: flex; padding: 8px;
  background: var(--bg); border-left: 1px solid var(--border); box-shadow: -10px 0 30px rgba(0, 0, 0, .35); }
.wa-drawer .wa-panel { flex: 1; min-width: 0; }
/* Na gaveta (420px) os botoes do cabecalho (Ligar, Ligar no WhatsApp, Hora combinada, Nao e lead) nao cabem ao lado do nome e
   empurravam o X para fora da tela (Isadora, 03/12/2026): nome e X ficam na primeira linha e os botoes descem para a de baixo. */
.wa-drawer .wa-panel header { flex-wrap: wrap; }
.wa-drawer .wa-panel header .grow { flex: 1 1 280px; }
.wa-drawer .wa-panel header > .btn { order: 2; }
.wa-drawer .wa-panel header > .btn.wa-close { order: 1; }
.wa-drawer-box { flex: 1; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; align-self: flex-start; }
.wa-btn { color: #1fa855; }
/* Com a conversa aberta ao lado, a pagina ocupa so o espaco que sobra (nao fica por baixo do chat) e as colunas ficam mais estreitas. */
@media (min-width: 1000px) {
  body.wa-drawer-open .page { padding-right: 420px; transition: padding-right .15s ease; }
  body.wa-drawer-open .detail { gap: 14px; padding: 16px; }
  body.wa-drawer-open .side { width: 270px; }
}
.wa-btn .icon-svg { width: 14px; height: 14px; }

.rec-audio { display: block; width: 280px; max-width: 100%; height: 34px; margin: 4px 0 2px; }
.bubble a { color: inherit; text-decoration: underline; }

/* Fila, item de WhatsApp: conversa em primeiro plano e o negocio resumido ao lado */
.queue-chatmain { flex: 1; min-width: 0; display: flex; justify-content: center; padding: 8px; }
.queue-chatmain .wa-panel, .queue-chatmain .queue-startchat { flex: 1; max-width: 900px; }
.queue-dealcol { width: 300px; flex: none; overflow-y: auto; border-left: 1px solid var(--border); background: var(--chrome); }
.queue-dealcol.open { width: 420px; background: none; }
.queue-dealcol.open .detail { flex-direction: column; padding: 12px; gap: 12px; }
.queue-dealcol.open .side { width: auto; }
.queue-dealcol.open .detail-head { padding: 10px 12px; }
.queue-dealcol.open .detail-head h2 { font-size: 17px; }
.deal-card { padding: 14px; }
.dc-title { display: block; font-size: 16px; font-weight: 600; color: var(--text); line-height: 1.3; }
.dc-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 13px; border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }
.dc-row span { color: var(--muted); flex: none; }
.dc-row b { font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.dc-sec { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); margin: 14px 0 4px; }
.dc-text { font-size: 13px; line-height: 1.45; }
.dc-note { max-height: 110px; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); }

/* Tamanho e nitidez das letras (Luiz, 20/11/2026): em monitor comum, no zoom de 100%, a letra pequena ficava serrilhada.
   Todos os tamanhos subiram 1px e ficaram inteiros; a letra deixou de ser afinada. Os controles acompanham. */
.btn { height: 30px; }
.btn.sm { height: 26px; }
.btn.icon { width: 30px; }
.input, select.input { height: 30px; }
.kv .k { width: 124px; }
.queue-side { width: 312px; }
.wa-legend { flex-wrap: nowrap; }
.wa-legend .wa-wait { font-size: 12px; padding-left: 6px; padding-right: 6px; }
.queue-page .queue-side .wa-legend { flex-wrap: nowrap; gap: 3px; }
.queue-page .queue-side .wa-legend .wa-wait { font-size: 11px; padding: 1px 6px; white-space: nowrap; }

/* Foto de perfil do WhatsApp */
.wa-avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; background: var(--surface-3); }
.wa-avatar.none { color: var(--text-2); font-weight: 600; letter-spacing: 0; }
.wa-row { display: flex; gap: 8px; align-items: flex-start; }

/* Campo de mensagem que cresce com o texto */
.wa-panel footer textarea.input { height: 32px; min-height: 32px; max-height: 170px; line-height: 1.4; padding: 6px 10px; overflow-y: auto; scrollbar-width: thin; font-size: 14px; }
.wa-panel footer textarea.input { overflow-y: hidden; }
.wa-name .editable { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.wa-name .input { height: 26px; font-weight: 400; }

/* Menu lateral: os itens herdavam espacamento e linha da lista de historico (.item) e os icones saiam do centro */
.rail a.item { padding: 0; gap: 0; border-bottom: 0; width: 38px; height: 38px; }
.rail a.item .icon-svg { width: 22px; height: 22px; }
/* Icones mais nitidos: traco com espessura fixa na tela (nao encolhe junto com o icone) e cantos calculados com precisao */
.icon-svg { shape-rendering: geometricPrecision; overflow: visible; }
.icon-svg path { vector-effect: non-scaling-stroke; stroke-width: 1.6px; }
.rail a.item .icon-svg path { stroke-width: 1.7px; }
.state .icon-svg path { stroke-width: 2.2px; }
.check .icon-svg path { stroke-width: 2.2px; }

/* Mensagens sugeridas na conversa */
.wa-seq { border-top: 1px solid var(--border); padding: 8px 10px; background: color-mix(in srgb, var(--primary) 9%, var(--surface)); max-height: 46%; overflow-y: auto; }
.wa-seq-row { align-items: flex-start; gap: 6px; margin-top: 6px; }
.wa-seq-row .n { width: 18px; height: 18px; flex: none; border-radius: 50%; background: var(--surface-3); font-size: 11px; display: grid; place-items: center; margin-top: 6px; }
.wa-seq textarea.input { min-height: 30px; height: auto; resize: none; line-height: 1.4; padding: 5px 8px; font-size: 14px; }

.head-actions { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; }

.new-version { animation: nv-pulse 1.2s infinite alternate; }
@keyframes nv-pulse { from { box-shadow: 0 0 0 0 rgba(222, 0, 253, .0); } to { box-shadow: 0 0 0 5px rgba(222, 0, 253, .45); } }

.wa-auto { color: #e8590c; font-weight: 600; }

/* Telefone embutido (botao no alto da tela) */
.phone-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); padding: 3px 10px; height: 30px; border: 1px solid var(--border);
  border-radius: 999px; background: none; white-space: nowrap; cursor: pointer; }
span.phone-chip { cursor: default; }
.phone-chip .icon-svg { width: 14px; height: 14px; }
.phone-chip i { width: 7px; height: 7px; border-radius: 50%; background: #2fa84f; }
.phone-chip.on { color: var(--text); }
.phone-chip.bad { color: #d9342b; border-color: #d9342b; }
.phone-chip.talk, .phone-chip.ring { border-color: #2fa84f; color: var(--text); padding-right: 4px; }
.phone-chip.ring { border-color: #e8590c; }

/* Arrastar arquivo para a conversa */
.wa-panel { position: relative; }
.wa-drop { position: absolute; inset: 6px; z-index: 5; display: grid; place-items: center; border: 2px dashed var(--primary); border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 18%, var(--surface)); font-size: 16px; font-weight: 600; pointer-events: none; }

.muted-btn { color: var(--muted); opacity: .7; }

/* Imagem ampliada por cima da tela */
.zoomable { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 2000; background: rgba(0, 0, 0, .86); display: grid; place-items: center; cursor: zoom-out; padding: 24px; overflow: hidden; touch-action: none; user-select: none; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 48px); border-radius: 8px; box-shadow: 0 10px 40px rgba(0, 0, 0, .6); }
.lightbox img { transition: transform .12s ease-out; will-change: transform; }
.lightbox-bar { position: absolute; top: 14px; right: 14px; display: flex; align-items: center; gap: 6px; background: rgba(20, 20, 24, .85); border-radius: 10px; padding: 6px; cursor: default; }
.lightbox-bar button { background: transparent; color: #fff; border: 0; border-radius: 6px; padding: 6px 10px; font-size: 14px; cursor: pointer; }
.lightbox-bar button:hover { background: rgba(255, 255, 255, .18); }
.lightbox-zoom { color: #fff; font-size: 13px; min-width: 44px; text-align: center; }

/* Responder uma mensagem especifica */
.bubble { position: relative; }
.bubble-reply { position: absolute; top: 2px; display: none; border: 0; border-radius: 50%; width: 24px; height: 24px; padding: 0; cursor: pointer;
  background: var(--surface-3); color: var(--text-2); place-items: center; }
.bubble.in .bubble-reply { right: -28px; }
.bubble.out .bubble-reply { left: -28px; }
.bubble:hover .bubble-reply { display: grid; }
.bubble-reply .icon-svg { width: 13px; height: 13px; }
.bubble-sender { font-size: 12px; font-weight: 600; color: var(--primary); margin-bottom: 2px; }
.wa-group-tag { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 999px; background: rgba(128, 128, 128, .18); }
.bubble-quote { border-left: 3px solid var(--primary); background: rgba(0, 0, 0, .18); border-radius: 4px; padding: 3px 7px; margin-bottom: 4px; font-size: 13px;
  color: var(--text-2); max-height: 58px; overflow: hidden; white-space: pre-wrap; }
.wa-replying { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-top: 1px solid var(--border); border-left: 3px solid var(--primary); font-size: 13px; }
.wa-replying .grow { min-width: 0; }
.wa-replying .ellipsis { color: var(--muted); }
.wa-seq textarea.input { field-sizing: content; max-height: 150px; overflow-y: auto; scrollbar-width: thin; }

/* Botao de responder: uma faixa invisivel liga a mensagem ao botao, para ele nao sumir quando o mouse vai ate ele */
.bubble::before { content: ''; position: absolute; top: 0; bottom: 0; width: 38px; }
.bubble.in::before { right: -38px; }
.bubble.out::before { left: -38px; }
.bubble-reply { z-index: 2; width: 26px; height: 26px; top: 50%; transform: translateY(-50%); }
.bubble.in .bubble-reply { right: -32px; }
.bubble.out .bubble-reply { left: -32px; }
.bubble-reply:hover { background: var(--primary); color: #fff; }

/* Telas do menu do usuario */
.hint-line { font-size: 12px; color: var(--muted); margin-top: 4px; }
.set-grid { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: 14px; }
.set-grid span { color: var(--muted); }
.set-grid b { font-weight: 500; }
.set-msg { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
.set-msg textarea.input { min-height: 0; field-sizing: content; margin-top: 4px; }
.set-sample { margin-top: 14px; padding: 10px; border-radius: 8px; background: var(--surface-2); display: flex; flex-direction: column; font-size: 13px; }
.set-step { padding: 4px 0; gap: 8px; }
.set-step .n { width: 20px; height: 20px; border-radius: 50%; background: var(--surface-3); font-size: 11px; display: grid; place-items: center; flex: none; }
code { background: var(--surface-3); border-radius: 4px; padding: 0 4px; font-size: 12px; }

/* Filtros da tela de Negocios */
.filterbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 12px; border-bottom: 1px solid var(--border); position: relative; min-height: 38px; }
.filterbar .cond { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; padding: 2px 4px 2px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 22%, var(--surface)); border: 1px solid color-mix(in srgb, var(--primary) 50%, transparent); }
.filterbar .cond button { border: 0; background: none; color: inherit; cursor: pointer; padding: 2px; display: grid; place-items: center; border-radius: 50%; }
.filterbar .cond button:hover { background: rgba(255, 255, 255, .15); }
.filterbar .cond .icon-svg { width: 12px; height: 12px; }
.cond-editor { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; width: 100%; padding: 6px 0 2px; }
.cond-editor select.input { max-width: 240px; }
.toolbar .chk { font-size: 13px; cursor: pointer; white-space: nowrap; gap: 5px; }
.card .badge { font-size: 11px; padding: 0 6px; vertical-align: 1px; }

.filterbar .chk { font-size: 13px; cursor: pointer; white-space: nowrap; gap: 5px; color: var(--text-2); }
.filterbar select.sort { height: 26px; font-size: 13px; width: auto; max-width: 250px; }

/* ── Acabamento dos controles (Luiz, 20/11/2026: mais sofisticado e arredondado, como no Pipedrive) ── */
.btn { border-radius: 8px; font-weight: 500; }
.btn.primary, .btn.good, .btn.danger { font-weight: 600; }
.input, select.input, textarea.input { border-radius: 8px; }
.toolbar { gap: 8px; padding: 10px 14px; }
.toolbar .group { border-radius: 8px; overflow: hidden; }
/* Lista suspensa propria */
.drop { display: inline-block; }
.drop-btn { display: inline-flex; align-items: center; gap: 7px; height: 30px; max-width: 280px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; transition: border-color .12s, background .12s; }
.drop-btn:hover { background: var(--surface-2); }
.drop-btn.open, .drop-btn:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent); outline: none; }
.drop-btn .icon-svg { width: 15px; height: 15px; color: var(--text-2); flex: none; }
.drop-btn .icon-svg:last-child { width: 13px; height: 13px; margin-left: 2px; }
.drop-btn .ellipsis { min-width: 0; }
.drop-pop { position: absolute; top: 36px; z-index: 70; min-width: 240px; max-width: 340px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .38); padding: 6px; }
.drop-search { display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 34px; margin-bottom: 6px; border: 1px solid var(--border); border-radius: 8px; }
.drop-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent); }
.drop-search .icon-svg { width: 14px; height: 14px; color: var(--muted); }
.drop-search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font: inherit; color: var(--text); }
.drop-list { max-height: 330px; overflow-y: auto; scrollbar-width: thin; }
.drop-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; outline: none; }
.drop-opt:hover, .drop-opt:focus { background: var(--surface-2); }
.drop-opt.on { color: var(--accent); font-weight: 600; }
.drop-opt .icon-svg { width: 15px; height: 15px; color: var(--text-2); flex: none; }
.drop-opt.on .icon-svg:last-child { color: var(--accent); }
.drop-none { padding: 10px; color: var(--muted); font-size: 13px; }
/* Caixa de adicionar condicao */
.cond-pop { position: absolute; top: 34px; left: 0; z-index: 65; display: flex; align-items: center; gap: 8px; padding: 10px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 14px 40px rgba(0, 0, 0, .38); white-space: nowrap; }
.filterbar { gap: 8px; padding: 6px 14px; }
.filterbar .btn.ghost.sm { border-radius: 999px; padding: 0 12px; height: 28px; }
.filterbar .cond { padding: 3px 5px 3px 12px; }
.pop { border-radius: 12px; padding: 6px; }
.pop .opt { border-radius: 8px; padding: 8px 10px; }

/* Tons de cinza com mais contraste no tema escuro, como no Pipedrive (Luiz, 20/11/2026): fundo mais escuro, cartoes e paineis mais claros,
   bordas visiveis. As cores ficam nas variaveis do alto do arquivo; aqui so o acabamento que depende delas. */
.card { border: 1px solid color-mix(in srgb, var(--border) 70%, transparent); box-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.card:hover { border-color: var(--border); background: var(--surface-2); }
.col { border-radius: 6px 6px 0 0; }
.col-head .name { color: var(--text); }
.panel { box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.topbar { border-bottom-color: var(--border); }
.wa-side, .queue-side, .queue-dealcol { background: var(--chrome); }
.bubble.in { background: var(--surface-2); }

/* Indicadores de atividade dos cartoes: maiores, cores cheias e desenho nitido (Luiz, 20/11/2026) */
.state { width: 18px; height: 18px; background: none !important; border-radius: 0; }
.state svg { width: 18px; height: 18px; display: block; overflow: visible; shape-rendering: geometricPrecision; }
.state .disc { stroke: var(--surface); stroke-width: 1; }
.state .mark { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.state.overdue .disc { fill: #f0483e; }
.state.today .disc { fill: #1fb866; }
.state.future .disc { fill: #d7dbe2; }
.state.future .mark { stroke: #14161a; }
.state.none .tri { fill: #f5b301; stroke: #f5b301; stroke-width: 1; stroke-linejoin: round; }
.state.none .mark { stroke: #1a1400; stroke-width: 2.1; }
.card .state { right: 9px; }
.card { padding-right: 34px; }

/* Respostas rapidas do chat (digitar "/") */
.wa-slash { border-top: 1px solid var(--border); max-height: 46%; overflow-y: auto; scrollbar-width: thin; padding: 6px; background: var(--surface); }
.wa-slash .head { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); padding: 4px 8px 6px; display: flex; gap: 10px; align-items: baseline; }
.wa-slash .head span { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); }
.wa-slash .opt { display: flex; flex-direction: column; gap: 2px; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.wa-slash .opt.on { background: color-mix(in srgb, var(--primary) 24%, var(--surface)); }
.wa-slash .opt b { font-size: 13px; }
.wa-slash .opt span { font-size: 13px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wa-slash .none { padding: 8px 10px; color: var(--muted); font-size: 13px; }

/* Acoes da mensagem (responder, editar, apagar): aparecem ao lado do balao ao passar o mouse */
.bubble-acts { position: absolute; top: 50%; transform: translateY(-50%); display: none; gap: 3px; z-index: 2; }
.bubble.in .bubble-acts { left: calc(100% + 6px); }
.bubble.out .bubble-acts { right: calc(100% + 6px); }
.bubble:hover .bubble-acts { display: flex; }
.bubble::before { width: 110px; }
.bubble.in::before { right: -110px; }
.bubble.out::before { left: -110px; }
.bubble-acts button { border: 0; border-radius: 13px; min-width: 26px; height: 26px; padding: 0 6px; cursor: pointer; background: var(--surface-3); color: var(--text-2);
  display: grid; place-items: center; font: inherit; font-size: 12px; white-space: nowrap; }
.bubble-acts button:hover { background: var(--primary); color: #fff; }
.bubble-acts button.sure { background: #d9342b; color: #fff; font-weight: 600; }
.bubble-acts .icon-svg { width: 13px; height: 13px; }
.bubble.gone { font-style: italic; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bubble.gone .icon-svg { width: 13px; height: 13px; }

/* Salvar mensagem num campo do negocio */
.sf-list { max-height: 46vh; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.sf-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 10px 0 2px; }
.sf-title:first-child { margin-top: 0; }
.sf-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }
.sf-name { flex: 1; min-width: 0; }
.sf-name .muted { font-size: 13px; }

/* Configuracao do primeiro acesso e Minhas conexoes */
.setup-page { min-height: 100vh; display: flex; justify-content: center; align-items: flex-start; padding: 40px 16px; background: var(--bg); overflow-y: auto; }
.setup-card { width: 100%; max-width: 680px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px 28px 20px; }
.setup-card h1 { font-size: 22px; margin: 0 0 6px; }
.setup-lead { color: var(--text-2); margin: 0 0 18px; line-height: 1.5; }
.setup-list { display: flex; flex-direction: column; gap: 12px; }
.setup-step { display: flex; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2, var(--surface)); }
.setup-step.ok { border-color: color-mix(in srgb, #2e9e5b 45%, var(--border)); }
.setup-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--surface-3); color: var(--text-2); }
.setup-step.ok .setup-n { background: #2e9e5b; color: #fff; }
.setup-n .icon-svg { width: 15px; height: 15px; }
.setup-title { font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.setup-badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); }
.setup-badge.ok { background: color-mix(in srgb, #2e9e5b 22%, transparent); color: #2e9e5b; }
.setup-badge.todo { background: color-mix(in srgb, #e0a100 22%, transparent); color: #c98f00; }
.setup-p { margin: 0 0 8px; color: var(--text-2); line-height: 1.5; font-size: 14px; }
.setup-p.warn { color: #c98f00; }
.setup-ol { margin: 0 0 10px; padding-left: 20px; color: var(--text-2); font-size: 14px; line-height: 1.7; }
.setup-foot { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }

/* Fila: grupo "Hora combinada" (atividade com hora marcada com o lead, quando a hora chega) */
.queue-group .head.due { color: #f0a020; }
.queue-group .head.due .n { background: #f0a020; color: #1a1300; }

/* Area de trabalho (Rayo x Lumina) e gerador de proposta da Lumina */
.area-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; margin-left: 4px; flex: none; }
.area-switch button { border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 13px; padding: 4px 12px; cursor: pointer; }
.area-switch button.on { color: #fff; font-weight: 600; }
.area-switch button.on.rayo { background: #801199; }
.area-switch button.on.lumina { background: #a2d643; color: #0f1d25; }
.overlay:has(.modal.proposal) { padding-top: 3vh; }
.modal.proposal { width: 720px; }
.proposal-frame { display: block; width: 100%; height: 78vh; border: 0; background: #0f1d25; }
.proposal-btn { margin-left: 6px; white-space: nowrap; }

/* Etiquetas do negocio (cores do Pipedrive) */
.tags { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; max-width: 100%; }
.tag { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 1px 7px; border-radius: 9px; font-size: 11.5px; font-weight: 700; line-height: 1.5; color: #fff; background: #7a8194; }
.tag.c-blue { background: #317ae2; } .tag.c-green { background: #08a742; } .tag.c-red { background: #d83c38; } .tag.c-purple { background: #721ea9; }
.tag.c-yellow { background: #ffcc00; color: #26292c; } .tag.c-orange { background: #f08a00; } .tag.c-pink { background: #e0348a; } .tag.c-brown { background: #8a5a3c; }
.tag.c-dark-gray { background: #4b5263; } .tag.c-gray { background: #7a8194; }
h2 + .tags { margin-left: 8px; }
.card .tags { margin-top: 4px; }

/* Acabamento dos cartoes do funil e das etiquetas (Luiz, 23/11/2026: "feio e grosseiro"). Etiqueta discreta: fundo
   clarinho na cor dela, texto na mesma cor e um ponto na frente, em vez da placa cheia e saturada. */
.tag { --tc: #7a8194; display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px 1px 6px; border-radius: 5px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .03em; line-height: 1.6; text-transform: uppercase;
  background: color-mix(in srgb, var(--tc) 15%, transparent); color: color-mix(in srgb, var(--tc) 62%, var(--text)); }
.tag::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--tc); }
.tag.c-blue { --tc: #3b82f6; }
.tag.c-green { --tc: #22a559; }
.tag.c-red { --tc: #e5484d; }
.tag.c-purple { --tc: #a855f7; }
.tag.c-yellow { --tc: #d4a306; }
.tag.c-orange { --tc: #f08a00; }
.tag.c-pink { --tc: #ec4899; }
.tag.c-brown { --tc: #a9714b; }
.tag.c-dark-gray, .tag.c-gray { --tc: #8b93a5; color: var(--text-2); }
.col-body { gap: 6px; padding: 4px 8px 8px; }
.card { padding: 9px 30px 8px 11px; border-radius: 8px; box-shadow: none; border: 1px solid color-mix(in srgb, var(--border) 55%, transparent); transition: border-color .12s, background .12s; }
.card:hover { border-color: color-mix(in srgb, var(--primary) 55%, var(--border)); }
.card .title { font-weight: 600; font-size: 13.5px; line-height: 1.3; letter-spacing: -.005em; }
.card .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card .foot { margin-top: 7px; gap: 6px; font-size: 12px; font-weight: 500; color: var(--text-2); min-height: 18px; }
.card .foot .tags { margin: 0; min-width: 0; flex-wrap: nowrap; overflow: hidden; }
.card .foot .num { white-space: nowrap; }
.card .foot .avatar { width: 16px; height: 16px; font-size: 7.5px; opacity: .85; }
.card .state { right: 8px; top: 11px; transform: none; }
.card .state, .card .state svg { width: 15px; height: 15px; }
.col-head { padding: 10px 14px 8px 12px; }
.col-head .name { font-weight: 600; font-size: 13.5px; }
.col-head .sum { font-size: 11.5px; }
.tags .tag[class*="c-"] { background: color-mix(in srgb, var(--tc) 15%, transparent); color: color-mix(in srgb, var(--tc) 62%, var(--text)); }
.tags .tag.c-gray, .tags .tag.c-dark-gray { color: var(--text-2); }
.tags .tag { display: inline-block; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.tags .tag::before { display: inline-block; margin-right: 5px; vertical-align: 1px; }
.card .foot .tags { flex: 0 1 auto; }

.queue-paused { padding: 6px 12px 0; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }

/* Acabamento do texto, dos icones e dos formularios (Luiz, 23/11/2026: "texto feio, icones pixelados").
   Em monitor comum (sem alta densidade) o texto claro sobre fundo escuro engrossa e borra com a suavizacao padrao do macOS;
   "antialiased" desenha a letra mais fina e nitida. */
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; font-feature-settings: "kern", "liga", "calt"; }
.icon-svg { width: 16px; height: 16px; }
.icon-svg path { stroke-width: 1.5px; }
.chip .icon-svg { width: 15px; height: 15px; }
.modal { width: 560px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.modal-head { padding: 16px 20px 14px; }
.modal-head h2 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.modal-body { padding: 18px 20px 6px; }
.modal-foot { padding: 12px 20px 14px; }
.field { gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: .01em; }
.input, select.input { height: 34px; }
.input, select.input, textarea.input { background: color-mix(in srgb, var(--bg) 55%, var(--surface)); border-color: color-mix(in srgb, var(--border) 75%, transparent); transition: border-color .12s, box-shadow .12s; }
.input:hover { border-color: var(--border); }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
textarea.input { line-height: 1.45; padding-top: 8px; }
.chip { height: 28px; padding: 0 11px; border-radius: 8px; font-size: 12.5px; font-weight: 500; color: var(--text-2); background: transparent;
  border-color: color-mix(in srgb, var(--border) 80%, transparent); transition: background .12s, border-color .12s, color .12s; }
.chip:hover { background: var(--surface-2); color: var(--text); }
.chip.on { background: color-mix(in srgb, var(--primary) 22%, transparent); border-color: color-mix(in srgb, var(--primary) 75%, transparent); color: var(--text); font-weight: 600; }
.type-groups { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.type-row { display: flex; align-items: flex-start; gap: 10px; }
.type-fam { flex: none; width: 78px; padding-top: 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.type-row .type-pick { margin: 0; gap: 6px; flex: 1; }
.hint-line { font-size: 11.5px; line-height: 1.4; }
.btn { letter-spacing: .005em; }

.proposal-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }
.proposal-row:last-of-type { border-bottom: 0; }

.file-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 6px; color: var(--text); font-size: 13px; }
.file-row:hover { background: var(--surface-2); text-decoration: none; }
.file-row .muted { font-size: 11.5px; white-space: nowrap; }
/* Resultado da busca: caixa mais larga que o campo e o nome com prioridade (antes o telefone espremia o nome) */
.search .pop { right: auto !important; width: 440px; max-width: 80vw; }
.search .pop .opt { gap: 12px; }
.search .pop .opt .grow { flex: 1 1 60%; min-width: 0; font-weight: 500; }
.search .pop .opt .muted { flex: 0 1 auto; max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }

/* Microanimacoes (Luiz, 23/11/2026: "sinto falta de uma pequena animacao quando clico nos botoes").
   Regra: resposta imediata ao toque (o botao afunda em 60 ms) e volta com um leve quique; nada demora mais de 250 ms. */
.btn, .chip, .check, .phone-chip, .area-switch button, .wa-color, .rail .item, .tab {
  transition: transform .26s cubic-bezier(.34, 1.56, .64, 1), background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .18s ease, filter .15s ease, opacity .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:not(:disabled):hover { filter: brightness(1.08); }
.btn.primary:not(:disabled):hover { box-shadow: 0 3px 12px color-mix(in srgb, var(--primary) 42%, transparent); }
.btn.good:not(:disabled):hover { box-shadow: 0 3px 12px rgba(23, 131, 74, .38); }
.btn.danger:not(:disabled):hover { box-shadow: 0 3px 12px color-mix(in srgb, var(--danger) 36%, transparent); }
.btn:not(:disabled):active, .chip:active, .phone-chip:active, .area-switch button:active, .wa-color:active, .rail .item:active, .tab:active {
  transform: scale(.955); filter: brightness(.93); transition-duration: .06s; box-shadow: none;
}
.btn.icon:not(:disabled):active, .check:active { transform: scale(.88); transition-duration: .06s; }
.btn:focus-visible, .chip:focus-visible { outline: 2px solid color-mix(in srgb, var(--primary) 70%, transparent); outline-offset: 2px; }
/* cartoes e linhas: sobem um pouco ao passar o mouse e afundam no clique */
.card { transition: transform .2s cubic-bezier(.34, 1.4, .64, 1), border-color .12s, background .12s, box-shadow .18s; }
.card:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0, 0, 0, .28); }
.card:active { transform: scale(.985); transition-duration: .06s; }
.queue-row, .pop .opt, .file-row { transition: background-color .12s ease, transform .12s ease; }
.queue-row:active, .pop .opt:active, .file-row:active { transform: scale(.99); }
/* janelas, menus e avisos entram com um movimento curto em vez de aparecer de uma vez */
.overlay { animation: fade-in .14s ease-out; }
.modal { animation: modal-in .2s cubic-bezier(.2, .9, .3, 1.15); }
.pop { animation: pop-in .13s ease-out; transform-origin: top center; }
.toast { animation: toast-in .24s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.975); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .btn, .chip, .check, .card, .modal, .overlay, .pop, .toast, .queue-row, .rail .item, .tab { animation: none !important; transition: none !important; transform: none !important; }
}

.dc-panels { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.dc-panels .panel { margin: 0; }
.dc-panels .proposal-row { flex-wrap: wrap; }
/* Janela com tabela larga (pessoas repetidas): mais espaco e sem quebrar as datas */
.modal.wide:has(table.grid) { width: 940px; }
.modal table.grid td, .modal table.grid th { white-space: nowrap; }
.modal table.grid td:last-child { white-space: normal; min-width: 160px; }

/* ── Balao de atividades do cartao do quadro (igual ao Pipedrive, 26/11/2026) ── */
.card .act-btn { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); padding: 3px; margin: 0; border: 0; background: none;
  border-radius: 50%; cursor: pointer; display: grid; place-items: center; line-height: 0; }
.card .act-btn .state { position: static; transform: none; }
.card .act-btn:hover { background: var(--surface-3, var(--surface-2)); }
.act-pop { position: fixed; z-index: 70; width: 340px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); overflow: hidden; }
.act-pop-list { max-height: 260px; overflow-y: auto; padding: 6px; }
.act-pop-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.act-pop-item:hover { background: var(--surface-2); }
.act-pop-item > .icon-svg { color: var(--text-2); }
.act-pop-check { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 1.5px solid var(--muted); background: none; padding: 0; cursor: pointer; }
.act-pop-check:hover { border-color: var(--good); background: color-mix(in srgb, var(--good) 20%, transparent); }
.act-pop-subject { font-weight: 600; font-size: 14px; color: var(--text); }
.act-pop-meta { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.act-pop-meta .due.overdue { color: var(--danger); }
.act-pop-meta .due.today { color: var(--good); }
.act-pop-empty { padding: 12px 10px; color: var(--muted); font-size: 13px; }
.act-pop-add { display: flex; align-items: center; gap: 8px; width: 100%; padding: 13px 16px; border: 0; border-top: 1px solid var(--border);
  background: none; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.act-pop-add:hover { background: var(--surface-2); }

/* ── Insights: relatorios no modelo do Pipedrive (26/11/2026) ── */
/* Paleta categorica validada (8 cores, ordem fixa; claro e escuro com passos proprios). Cinza para "Outros". */
:root { --cat-1: #257de0; --cat-2: #f47230; --cat-3: #00b894; --cat-4: #f2a600; --cat-5: #ee7fac; --cat-6: #008a17; --cat-7: #6a4ce2; --cat-8: #ec4647; --cat-other: #9aa0aa; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --cat-1: #338ced; --cat-2: #e76624; --cat-3: #00a888; --cat-4: #d28e05; --cat-5: #e24d8b; --cat-6: #0aac23; --cat-7: #9887ef; --cat-8: #eb6263; --cat-other: #6b707a; } }
:root[data-theme="dark"] { --cat-1: #338ced; --cat-2: #e76624; --cat-3: #00a888; --cat-4: #d28e05; --cat-5: #e24d8b; --cat-6: #0aac23; --cat-7: #9887ef; --cat-8: #eb6263; --cat-other: #6b707a; }

.ins-layout { display: flex; flex: 1; min-height: 0; }
.ins-side { width: 260px; flex: none; border-right: 1px solid var(--border); padding: 14px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; background: var(--chrome); }
.ins-create { display: flex; gap: 6px; margin-bottom: 6px; }
.ins-create-btn { width: 100%; justify-content: center; height: 36px; }
.ins-search { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; }
.ins-search input { border: 0; background: none; outline: none; color: var(--text); font: inherit; width: 100%; }
.ins-search .icon-svg { color: var(--muted); }
.ins-sec { display: flex; align-items: center; gap: 8px; margin: 12px 4px 4px; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--text-2); }
.ins-sec.click { cursor: pointer; }
.ins-sec .icon-svg:last-child { width: 13px; height: 13px; }
.ins-count { font-size: 11px; font-weight: 600; padding: 0 7px; border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.ins-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; color: var(--text); font-size: 14px; text-decoration: none; min-width: 0; }
.ins-item:hover { background: var(--surface-2); text-decoration: none; }
.ins-item.on { background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--primary); font-weight: 600; }
.ins-item .icon-svg { color: var(--muted); }
.ins-item.on .icon-svg { color: var(--primary); }
.ins-none { padding: 6px 10px; font-size: 13px; color: var(--muted); }
.ins-main { flex: 1; min-width: 0; overflow: auto; }
.ins-title { font-size: 20px; font-weight: 700; padding: 18px 16px 6px; }
@media (max-width: 760px) { .ins-layout { flex-direction: column; } .ins-side { width: auto; border-right: 0; border-bottom: 1px solid var(--border); max-height: 40vh; } }

.rep { padding: 16px 20px 32px; display: flex; flex-direction: column; gap: 14px; max-width: 1500px; }
.rep-head { display: flex; align-items: center; gap: 8px; }
.rep-title { font-size: 21px; font-weight: 700; color: var(--text); background: none; border: 1px solid transparent; border-radius: 8px; padding: 4px 8px; margin-left: -8px; min-width: 0; flex: 0 1 520px; font-family: inherit; }
.rep-title:hover { border-color: var(--border); }
.rep-title:focus { outline: none; border-color: var(--accent); }
.rep-kind-pill { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; font-weight: 600; font-size: 14px; }
.rep-kind-pill .icon-svg { color: var(--text-2); }

.rep-filters { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.rep-filters-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; }
.rep-filters-head .icon-svg { color: var(--text-2); }
.rep-chips { font-size: 11.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-filters-body { border-top: 1px solid var(--border); padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.rep-group { position: relative; border: 1px solid var(--border); border-radius: 10px; padding: 12px 84px 10px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.rep-group-tools { position: absolute; right: 8px; top: 10px; display: flex; gap: 2px; }
.rep-cond { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rep-and { width: 62px; flex: none; color: var(--muted); font-size: 14px; }
.rep-val { width: 200px; height: 30px; }
.rep-date { width: 150px; height: 30px; }
.rep-range { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; color: var(--text-2); min-width: 110px; }
.rep-add { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; margin-left: 70px; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 4px 0; }
.rep-add .plus { width: 22px; height: 22px; border-radius: 50%; background: var(--good); color: #fff; display: grid; place-items: center; }
.rep-add .plus .icon-svg { width: 13px; height: 13px; stroke-width: 3; }
.rep-or { align-self: flex-start; font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 6px; text-transform: uppercase; letter-spacing: .05em; }
.rep-group-add { display: flex; align-items: center; gap: 8px; }
.rep-or-pill { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border: 1px solid var(--border); border-radius: 8px; color: var(--text-2); font-weight: 600; }
.rep-ent .drop-btn { font-weight: 700; letter-spacing: .01em; }
.drop-head { padding: 7px 10px 5px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); border-radius: 6px; margin-bottom: 4px; }

.rep-card { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.rep-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.rep-types { display: flex; gap: 4px; }
.rep-types .btn.on { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.rep-types .btn .icon-svg { width: 18px; height: 18px; }
.rep-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 16px 4px; }
.rep-controls label { font-size: 13.5px; color: var(--text-2); }
.rep-controls .sep { width: 1px; height: 22px; background: var(--border); margin: 0 6px; }
.rep-body { padding: 8px 16px 16px; min-height: 220px; transition: opacity .15s; }
.rep-body.busy { opacity: .55; }
.rep-empty { padding: 48px 0; text-align: center; color: var(--muted); }
.rep-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: flex-end; font-size: 13px; color: var(--text-2); padding: 4px 0 8px; }
.rep-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rep-legend i, .rep-tip i, .rep-pie-legend i { width: 11px; height: 11px; border-radius: 3px; flex: none; display: inline-block; }
.rep-chart { position: relative; width: 100%; overflow: hidden; }
.rep-chart svg { display: block; }
.rep-chart .grid { stroke: var(--grid); stroke-width: 1; }
.rep-chart .ax, .rep-pie .ax { fill: var(--muted); font-size: 11.5px; }
.rep-chart .val { fill: var(--text); font-size: 11.5px; font-weight: 700; }
.rep-tip { position: absolute; pointer-events: none; min-width: 200px; z-index: 5; }
.rep-tip .row { display: flex; align-items: center; gap: 7px; margin-top: 3px; }
.rep-tip .row.tot { border-top: 1px solid var(--border); padding-top: 4px; margin-top: 6px; font-weight: 700; }
.rep-hbars { position: relative; display: flex; flex-direction: column; gap: 6px; max-height: 560px; overflow-y: auto; padding-right: 4px; }
.rep-hrow { display: grid; grid-template-columns: minmax(120px, 220px) 1fr; align-items: center; gap: 12px; font-size: 13px; }
.rep-hrow .lab { color: var(--text-2); text-align: right; }
.rep-hrow .track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rep-hrow .stack { display: flex; height: 18px; gap: 1px; min-width: 2px; border-radius: 0 4px 4px 0; overflow: hidden; }
.rep-hrow .stack i { display: block; height: 100%; min-width: 1px; }
.rep-hrow .v { font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.rep-pie { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; padding: 8px 0; }
.rep-pie path { cursor: pointer; transition: opacity .12s; }
.rep-pie path.dim { opacity: .35; }
.rep-pie .pie-big { fill: var(--text); font-size: 19px; font-weight: 700; }
.rep-pie-legend { display: flex; flex-direction: column; gap: 4px; min-width: 260px; flex: 1; max-width: 520px; }
.rep-pie-legend .row { display: flex; align-items: center; gap: 9px; padding: 5px 8px; border-radius: 6px; font-size: 13.5px; }
.rep-pie-legend .row.on { background: var(--surface-2); }
.rep-pie-legend .pct { width: 56px; text-align: right; }
.rep-number { padding: 40px 0; text-align: center; }
.rep-number .n { font-size: 46px; font-weight: 700; letter-spacing: -.02em; }
.rep-table tfoot td { border-top: 2px solid var(--border); }
.rep-items { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.rep-items-head { display: flex; align-items: baseline; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.rep-items-head .muted { font-size: 12.5px; }
.rep-items .table-wrap { max-height: 520px; overflow: auto; }
.rep-items tr.click { cursor: pointer; }
.rep-items tr.click:hover td { background: var(--surface-2); }
.rep-ctl { display: inline-flex; align-items: center; gap: 8px; padding-right: 14px; margin-right: 6px; border-right: 1px solid var(--border); }
.rep-ctl:last-child { border-right: 0; }

/* Dias em cada etapa, dentro da barra do funil (como no Pipedrive) */
.stagebar button { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 42px; line-height: 1.2; padding: 0 12px; }
.stagebar button .st-name { max-width: 100%; }
.stagebar button .st-days { font-size: 11px; font-weight: 500; opacity: .85; white-space: nowrap; }

/* WhatsApp: mensagem na fila de envio (intervalo entre conversas novas, 27/11/2026) */
.wa-queued { display: inline-flex; align-items: center; gap: 3px; color: var(--text-2, inherit); font-style: italic; }
.wa-queued svg { width: 12px; height: 12px; }
.wa-failed { color: var(--danger, #d9342b); font-weight: 600; }

/* Cartao da ligacao pelo WhatsApp (wacall.js): fixo no canto, com a situacao de verdade da chamada. */
.wacall-card { position: fixed; right: 20px; bottom: 20px; z-index: 900; width: 300px; padding: 14px 16px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--text); white-space: normal; text-align: left; font-weight: 400; }
.wacall-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wacall-ico { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.wacall-ico .icon-svg { width: 18px; height: 18px; }
.wacall-names { display: flex; flex-direction: column; min-width: 0; }
.wacall-names b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wacall-names small { color: var(--muted); font-size: 12px; }
.wacall-state { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.wacall-state .num { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--text-2); margin-left: 4px; }
.wacall-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--muted); }
.wacall-hint { color: var(--muted); font-size: 12.5px; line-height: 1.35; margin-top: -4px; }
.wacall-actions { display: flex; gap: 8px; justify-content: flex-end; }
.wacall-card.wc-wait .wacall-dot { animation: call-pulse .8s infinite alternate; }
.wacall-card.wc-ring { border-color: var(--warn); }
.wacall-card.wc-ring .wacall-ico { background: var(--warn-bg); color: var(--warn); animation: wacall-shake 1s infinite; }
.wacall-card.wc-ring .wacall-dot { background: var(--warn); box-shadow: 0 0 0 0 var(--warn); animation: wacall-wave 1.2s infinite; }
.wacall-card.wc-talk { border-color: var(--good); }
.wacall-card.wc-talk .wacall-ico { background: var(--good-bg); color: var(--good); }
.wacall-card.wacall-in { bottom: auto; top: 72px; z-index: 950; }   /* chamada recebida: no alto, para nao cobrir o cartao da ligacao feita */
.wacall-card.wc-talk .wacall-dot { background: var(--good); }
@keyframes wacall-wave { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--warn) 60%, transparent); } to { box-shadow: 0 0 0 10px transparent; } }
@keyframes wacall-shake { 0%, 50%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(-12deg); } 20%, 40% { transform: rotate(12deg); } }
@media (prefers-reduced-motion: reduce) { .wacall-card .wacall-dot, .wacall-card .wacall-ico { animation: none !important; } }

/* Produtos (os servicos vendidos) no negocio e no ganho (30/11/2026) */
.prod-lines { display: flex; flex-direction: column; gap: 8px; }
.prod-line { display: grid; grid-template-columns: minmax(0, 1fr) 70px 130px 120px 30px; gap: 8px; align-items: center; }
.prod-line.head { font-size: 12px; color: var(--muted); }
.prod-line .input { width: 100%; min-width: 0; }
.prod-line .right { text-align: right; }
.prod-total { font-size: 14px; }
.kv.prod-sum { border-top: 1px solid var(--border); padding-top: 6px; margin-top: 4px; }
table.grid tr.off td { opacity: .6; }
@media (max-width: 640px) { .prod-line { grid-template-columns: minmax(0, 1fr) 56px 100px 30px; } .prod-line > span.right, .prod-line.head > span:nth-child(4) { display: none; } }

/* Insights (30/11/2026): tipos de relatorio, funil de conversao, filtro com varios valores, compartilhar e paineis */
.rep-kind-drop .drop-btn { height: 32px; font-weight: 600; font-size: 14px; }
.rep-fixed { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.rep-fixed .rep-and { width: auto; }
.rep-fixed .rep-and.wide { margin-left: 14px; }
.rep-headline { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 10px; font-size: 14px; }
.rep-headline b { font-size: 15px; }
.rep-chart .rate path { fill: var(--surface-2); stroke: var(--border); }
.rep-chart .rate text { fill: var(--text); font-size: 11px; font-weight: 700; }
.rep-multi .drop-btn { max-width: 340px; }
.rep-box { width: 16px; height: 16px; border: 1.5px solid var(--border); border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.rep-box.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.rep-box .icon-svg { width: 12px; height: 12px; }
.rep-shared { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; background: var(--surface-2); color: var(--text-2); font-size: 12.5px; white-space: nowrap; }
.rep-shared .icon-svg { width: 14px; height: 14px; }
.rep-note { margin: 0 0 10px; padding: 8px 12px; border-radius: 8px; background: var(--surface-2); color: var(--text-2); font-size: 13px; }
.ins-shared { display: inline-flex; flex: none; }
.ins-shared .icon-svg { width: 14px; height: 14px; }
.ins-create-pop { max-height: 70vh; overflow-y: auto; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 14px; }
.dash-card { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 12px 14px; min-width: 0; display: flex; flex-direction: column; }
.dash-card-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; min-width: 0; }
.dash-card-head a { color: var(--text); text-decoration: none; }
.dash-card-head a:hover { text-decoration: underline; }
.dash-card-head > .icon-svg { color: var(--muted); flex: none; }
.dash-tools { display: inline-flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.dash-card:hover .dash-tools, .dash-tools:focus-within { opacity: 1; }
.dash-chips { font-size: 11.5px; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); margin: 3px 0 8px; }
.dash-body { position: relative; min-height: 250px; overflow: hidden; }
.dash-body.busy { opacity: .55; }
.dash-body .rep-empty { padding: 90px 0; }
.dash-body .rep-pie { justify-content: center; }
.dash-body .rep-table { max-height: 300px; overflow: auto; }
@media (hover: none) { .dash-tools { opacity: 1; } }

/* Escolha das colunas da lista do relatorio (30/11/2026) */
.rep-items-head { display: flex; align-items: center; gap: 10px; }
.rep-cols .drop-list { max-height: 360px; }

/* Mini calendario do periodo (30/11/2026) */
.rep-cal .drop-btn { font-variant-numeric: tabular-nums; }
.cal-pop { left: 0; width: 276px; padding: 10px; }
.cal-head { display: flex; align-items: center; gap: 6px; text-align: center; padding-bottom: 8px; font-size: 14px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; }
.cal-wd { text-align: center; font-size: 11.5px; color: var(--muted); padding: 4px 0; }
.cal-day { height: 32px; border: 0; background: none; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; border-radius: 0; font-variant-numeric: tabular-nums; }
.cal-day:hover { background: var(--surface-2); border-radius: 8px; }
.cal-day.today { font-weight: 700; text-decoration: underline; }
.cal-day.in { background: color-mix(in srgb, var(--primary) 18%, transparent); border-radius: 0; }
.cal-day.edge { background: var(--primary); color: #fff; border-radius: 8px; }
.cal-foot { padding-top: 8px; font-size: 12px; color: var(--muted); text-align: center; }
.rep-items table.grid th, .rep-items table.grid td { white-space: nowrap; max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
/* Arrastar o titulo da coluna para mudar a ordem (30/11/2026) */
.rep-items th.movable { cursor: grab; user-select: none; }
.rep-items th.movable:hover { background: var(--surface-2); }
.rep-items th.dragging { opacity: .45; }
.rep-items th.drop-before { box-shadow: inset 3px 0 0 var(--primary); }
.rep-items th.drop-after { box-shadow: inset -3px 0 0 var(--primary); }
/* Filtro "Grupos" da lista de conversas (30/11/2026) */
.chip b.n { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: #e5484d; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

/* Campos personalizados (tela do administrador, fields.js) */
.cf-list { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow: auto; }
.cf-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.cf-row .cf-move { display: flex; }
.cf-row .cf-kind { width: 150px; flex: none; }
.cf-row .cf-used { width: 96px; flex: none; text-align: right; font-size: 12px; }
.cf-row.cf-new { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
@media (max-width: 640px) { .cf-row { flex-wrap: wrap; } .cf-row .cf-used { display: none; } }

/* Automacoes do CRM (01/12/2026) */
.au-card { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.au-form { border: 1px solid var(--accent, var(--border)); border-radius: 8px; padding: 12px; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.au-act { border-top: 1px solid var(--border); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }

/* Campanhas (04/12/2026) */
.cp-page { padding: 14px 16px 40px; display: flex; flex-direction: column; gap: 14px; max-width: 1080px; width: 100%; }
.cp-head { gap: 8px; flex-wrap: wrap; }
.cp-head h2 { margin: 0; font-size: 19px; }
.cp-name { flex: 1; min-width: 220px; font-size: 16px; font-weight: 600; }
.cp-page section { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.cp-page section > .btn { align-self: flex-start; }
.cp-page h3 { margin: 6px 0 0; font-size: 15px; }
.cp-page .wa-note { margin: 0; }
.cp-n { width: 68px; }
.cp-idle { gap: 6px; flex-wrap: wrap; }
.cp-count { display: flex; align-items: center; gap: 8px; min-height: 28px; flex-wrap: wrap; }
.cp-count b { font-size: 16px; }
.cp-err { color: var(--danger); }
.cp-skip, .cp-note { font-size: 12.5px; }
.cp-people { max-height: 340px; overflow: auto; }
.cp-step { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.cp-step > .row, .cp-vars { flex-wrap: wrap; gap: 8px; }
.cp-step textarea { width: 100%; min-height: 60px; resize: vertical; }
.cp-step .cp-text { min-height: 96px; }
.cp-variations { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--border); padding-top: 8px; font-size: 13px; }
.cp-variations .row { align-items: flex-start; }
.cp-pace { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; align-items: center; }
.cp-pace > span { color: var(--muted); }
.cp-pace > select { justify-self: start; }
.cp-pace .row { gap: 6px; flex-wrap: wrap; }
.cp-line { padding: 2px 0; }
.cp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; padding: 4px 14px 20px; }
.cp-card { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 12px 14px; color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: 6px; }
.cp-card:hover { border-color: color-mix(in srgb, var(--primary) 55%, var(--border)); }
.cp-nums { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 4px; }
.cp-nums div { display: flex; flex-direction: column; }
.cp-nums b { font-size: 18px; }
.cp-nums span { font-size: 12px; color: var(--muted); }
@media (max-width: 640px) { .cp-pace { grid-template-columns: 1fr; gap: 4px; } .cp-pace > span { margin-top: 8px; } .cp-list { grid-template-columns: 1fr; } }
.cp-pace input[type=time] { width: 120px; }
.cp-page .table-wrap { margin: 0; }

/* Importar lista de leads (04/12/2026) */
.il-text { width: 100%; min-height: 90px; resize: vertical; }
.il-file { color: var(--primary); cursor: pointer; text-decoration: underline; }
.il-file input { display: none; }
.il-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0; }
.il-opts .input { width: 100%; }
.il-rows { max-height: 280px; overflow: auto; margin: 0; }
@media (max-width: 640px) { .il-opts { grid-template-columns: 1fr; } }
