/* CRM de WhatsApp — usa os mesmos tokens de ui.css */
:root { --col: #e4e8ed; --bubble-in: #ffffff; --bubble-out: #d9ecf2; --chat-bg: #eef1f4; }
@media (prefers-color-scheme: dark) {
  :root { --col: #161c24; --bubble-in: #222b36; --bubble-out: #16414f; --chat-bg: #12171e; }
}

.crm { margin-bottom: 8px; }

/* Campos sem "type" e de busca seguem o mesmo estilo dos demais */
.crm input[type=search], .crm-search input[type=search], .cp input:not([type]), .tm input:not([type]) {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); font: inherit; color: inherit;
}
.crm input[type=search]::-webkit-search-cancel-button { cursor: pointer; }

/* ---------- Barra de busca e filtros ---------- */
.crm-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.crm-search { position: relative; display: block; margin: 0; flex: 1 1 280px; min-width: 220px; max-width: 420px; }
.crm .crm-search input { padding-left: 36px; background: var(--panel); }
.crm-search input[type=search] { background: var(--panel); }
.crm-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.crm-chips { display: flex; gap: 4px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.crm-chips button { border: 0; background: none; padding: 6px 11px; border-radius: 7px; cursor: pointer; font-size: 14px; color: var(--muted); font-weight: 500; }
.crm-chips button:hover { color: var(--ink); }
.crm-chips button[aria-pressed=true] { background: var(--brand); color: var(--brand-ink); }
.crm-bar select { width: auto; min-width: 150px; padding: 8px 10px; background: var(--panel); font-size: 14px; }
.crm-bar .btn { margin-left: auto; }

/* ---------- Quadro ---------- */
.crm-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(264px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.col { background: var(--col); border-radius: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 200px); min-height: 180px; }
.col header { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px; border-top: 3px solid var(--stage, var(--brand)); border-radius: 12px 12px 0 0; }
.col header b { font-size: 14px; font-weight: 600; }
.col-count { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--panel); border-radius: 99px; padding: 0 8px; min-width: 24px; text-align: center; }
.col-total { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.col-list { padding: 4px 8px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 60px; border-radius: 0 0 12px 12px; transition: background .12s; }
.col.drop-target .col-list { background: color-mix(in srgb, var(--stage, var(--brand)) 12%, transparent); outline: 2px dashed color-mix(in srgb, var(--stage, var(--brand)) 60%, transparent); outline-offset: -4px; }
.col-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 18px 8px; }

/* ---------- Card do lead ---------- */
.lead-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; cursor: pointer; display: grid; gap: 6px; position: relative; }
.lead-card:hover { border-color: var(--muted); }
.lead-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.lead-card.dragging { opacity: .45; }
.lead-card.prio-3 { box-shadow: inset 3px 0 0 var(--danger); }
.lead-card.prio-2 { box-shadow: inset 3px 0 0 var(--wait); }
.lead-card.prio-1 { box-shadow: inset 3px 0 0 var(--off); }
.lead-top { display: grid; grid-template-columns: 34px 1fr auto; gap: 9px; align-items: center; }
.av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; color: #fff; background: hsl(var(--h, 200) 42% 42%); flex: none; }
.av.lg { width: 44px; height: 44px; font-size: 16px; }
.lead-id { min-width: 0; }
.lead-id b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-id span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-when { display: grid; justify-items: end; gap: 3px; font-size: 12px; color: var(--muted); }
.lead-when.has-unread time { color: var(--ok); font-weight: 600; }
.unread { background: var(--ok); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 6px; }
.lead-msg { margin: 0; font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.lead-msg.unread-msg { color: var(--ink); }
.lead-foot { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 99px; background: color-mix(in srgb, var(--c) 16%, transparent); color: color-mix(in srgb, var(--c) 78%, var(--ink)); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); white-space: nowrap; }
.tag button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 0 0 2px; font-size: 14px; line-height: 1; }
.flag { font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 99px; white-space: nowrap; }
.flag.today { background: var(--wait-soft); color: var(--wait); }
.flag.late { background: var(--danger-soft); color: var(--danger); }
.flag.later { background: var(--bg); color: var(--muted); }
.owner { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.owner i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; background: hsl(var(--h, 200) 30% 48%); }

/* ---------- Painel de atendimento ---------- */
.cp-overlay { position: fixed; inset: 0; background: rgba(15, 22, 30, .42); z-index: 40; }
.cp { position: fixed; top: 0; right: 0; bottom: 0; width: min(1180px, 100vw); background: var(--bg); z-index: 41; display: grid; grid-template-rows: auto 1fr; box-shadow: -8px 0 30px rgba(0,0,0,.18); }
@media (prefers-reduced-motion: no-preference) { .cp { animation: cp-in .18s ease-out; } }
@keyframes cp-in { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.cp-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cp-head .who { min-width: 0; flex: 1; }
.cp-head h2 { font-size: 20px; margin: 0; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-head .who span { font-size: 14px; color: var(--muted); }
.cp-head select { width: auto; min-width: 170px; }
.cp-close { border: 0; background: none; cursor: pointer; width: 38px; height: 38px; border-radius: 8px; font-size: 22px; color: var(--muted); line-height: 1; }
.cp-close:hover { background: var(--bg); color: var(--ink); }
.cp-tabs { display: none; }
.cp-body { display: grid; grid-template-columns: 360px 1fr; min-height: 0; }
.cp-info { overflow-y: auto; padding: 16px; border-right: 1px solid var(--line); display: grid; gap: 12px; align-content: start; background: var(--panel); }
.cp-sec { border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.cp-sec:last-child { border-bottom: 0; }
.cp-sec h3 { font-size: 13px; font-weight: 600; margin: 0 0 8px; color: var(--muted); }
.cp-sec .field { margin-bottom: 10px; }
.cp-sec label { font-size: 13px; margin-bottom: 4px; }
.cp-sec input, .cp-sec select, .cp-sec textarea { padding: 8px 10px; font-size: 14px; }
.cp-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tags-edit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tags-edit select { width: auto; padding: 4px 8px; font-size: 13px; }
.task, .note { font-size: 14px; padding: 8px 0; border-top: 1px dashed var(--line); }
.task:first-child, .note:first-child { border-top: 0; }
.task { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: start; }
.task.done .t-title { text-decoration: line-through; color: var(--muted); }
.task small, .note small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.note p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 0 4px; line-height: 1; }
.x:hover { color: var(--danger); }
.hist { list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--muted); display: grid; gap: 4px; }

.cp-chat { display: grid; grid-template-rows: 1fr auto; min-height: 0; background: var(--chat-bg); }
.cp-msgs { overflow-y: auto; padding: 18px clamp(12px, 3vw, 32px); display: flex; flex-direction: column; gap: 4px; }
.day { align-self: center; font-size: 12px; color: var(--muted); background: var(--panel); border-radius: 99px; padding: 2px 10px; margin: 10px 0 6px; }
.bub { max-width: min(560px, 78%); padding: 7px 10px 5px; border-radius: 10px; font-size: 14px; line-height: 1.45; background: var(--bubble-in); align-self: flex-start; border: 1px solid var(--line); }
.bub.me { align-self: flex-end; background: var(--bubble-out); border-color: transparent; }
.bub p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.bub a.msg-link { color: #0b57d0; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; word-break: break-word; }
.bub a.msg-link:hover { color: #0842a0; }
.bub a.msg-link:focus-visible { outline: 2px solid #0b57d0; outline-offset: 2px; border-radius: 3px; }
.bub .meta { display: flex; justify-content: flex-end; gap: 4px; font-size: 11px; color: var(--muted); margin-top: 2px; }
.bub .st.read { color: #2a8bd6; }
.bub .st.err { color: var(--danger); font-weight: 700; }
.bub.sending { opacity: .7; }
.bub img, .bub video { max-width: 100%; border-radius: 6px; display: block; margin-bottom: 4px; }
.bub audio { max-width: 100%; }
.media-btn { border: 1px dashed var(--line); background: none; border-radius: 8px; padding: 8px 12px; cursor: pointer; color: var(--brand); font-size: 13px; margin-bottom: 4px; }
.more-msgs { align-self: center; margin-bottom: 8px; }
.chat-empty { margin: auto; color: var(--muted); text-align: center; max-width: 320px; }
.cp-composer { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; padding: 12px 16px; background: var(--panel); border-top: 1px solid var(--line); align-items: end; }
.cp-composer textarea { min-height: 44px; max-height: 160px; resize: none; background: var(--bg); }
.cp-composer .hint { grid-column: 1 / -1; margin: 0; }

/* ---------- Gerenciar etiquetas ---------- */
.tm { position: fixed; left: 50%; top: 10vh; transform: translateX(-50%); width: min(520px, 94vw); max-height: 80vh; overflow-y: auto; background: var(--panel); border-radius: 14px; z-index: 51; padding: 22px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.tm-overlay { position: fixed; inset: 0; background: rgba(15,22,30,.42); z-index: 50; }
.tm h3 { margin: 0 0 4px; font-size: 18px; }
.tm-row { display: grid; grid-template-columns: 40px 1fr auto auto; gap: 8px; align-items: center; padding: 6px 0; }
.tm-row input[type=color] { width: 40px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); cursor: pointer; }
.tm-row small { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ---------- Telas menores ---------- */
@media (max-width: 860px) {
  .cp-tabs { display: flex; gap: 4px; padding: 6px 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
  .cp-tabs button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 7px; font-weight: 500; color: var(--muted); cursor: pointer; }
  .cp-tabs button[aria-selected=true] { background: var(--bg); color: var(--ink); }
  .cp { grid-template-rows: auto auto 1fr; }
  .cp-body { grid-template-columns: 1fr; }
  .cp-body[data-tab=chat] .cp-info, .cp-body[data-tab=info] .cp-chat { display: none; }
  .cp-info { border-right: 0; }
  .crm-bar .btn { margin-left: 0; }
  .cp-head { padding: 12px 14px; }
  .cp-head select { order: 3; flex: 1 1 100%; }
  .cp-head .who span { display: block; }
}

/* ---------- Origem do lead ---------- */
.origin { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 500; color: var(--ink); background: var(--bg); border-radius: 99px; padding: 1px 8px; white-space: nowrap; }
.origin.big { font-size: 14px; padding: 3px 10px; margin-top: 2px; }
.attr-head { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; }
.attr-head small { display: block; font-size: 12px; color: var(--muted); }
dl.attr { display: grid; grid-template-columns: 120px 1fr; gap: 3px 10px; margin: 6px 0 0; font-size: 13px; }
dl.attr dt { color: var(--muted); }
dl.attr dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
details.attr-more { margin-top: 8px; font-size: 13px; }
details.attr-more summary { cursor: pointer; color: var(--brand); font-weight: 500; }

/* ---------- Vendas e dashboard ---------- */
.kpis { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 12px; }
@media (max-width: 900px) { .kpis { grid-template-columns: 1fr 1fr; } }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; display: grid; gap: 2px; align-content: start; }
.kpi small { color: var(--muted); font-size: 13px; }
.kpi b { font-size: 26px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi.main { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.kpi.main small { color: color-mix(in srgb, var(--brand-ink) 80%, transparent); }
.kpi.main b { font-size: 34px; }
.kpi span { font-size: 12px; color: var(--muted); }
.chart svg { width: 100%; height: auto; display: block; }
.chart .g { stroke: var(--line); stroke-width: 1; }
.chart .t { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.chart .b { fill: var(--brand); }
.chart g:hover .b { fill: color-mix(in srgb, var(--brand) 75%, var(--ink)); }
.bar-row { margin-bottom: 12px; }
.bar-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.bar-top b { font-variant-numeric: tabular-nums; }
.bar { height: 10px; background: var(--bg); border-radius: 99px; overflow: hidden; margin: 4px 0 2px; }
.bar i { display: block; height: 100%; border-radius: 99px; }
.bar-row small { font-size: 12px; color: var(--muted); }
dl.ops { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin: 0; font-size: 14px; }
dl.ops dt { color: var(--muted); }
dl.ops dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.flag.sale { background: var(--ok-soft); color: var(--ok); }

/* Abas do painel lateral da conversa */
.cp-subtabs { display: flex; gap: 2px; position: sticky; top: -16px; z-index: 2; background: var(--panel); margin: -16px -16px 4px; padding: 10px 12px 0; border-bottom: 1px solid var(--line); }
.cp-subtabs button { border: 0; background: none; padding: 8px 10px; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; font-size: 14px; }
.cp-subtabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--brand); }
.cp-subtabs button .n { font-size: 11px; background: var(--bg); border-radius: 99px; padding: 0 6px; margin-left: 4px; }
.sales-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sales-sum div { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.sales-sum small { display: block; font-size: 12px; color: var(--muted); }
.sales-sum b { font-size: 20px; font-variant-numeric: tabular-nums; }
.sales-sum span { display: block; font-size: 12px; color: var(--muted); }
.sale-item { border-top: 1px dashed var(--line); padding: 10px 0; display: grid; gap: 4px; font-size: 14px; }
.sale-item:first-child { border-top: 0; }
.sale-item .top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.sale-item .top b { font-variant-numeric: tabular-nums; }
.sale-item small { color: var(--muted); font-size: 12px; }
.sale-item .row { gap: 4px; }
.cp-info { overflow-x: hidden; }
.sale-item .top b { white-space: nowrap; }
.sale-item .top span { min-width: 0; }

/* O conteúdo principal não pode ser alargado pelo quadro */
.app > main { min-width: 0; }

/* Controle de acesso e auditoria */
.lock { background: var(--wait-soft); color: var(--ink); border-radius: 8px; padding: 10px 12px; font-size: 13px; margin: 0; }
.owner-line { font-size: 15px; }
ol.audit { list-style: none; margin: 8px 0 0; padding: 8px 10px; background: var(--bg); border-radius: 8px; display: grid; gap: 8px; font-size: 12px; }
ol.audit time { color: var(--muted); display: block; }
ol.audit span { color: var(--muted); }
.st-row { display: grid; grid-template-columns: 28px 1fr 44px 150px auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.st-row input[type=color] { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.st-row .mv { display: grid; gap: 2px; }
.st-row .mv button { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; cursor: pointer; font-size: 11px; line-height: 1; padding: 3px 0; }
.team-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.team-row small { display: block; color: var(--muted); font-size: 12px; }

.sale-item .top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }

/* Grupos */
.av.group { background: #3d4b5c; }
.bub .sender { display: block; font-size: 12px; font-weight: 600; margin-bottom: 2px; color: hsl(var(--h, 200) 55% 38%); }
@media (prefers-color-scheme: dark) { .bub .sender { color: hsl(var(--h, 200) 60% 70%); } }

.funnel-mode { background: var(--bg); border-radius: 10px; padding: 12px 14px; margin-top: 8px; }
.funnel-mode p { margin: 0 0 8px; font-size: 14px; }

/* Contato compartilhado, fixar e nova conversa */
.vcard { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 0; min-width: 240px; }
.vcard .av { width: 36px; height: 36px; font-size: 13px; }
.vcard b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vcard small { color: var(--muted); font-size: 12px; }
.pin { font-size: 12px; margin-right: 4px; }
.nc-list { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.nc-list:empty { display: none; }
.nc-list button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: none; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.nc-list li:last-child button { border-bottom: 0; }
.nc-list button:hover { background: var(--bg); }
.nc-list .av { width: 34px; height: 34px; font-size: 12px; flex: none; }
.nc-tx b { display: block; font-size: 14px; }
.nc-tx small { color: var(--muted); font-size: 12px; }

/* Anexos e gravação de áudio */
.icon-btn { width: 44px; height: 44px; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; cursor: pointer; font-size: 19px; display: grid; place-items: center; }
.icon-btn:hover:not(:disabled) { border-color: var(--muted); }
.icon-btn:disabled { opacity: .45; cursor: not-allowed; }
.rec-bar { grid-column: 2 / 4; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px; background: var(--danger-soft); font-variant-numeric: tabular-nums; }
.rec-bar .btn:first-of-type { margin-left: auto; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: rec-blink 1s infinite; }
@keyframes rec-blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .rec-dot { animation: none; } }
.att-preview { border-top: 1px solid var(--line); background: var(--panel); padding: 12px 16px; }
.att-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.att-row img, .att-row video { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; background: var(--bg); }
.att-row audio { width: 220px; }
.att-ic { width: 72px; height: 72px; border-radius: 8px; background: var(--bg); display: grid; place-items: center; font-size: 30px; }
.att-info { display: grid; gap: 4px; min-width: 0; }
.att-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-info small { color: var(--muted); font-size: 12px; }
.att-info input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font: inherit; color: inherit; }
.att-actions { display: flex; gap: 6px; }
.cp-chat.dropping .cp-msgs { outline: 2px dashed var(--brand); outline-offset: -8px; }
@media (max-width: 700px) { .att-row { grid-template-columns: auto minmax(0, 1fr); } .att-actions { grid-column: 1 / -1; justify-content: flex-end; } }

/* Ciclo do lead */
.life { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 99px; background: var(--bg); color: var(--muted); }
.life.wait { background: var(--brand-soft); color: var(--brand); }
.life.warn { background: var(--wait-soft); color: var(--wait); }
.life.alert { background: var(--danger-soft); color: var(--danger); }
.life.optout { background: var(--bg); color: var(--muted); margin-left: 4px; }
.timeline .tl-session { margin-top: 6px; }
.optout-toggle { display: flex; gap: 8px; align-items: center; font-weight: 400; font-size: 14px; margin: 4px 0 10px; }
button.sender { border: 0; background: none; padding: 0; cursor: pointer; text-align: left; font: inherit; }
button.sender:hover { text-decoration: underline; }
.parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.parts li { display: grid; grid-template-columns: 18px 34px minmax(0, 1fr) auto; gap: 7px; align-items: center; }
.parts .av { width: 34px; height: 34px; font-size: 12px; }

.rec-kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpi.late b { color: var(--danger); }

.inst-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.inst-list li { display: grid; grid-template-columns: 88px 1fr auto auto; gap: 8px; align-items: center; font-size: 13px; padding: 6px 8px; background: var(--bg); border-radius: 8px; }
.inst-list b { text-align: right; }
.inst-list li { grid-template-columns: 78px 1fr auto auto; }
.inst-list .btn { white-space: nowrap; }

/* Foto de perfil: ocupa o mesmo círculo das iniciais */
.av { position: relative; overflow: hidden; }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; background: var(--panel); }

/* ---------- Reuniões ---------- */
.mt-week { display: grid; grid-template-columns: repeat(var(--days, 5), minmax(200px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.mt-col { background: var(--col); border-radius: var(--radius-lg); padding: 10px; min-height: 240px; border-top: 3px solid transparent; }
.mt-col.is-today { border-top-color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, var(--col)); }
.mt-col.drop { outline: 2px dashed var(--brand); outline-offset: -4px; }
.mt-col header { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font-weight: 600; }
.mt-col header small { color: var(--muted); font-weight: 400; }
.mt-col .cnt { font-size: 12px; background: var(--panel); border-radius: 99px; padding: 0 8px; }
.mt-add { margin-left: auto; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 16px; }
.mt-list { display: grid; gap: 8px; }
.mt-empty { color: var(--muted); font-size: 13px; text-align: center; margin: 24px 0; }
.mt-card { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 10px; padding: 10px 12px; display: grid; gap: 4px; cursor: grab; }
.mt-card.dragging { opacity: .5; }
.mt-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.mt-time { font-size: 16px; font-variant-numeric: tabular-nums; }
.mt-st { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--bg); }
.mt-title { font-weight: 600; overflow-wrap: anywhere; }
.mt-contact { font-size: 14px; }
.mt-meta { font-size: 12px; color: var(--muted); }
.mt-notes { margin: 4px 0 0; font-size: 13px; background: var(--bg); border-radius: 6px; padding: 6px 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.mt-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; align-items: center; }
.mt-actions .mt-status { font-size: 12px; padding: 4px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); max-width: 150px; }
.m-scheduled { border-left-color: #2f6fd6; } .m-scheduled .mt-st { background: #e3edfb; color: #2f6fd6; }
.m-confirmed { border-left-color: var(--ok); } .m-confirmed .mt-st { background: var(--ok-soft); color: var(--ok); }
.m-done { border-left-color: #6b7280; opacity: .85; } .m-done .mt-st { background: var(--bg); color: #4b5563; }
.m-noshow { border-left-color: var(--danger); } .m-noshow .mt-st { background: var(--danger-soft); color: var(--danger); }
.m-canceled { border-left-color: #9ca3af; opacity: .6; } .m-canceled .mt-title { text-decoration: line-through; }
.m-resched { border-left-color: var(--wait); } .m-resched .mt-st { background: var(--wait-soft); color: var(--wait); }
.mt-tabs { display: none; gap: 4px; overflow-x: auto; margin-bottom: 10px; }
.mt-tabs button { border: 1px solid var(--line); background: var(--panel); border-radius: 99px; padding: 6px 12px; white-space: nowrap; cursor: pointer; }
.mt-tabs button[aria-pressed=true] { background: var(--brand); color: #fff; border-color: var(--brand); }
.mt-tabs button.is-today:not([aria-pressed=true]) { border-color: var(--brand); color: var(--brand); }
@media (max-width: 860px) {
  .mt-tabs { display: flex; }
  .mt-week { grid-template-columns: 1fr; }
  .mt-col:not(.is-active) { display: none; }
  .mt-card { cursor: default; }
}
@media (max-width: 860px) {
  #meetRoot .page-head { flex-direction: column; align-items: stretch; gap: 10px; }
  #meetRoot .page-head .row { flex-wrap: wrap; }
}
/* Campo de horário no mesmo padrão dos demais */
input[type=time] { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); font: inherit; color: inherit; }

/* Botões dentro das mensagens de empresas/bots (ex.: "Abrir link de pagamento") */
.msg-btns { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; border-top: 1px solid rgba(0, 0, 0, .08); padding-top: 8px; }
.msg-btn { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; border: 1px solid #d6dbe6; border-radius: 10px; background: #fff; color: #0b57d0; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.msg-btn small { font-weight: 400; color: #64748b; }
.msg-btn.static { cursor: default; color: #1f2937; font-weight: 500; }
.msg-btn.reply small.sent { color: #15803d; font-weight: 600; }
a.msg-btn:hover, button.msg-btn:hover { background: #f1f5ff; }
a.msg-btn:focus-visible, button.msg-btn:focus-visible { outline: 2px solid #0b57d0; outline-offset: 2px; }

/* Grupos: silenciar */
.mute { font-size: 12px; margin-right: 4px; opacity: .85; }

/* Grupos: marcar pessoas (seletor de @) */
.cp-composer { position: relative; }
.mention-pop { position: absolute; left: 8px; bottom: calc(100% + 6px); width: min(360px, calc(100% - 16px)); max-height: 300px; overflow: auto; z-index: 30; background: #fff; border: 1px solid #dbe3ec; border-radius: 12px; box-shadow: 0 10px 30px rgba(15, 23, 42, .18); padding: 6px; }
.mp-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; background: transparent; border-radius: 8px; text-align: left; cursor: pointer; font: inherit; }
.mp-item.on, .mp-item:hover { background: #eef4ff; }
.mp-item .nc-tx { display: flex; flex-direction: column; min-width: 0; } .mp-item small { color: #64748b; font-size: 12px; }
.mp-note { margin: 6px 8px 2px; font-size: 12px; color: #64748b; }

/* Grupo: o botão @ ganha uma coluna própria; o campo de texto continua ocupando o espaço que sobra */
.cp-composer.has-mention { grid-template-columns: auto 1fr auto auto; }   /* (os botões ficam juntos em .cp-tools) */

/* Campo de escrever: botões juntos, emojis, menu "＋", mensagens agendadas */
.cp-tools { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.more-pop { position: absolute; left: 8px; bottom: calc(100% + 6px); z-index: 30; background: #fff; border: 1px solid #dbe3ec; border-radius: 12px; box-shadow: 0 10px 30px rgba(15, 23, 42, .18); padding: 6px; min-width: 220px; display: flex; flex-direction: column; }
.more-pop[hidden] { display: none; }
.more-pop button { text-align: left; border: 0; background: transparent; padding: 9px 12px; border-radius: 8px; font: inherit; cursor: pointer; }
.more-pop button:hover, .more-pop button:focus-visible { background: #eef4ff; }
.emoji-panel { position: fixed; z-index: 120; background: #fff; border: 1px solid #dbe3ec; border-radius: 14px; box-shadow: 0 14px 40px rgba(15, 23, 42, .25); padding: 8px; max-height: 320px; display: flex; flex-direction: column; }
.emoji-tabs { display: flex; gap: 2px; border-bottom: 1px solid #e2e8f0; padding-bottom: 6px; overflow-x: auto; }
.emoji-tabs button { border: 0; background: transparent; font-size: 20px; padding: 4px 8px; border-radius: 8px; cursor: pointer; }
.emoji-tabs button.on { background: #eef4ff; }
.emoji-title { font-size: 12px; color: #64748b; margin: 6px 4px 2px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; overflow-y: auto; }
.emoji-i { border: 0; background: transparent; font-size: 22px; padding: 4px; border-radius: 8px; cursor: pointer; line-height: 1.1; }
.emoji-i:hover, .emoji-i:focus-visible { background: #eef4ff; }
.sched-bar { padding: 6px 16px; background: #fffbeb; border-top: 1px solid #fde68a; font-size: 13px; }
.sched-bar[hidden] { display: none; }
.sched-toggle { border: 0; background: transparent; font: inherit; cursor: pointer; padding: 2px 0; color: #92400e; }
.sched-toggle .err, .sched-list .err { color: #b91c1c; }
.sched-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sched-list[hidden] { display: none; }
.sched-list li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.sched-list .when { font-weight: 600; white-space: nowrap; } .sched-list .txt { flex: 1; min-width: 160px; }
.left-banner { padding: 10px 16px; background: #f1f5f9; border-top: 1px solid #e2e8f0; color: #475569; font-size: 14px; }
.left-banner[hidden] { display: none; }
.left-tag { font-size: 11px; background: #e2e8f0; color: #475569; border-radius: 99px; padding: 1px 7px; margin-right: 6px; }

/* Dentro da conversa: reações, localização e enquete */
.react-btn { position: absolute; top: 36px; right: -34px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); font-size: 14px; cursor: pointer; display: grid; place-items: center; opacity: 0; transition: opacity .12s; box-shadow: var(--shadow-sm); }
.bub.me .react-btn { right: auto; left: -34px; }
.bub:hover .react-btn, .react-btn:focus-visible { opacity: 1; }
@media (hover: none) { .react-btn { opacity: .85; } }
.react-bar { position: absolute; z-index: 25; bottom: calc(100% + 4px); left: 0; display: flex; gap: 2px; background: #fff; border: 1px solid #dbe3ec; border-radius: 99px; padding: 4px 6px; box-shadow: 0 8px 24px rgba(15, 23, 42, .2); }
.bub.me .react-bar { left: auto; right: 0; }
.react-bar button { border: 0; background: transparent; font-size: 22px; padding: 2px 5px; border-radius: 99px; cursor: pointer; line-height: 1.2; }
.react-bar button:hover, .react-bar button:focus-visible { background: #eef4ff; transform: scale(1.15); }
.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 2px; }
.react { border: 1px solid #dbe3ec; background: #fff; border-radius: 99px; padding: 0 7px; font-size: 14px; line-height: 1.6; cursor: pointer; }
.react.mine { background: #eef4ff; border-color: #93c5fd; }
.react small { font-size: 11px; color: #475569; }
.loc { display: flex; flex-direction: column; gap: 2px; min-width: 200px; }
.loc a { color: #1d4ed8; font-weight: 600; }
.loc small { color: #64748b; }
.poll { display: flex; flex-direction: column; gap: 5px; min-width: 240px; }
.poll small { color: #64748b; }
.poll-o { position: relative; display: flex; justify-content: space-between; gap: 10px; padding: 5px 8px; border: 1px solid #dbe3ec; border-radius: 8px; overflow: hidden; background: #fff; }
.poll-o .bar { position: absolute; inset: 0 auto 0 0; background: #dbeafe; z-index: 0; }
.poll-o.mine { border-color: #60a5fa; }
.poll-o .n, .poll-o .c { position: relative; z-index: 1; }
.poll-o .c { font-weight: 700; }

/* Transcrição do áudio, dentro da conversa */
.tr-btn { margin: 4px 0 2px; }
.transcript { margin: 6px 0 2px; padding: 8px 10px; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 8px; }
.transcript p { margin: 4px 0 6px; white-space: pre-wrap; }

/* pessoa marcada em mensagem de grupo */
.mention { color: var(--brand); font-weight: 600; background: var(--brand-soft); border-radius: 4px; padding: 0 3px; }

/* envio de vários arquivos (até 20 imagens ou vídeos) */
.batch { display: grid; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.batch-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.batch-head small { color: var(--muted); margin-right: auto; }
.batch-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; max-height: 260px; overflow-y: auto; }
.b-item { position: relative; display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: var(--bg); min-width: 0; }
.b-thumb { position: relative; height: 84px; border-radius: 8px; overflow: hidden; background: #000; display: grid; place-items: center; }
.b-thumb img, .b-thumb video { width: 100%; height: 100%; object-fit: cover; }
.b-play { position: absolute; color: #fff; text-shadow: 0 0 6px rgba(0,0,0,.7); font-size: 18px; }
.b-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-item small { color: var(--muted); font-size: 11px; }
.b-state { font-size: 11px; color: var(--muted); }
.b-x { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%; border: 0; cursor: pointer; background: rgba(0,0,0,.65); color: #fff; line-height: 1; }
.b-item.st-sending { outline: 2px solid var(--brand); }
.b-item.st-done .b-state { color: var(--ok); }
.b-item.st-failed { border-color: var(--danger); }
.b-item.st-failed .b-state { color: var(--danger); font-weight: 600; white-space: normal; }
.batch-progress { display: grid; gap: 4px; }
.batch-progress progress { width: 100%; }
.batch-actions { display: flex; gap: 8px; justify-content: flex-end; }
.batch-note { margin: 0; font-size: 12px; color: var(--muted); }
