/* ====== tokens ====== */
/* Identidade Café Conceito: preto, branco, marrom chocolate e laranja caramelo */
:root {
  --black: #141110;
  --chocolate: #4a2c20;
  --caramel: #ad5f1c;
  --caramel-light: #e0924f;
  --bg: #f7f3ef;
  --surface: #ffffff;
  --surface-2: #faf6f2;
  --border: #e9e0d8;
  --border-strong: #d6c9be;
  --text: #1c1714;
  --text-2: #4d423b;
  --muted: #7a6d64;
  --primary: var(--caramel);
  --primary-hover: #94501a;
  --primary-soft: #f6e9dc;
  --on-primary: #ffffff;
  --accent: var(--chocolate);
  --success: #2f7d3b;
  --success-soft: #e4f2e5;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --warning: #9a5a00;
  --warning-soft: #fdf1dc;
  --meta: #1a5fd0;
  --meta-soft: #e8eefd;
  --sidebar: var(--black);
  --sidebar-2: #2a211c;
  --sidebar-text: #cbbfb6;
  --sidebar-active: var(--caramel);
  --temp-fria: #3b82c4;
  --temp-morna: #d4843c;
  --temp-quente: #b3261e;
  --chart: var(--caramel);
  --shadow: 0 1px 2px rgba(20, 17, 16, .05), 0 1px 3px rgba(20, 17, 16, .07);
  --shadow-lg: 0 10px 30px rgba(20, 17, 16, .18);
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #100d0c;
    --surface: #1a1614;
    --surface-2: #221c19;
    --border: #342a25;
    --border-strong: #463831;
    --text: #f1ebe6;
    --text-2: #d0c4bb;
    --muted: #a8998e;
    --primary: var(--caramel-light);
    --primary-hover: #eaa367;
    --primary-soft: #3a2618;
    --on-primary: #141110;
    --accent: #c89a7a;
    --success: #5cc26f;
    --success-soft: #16301c;
    --danger: #ff8a80;
    --danger-soft: #3a1c1a;
    --warning: #f0b44c;
    --warning-soft: #362a12;
    --meta: #7aa7ff;
    --meta-soft: #1f2d52;
    --sidebar: #0a0807;
    --sidebar-2: #221a16;
    --sidebar-active: var(--caramel);
    --chart: var(--caramel-light);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

/* ====== base ====== */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 15px; font-weight: 650; }
h3 { font-size: 14px; }
code { font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--border); word-break: break-all; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: -4px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.pre { white-space: pre-wrap; }
.spacer { flex: 1; }

/* ====== controles ====== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  padding: 7px 12px; border-radius: 8px; font: inherit; font-weight: 550; cursor: pointer;
  white-space: nowrap; text-decoration: none !important; line-height: 1.3;
}
.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.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger.ghost { background: transparent; color: var(--danger); border-color: transparent; }
.btn.whatsapp { background: #1f9d55; border-color: #1f9d55; color: #fff; }
.btn.small { padding: 4px 9px; font-size: 13px; }
.btn.block { width: 100%; justify-content: center; padding: 10px; }
.btn .icon { width: 16px; height: 16px; vertical-align: 0; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn .icon { vertical-align: 0; }
.whatsapp-icon { color: #1f9d55; }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 8px; padding: 7px 10px; min-width: 0;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, .icon-btn:focus-visible, .deal-card:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 1px;
}
textarea { resize: vertical; width: 100%; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field input, .field select, .field textarea { width: 100%; }
.field small { color: var(--muted); font-size: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.narrow { max-width: 560px; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 6px; }
.form-error { color: var(--danger); min-height: 1.2em; margin: 8px 0 0; font-size: 13px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.row-start { display: flex; gap: 8px; align-items: center; }
.row-start.wrap { flex-wrap: wrap; }

.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; background: var(--surface); }
.segmented button { border: 0; background: transparent; color: var(--text-2); padding: 6px 11px; font: inherit; font-weight: 550; cursor: pointer; }
.segmented button + button { border-left: 1px solid var(--border); }
.segmented button.active { background: var(--primary-soft); color: var(--accent); }
.segmented .icon { vertical-align: -4px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600;
  padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
  white-space: nowrap;
}
.chip .icon { width: 13px; height: 13px; vertical-align: 0; }
.chip.meta { background: var(--meta-soft); color: var(--meta); border-color: transparent; }
.status-pill { display: inline-block; font-size: 11.5px; font-weight: 650; padding: 1px 8px; border-radius: 999px; vertical-align: middle; }
.status-pill.ganha { background: var(--success-soft); color: var(--success); }
.status-pill.perdida { background: var(--danger-soft); color: var(--danger); }

.avatar {
  --h: 220;
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: hsl(var(--h) 55% 88%); color: hsl(var(--h) 55% 28%); font-size: 12px; font-weight: 700; vertical-align: middle;
}
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.empty { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--border-strong); }

.banner code { white-space: nowrap; }
.banner { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; margin: 8px 0; font-size: 13.5px; }
.banner.info { background: var(--primary-soft); color: var(--text); }
.banner.warning { background: var(--warning-soft); color: var(--warning); }
.banner.danger { background: var(--danger-soft); color: var(--danger); }
.banner.success { background: var(--success-soft); color: var(--success); }

/* ====== layout ====== */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--sidebar); color: var(--sidebar-text); padding: 16px 12px;
}
.brand { display: flex; align-items: center; padding: 6px 10px 22px; }
.brand img { height: 64px; width: auto; display: block; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px;
  color: var(--sidebar-text); text-decoration: none; font-weight: 550;
}
.sidebar nav a:hover { background: var(--sidebar-2); color: #fff; }
.sidebar nav a.active { background: var(--sidebar-active); color: #fff; }
.sidebar-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 6px 0; border-top: 1px solid var(--sidebar-2); }
.su-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.su-info strong { color: #fff; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.su-info span { font-size: 12px; }
.sidebar-user .icon-btn { color: var(--sidebar-text); }
.sidebar-user .icon-btn:hover { background: var(--sidebar-2); color: #fff; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.view { padding: 22px 26px 40px; min-width: 0; }
.loading { color: var(--muted); padding: 40px; text-align: center; }
.scrim { display: none; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.select-title { font-weight: 650; font-size: 14px; padding: 6px 30px 6px 10px; max-width: 280px; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.search { position: relative; display: flex; align-items: center; flex: 0 1 320px; min-width: 200px; }
.search .icon { position: absolute; left: 9px; color: var(--muted); width: 16px; height: 16px; vertical-align: 0; }
.search input { width: 100%; padding-left: 32px; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.panel > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.panel > header h2 .icon { color: var(--accent); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-2 > .panel { margin-bottom: 0; }
.grid-2 + .panel, .panel + .grid-2 { margin-top: 16px; }
.empty-state { color: var(--muted); padding: 40px 16px; text-align: center; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.empty-state.small { padding: 18px; border: 0; background: transparent; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 550; margin-bottom: 10px; }

/* ====== KPIs ====== */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 24px; font-weight: 750; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: 12.5px; color: var(--text-2); }

/* ====== kanban ====== */
.kanban {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 10px;
  overflow-x: auto; padding-bottom: 12px; align-items: start; min-height: calc(100vh - 200px);
}
.column { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 190px); min-height: 200px; }
.column.drag-over { border-color: var(--primary); background: var(--primary-soft); }
.column > header { padding: 10px 12px 8px; border-top: 3px solid var(--accent); border-radius: var(--radius) var(--radius) 0 0; background: var(--surface); border-bottom: 1px solid var(--border); }
.col-name { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-info { display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.col-sla { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.col-sla .icon { width: 12px; height: 12px; vertical-align: -2px; }
.col-body { padding: 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.col-empty { color: var(--muted); font-size: 12.5px; text-align: center; padding: 20px 8px; border: 1px dashed var(--border-strong); border-radius: 8px; }

.deal-card {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border-strong);
  border-radius: 8px; padding: 9px 10px; box-shadow: var(--shadow); cursor: grab; display: flex; flex-direction: column; gap: 5px;
}
.deal-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.deal-card.dragging { opacity: .45; }
.deal-card.temp-fria { border-left-color: var(--temp-fria); }
.deal-card.temp-morna { border-left-color: var(--temp-morna); }
.deal-card.temp-quente { border-left-color: var(--temp-quente); }
/* passou do prazo da etapa: card fica vermelho */
.deal-card.late { border-color: var(--danger); border-left-color: var(--danger); background: var(--danger-soft); }
.deal-card.late .cd-foot { border-top-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.cd-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.cd-title { color: var(--text); font-weight: 650; font-size: 13.5px; line-height: 1.3; overflow-wrap: anywhere; }
.cd-sub { color: var(--muted); font-size: 12px; }
.cd-meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.cd-value { font-weight: 650; font-size: 13px; font-variant-numeric: tabular-nums; }
.cd-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 12px; border-top: 1px solid var(--border); padding-top: 6px; }
.cd-activity { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.cd-activity .icon, .cd-days .icon { width: 13px; height: 13px; vertical-align: 0; }
.cd-activity.scheduled { color: var(--success); }
.cd-activity.overdue { color: var(--danger); }
.cd-activity.none { color: var(--warning); }
.cd-days { color: var(--muted); display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.cd-days.late { color: var(--danger); }

.drop-bar { position: fixed; left: 232px; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 26px; z-index: 20; pointer-events: none; }
.drop-zone { pointer-events: auto; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 18px; border-radius: 10px; font-weight: 700; font-size: 15px; border: 2px dashed; box-shadow: var(--shadow-lg); }
.drop-zone.win { background: var(--success-soft); color: var(--success); }
.drop-zone.lose { background: var(--danger-soft); color: var(--danger); }
.drop-zone.drag-over { filter: brightness(.94); border-style: solid; }

/* ====== tabelas ====== */
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; background: var(--surface-2); }
.table th.num, .table td.num { text-align: right; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[data-id] { cursor: pointer; }
.table tbody tr[data-id]:hover { background: var(--surface-2); }
.table.compact th, .table.compact td { padding: 7px 10px; }
.table.stages input { width: 100%; }
.table.stages td:nth-child(2) { width: 110px; }
.table.stages td:nth-child(3) select { width: 100%; min-width: 150px; }
.btn.has-msg { color: #1f9d55; border-color: #1f9d55; }

/* ====== oportunidade ====== */
.deal-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.deal-head h1 { overflow-wrap: anywhere; }
.deal-sub { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--text-2); margin-top: 6px; }
.deal-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.owner-box { display: flex; align-items: center; gap: 6px; padding-right: 4px; }
.owner-box select { max-width: 180px; }
.temp-tag { font-weight: 650; }
.temp-tag.temp-fria { color: var(--temp-fria); }
.temp-tag.temp-morna { color: var(--temp-morna); }
.temp-tag.temp-quente { color: var(--temp-quente); }

.stage-bar { display: flex; list-style: none; padding: 0; margin: 0 0 14px; gap: 3px; overflow-x: auto; }
.stage-bar li { flex: 1 0 110px; }
.stage-bar button {
  width: 100%; height: 38px; border: 0; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600;
  background: var(--surface); color: var(--muted); border: 1px solid var(--border);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%);
  padding: 0 14px 0 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stage-bar li:first-child button { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); border-radius: 8px 0 0 8px; }
.stage-bar button:hover:not(:disabled) { background: var(--primary-soft); color: var(--primary); }
.stage-bar .past button { background: var(--primary-soft); color: var(--primary); }
.stage-bar .current button { background: var(--primary); color: var(--on-primary); }
.stage-bar.ganha .current button, .stage-bar.ganha .past button { background: var(--success); color: #fff; }
.stage-bar.perdida .current button { background: var(--danger); color: #fff; }
.stage-bar button:disabled { cursor: default; }

.deal-grid { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.person-name { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.props { display: grid; grid-template-columns: minmax(90px, auto) 1fr; gap: 7px 12px; margin: 0; font-size: 13.5px; }
.props dt { color: var(--muted); }
.props dd { margin: 0; overflow-wrap: anywhere; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: -4px -4px 12px; }
.tab { display: inline-flex; gap: 6px; align-items: center; border: 0; background: transparent; padding: 8px 12px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.quick-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.type-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.type-picker label { cursor: pointer; }
.type-picker input { position: absolute; opacity: 0; }
.type-picker span { display: inline-block; padding: 5px 11px; border: 1px solid var(--border-strong); border-radius: 999px; font-weight: 600; font-size: 13px; }
.type-picker input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.type-picker input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 1px; }

.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: 0; }
.check-btn { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); color: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; margin-top: 1px; }
.check-btn .icon { width: 14px; height: 14px; vertical-align: 0; }
.check-btn:hover:not(:disabled) { border-color: var(--success); color: var(--success); }
.activity-item.done .check-btn { background: var(--success); border-color: var(--success); color: #fff; cursor: default; }
.activity-item.overdue .check-btn { border-color: var(--danger); }
.ai-body { flex: 1; min-width: 0; cursor: pointer; }
.ai-title { font-weight: 600; overflow-wrap: anywhere; }
.ai-title .icon { width: 15px; height: 15px; color: var(--muted); vertical-align: -3px; }
.activity-item.done .ai-title { text-decoration: line-through; color: var(--muted); }
.ai-meta { font-size: 12.5px; color: var(--muted); }
.done-acts { margin-top: 12px; }
.done-acts summary { cursor: pointer; color: var(--muted); font-weight: 600; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.tl-item { display: flex; gap: 12px; padding: 0 0 14px; position: relative; }
.tl-icon { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); z-index: 1; }
.tl-icon .icon { width: 15px; height: 15px; vertical-align: 0; }
.kind-nota .tl-icon { background: var(--warning-soft); color: var(--warning); }
.kind-criado .tl-icon, .kind-reconversao .tl-icon { background: var(--primary-soft); color: var(--accent); }
.kind-whatsapp .tl-icon { background: #e3f5e9; color: #1f9d55; }
.kind-status .tl-icon, .kind-atividade .tl-icon { background: var(--success-soft); color: var(--success); }
.tl-content { flex: 1; min-width: 0; padding-top: 5px; }
.tl-head { font-size: 13px; }
.tl-body { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); margin-top: 2px; }
.kind-nota .tl-body { background: var(--warning-soft); color: var(--text); padding: 8px 10px; border-radius: 8px; margin-top: 4px; }

.simple-list { list-style: none; margin: 0; padding: 0; }
.simple-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.simple-list li:last-child { border-bottom: 0; }
.simple-list.editable li { align-items: center; flex-wrap: nowrap; }
.simple-list.editable input { flex: 1; }

/* ====== relatórios ====== */
.vchart { position: relative; height: 220px; padding-left: 34px; }
.vchart-grid { position: absolute; inset: 0 0 22px 34px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.vchart-grid div { border-top: 1px solid var(--border); position: relative; height: 0; }
.vchart-grid div:last-child { border-top-color: var(--border-strong); }
.vchart-grid span { position: absolute; left: -34px; top: -8px; width: 28px; text-align: right; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.vchart-bars { position: absolute; inset: 0 0 0 34px; display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 2px; }
.vbar-slot { position: relative; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 22px; cursor: default; }
.vbar-slot:hover { background: var(--primary-soft); border-radius: 4px 4px 0 0; }
.vbar { background: var(--chart); border-radius: 4px 4px 0 0; min-height: 0; width: min(100%, 26px); margin: 0 auto; }
.vlabel { position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar-row { display: grid; grid-template-columns: minmax(90px, 36%) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 12px; }
.hbar { display: block; height: 100%; background: var(--chart); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar-row:hover .hbar { filter: brightness(1.12); }
.hbar-value { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 64px; text-align: right; }
.hbar-value small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.chart-tip { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; background: var(--text); color: var(--bg); padding: 5px 9px; border-radius: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; box-shadow: var(--shadow-lg); }

/* ====== configurações ====== */
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; position: sticky; top: 16px; }
.settings-nav a { padding: 8px 10px; border-radius: 7px; color: var(--text-2); font-weight: 550; text-decoration: none; }
.settings-nav a:hover { background: var(--surface-2); }
.settings-nav a.active { background: var(--primary-soft); color: var(--primary); }
.inline-title { font-size: 15px; font-weight: 650; border-color: transparent; background: transparent; padding: 4px 6px; min-width: 200px; }
.inline-title:hover, .inline-title:focus { border-color: var(--border-strong); background: var(--surface); }
.add-stage { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.add-stage input:first-child { flex: 1; min-width: 180px; }
.add-stage input[type=number] { width: 130px; }
.steps { padding-left: 20px; margin: 0 0 16px; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); }
.copy-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.copy-row > span { font-size: 12.5px; font-weight: 600; min-width: 130px; color: var(--text); }
.code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; overflow-x: auto; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ====== modal / toast / login ====== */
.modal { border: 0; border-radius: 14px; padding: 0; width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.modal.wide { width: min(760px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(10, 15, 27, .5); }
.modal form { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal .form-error { padding: 0 20px; margin: 0; }
.modal footer { display: flex; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--border); }
.modal p { margin-top: 0; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 9px; font-weight: 600; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); }
.toast.success { background: var(--success); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 20% 10%, #3a2318 0%, var(--black) 60%); }
.login-card { width: min(380px, 100%); background: var(--surface); border-radius: 14px; padding: 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-lg); }
.login-logo { display: flex; justify-content: center; padding: 4px 0 8px; }
.login-logo img { height: 84px; width: auto; }
.setup-intro { margin: 0; color: var(--text-2); font-size: 13.5px; text-align: center; }
.login-card h1 { text-align: center; font-size: 18px; color: var(--text-2); font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .login-logo img { filter: invert(1); } }

/* ====== responsivo ====== */
@media (max-width: 1100px) {
  .deal-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 40; }
  .topbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--sidebar); color: #fff; position: sticky; top: 0; z-index: 30; }
  .topbar img { height: 30px; width: auto; }
  .topbar .icon-btn { color: #fff; }
  .view { padding: 16px 16px 40px; }
  .settings { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; }
  .settings-nav a { white-space: nowrap; }
  .drop-bar { left: 0; padding: 10px 16px; }
  .kanban { grid-auto-columns: minmax(78vw, 1fr); scroll-snap-type: x mandatory; }
  .column { scroll-snap-align: start; }
  .form-grid { grid-template-columns: 1fr; }
  .search { flex: 1 1 100%; }
  .filters select { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ====== reuniões ====== */
.cd-meeting { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; color: var(--accent); background: var(--primary-soft); border-radius: 6px; padding: 2px 7px; align-self: flex-start; }
.cd-meeting .icon { width: 13px; height: 13px; vertical-align: 0; }
.participants { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0; }
.chip-check { border: 1px solid var(--border-strong); border-radius: 999px; padding: 5px 12px; }
.chip-check:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.center { text-align: center; }
.ok-chip { background: var(--success-soft); color: var(--success); border-color: transparent; padding: 4px 10px; }

/* ====== agenda ====== */
.month-label { font-size: 16px; }
.user-toggle { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--border); gap: 1px; margin-bottom: 10px; }
.cal-head { background: var(--surface-2); padding: 8px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; text-align: center; }
.cal-day { background: var(--surface); min-height: 112px; padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.other { background: var(--surface-2); }
.cal-day.other .cal-num { color: var(--muted); opacity: .6; }
.cal-num { font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-bottom: 2px; }
.cal-day.today .cal-num { background: var(--primary); color: var(--on-primary); border-radius: 999px; width: 24px; height: 24px; display: grid; place-items: center; }
.cal-chip {
  display: flex; align-items: center; gap: 4px; width: 100%; text-align: left; font: inherit; font-size: 12px; line-height: 1.3;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 3px 6px 3px 8px; cursor: pointer;
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; text-decoration: none !important;
}
.cal-chip .icon { width: 12px; height: 12px; flex: none; vertical-align: 0; color: var(--muted); }
.cal-chip b { font-weight: 700; }
.cal-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.cal-chip.meeting { background: var(--primary-soft); border-color: transparent; font-weight: 600; }
.cal-chip.done { opacity: .55; text-decoration: line-through !important; }
.cal-chip.late { border-color: var(--danger); }
.cal-chip.gcal { background: transparent; border-style: dashed; color: var(--text-2); border-left: 4px solid var(--c); }
.gcal-tag { font-size: 10px; font-weight: 700; color: var(--muted); border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 3px; }

/* ====== demandas ====== */
.tasks-board { grid-auto-columns: minmax(180px, 1fr); }
.tasks-board .column { max-height: calc(100vh - 200px); }
.task-column > header { border-top-color: var(--primary); }
.task-column.done-col > header { border-top-color: var(--success); }
.task-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; gap: 5px; }
.task-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.task-card.dragging { opacity: .45; }
.task-title { font-weight: 600; font-size: 13.5px; overflow-wrap: anywhere; }
.task-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.task-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--muted); border-radius: 4px; padding: 1px 5px; }
.task-badge .icon { width: 12px; height: 12px; vertical-align: 0; }
.task-badge.late { background: var(--danger); color: #fff; }
.task-badge.ok { background: var(--success); color: #fff; }
.area-label { align-self: flex-start; font-size: 11px; font-weight: 700; color: #fff; border-radius: 4px; padding: 1px 8px; }
.area-expansao { background: var(--caramel); }
.area-comercial { background: var(--chocolate); }
.area-marketing { background: #2f6f8f; }
.quick-add { padding: 6px 8px 8px; }
.add-card { width: 100%; display: flex; align-items: center; gap: 6px; background: transparent; border: 0; border-radius: 8px; padding: 7px 8px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.add-card:hover { background: var(--border); color: var(--text); }
.quick-add form { display: flex; flex-direction: column; gap: 6px; }
.checklist { list-style: none; margin: 6px 0; padding: 0; }
.checklist li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.checklist li:has(input:checked) span { text-decoration: line-through; color: var(--muted); }
@media (max-width: 860px) { .cal-day { min-height: 80px; } .cal-chip b { display: none; } }

/* ====== WhatsApp ====== */
.nav-badge { margin-left: auto; background: #1f9d55; color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.inbox { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; height: calc(100vh - 130px); min-height: 480px; }
.inbox-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.inbox-list .search { margin: 10px; flex: none; min-width: 0; }
.inbox-list ul { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.inbox-list li[data-person] { padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.inbox-list li[data-person]:hover { background: var(--surface-2); }
.inbox-list li.active { background: var(--primary-soft); }
.conv-top, .conv-bottom { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.conv-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-preview { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-count { background: #1f9d55; color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; flex: none; }
.conv-tags { display: flex; gap: 8px; align-items: center; font-size: 12px; }
.dot-open { color: #1f9d55; font-weight: 600; }
.inbox-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.inbox-chat > .empty-state { margin: auto; border: 0; }
.inbox-chat #chat { flex: 1; min-height: 0; display: flex; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.back-mobile { display: none; }

.wa-chat { display: flex; flex-direction: column; width: 100%; min-height: 0; flex: 1; }
.tab-panel .wa-chat { height: 460px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.wa-thread { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 6px; background: var(--bg); min-height: 0; }
.wa-day { align-self: center; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; margin: 6px 0; }
.wa-msg { max-width: min(75%, 520px); padding: 7px 10px 5px; border-radius: 10px; box-shadow: var(--shadow); font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.wa-msg.in { align-self: flex-start; background: var(--surface); border-top-left-radius: 2px; }
.wa-msg.out { align-self: flex-end; background: #f3e3d3; border-top-right-radius: 2px; }
.wa-msg.tpl { border: 1px dashed var(--caramel); }
.wa-msg.failed { outline: 1px solid var(--danger); }
.wa-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.wa-meta { display: flex; justify-content: flex-end; gap: 6px; font-size: 11px; color: var(--muted); }
.wa-status.read { color: #2f80ed; font-weight: 700; }
.wa-error { font-size: 12px; color: var(--danger); }
.wa-img { max-width: 260px; max-height: 260px; border-radius: 8px; display: block; }
.wa-msg audio { width: 240px; max-width: 100%; }
.wa-doc { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); padding: 6px 10px; border-radius: 8px; font-weight: 600; }
.wa-closed { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--warning-soft); color: var(--warning); font-size: 13px; }
.wa-closed span { flex: 1; }
.wa-pending { padding: 4px 14px; background: var(--surface-2); }
.wa-composer { display: flex; align-items: flex-end; gap: 6px; padding: 8px; border-top: 1px solid var(--border); background: var(--surface); }
.wa-composer textarea { flex: 1; resize: none; max-height: 120px; }
.wa-composer .btn { padding: 8px 12px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wa-msg.out { background: #3a2618; } }

.recorder { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 10px; }
.rec-btn { width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--primary); color: var(--on-primary); cursor: pointer; display: grid; place-items: center; }
.rec-btn .icon { width: 30px; height: 30px; vertical-align: 0; }
.rec-btn.recording { background: var(--danger); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--danger) 20%, transparent); } }
.rec-time { font-weight: 600; color: var(--text-2); }

/* robô por etapa */
.auto-summary { display: flex; flex-wrap: wrap; gap: 4px; min-width: 220px; }
.auto-chip { background: var(--primary-soft); color: var(--accent); border-color: transparent; }
.auto-section { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.auto-section h3 { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.auto-section h4 { margin: 14px 0 6px; }
.tpl-preview { white-space: pre-wrap; background: #f3e3d3; border-radius: 8px; padding: 8px 10px; font-size: 13.5px; margin: 0; }
.tpl-preview:empty { display: none; }
.bot-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bot-step { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); }
.step-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.step-num { width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.step-head input[type=number] { width: 64px; padding: 3px 6px; }
.step-thumb { max-height: 90px; border-radius: 6px; }
.step-media audio { width: 260px; max-width: 100%; }
.add-step { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.howto { margin-bottom: 12px; }
.howto summary { cursor: pointer; padding: 6px 0; }

@media (max-width: 860px) {
  .inbox { grid-template-columns: 1fr; height: calc(100vh - 150px); }
  .inbox.has-chat .inbox-list { display: none; }
  .inbox:not(.has-chat) .inbox-chat { display: none; }
  .back-mobile { display: inline-grid; }
  .wa-msg { max-width: 88%; }
}
.map-chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ====== telefone ====== */
.phone-widget { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.phone-fab { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--black); color: #fff; box-shadow: var(--shadow-lg); cursor: pointer; display: grid; place-items: center; position: relative; order: 2; }
.phone-fab .icon { width: 24px; height: 24px; vertical-align: 0; }
.phone-dot { position: absolute; top: 6px; right: 6px; width: 12px; height: 12px; border-radius: 50%; background: #8a8a8a; border: 2px solid var(--black); }
.phone-widget[data-status="online"] .phone-dot { background: #2ecc71; }
.phone-widget[data-status="connecting"] .phone-dot { background: #f0b44c; }
.phone-widget[data-status="error"] .phone-dot { background: var(--danger); }
.phone-widget.in-call .phone-fab { background: #1f9d55; animation: pulse 1.6s infinite; }
.phone-panel { display: none; width: 290px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; order: 1; }
.phone-widget.open .phone-panel { display: block; }
.phone-panel header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--black); color: #fff; }
.phone-panel header .icon-btn { color: #fff; margin-left: auto; }
.phone-status { font-size: 12px; opacity: .8; }
.phone-status.online { color: #2ecc71; opacity: 1; }
.phone-status.error { color: #ff8a80; opacity: 1; }
.phone-body { padding: 14px; }
.phone-setup { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.phone-setup .icon { width: 28px; height: 28px; color: var(--muted); }
.dial-input { width: 100%; font-size: 20px; text-align: center; letter-spacing: .04em; margin-bottom: 10px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.keypad button { font: inherit; font-size: 18px; font-weight: 600; padding: 10px 0; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; }
.keypad button:hover { background: var(--primary-soft); }
.keypad.small-pad { width: 100%; margin: 6px 0 0; }
.keypad.small-pad button { font-size: 14px; padding: 6px 0; }
.phone-call { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.phone-peer { font-size: 17px; font-weight: 700; }
.phone-timer { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 4px 0; }
.rec-dot { color: var(--danger); font-size: 12px; font-weight: 700; vertical-align: middle; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.phone-actions { display: flex; gap: 14px; margin-top: 8px; }
.round-btn { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); cursor: pointer; display: grid; place-items: center; }
.round-btn .icon { vertical-align: 0; }
.round-btn.on { background: var(--warning-soft); color: var(--warning); border-color: var(--warning); }
.round-btn.accept { background: #1f9d55; color: #fff; border: 0; }
.round-btn.hang { background: var(--danger); color: #fff; border: 0; }
.round-btn.hang .icon { transform: rotate(135deg); }
.btn.call-btn { background: var(--black); border-color: var(--black); color: #fff; }
.call-notes { max-width: 320px; white-space: pre-wrap; }
.kind-ligacao .tl-icon { background: var(--primary-soft); color: var(--accent); }
@media (max-width: 860px) { .phone-widget { right: 12px; bottom: 12px; } .phone-panel { width: calc(100vw - 24px); } }

/* WhatsApp pelo QR Code */
.wa-qr-box { margin: 8px 0 12px; }
.wa-qr-scan { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.wa-qr-scan img { background: #fff; padding: 8px; border-radius: 10px; border: 1px solid var(--border); }
.wa-qr-scan ol { margin: 0; padding-left: 18px; max-width: 360px; line-height: 1.6; }
.wa-qr-ok { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--success-soft); color: var(--text); margin-bottom: 10px; }
.wa-qr-ok > .icon { color: var(--success); flex: none; }

/* Conversas: painel da oportunidade ao lado do chat */
.inbox:has(.inbox-side) { grid-template-columns: 300px minmax(0, 1fr) 300px; }
.inbox-side { border-left: 1px solid var(--border); overflow-y: auto; min-height: 0; background: var(--surface-2); }
.side-block { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.side-block h3 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.side-head { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.side-title { font-weight: 650; color: var(--text); text-decoration: none; }
.side-title:hover { color: var(--primary); }
.side-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 13px; color: var(--text); text-decoration: none; min-width: 0; }
.side-row > span:last-child { text-align: right; overflow-wrap: anywhere; }
.side-row select { max-width: 170px; }
a.side-row:hover span:first-child { color: var(--primary); }
.side-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
@media (max-width: 1200px) {
  .inbox:has(.inbox-side) { grid-template-columns: 260px minmax(0, 1fr); }
  .inbox-side { display: none; }
}
@media (max-width: 860px) { .inbox:has(.inbox-side) { grid-template-columns: 1fr; } }
.status-pill.aberta { background: var(--primary-soft); color: var(--accent); }
.side-head .status-pill { white-space: nowrap; flex: none; }
@media (min-width: 1201px) { .inbox:has(.inbox-side) .only-narrow { display: none; } }
@media (max-width: 860px) { .chat-head { flex-wrap: wrap; } .chat-head > div { flex: 1 1 160px; } }

/* menu suspenso simples (details) */
.side-toolbar { padding: 10px 16px 0; display: flex; justify-content: flex-end; }
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 250px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 4px; display: flex; flex-direction: column; }
.menu-list button { display: flex; gap: 8px; align-items: center; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 6px; font: inherit; color: var(--text); cursor: pointer; }
.menu-list button:hover { background: var(--primary-soft); }

/* listas de ligação */
.page-tabs { margin: 0 0 14px; }
.page-tabs .tab { text-decoration: none; }
.call-lists { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.call-list-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; color: var(--text); text-decoration: none; box-shadow: var(--shadow); }
.call-list-card:hover { border-color: var(--primary); }
.cl-head { display: flex; justify-content: space-between; gap: 8px; }
.cl-progress { height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; }
.cl-progress span { display: block; height: 100%; background: var(--primary); }
.cl-counts { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--text-2); }
.cl-title { margin: 0; font-size: 18px; }
.call-board { grid-auto-columns: minmax(220px, 1fr); }
.col-hint { padding: 0 10px 6px; }
.col-empty { text-align: center; padding: 14px 6px; }
.call-card .cc-phone { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.call-card .cc-phone a:first-child { color: var(--text); text-decoration: none; font-variant-numeric: tabular-nums; display: inline-flex; gap: 4px; align-items: center; }
.call-card .cc-notes { background: var(--surface-2); border-radius: 6px; padding: 4px 6px; color: var(--text-2); white-space: pre-wrap; max-height: 4.5em; overflow: hidden; }
.call-card.closed { opacity: .6; }
.col-realizada header .col-name { color: var(--success); }
.col-nao_atendeu header .col-name { color: var(--danger); }
.col-reuniao header .col-name { color: var(--primary); }
.picker-filters { margin: 10px 0 6px; }
.picker-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 2px; }
.picker-list { max-height: 45vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }
.picker-list tr[data-id] { cursor: pointer; }
.picker-list tr[data-id]:hover { background: var(--surface-2); }
.check-cell { width: 28px; }
a.kpi-link { color: inherit; text-decoration: none; }
a.kpi-link:hover { border-color: var(--primary); }
.home-kpis { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

/* Automações */
.auto-group > header h2 { display: flex; gap: 6px; align-items: center; }
.auto-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.auto-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.auto-card.off { opacity: .6; background: var(--surface-2); }
.auto-head { display: flex; gap: 8px; align-items: flex-start; }
.auto-steps { line-height: 1.7; color: var(--text-2); overflow-wrap: anywhere; }
.auto-steps .icon { width: 14px; height: 14px; vertical-align: -2px; }
.auto-foot { display: flex; flex-direction: column; gap: 2px; }
.auto-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 99px; transition: background .15s; }
.switch span::after { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--success); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.step-delay select { width: auto; padding: 2px 4px; }
.step-delay input { width: 56px; }
.qr-search { margin-bottom: 8px; }
.qr-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.qr-list button { width: 100%; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; font: inherit; color: var(--text); }
.qr-list button:hover { border-color: var(--primary); background: var(--primary-soft); }
