:root {
  /* Identidade Palazzo: preto, verde-limão do ícone, verde do site e tons quentes */
  --bg: #F6F4EF;
  --surface: #FFFFFF;
  --surface-2: #FAF9F5;
  --border: #E7E3DA;
  --border-strong: #D9D4C9;
  --text: #161614;
  --text-2: #393935;
  --muted: #66655E;
  --primary: #7ED957;          /* verde Palazzo (fundo de botões, barras) */
  --primary-dark: #6BC946;
  --primary-ink: #2E6A1A;      /* verde escuro para texto e links (contraste) */
  --primary-soft: #EDF7E5;
  --lime: #E4F870;             /* verde-limão do ícone */
  --nav: #111110;
  --nav-2: #1C1C1A;
  --nav-active: #272724;
  --nav-text: #D9D7CF;
  --nav-muted: #8F8D84;
  --green: #3F9A22;
  --green-soft: #E9F6E1;
  --green-text: #1F4D12;
  --bubble-me: #E6F4DA;
  --amber-soft: #FFF3DF;
  --amber-text: #7A3E06;
  --red: #C62828;
  --red-soft: #FCEBEA;
  --red-text: #8F1D1D;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(22, 22, 20, 0.06);
  --shadow-lg: 0 16px 40px rgba(22, 22, 20, 0.18);
  --font-title: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--text);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); min-height: 100%; }
body { font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--primary-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 2px; }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0; background: var(--nav); color: var(--nav-text);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 22px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--primary); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.brand-name { font-size: 16px; font-weight: 700; color: #fff; line-height: 1.2; }
.brand-sub { font-size: 12px; color: #8F8D84; }
.nav-group { display: flex; flex-direction: column; gap: 3px; }
.nav-title { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--nav-muted); padding: 0 12px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 44px;
  border-radius: 10px; color: var(--nav-text); text-decoration: none; font-weight: 500;
}
.nav-link:hover { background: var(--nav-2); color: #fff; }
.nav-link.active { background: var(--nav-active); color: #fff; font-weight: 600; }
.nav-link span.lbl { flex-grow: 1; }
.nav-badge { background: #2A4366; color: #fff; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.nav-link.active .nav-badge, .nav-badge.blue { background: var(--primary); }
.nav-badge.red { background: #8F2B2B; }
.me-box { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--nav-2); }
.me-box .who { min-width: 0; flex-grow: 1; }
.me-box .who b { display: block; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-box .who span { font-size: 12px; color: #8F8D84; }
.me-box button { background: transparent; border: 0; color: var(--nav-text); width: 36px; height: 36px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.me-box button:hover { background: var(--nav-active); color: #fff; }

.main { flex: 1 1 auto; min-width: 0; padding: 26px 30px 40px; display: flex; flex-direction: column; gap: 18px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.page-head .titles { flex: 1 1 320px; display: flex; flex-direction: column; gap: 4px; }
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.page-head p { color: var(--muted); }

/* ---------- Componentes ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--primary);
  background: var(--primary); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--text-2); border-color: var(--border-strong); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.danger { background: #fff; color: var(--red-text); border-color: #F3C4C4; }
.btn.danger:hover { background: var(--red-soft); }
.btn.green { background: var(--green); border-color: var(--green); }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 40px; padding: 0; }
.btn.block { width: 100%; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.pill .dot { width: 8px; height: 8px; border-radius: 999px; background: currentColor; }
.pill.ok { background: var(--green-soft); color: var(--green-text); }
.pill.off { background: var(--red-soft); color: var(--red-text); }
.pill.wait { background: var(--amber-soft); color: var(--amber-text); }
.pill.blue { background: #EFEDE6; color: #3A3934; }
.pill.gray { background: #EFEDE6; color: var(--text-2); }

.tag { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: #F1EFE9; color: var(--text-2); }
.tag.pj { background: #EFEDE6; color: #3A3934; }
.tag.pf { background: #E0F2EF; color: #115E59; }
.tag.utm { background: #F3E8FF; color: #6B21A8; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: #fff; color: var(--text-2); font-weight: 500; font-size: 13px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--nav); border-color: var(--nav); color: #fff; font-weight: 600; }
.chip.blue[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); }

.search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border-strong); border-radius: 10px; padding: 0 12px; min-height: 42px; color: var(--muted); }
.search input { border: 0; outline: none; background: transparent; width: 100%; color: var(--text); }

.avatar { width: 36px; height: 36px; border-radius: 999px; background: #ECE9E1; color: var(--text-2); font-size: 13px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.lg { width: 40px; height: 40px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.warn-box { background: var(--amber-soft); color: var(--amber-text); border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.err-box { background: var(--red-soft); color: var(--red-text); border-radius: 12px; padding: 12px 14px; font-size: 13px; }

/* Formulários */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .field-label { font-size: 13px; font-weight: 600; }
.field small { color: var(--muted); font-size: 12px; }
.input, .field input[type=text], .field input[type=email], .field input[type=password], .field input[type=tel], .field input[type=date], .field input[type=number], .field select, .field textarea {
  border: 1px solid var(--border-strong); border-radius: 10px; padding: 0 12px; min-height: 42px; background: #fff; width: 100%;
}
.field textarea { padding: 10px 12px; resize: vertical; line-height: 1.5; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--primary); flex-shrink: 0; }
.segmented { display: flex; background: #EFEDE6; border-radius: 10px; padding: 4px; gap: 4px; }
.segmented button { flex: 1 1 0; min-height: 36px; border-radius: 8px; border: 0; background: transparent; color: #4A4943; font-weight: 500; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(15,23,42,.12); }

/* ---------- Kanban ---------- */
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.col { flex: 0 0 290px; background: #EEEBE4; border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 10px; border: 2px solid transparent; transition: border-color .15s, background .15s; }
.col.novos { background: var(--primary-soft); border-color: #C9D8F7; }
.col.drop-over { border-color: #7FA3EE; border-style: dashed; background: #F4FBEF; }
.col-head { display: flex; align-items: center; gap: 10px; padding: 2px 2px 0; }
.col-head .t { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.col-head .t b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-head .t span { font-size: 12px; color: #4A4943; display: flex; align-items: center; gap: 6px; }
.count { background: #fff; color: var(--text-2); font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.col.novos .count { background: var(--primary); color: #fff; }
.col-body { display: flex; flex-direction: column; gap: 10px; min-height: 60px; }
.dot-status { width: 8px; height: 8px; border-radius: 999px; background: var(--red); display: inline-block; }
.dot-status.open { background: var(--green); }
.dot-status.connecting { background: #D97706; }

.lead-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; box-shadow: var(--shadow); cursor: grab; }
.lead-card:active { cursor: grabbing; }
.lead-card.dragging { opacity: .5; }
.lc-top { display: flex; align-items: flex-start; gap: 10px; }
.lc-id { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lc-id b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-id span { font-size: 12px; color: var(--muted); }
.lc-time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.lc-msg { font-size: 13px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.lc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.lc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.lc-status { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.lc-status.ok { color: var(--green-text); }
.lc-status.wait { color: var(--amber-text); }
.unread-badge { background: var(--green); color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; }
a.lead-card { text-decoration: none; color: inherit; }

/* ---------- Conversas ---------- */
.conv { display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) minmax(280px, 340px); gap: 16px; align-items: stretch; height: calc(100vh - 52px); min-height: 560px; }
.conv-list, .chat, .ficha { background: #fff; border: 1px solid var(--border); border-radius: 16px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.conv-list-head { padding: 16px 16px 12px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid #EFEDE6; }
.conv-list-head h1 { font-size: 20px; }
.conv-items { overflow-y: auto; flex: 1 1 auto; }
.conv-item { display: flex; gap: 12px; padding: 12px 16px; text-decoration: none; color: inherit; border-bottom: 1px solid #F1EFE9; }
.conv-item:hover { background: var(--surface-2); }
.conv-item.active { background: #F4FBEF; }
.conv-item .body { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.conv-item .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.conv-item .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-item .last { font-size: 13px; color: #475569; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item .who-tag { font-size: 11px; font-weight: 600; color: #4A4943; background: #EFEDE6; padding: 2px 7px; border-radius: 6px; }

.chat-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #EFEDE6; }
.chat-head .t { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-head .t b { font-size: 15px; }
.chat-head .t span { font-size: 12px; color: var(--muted); }
.back-btn { display: none; }
.chat-body { flex: 1 1 auto; overflow-y: auto; background: #F6F4EF; padding: 18px 16px; display: flex; flex-direction: column; gap: 8px; }
.day-sep { align-self: center; font-size: 12px; font-weight: 600; color: #4A4943; background: #E6E2D9; padding: 4px 10px; border-radius: 999px; margin: 6px 0; }
.msg { max-width: 75%; display: flex; flex-direction: column; gap: 3px; align-self: flex-start; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg .bubble { background: #fff; border: 1px solid var(--border); border-radius: 14px 14px 14px 4px; padding: 9px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.me .bubble { background: var(--bubble-me); border-color: transparent; border-radius: 14px 14px 4px 14px; }
.msg.auto .bubble { background: #EFEDE6; }
.msg .media { font-style: italic; color: var(--muted); }
.msg .meta { font-size: 11px; color: var(--muted); padding: 0 4px; }
.composer { border-top: 1px solid #EFEDE6; padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.composer-row { display: flex; gap: 10px; align-items: flex-end; }
.composer textarea { flex-grow: 1; border: 1px solid var(--border-strong); border-radius: 12px; padding: 10px 12px; resize: none; min-height: 44px; max-height: 160px; line-height: 1.45; }
.composer .via { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.composer .via select { border: 1px solid var(--border-strong); border-radius: 8px; padding: 4px 8px; background: #fff; }

.ficha { padding: 16px; gap: 14px; overflow-y: auto; }
.ficha h2 { font-size: 16px; }
.ficha-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.campaign-box { background: #FAF5FF; border: 1px solid #EBD9FC; border-radius: 12px; padding: 10px 12px; font-size: 12px; color: #4C1D95; display: flex; flex-direction: column; gap: 3px; }
.events { display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--muted); }
.events li { list-style: none; }
.events ul { margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
details summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-2); }
.placeholder-center { flex: 1 1 auto; display: grid; place-items: center; color: var(--muted); padding: 24px; text-align: center; }

/* ---------- Tabelas / listas ---------- */
.table-wrap { overflow-x: auto; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 14px 16px; margin: 16px 0 8px; }
.filters .grow { flex: 1 1 260px; }
.filters .field { flex: 0 1 160px; min-width: 130px; }
@media (max-width: 600px) { .filters .field { flex: 1 1 140px; } }
.tbl.clickable tbody tr { cursor: pointer; }
.tbl.clickable tbody tr:hover td, .tbl.clickable tbody tr:focus td { background: var(--surface-2); }
.tbl.clickable tbody tr:focus { outline: none; }
.tbl.clickable tbody tr:focus-visible td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.tbl .nowrap { white-space: nowrap; }
.pend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 16px; align-items: start; margin-top: 16px; }
.pend-section { min-width: 0; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.pend-head { display: flex; align-items: center; gap: 10px; }
.pend-head h2 { font-size: 16px; flex: 1; }
.pend-head .count { background: #EFEDE6; color: var(--text-2); font-weight: 700; font-size: 12px; padding: 2px 9px; border-radius: 999px; }
.pend-list { display: flex; flex-direction: column; gap: 8px; }
.pend-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: inherit; background: #fff; }
.pend-item:hover { background: var(--surface-2); }
.pend-item .pi-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pend-item .pi-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.pend-item .pi-msg { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pend-item .pi-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.ok-banner { padding: 14px 18px; margin-top: 16px; background: var(--green-soft); border-color: #BFE3CF; color: var(--green-text); }
.lc-retorno { font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 8px; align-self: flex-start; }
.lc-retorno.off { background: var(--red-soft); color: var(--red-text); }
.lc-retorno.wait { background: var(--amber-soft); color: var(--amber-text); }
.lc-retorno.blue { background: #EFEDE6; color: #3A3934; }
.lc-retorno.gray { background: #EFEDE6; color: var(--text-2); }
.retorno-box { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.quick-dates { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-dates .chip { min-height: 30px; padding: 0 10px; font-size: 12px; }
.stage-editor { display: flex; flex-direction: column; gap: 8px; }
.stage-row { display: flex; gap: 6px; align-items: center; }
.stage-row input { flex: 1; }
.stage-row .fixed { flex: 1; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 14px; border: 1px dashed var(--border-strong); }
.num-inline { display: inline-flex; align-items: center; gap: 6px; }
.check-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.num-inline input { width: 80px; }
@media (max-width: 600px) { .pend-grid { grid-template-columns: 1fr; } .pend-item .pi-side { display: none; } }
.danger-zone { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding-top: 14px; margin-top: 4px; border-top: 1px solid var(--border); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid #F1EFE9; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }

.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.conn-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.conn-card .top { display: flex; align-items: flex-start; gap: 12px; }
.conn-card .top .t { flex-grow: 1; min-width: 0; }
.conn-card .top .t b { display: block; font-size: 15px; }
.conn-card .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.wa-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; flex-shrink: 0; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile { padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.tile .v { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile .l { font-size: 13px; color: var(--muted); }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.report-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.report-card h2 { font-size: 15px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) 40px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 10px; border-radius: 999px; background: #EFEDE6; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--primary); border-radius: 999px; }

.panel { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.panel h2 { font-size: 16px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; align-items: start; }
.vars { font-size: 12px; color: var(--muted); }
.vars code { background: #EFEDE6; padding: 1px 6px; border-radius: 4px; color: var(--text-2); }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { flex-grow: 1; min-width: 0; border: 1px solid var(--border-strong); border-radius: 8px; padding: 0 10px; min-height: 34px; background: var(--surface-2); font-size: 12px; }

/* ---------- Modal e avisos ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; z-index: 50; overflow-y: auto; }
.modal { background: #fff; border-radius: 18px; width: min(560px, 100%); box-shadow: var(--shadow-lg); padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.modal.wide { width: min(720px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h2 { font-size: 18px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.step i { width: 22px; height: 22px; border-radius: 999px; background: var(--nav); color: #fff; font-style: normal; font-size: 12px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }
.fw-route { display: flex; align-items: center; gap: 10px; background: var(--bg); border-radius: 12px; padding: 12px; flex-wrap: wrap; }
.fw-route .p { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 160px; }
.fw-route .p div { min-width: 0; display: flex; flex-direction: column; }
.fw-route .p b { font-size: 14px; }
.fw-route .p span { font-size: 12px; color: var(--muted); }
.qr-box { display: grid; place-items: center; min-height: 280px; background: var(--surface-2); border-radius: 14px; }
.qr-box img { width: 264px; height: 264px; image-rendering: pixelated; }
.qr-steps { margin: 0; padding-left: 20px; color: var(--text-2); display: flex; flex-direction: column; gap: 4px; font-size: 13px; }

#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--nav); color: #fff; padding: 12px 14px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 13px; }
.toast.error { background: #7F1D1D; }
.toast.warn { background: #78350F; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--nav); }
.login-card { background: #fff; border-radius: 20px; width: min(400px, 100%); padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.login-card .brand-name { color: var(--text); font-size: 18px; }
.login-card .brand-sub { color: var(--muted); }

/* ---------- Celular / telas menores ---------- */
@media (max-width: 1200px) {
  .conv { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); height: auto; }
  .conv .ficha { grid-column: 1 / -1; }
  .conv-list, .chat { height: calc(100vh - 52px); min-height: 520px; }
}
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: sticky; top: 0; z-index: 20; flex-direction: row; align-items: center; padding: 8px 10px; gap: 8px; overflow-x: auto; }
  .brand .brand-sub, .brand-name, .nav-title { display: none; }
  .nav-group { flex-direction: row; gap: 2px; }
  .nav-link { padding: 8px 10px; min-height: 40px; gap: 6px; white-space: nowrap; }
  .me-box { margin: 0 0 0 auto; padding: 4px; background: transparent; }
  .me-box .who, .me-box .avatar { display: none; }
  .main { padding: 16px; }
  .conv { grid-template-columns: 1fr; }
  .conv.has-lead .conv-list { display: none; }
  .conv:not(.has-lead) .chat, .conv:not(.has-lead) .ficha { display: none; }
  .conv-list, .chat { height: calc(100vh - 90px); }
  .back-btn { display: inline-flex; }
  .grid-2 { grid-template-columns: 1fr; }
  .msg { max-width: 88%; }
  .settings-grid, .report-grid { grid-template-columns: 1fr; }
}

/* ---------- Tema Palazzo (cores e tipografia; a estrutura das telas não muda) ---------- */
body { font-size: 13.5px; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: #000; object-fit: cover; box-shadow: 0 0 0 1px #2B2B27; }
.brand-name { font-family: var(--font-title); font-size: 21px; font-weight: 600; letter-spacing: .01em; color: #fff; }
.brand-sub { color: var(--nav-muted); letter-spacing: .04em; }
.nav-title { color: var(--nav-muted); letter-spacing: .14em; }
.nav-link { position: relative; }
.nav-link svg { opacity: .85; }
.nav-link:hover { background: var(--nav-2); color: #fff; }
.nav-link.active { background: var(--nav-active); color: #fff; }
.nav-link.active svg { color: var(--lime); opacity: 1; }
.nav-link.active::before { content: ''; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--lime); }
.nav-badge { background: #34342F; color: #fff; }
.nav-link.active .nav-badge, .nav-badge.blue { background: var(--lime); color: #111110; }
.nav-badge.red { background: #9B2C2C; color: #fff; }
.me-box { background: var(--nav-2); border: 1px solid #2A2A26; }
.me-box .who span { color: var(--nav-muted); }
.me-box button:hover { background: var(--nav-active); color: var(--lime); }

.page-head h1 { font-family: var(--font-title); font-size: 32px; font-weight: 600; letter-spacing: 0; line-height: 1.1; }
.panel h2, .pend-head h2, .report-card h2 { font-family: var(--font-title); font-size: 20px; font-weight: 600; }
.conv-list-head h1, .ficha-head h2 { font-family: var(--font-title); font-weight: 600; }
.conv-list-head h1 { font-size: 26px; }
.ficha-head h2 { font-size: 20px; }
.modal-head h2 { font-family: var(--font-title); font-size: 22px; font-weight: 600; }

.btn { background: var(--primary); border-color: var(--primary); color: #10140C; font-weight: 600; }
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #10140C; }
.btn.secondary { background: #fff; color: var(--text-2); border-color: var(--border-strong); }
.btn.secondary:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { background: #fff; color: var(--red-text); border-color: #F0C3C0; }
.btn.green { background: var(--primary); border-color: var(--primary); color: #10140C; }

.chip[aria-pressed="true"] { background: var(--nav); border-color: var(--nav); color: #fff; }
.chip.blue[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #10140C; }
.pill.blue { background: #EFEDE6; color: #3A3934; }
.tag.pj { background: #EFEDE6; color: #3A3934; }
.tag.pf { background: var(--green-soft); color: var(--green-text); }
.lc-retorno.blue { background: #EFEDE6; color: #3A3934; }
.check input { accent-color: var(--green); }
.col { background: #EEEBE4; }
.col.novos { background: var(--primary-soft); border-color: #CFE9BE; }
.col.novos .count { background: var(--nav); color: var(--lime); }
.col.drop-over { border-color: var(--primary); background: #F4FBEF; }
.msg.auto .bubble { background: #F1EEE6; }
.bar > i { background: var(--primary); }
.tbl.clickable tbody tr:focus-visible td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.step i { background: var(--nav); color: var(--lime); }
.toast { background: var(--nav); }
.ok-banner { background: var(--green-soft); border-color: #CDE8BC; color: var(--green-text); }
.card { border-color: var(--border); }

/* Login */
.login { background: #0B0B0A radial-gradient(circle at 50% -10%, #1D2210 0%, #0B0B0A 55%); }
.login-card { border-radius: 18px; padding: 32px 28px; gap: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding-bottom: 4px; }
.login-brand img { width: min(260px, 80%); height: auto; }
.login-brand p { color: var(--muted); font-size: 12.5px; letter-spacing: .02em; }
.avatar { background: #ECE9E1; color: #3A3934; }
.campaign-box { background: #F7F9EC; border-color: #E2EBC0; color: #3D4710; }
