@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ============ Tokens ============ */
:root {
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-2: #f7f9f8;
  --text: #13201b;
  --text-2: #43514b;
  --muted: #6b7a73;
  --border: #e3e8e5;
  --border-strong: #cfd8d3;
  --brand: #12a26e;
  --brand-600: #0e8a5d;
  --brand-700: #0b5c42;
  --brand-900: #062e22;
  --brand-soft: #e3f6ee;
  --focus: rgba(18, 162, 110, .28);
  --danger: #d14343;
  --danger-soft: #fdecec;
  --warn: #b26b00;
  --warn-soft: #fff4de;
  --info: #2f6bd8;
  --info-soft: #e8f0fd;
  --shadow-sm: 0 1px 2px rgba(16, 32, 26, .06);
  --shadow: 0 1px 2px rgba(16, 32, 26, .05), 0 8px 24px rgba(16, 32, 26, .06);
  --shadow-lg: 0 24px 60px rgba(6, 46, 34, .18);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1311;
    --surface: #131c19;
    --surface-2: #18231f;
    --text: #e8efeb;
    --text-2: #b9c6c0;
    --muted: #87968f;
    --border: #24312c;
    --border-strong: #31403a;
    --brand-soft: #123528;
    --danger-soft: #3a1b1b;
    --warn-soft: #3a2c10;
    --info-soft: #172846;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}

/* ============ Base ============ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-600); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }
code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.01em; color: #fff; }
.brand img { width: 32px; height: 32px; }
.brand small { display: block; font-weight: 500; font-size: 12px; color: #9fd9c2; letter-spacing: 0; }
svg.i { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ============ App: estrutura (menu lateral + conteúdo) ============ */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: var(--brand-900);
  background-image: radial-gradient(90% 40% at 0% 0%, rgba(52,211,153,.18) 0%, transparent 70%);
  color: #fff;
  display: flex; flex-direction: column; gap: 22px;
  padding: 22px 14px;
}
.sidebar .brand { padding: 0 8px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav .nav-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #6fb79b; padding: 0 12px; margin: 6px 0 6px; }
.side-nav button {
  display: flex; align-items: center; gap: 12px;
  font: inherit; font-size: 14.5px; font-weight: 600; text-align: left;
  background: transparent; color: #bfe6d6;
  border: 0; padding: 10px 12px; border-radius: 10px; cursor: pointer;
  transition: background .15s, color .15s;
}
.side-nav button:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav button.active { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 #34d399; }
.side-nav .count { margin-left: auto; background: rgba(255,255,255,.12); border-radius: 99px; font-size: 11.5px; padding: 1px 8px; color: #d9f2e8; }
.side-nav .count:empty { display: none; }
.side-foot { margin-top: auto; display: grid; gap: 10px; }
.number-card { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 12px; font-size: 13px; }
.number-card .num { font-weight: 700; font-size: 14px; color: #fff; margin-top: 2px; }
.number-card .row-q { display: flex; align-items: center; gap: 8px; color: #a8d8c4; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #87968f; flex: 0 0 8px; }
.dot.GREEN { background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.18); }
.dot.YELLOW { background: #f5b83d; box-shadow: 0 0 0 4px rgba(245,184,61,.2); }
.dot.RED { background: #f05252; box-shadow: 0 0 0 4px rgba(240,82,82,.2); }
.side-foot .logout { display: flex; align-items: center; gap: 10px; font: inherit; font-size: 14px; font-weight: 600; background: transparent; border: 0; color: #9fd9c2; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.side-foot .logout:hover { background: rgba(255,255,255,.07); color: #fff; }

.content { min-width: 0; }
main { max-width: 1120px; margin: 0 auto; padding: 32px 32px 72px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 4px; }
.page-sub { color: var(--muted); margin: 0; }

/* KPIs */
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-sm); min-width: 0; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-600); }
.kpi-ic.blue { background: var(--info-soft); color: var(--info); }
.kpi-ic.amber { background: var(--warn-soft); color: var(--warn); }
.kpi-value { font-size: 28px; font-weight: 800; letter-spacing: -.03em; margin-top: 10px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-value.sm { font-size: 19px; }
.kpi-foot { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.meter { height: 8px; border-radius: 99px; background: var(--border); overflow: hidden; margin-top: 12px; }
.meter > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), #34d399); transition: width .5s; }
.meter.warn > div { background: linear-gradient(90deg, #e0892b, #f5b83d); }
.meter.full > div { background: var(--danger); }

.two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.link-btn { font: inherit; font-size: 13.5px; font-weight: 700; color: var(--brand-600); background: none; border: 0; cursor: pointer; padding: 4px 0; }
.link-btn:hover { text-decoration: underline; }

/* Lista de campanhas */
.camp-list { display: grid; gap: 10px; }
.camp-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.camp-item:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.camp-item.active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus); }
.camp-item .name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.camp-item .meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.camp-item .bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--muted); }
.camp-item .bar .progress { flex: 1; margin: 0; }
.camp-item .nums { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); grid-column: 1 / -1; flex-wrap: wrap; }
.camp-item .nums b { color: var(--text); font-weight: 700; }

/* Funil */
.funnel { display: grid; gap: 10px; }
.funnel-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 90px; gap: 12px; align-items: center; font-size: 14px; }
.funnel-row .lbl { color: var(--text-2); font-weight: 600; }
.funnel-row .track { height: 28px; background: var(--surface-2); border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.funnel-row .fill { height: 100%; border-radius: 7px; transition: width .5s; }
.funnel-row .val { text-align: right; font-weight: 700; }
.funnel-row .val small { color: var(--muted); font-weight: 600; margin-left: 4px; }

/* Etapas da nova campanha */
.step-card { position: relative; }
.step-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.step-num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--brand-soft); color: var(--brand-600); flex: 0 0 34px; }
.step-card.done .step-num { background: var(--brand); color: #fff; }
.step-card.locked { opacity: .55; pointer-events: none; }
.step-head h2 { margin: 0; }
.step-head p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.dropzone {
  display: grid; place-items: center; text-align: center; gap: 8px;
  padding: 34px 20px; border: 2px dashed var(--border-strong); border-radius: var(--r-lg);
  background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-soft); }
.dropzone .dz-ic { width: 48px; height: 48px; border-radius: 14px; background: var(--surface); display: grid; place-items: center; color: var(--brand-600); box-shadow: var(--shadow-sm); }
.dropzone .dz-ic svg.i { width: 22px; height: 22px; }
.dropzone b { font-size: 15px; }
.dropzone span { color: var(--muted); font-size: 13.5px; }
.file-chip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.file-chip .kpi-ic { flex: 0 0 34px; }
.file-chip .fname { font-weight: 700; }
.file-chip .fmeta { color: var(--muted); font-size: 12.5px; }
.file-chip .link-btn { margin-left: auto; }
.compose { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.var-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.var-row:last-child { border-bottom: 0; }
.var-tag { font-family: ui-monospace, Consolas, monospace; font-size: 13px; font-weight: 700; background: var(--brand-soft); color: var(--brand-600); padding: 4px 8px; border-radius: 6px; justify-self: start; }
.var-row select, .var-row input[type=text] { padding: 9px 11px; font-size: 14px; }
.var-row input:disabled { background: var(--surface-2); color: var(--muted); }
.var-row.custom input[type=text] { font-family: ui-monospace, Consolas, monospace; font-size: 13.5px; grid-column: 2 / -1; }
.v-tools { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { font: inherit; font-size: 12.5px; font-weight: 600; color: var(--brand-600); background: var(--brand-soft); border: 1px solid transparent; border-radius: 99px; padding: 4px 10px; cursor: pointer; }
.chip-btn:hover { border-color: var(--brand); }
.tip { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--info-soft); color: var(--text-2); font-size: 13.5px; }
.tip svg.i { color: var(--info); margin-top: 2px; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 6px; }
.summary div { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; }
.summary span { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.summary b { font-size: 14.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Celular de pré-visualização */
.phone {
  position: sticky; top: 24px;
  border-radius: 34px; padding: 10px; background: #111b21;
  box-shadow: var(--shadow-lg);
}
.phone-screen { border-radius: 26px; overflow: hidden; background: #efeae2; min-height: 420px; display: flex; flex-direction: column; }
.phone-bar { background: #075e54; color: #fff; padding: 14px 14px 12px; display: flex; align-items: center; gap: 10px; }
.phone-bar .av { width: 34px; height: 34px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.phone-bar .av img { width: 24px; height: 24px; }
.phone-bar b { display: block; font-size: 14px; }
.phone-bar small { font-size: 11.5px; opacity: .8; }
.phone-chat {
  flex: 1; padding: 16px 12px;
  background-color: #efeae2;
  background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px);
  background-size: 14px 14px;
}
.wa-msg { background: #fff; color: #111b21; border-radius: 0 10px 10px 10px; padding: 6px; box-shadow: 0 1px 1px rgba(0,0,0,.13); max-width: 95%; font-size: 13.5px; }
.wa-media { height: 130px; border-radius: 7px; background: linear-gradient(135deg, #b7e4d0, #7fcfae); display: grid; place-items: center; color: #0b5c42; font-size: 12px; font-weight: 700; margin-bottom: 6px; background-size: cover; background-position: center; }
.wa-head { font-weight: 700; padding: 2px 4px; }
.wa-body { white-space: pre-wrap; padding: 2px 4px; line-height: 1.4; }
.wa-body .v { background: #d9fdd3; border-radius: 4px; padding: 0 3px; font-weight: 600; }
.wa-foot { color: #667781; font-size: 12px; padding: 4px 4px 0; }
.wa-time { text-align: right; color: #667781; font-size: 11px; padding: 2px 4px 0; }
.wa-btn { display: flex; align-items: center; justify-content: center; gap: 6px; color: #027eb5; font-weight: 600; font-size: 13.5px; background: #fff; border-radius: 10px; margin-top: 3px; padding: 9px; box-shadow: 0 1px 1px rgba(0,0,0,.13); }
.wa-empty { color: #667781; font-size: 13px; text-align: center; margin-top: 120px; padding: 0 20px; }

/* Respostas (estilo conversa) */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.search { position: relative; flex: 1 1 260px; }
.search svg.i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 17px; height: 17px; }
.search input[type=text] { padding-left: 38px; }
.inbox { display: grid; }
.inbox-item { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--border); align-items: start; }
.inbox-item:last-child { border-bottom: 0; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff; }
.inbox-item .who { font-weight: 700; }
.inbox-item .who small { color: var(--muted); font-weight: 500; margin-left: 6px; }
.inbox-item .bubble { display: inline-block; margin-top: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px 12px 12px 12px; padding: 8px 12px; font-size: 14px; max-width: 100%; overflow-wrap: anywhere; }
.inbox-item .when { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--danger-soft); color: var(--danger); margin-left: 6px; vertical-align: middle; }

/* Estado vazio */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .kpi-ic { margin: 0 auto 12px; width: 48px; height: 48px; border-radius: 14px; }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

/* Checklist */
.checklist { list-style: none; padding: 0 !important; margin: 0; display: grid; gap: 12px; }
.checklist li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; margin: 0 !important; font-size: 14px; color: var(--text-2); }
.checklist .ck { width: 22px; height: 22px; border-radius: 7px; background: var(--brand-soft); color: var(--brand-600); display: grid; place-items: center; }
.checklist .ck svg.i { width: 13px; height: 13px; stroke-width: 3; }
.checklist b { color: var(--text); }

/* Toasts e modal */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 10px; max-width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; background: var(--text); color: var(--surface); padding: 12px 14px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; animation: rise .25s ease both; }
.toast.error { background: var(--danger); color: #fff; }
.toast.ok svg.i { color: #34d399; }
.modal-bg { position: fixed; inset: 0; z-index: 90; background: rgba(6, 20, 15, .5); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: fade .15s ease both; }
.modal { background: var(--surface); border-radius: var(--r-lg); padding: 24px; width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); animation: rise .2s ease both; }
.modal h3 { margin: 0 0 8px; font-size: 18px; text-transform: none; letter-spacing: -.01em; color: var(--text); }
.modal p { margin: 0; color: var(--text-2); white-space: pre-line; }
.modal .actions { justify-content: flex-end; margin-top: 22px; }
@keyframes fade { from { opacity: 0; } }

@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col, .compose { grid-template-columns: 1fr; }
  .phone { position: static; max-width: 340px; margin: 0 auto; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { min-width: 0; position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; gap: 12px; padding: 10px 12px; flex-wrap: wrap; }
  .sidebar .brand small { display: none; }
  .side-nav { flex-direction: row; overflow-x: auto; order: 3; width: 100%; scrollbar-width: none; }
  .side-nav .nav-label { display: none; }
  .side-nav button { white-space: nowrap; padding: 8px 12px; }
  .side-nav button.active { box-shadow: inset 0 -2px 0 #34d399; }
  .side-foot { margin: 0 0 0 auto; display: flex; align-items: center; }
  .number-card { display: none; }
  main { padding: 22px 16px 56px; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 22px; }
  .var-row { grid-template-columns: 1fr; }
  .v-tools { grid-column: auto; }
  .funnel-row { grid-template-columns: 80px minmax(0, 1fr) 70px; }
  .page-title { font-size: 22px; }
}

/* ============ Cards e estatísticas ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.card h2 { margin: 0 0 14px; font-size: 17px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card h3 { margin: 22px 0 10px; font-size: 14px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.card ul { margin: 0; padding-left: 20px; color: var(--text-2); }
.card li { margin: 6px 0; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
}
.stat .label { color: var(--muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 24px; font-weight: 800; margin-top: 4px; letter-spacing: -.02em; }
.stat .value small { font-size: 13px; font-weight: 600; }

/* ============ Formulários ============ */
label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; color: var(--text); }
.hint { color: var(--muted); font-size: 13px; font-weight: 400; margin-top: 2px; }
input[type=text], input[type=password], input[type=number], input[type=url], input[type=email], select, textarea {
  width: 100%;
  font: inherit; font-size: 15px;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--focus); }
input[type=file] {
  width: 100%; font: inherit; font-size: 14px;
  padding: 18px; border: 2px dashed var(--border-strong); border-radius: var(--r);
  background: var(--surface-2); color: var(--text-2); cursor: pointer;
}
input[type=file]::file-selector-button {
  font: inherit; font-weight: 700; margin-right: 12px;
  background: var(--brand); color: #fff; border: 0; border-radius: 8px; padding: 8px 14px; cursor: pointer;
}
input[type=checkbox] { accent-color: var(--brand); width: 16px; height: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 200px; }
.row.top { align-items: start; }
.row.top > * > :is(input, select) { height: 46px; }

/* ============ Botões ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 14px; font-weight: 700;
  background: var(--brand); color: #fff;
  border: 0; padding: 10px 18px; border-radius: var(--r-sm);
  cursor: pointer; text-decoration: none;
  transition: background .15s, transform .05s, box-shadow .15s;
  box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 1px 2px rgba(6,46,34,.2);
}
.btn:hover { background: var(--brand-600); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus); }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); box-shadow: none; }
.btn.secondary:hover { background: var(--border); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #b33434; }
.btn.block { width: 100%; padding: 13px 18px; font-size: 15px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn .spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }

/* ============ Tabelas ============ */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }

/* ============ Etiquetas e avisos ============ */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.running, .badge.GREEN { background: var(--brand-soft); color: var(--brand-600); border-color: transparent; }
.badge.running::before { animation: pulse 1.4s ease-in-out infinite; }
.badge.paused, .badge.YELLOW { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.done { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.RED { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
@keyframes pulse { 50% { opacity: .25; } }
.alert { padding: 12px 14px; border-radius: var(--r-sm); margin: 12px 0; font-size: 14px; border: 1px solid transparent; }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.ok { background: var(--brand-soft); color: var(--brand-600); }

.preview-bubble {
  position: relative;
  background: #dcf8c6; color: #111b21;
  border-radius: 4px 12px 12px 12px;
  padding: 10px 12px 12px;
  white-space: pre-wrap; font-size: 14.5px;
  max-width: 440px;
  box-shadow: 0 1px 1px rgba(0,0,0,.12);
}
.progress { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; margin-top: 6px; min-width: 90px; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--brand), #34d399); border-radius: 99px; transition: width .4s; }

/* ============ Telas de acesso (login / esqueci / redefinir) ============ */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
.auth-hero {
  position: relative; overflow: hidden;
  background: var(--brand-900);
  background-image:
    radial-gradient(60% 50% at 15% 10%, rgba(52, 211, 153, .35) 0%, transparent 70%),
    radial-gradient(50% 45% at 90% 90%, rgba(18, 162, 110, .45) 0%, transparent 70%);
  color: #fff;
  padding: 48px 56px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.auth-hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
}
.auth-hero > * { position: relative; z-index: 1; }
.auth-hero .brand { font-size: 19px; }
.auth-hero h1 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.1; letter-spacing: -.03em; font-weight: 800; margin: 0 0 16px; max-width: 520px; }
.auth-hero h1 em { font-style: normal; color: #6ee7b7; }
.auth-hero p.lead { color: #bfe6d6; font-size: 16px; max-width: 460px; margin: 0; }
.features { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.features li { display: flex; gap: 12px; align-items: flex-start; color: #d9f2e8; font-size: 15px; }
.features .ic { flex: 0 0 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.1); display: grid; place-items: center; }
.features .ic svg { width: 16px; height: 16px; stroke: #6ee7b7; }

.chat-demo { display: grid; gap: 10px; max-width: 360px; }
.chat-demo .msg {
  background: #fff; color: #111b21; border-radius: 4px 14px 14px 14px;
  padding: 10px 12px; font-size: 13.5px; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  animation: rise .6s ease both;
}
.chat-demo .msg.me { justify-self: end; background: #d9fdd3; border-radius: 14px 4px 14px 14px; animation-delay: .25s; }
.chat-demo .msg .meta { display: flex; justify-content: flex-end; gap: 4px; align-items: center; color: #667781; font-size: 11px; margin-top: 4px; }
.chat-demo .ticks { color: #53bdeb; font-weight: 700; letter-spacing: -3px; }
.chat-demo .stats { display: flex; gap: 8px; animation: rise .6s ease .5s both; }
.chat-demo .chip { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); color: #d9f2e8; border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; backdrop-filter: blur(4px); }
.chat-demo .chip b { color: #6ee7b7; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.hero-foot { color: #8fcab3; font-size: 13px; }

.auth-main { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .mobile-brand { display: none; margin-bottom: 28px; }
.auth-card .mobile-brand .brand { color: var(--text); }
.auth-card .mobile-brand .brand small { color: var(--brand-600); }
.auth-card h2 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; }
.auth-card .sub { color: var(--muted); margin: 0 0 28px; }
.auth-card form > label:first-of-type { margin-top: 0; }
.field { position: relative; }
.field .toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; color: var(--muted); cursor: pointer;
  width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center;
}
.field .toggle:hover { color: var(--text); background: var(--surface-2); }
.field .toggle svg { width: 18px; height: 18px; }
.field input { padding-right: 46px; }
.form-meta { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 22px; font-size: 14px; gap: 12px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; color: var(--text-2); cursor: pointer; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 24px; font-size: 14px; }
.auth-foot { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.auth-foot svg { width: 16px; height: 16px; flex: 0 0 16px; stroke: var(--brand); }
.success-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--brand-soft); display: grid; place-items: center; margin-bottom: 20px; }
.success-icon svg { width: 28px; height: 28px; stroke: var(--brand-600); }
.success-icon.danger { background: var(--danger-soft); }
.success-icon.danger svg { stroke: var(--danger); }
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; }
.strength span { height: 4px; border-radius: 99px; background: var(--border); transition: background .2s; }
.strength-label { font-size: 12.5px; color: var(--muted); margin-top: 6px; min-height: 18px; }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-card .mobile-brand { display: flex; }
  .auth-main { align-items: start; padding-top: 48px; }
}
@media (max-width: 640px) {
  .card { padding: 18px 16px; border-radius: var(--r); }
}

/* ============ Atendimento (estilo WhatsApp Web) ============ */
:root {
  --chat-bg: #efeae2;
  --chat-dots: rgba(11, 20, 26, .05);
  --bubble-in: #ffffff;
  --bubble-out: #d9fdd3;
  --bubble-text: #111b21;
  --bubble-meta: #667781;
  --tick-read: #53bdeb;
}
@media (prefers-color-scheme: dark) {
  :root {
    --chat-bg: #0b141a;
    --chat-dots: rgba(255, 255, 255, .03);
    --bubble-in: #202c33;
    --bubble-out: #005c4b;
    --bubble-text: #e9edef;
    --bubble-meta: #8696a0;
  }
}
body.full-tab main { max-width: none; padding: 0; }
.side-nav .count.alert { background: #34d399; color: #062e22; font-weight: 800; }

.icon-btn {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 38px; height: 38px; border-radius: 10px;
  background: transparent; border: 0; color: var(--muted); cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.icon-btn.primary { background: var(--brand); color: #fff; }
.icon-btn.primary:hover { background: var(--brand-600); }
.icon-btn.on { color: var(--brand-600); }

.chat-app {
  display: grid; grid-template-columns: 340px minmax(0, 1fr);
  height: 100vh; min-height: 420px; background: var(--surface); overflow: hidden;
}
.chat-app.with-info { grid-template-columns: 340px minmax(0, 1fr) 320px; }

/* Lista */
.chat-side { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--border); background: var(--surface); }
.chat-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 18px 16px 10px; }
.chat-side-head h1 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.chat-tools { display: flex; gap: 4px; }
.chat-search { flex: 0 0 auto; margin: 0 16px 10px; }
.chat-search input[type=text] { background: var(--surface-2); border-color: transparent; padding-top: 9px; padding-bottom: 9px; font-size: 14px; }
.chat-filters { display: flex; gap: 6px; overflow-x: auto; padding: 0 16px 12px; scrollbar-width: none; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.chat-filters::-webkit-scrollbar { display: none; }
.chat-filters button {
  font: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  padding: 5px 11px; border-radius: 99px; cursor: pointer;
}
.chat-filters button:hover { background: var(--surface-2); }
.chat-filters button.active { background: var(--brand-soft); color: var(--brand-600); border-color: transparent; }
.chat-list { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.chat-item {
  display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 12px; align-items: center;
  width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: transparent; border: 0; border-bottom: 1px solid var(--border); padding: 11px 16px;
}
.chat-item:hover { background: var(--surface-2); }
.chat-item.active { background: var(--brand-soft); }
.chat-item .avatar { width: 46px; height: 46px; }
.ci-body { min-width: 0; }
.ci-top, .ci-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ci-top b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-time { font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.chat-item.unread .ci-time { color: var(--brand-600); font-weight: 700; }
.ci-prev { font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item.unread .ci-prev { color: var(--text); font-weight: 600; }
.ci-prev .you { color: var(--text-2); }
.ci-badge { flex: 0 0 auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 800; display: grid; place-items: center; }
.ci-tags { display: flex; gap: 6px; align-items: center; margin-top: 3px; }
.ci-tags:empty { display: none; }
.ci-tags .tag { margin-left: 0; }
.stage { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--info-soft); color: var(--info); }
.stage.fechado { background: var(--brand-soft); color: var(--brand-600); }
.stage.perdido { background: var(--surface-2); color: var(--muted); }
.win-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.2); }

/* Conversa */
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--chat-bg); position: relative; }
.chat-welcome { margin: auto; text-align: center; max-width: 440px; padding: 24px; color: var(--muted); }
.chat-welcome .kpi-ic { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 16px; }
.chat-welcome .kpi-ic svg { width: 28px; height: 28px; }
.chat-welcome h2 { color: var(--text); font-size: 20px; margin: 0 0 8px; }
.chat-welcome p { margin: 0; line-height: 1.6; }
.chat-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--surface); border-bottom: 1px solid var(--border); flex: 0 0 auto; min-width: 0;
}
.chat-head .back { display: none; }
.chat-head .avatar { flex-shrink: 0; }
.chat-main { container-type: inline-size; container-name: chatmain; }
/* Coluna da conversa estreita (ex.: notebook com menu lateral): o nome nunca some */
@container chatmain (max-width: 620px) {
  .chat-head { flex-wrap: wrap; row-gap: 6px; }
  .chat-head .ch-who { min-width: 120px; }
  .chat-head .stage-select { display: none; }
  .chat-head .win-pill { order: 5; margin-left: 50px; font-size: 11.5px; padding: 3px 9px; }
}
.ch-who { display: flex; flex-direction: column; min-width: 0; flex: 1 1 0; text-align: left; background: none; border: 0; font: inherit; color: inherit; cursor: pointer; padding: 0; }
.ch-who b { font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-who span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 99px; white-space: nowrap; }
.win-pill svg.i { width: 14px; height: 14px; }
.win-pill.open { background: var(--brand-soft); color: var(--brand-600); }
.win-pill.closing { background: var(--warn-soft); color: var(--warn); }
.win-pill.closed { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.stage-select { width: auto; padding: 7px 30px 7px 10px; font-size: 13px; font-weight: 600; }

.chat-scroll {
  flex: 1 1 auto; overflow-y: auto; min-height: 0; padding: 14px 6% 18px;
  background-color: var(--chat-bg);
  background-image: radial-gradient(var(--chat-dots) 1px, transparent 1px);
  background-size: 18px 18px;
}
.load-older { text-align: center; margin-bottom: 8px; }
.day-sep { text-align: center; margin: 12px 0; }
.day-sep span { display: inline-block; background: var(--bubble-in); color: var(--bubble-meta); font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 8px; box-shadow: 0 1px 1px rgba(0,0,0,.08); text-transform: capitalize; }
.chat-scroll .msg { display: flex; flex-direction: column; align-items: flex-start; margin: 3px 0; }
.chat-scroll .msg.out { align-items: flex-end; }
.m-bubble {
  position: relative; max-width: min(560px, 78%); min-width: 90px;
  background: var(--bubble-in); color: var(--bubble-text);
  border-radius: 4px 10px 10px 10px; padding: 6px 9px 5px;
  box-shadow: 0 1px 1px rgba(0,0,0,.12); font-size: 14.5px; line-height: 1.42;
}
.msg.out .m-bubble { background: var(--bubble-out); border-radius: 10px 4px 10px 10px; }
.m-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.m-text a { color: #027eb5; font-weight: 500; }
.m-text code { background: rgba(0,0,0,.06); border: 0; }
.m-meta { display: flex; justify-content: flex-end; align-items: center; gap: 3px; font-size: 11px; color: var(--bubble-meta); margin-top: 2px; }
.tick { display: inline-flex; }
.tick svg.i { width: 15px; height: 15px; stroke-width: 2.4; }
.tick.read { color: var(--tick-read); }
.tick.fail { color: var(--danger); }
.m-reply {
  position: absolute; top: 4px; right: -40px; width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: var(--surface); color: var(--muted); box-shadow: var(--shadow-sm);
  display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s;
}
.msg.out .m-reply { right: auto; left: -40px; }
.m-reply svg.i { width: 15px; height: 15px; }
.msg:hover .m-reply, .m-reply:focus-visible, .m-bubble.tapped .m-reply { opacity: 1; }
.m-quote { border-left: 4px solid var(--brand); background: rgba(0,0,0,.05); border-radius: 6px; padding: 5px 8px; margin-bottom: 5px; font-size: 13px; display: flex; flex-direction: column; }
.m-quote b { color: var(--brand-600); font-size: 12.5px; }
.m-quote span { color: var(--bubble-meta); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.m-tpl-label, .m-btn-label, .m-ref { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--bubble-meta); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .03em; }
.m-tpl-label svg.i, .m-btn-label svg.i, .m-ref svg.i { width: 13px; height: 13px; }
.m-ref { text-transform: none; letter-spacing: 0; background: rgba(0,0,0,.05); padding: 5px 8px; border-radius: 6px; font-weight: 500; }
.m-tpl-media { height: 70px; border-radius: 7px; background: linear-gradient(135deg, #b7e4d0, #7fcfae); color: #0b5c42; display: grid; place-items: center; font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.m-tpl-btns { display: grid; gap: 4px; margin-top: 6px; }
.m-tpl-btns span { text-align: center; color: #027eb5; font-weight: 600; font-size: 13.5px; padding: 6px; border-top: 1px solid rgba(0,0,0,.08); }
.m-img { display: block; margin: -2px -5px 4px; border-radius: 7px; overflow: hidden; background: rgba(0,0,0,.05); }
.m-img img { display: block; max-width: 100%; max-height: 340px; min-width: 120px; object-fit: cover; }
.m-img.sticker { background: none; }
.m-img.sticker img { max-width: 140px; }
.m-video { display: block; max-width: 100%; max-height: 340px; border-radius: 7px; margin-bottom: 4px; }
.m-audio { display: flex; align-items: center; gap: 6px; }
.m-audio audio { width: 260px; max-width: 100%; height: 40px; }
.m-doc, .m-loc, .m-contact {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit;
  background: rgba(0,0,0,.05); border-radius: 8px; padding: 10px 12px; margin-bottom: 4px;
}
.m-doc:hover, .m-loc:hover { text-decoration: none; background: rgba(0,0,0,.08); }
.m-doc span, .m-loc span, .m-contact span { display: flex; flex-direction: column; min-width: 0; }
.m-doc b, .m-loc b, .m-contact b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-doc small, .m-loc small, .m-contact small { color: var(--bubble-meta); font-size: 12px; font-weight: 500; }
.m-doc svg.i, .m-loc svg.i, .m-contact svg.i { width: 26px; height: 26px; color: var(--brand-600); }
.m-reacts { margin-top: -6px; background: var(--surface); border-radius: 99px; padding: 1px 7px; font-size: 14px; box-shadow: var(--shadow-sm); z-index: 1; }
.m-err { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--danger); margin-top: 3px; max-width: min(560px, 78%); }
.m-err svg.i { width: 14px; height: 14px; }

/* Campo de mensagem */
.composer { flex: 0 0 auto; background: var(--surface); border-top: 1px solid var(--border); padding: 8px 12px; position: relative; }
.composer-row { display: flex; align-items: flex-end; gap: 6px; }
.composer textarea {
  flex: 1 1 auto; resize: none; min-height: 42px; max-height: 160px; line-height: 1.4;
  border-radius: 21px; padding: 10px 16px; background: var(--surface-2); border-color: transparent; font-size: 15px;
}
.send-btn {
  flex: 0 0 42px; width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--brand); color: #fff; display: grid; place-items: center; transition: background .15s, transform .05s;
}
.send-btn:hover { background: var(--brand-600); }
.send-btn:active { transform: scale(.95); }
.send-btn:disabled { opacity: .5; cursor: wait; }
.reply-bar { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-left: 4px solid var(--brand); border-radius: 8px; padding: 6px 6px 6px 10px; margin-bottom: 8px; }
.reply-bar > div { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: 13px; }
.reply-bar b { color: var(--brand-600); display: flex; align-items: center; gap: 6px; }
.reply-bar b svg.i { width: 14px; height: 14px; }
.reply-bar span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer.closed { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; }
.closed-note { display: flex; gap: 10px; align-items: flex-start; flex: 1 1 320px; font-size: 13.5px; color: var(--text-2); }
.closed-note svg.i { color: var(--warn); margin-top: 2px; }
.quick-pop {
  position: absolute; left: 12px; right: 12px; bottom: calc(100% - 4px); z-index: 5;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  max-height: 280px; overflow-y: auto; padding: 6px;
}
.quick-pop button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; font: inherit; background: none; border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer; color: inherit; }
.quick-pop button.sel, .quick-pop button:hover { background: var(--brand-soft); }
.quick-pop b { color: var(--brand-600); font-size: 13.5px; }
.quick-pop span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.qp-empty { padding: 10px; font-size: 13.5px; color: var(--muted); }

/* Painel do contato */
.chat-info { border-left: 1px solid var(--border); background: var(--surface); overflow-y: auto; padding: 0 18px 24px; min-height: 0; }
.info-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.info-id { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 4px 0 8px; border-bottom: 1px solid var(--border); }
.info-id .avatar { width: 72px; height: 72px; font-size: 24px; margin-bottom: 8px; }
.info-id b { font-size: 17px; }
.info-id span { color: var(--muted); font-size: 14px; }
.info-id small { color: var(--muted); font-size: 12.5px; }
.chat-info h3 { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 20px 0 8px; }
.chat-info textarea { resize: vertical; font-size: 14px; }
.info-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 14px; }
.info-list li { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.info-list svg.i { width: 15px; height: 15px; color: var(--muted); }
.crm-list { margin-bottom: 10px; }
.crm-list li { align-items: flex-start; }
.crm-list li svg.i { margin-top: 3px; color: var(--brand-600); flex-shrink: 0; }
.crm-list span { display: flex; flex-direction: column; min-width: 0; }
.crm-list b { color: var(--text); }
.crm-list small { color: var(--muted); font-size: 12.5px; }
.icon-btn.crm-sent { color: var(--brand-600); background: var(--brand-soft); }
.info-actions { display: grid; gap: 8px; }
.info-actions .btn { justify-content: flex-start; }

/* Modais do atendimento */
.modal.wide { max-width: 600px; max-height: calc(100vh - 40px); overflow-y: auto; }
.modal label { margin-top: 12px; }
.tm-preview { background: var(--bubble-out); color: var(--bubble-text); border-radius: 10px 4px 10px 10px; padding: 10px 12px; font-size: 14px; white-space: pre-wrap; line-height: 1.45; }
.tm-preview .v { background: rgba(18,162,110,.18); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.tm-preview small { color: var(--bubble-meta); }
.qr-list { display: grid; gap: 6px; max-height: 260px; overflow-y: auto; }
.qr-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 8px 8px 12px; }
.qr-item > div { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: 13.5px; }
.qr-item b { color: var(--brand-600); }
.qr-item span { color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 1180px) {
  .chat-app.with-info { grid-template-columns: 300px minmax(0, 1fr); }
  .chat-app.with-info .chat-info { position: absolute; right: 0; top: 0; bottom: 0; width: min(340px, 100%); z-index: 6; box-shadow: var(--shadow-lg); }
  .chat-app { position: relative; grid-template-columns: 300px minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .chat-app, .chat-app.with-info { grid-template-columns: minmax(0, 1fr); }
  .chat-app .chat-main { display: none; }
  .chat-app.open .chat-side { display: none; }
  .chat-app.open .chat-main { display: flex; }
  .chat-head { padding: 8px 10px; gap: 8px; flex-wrap: wrap; }
  .chat-head .back { display: inline-grid; }
  .chat-head .avatar { width: 36px; height: 36px; font-size: 13px; }
  .chat-head .win-pill { order: 5; margin-left: 46px; font-size: 11.5px; padding: 3px 9px; }
  .chat-head .stage-select { display: none; }
  .chat-scroll { padding: 10px 10px 14px; }
  .m-bubble { max-width: 88%; }
  .m-reply { right: -34px; width: 28px; height: 28px; }
  .msg.out .m-reply { left: -34px; }
  .chat-app.with-info .chat-info { width: 100%; }
}
