/* ============================================================
   ATENDIMENTO + contact panel + integrations styles
   ============================================================ */

.atendimento { flex: 1; display: flex; min-width: 0; }

/* ---------- Column B: conversation list ---------- */
.conv-list { width: var(--list-w); flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; min-height: 0; }
.cl-top { display: flex; gap: 8px; padding: 12px 14px 10px; }
.cl-filtertoggle { display: flex; align-items: center; gap: 8px; margin: 0 14px 8px; padding: 8px 12px;
  background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--r); color: var(--text-2);
  font-weight: 700; font-size: 12.5px; }
.cl-filters { margin: 0 14px 10px; padding: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); }
.ff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.cl-quick { display: flex; gap: 6px; padding: 0 14px 10px; flex-wrap: wrap; }
.qf { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 11.5px; font-weight: 700; }
.qf:hover { background: var(--surface-3); }
.qf.on { background: var(--green-100); color: var(--green-700); border-color: transparent; }
[data-theme="dark"] .qf.on { color: var(--green-400); }
.cl-count { padding: 0 16px 8px; font-size: 12px; color: var(--text-2); }
.cl-count b { color: var(--text); }
.cl-scroll { flex: 1; }

.conv-card { display: flex; gap: 11px; width: 100%; text-align: left; padding: 11px 14px; background: none;
  border: none; border-bottom: 1px solid var(--border-soft); position: relative; transition: background .12s; }
.conv-card:hover { background: var(--surface-2); }
.conv-card[data-active] { background: var(--green-50); }
.conv-card[data-active]::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--green-500); }
.cc-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-time { font-size: 11.5px; color: var(--text-3); flex-shrink: 0; }
.cc-prev { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.cc-unread { min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--green-500); color: #fff;
  font-size: 11px; font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }
.cc-unassigned { width: 20px; height: 20px; border-radius: 50%; border: 1.5px dashed var(--text-3); color: var(--text-3);
  display: grid; place-items: center; }

/* ---------- Column C: messages ---------- */
.msg-panel { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--chat-bg); }
.mp-head { display: flex; align-items: center; gap: 11px; padding: 9px 14px; background: var(--surface);
  border-bottom: 1px solid var(--border); flex-shrink: 0; }
.mp-name { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-phone { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-id { min-width: 0; max-width: 260px; }
.mp-status { border: none; cursor: pointer; }
.mp-status-menu { position: absolute; top: calc(100% + 6px); left: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 6px; z-index: 30; display: flex; flex-direction: column; gap: 2px; }
.mp-status-menu button { background: none; border: none; padding: 6px 8px; border-radius: 7px; text-align: left; }
.mp-status-menu button:hover { background: var(--surface-3); }
.mp-head-sep { width: 1px; height: 26px; background: var(--border); margin: 0 4px; }
.mp-tab { width: 36px; height: 36px; border-radius: 8px; border: none; background: transparent; color: var(--text-2);
  display: grid; place-items: center; position: relative; }
.mp-tab:hover { background: var(--surface-3); }
.mp-tab.on { background: var(--green-100); color: var(--green-700); }
[data-theme="dark"] .mp-tab.on { color: var(--green-400); }
.mp-tab-dot { position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }

.mp-body { flex: 1; padding: 18px 8%; display: flex; flex-direction: column; gap: 4px;
  background-image: radial-gradient(circle at 1px 1px, rgba(120,130,90,.10) 1px, transparent 0);
  background-size: 22px 22px; }
.mp-daysep { text-align: center; margin: 4px 0 12px; }
.mp-daysep span { background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-size: 11.5px;
  font-weight: 700; padding: 4px 12px; border-radius: 999px; box-shadow: var(--shadow-sm); }
.bubrow { display: flex; margin: 2px 0; }
.bubrow.out { justify-content: flex-end; }
.bubble { max-width: 74%; padding: 8px 11px 6px; border-radius: 12px; box-shadow: 0 1px 1px rgba(31,36,23,.08);
  position: relative; display: flex; flex-direction: column; }
.b-in { background: var(--surface); border-top-left-radius: 3px; }
.b-out { background: var(--green-100); border-top-right-radius: 3px; }
[data-theme="dark"] .b-in { background: #232c1a; }
[data-theme="dark"] .b-out { background: #2c3a1a; }
.bub-text { font-size: 13.5px; line-height: 1.45; color: var(--text); white-space: pre-wrap; }
.bub-meta { align-self: flex-end; display: flex; align-items: center; gap: 3px; font-size: 10.5px; color: var(--text-3); margin-top: 3px; }
.bub-file { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.04); border-radius: 8px; padding: 9px 11px; margin-bottom: 4px; min-width: 220px; }
.bf-ic { width: 36px; height: 36px; border-radius: 8px; background: var(--green-500); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.bf-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bf-size { font-size: 11px; color: var(--text-2); }
.mp-typing { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); margin: 8px 0 2px; }
.mp-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: typing 1.2s infinite; }
.mp-typing span:nth-child(2) { animation-delay: .2s; } .mp-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typing { 0%,60%,100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.mp-foot { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: var(--surface); border-top: 1px solid var(--border); flex-shrink: 0; }
.mp-inputwrap { flex: 1; }
.mp-input { width: 100%; background: var(--surface-3); border: 1px solid var(--border); border-radius: 999px; padding: 11px 16px;
  color: var(--text); font-size: 13.5px; outline: none; }
.mp-input:focus { border-color: var(--green-400); }
.mp-send { background: var(--green-500); }

/* ---------- Column D: contact panel ---------- */
.contact-panel { width: var(--contact-w); flex-shrink: 0; display: flex; background: var(--surface); border-left: 1px solid var(--border); min-height: 0; }
.cp-tabbar { width: 52px; flex-shrink: 0; background: var(--surface-2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 0; overflow-y: auto; }
.cp-tab { width: 38px; height: 38px; border-radius: 9px; border: none; background: transparent; color: var(--text-2);
  display: grid; place-items: center; position: relative; flex-shrink: 0; }
.cp-tab:hover { background: var(--surface-3); }
.cp-tab.on { background: var(--green-100); color: var(--green-700); }
[data-theme="dark"] .cp-tab.on { color: var(--green-400); }
.cp-tab.integ::after { content: ""; position: absolute; bottom: 5px; right: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.cp-tab.integ.on::after { display: none; }
.cp-content { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.cp-titlebar { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.integ-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; background: var(--gold-soft); color: #8a6a26; font-size: 10px; font-weight: 800; }
[data-theme="dark"] .integ-pill { background: #3a3013; color: var(--gold); }
.cp-scroll { flex: 1; }
.cp-pad { padding: 16px 16px 28px; }
.cp-rowitem { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--border-soft); font-weight: 600; font-size: 13.5px; }
.cp-sub { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); font-weight: 800; margin: 18px 0 9px; }
.cp-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 11px; }
.select-fake { display: flex; align-items: center; gap: 8px; flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 7px 11px; font-weight: 600; font-size: 13px; }
.tag-add { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 6px; border: 1px dashed var(--green-400); background: transparent; color: var(--green-500); font-size: 11.5px; font-weight: 700; }

/* timeline */
.timeline { position: relative; padding-left: 4px; }
.tl-item { display: flex; gap: 12px; padding: 0 0 16px 8px; position: relative; }
.tl-item::before { content: ""; position: absolute; left: 11px; top: 14px; bottom: -4px; width: 2px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-mark { width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--green-400); background: var(--surface); margin-top: 2px; flex-shrink: 0; z-index: 1; }

/* notes */
.note-card { background: var(--note-bg); border: 1px solid var(--note-border); border-radius: var(--r-lg); padding: 12px 13px; margin-bottom: 10px; }
.note-del { background: none; border: none; color: #b59b3d; padding: 2px; display: grid; place-items: center; }
.note-del:hover { color: var(--st-open); }

/* funnel steps */
.funil-steps { display: flex; flex-direction: column; gap: 2px; }
.fs-row { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px; font-size: 13px; }
.fs-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); display: grid; place-items: center; font-size: 11px; font-weight: 800; flex-shrink: 0; }
.fs-row.past .fs-dot { background: var(--green-400); color: #fff; }
.fs-row.past .fs-name { color: var(--text-2); }
.fs-row.current { background: var(--green-50); }
.fs-row.current .fs-dot { background: var(--green-500); }
.fs-row.current .fs-name { font-weight: 800; }
.fs-pulse { width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgba(255,255,255,.7); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(90,110,42,.5); } 70% { box-shadow: 0 0 0 7px rgba(90,110,42,0); } 100% { box-shadow: 0 0 0 0 rgba(90,110,42,0); } }

/* context table */
.ctx-table { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.ctx-head { display: grid; grid-template-columns: 1fr 1.4fr; background: var(--surface-3); padding: 8px 12px; font-size: 11px; font-weight: 800; color: var(--text-2); letter-spacing: .05em; }
.ctx-row { display: grid; grid-template-columns: 1fr 1.4fr; padding: 9px 12px; border-top: 1px solid var(--border-soft); font-size: 12.5px; }
.ctx-tag { font-family: ui-monospace, monospace; color: var(--green-500); font-weight: 700; }
.ctx-val { color: var(--text); }

/* media grid */
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.media-tile { aspect-ratio: 1; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; overflow: hidden; }
.media-tile.doc { background: var(--surface-3); color: var(--text-2); }

/* ---------- Integration cards ---------- */
.integ-logo { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.integ-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 13px; margin-bottom: 10px; }
.integ-card.proc { margin-bottom: 8px; }
.kv-k { font-size: 11px; color: var(--text-3); font-weight: 700; display: block; }
.kv-v { font-size: 13px; color: var(--text); font-weight: 600; }
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.proc-num { font-family: ui-monospace, monospace; font-size: 12px; font-weight: 700; }
.fin-tile { flex: 1; border-radius: var(--r-lg); padding: 11px 13px; }
.fin-tile.ok { background: color-mix(in srgb, var(--st-done) 12%, transparent); }
.fin-tile.bad { background: color-mix(in srgb, var(--st-open) 12%, transparent); }
.fin-val { display: block; font-weight: 800; font-size: 16px; margin-top: 3px; }
.fin-tile.ok .fin-val { color: var(--st-done); }
.fin-tile.bad .fin-val { color: var(--st-open); }

/* zapsign */
.zs-status { padding: 6px 0 14px; }
.zs-steps { display: flex; align-items: center; }
.zs-step { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--text-3); flex-shrink: 0; }
.zs-step .zs-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.zs-step.done { color: var(--green-500); }
.zs-step.done .zs-dot { background: var(--green-500); color: #fff; }
.zs-line { flex: 1; height: 2px; background: var(--border); margin: 0 4px; margin-bottom: 18px; }
.zs-line.done { background: var(--green-400); }
.zs-doc { display: flex; align-items: center; gap: 11px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 11px 13px; margin-top: 10px; }

/* calc */
.calc-result { margin-top: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px; display: flex; flex-direction: column; gap: 9px; }
.cr-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.strike { text-decoration: line-through; color: var(--text-3); font-weight: 600; }
.cr-big { display: flex; flex-direction: column; gap: 2px; padding: 8px 0 4px; }
.cr-econ { font-family: var(--font-title); font-weight: 800; font-size: 26px; color: var(--green-500); }

/* IA */
.ia-card { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px; font-size: 13px; }
.ia-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; color: #7A5A6E; text-transform: uppercase; letter-spacing: .05em; }
[data-theme="dark"] .ia-tag { color: #b894a8; }
.ia-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ia-chip { background: var(--surface-3); border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 700; color: var(--text-2); }
