/* =========================================================
   CRM Imóveis — tema (v11: layout moderno e responsivo)
   ========================================================= */
:root {
  --cor: #2563eb;          /* azul principal */
  --cor-escura: #1d4ed8;
  --cor-clara: #eff6ff;
  --lateral: #0f172a;      /* menu lateral */
  --lateral-2: #1e293b;
  --fundo: #f1f5f9;
  --texto: #0f172a;
  --suave: #64748b;
  --borda: #e2e8f0;
  --raio: 14px;
  --sombra: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
  --lat-larg: 256px;
  --barra-inf: 66px;
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-color: var(--texto);
  --bs-primary: #2563eb; --bs-primary-rgb: 37, 99, 235;
  --bs-link-color: #2563eb; --bs-link-color-rgb: 37, 99, 235; --bs-link-hover-color: #1d4ed8;
  --bs-border-color: var(--borda);
  --bs-border-radius: .6rem; --bs-border-radius-sm: .45rem; --bs-border-radius-lg: .8rem;
  --bs-secondary-color: var(--suave);
}
body { background: var(--fundo); font-size: .95rem; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -.01em; }
h6 { font-weight: 600; }
.text-muted { color: var(--suave) !important; }
a { text-underline-offset: 2px; }

/* ---------- Estrutura: menu lateral + conteúdo ---------- */
.app-main { padding: 1.5rem 1.75rem 3rem; max-width: 1600px; }
@media (min-width: 992px) {
  body.com-menu .app-main { margin-left: var(--lat-larg); }
  .app-sidebar { position: fixed !important; inset: 0 auto 0 0; width: var(--lat-larg) !important; z-index: 1030; }
}
.app-sidebar { background: var(--lateral) !important; color: #cbd5e1; display: flex; flex-direction: column; }
@media (max-width: 991.98px) { .app-sidebar { --bs-offcanvas-width: 280px; --bs-offcanvas-bg: var(--lateral); } }
.sidebar-topo { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.25rem 1rem; }
.marca { min-width: 0; display: flex; align-items: center; gap: .6rem; color: #fff; font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.marca:hover { color: #fff; }
.marca-icone { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; font-size: 1rem; box-shadow: 0 4px 12px rgba(37, 99, 235, .4); }
.btn-novo { margin: 0 1rem 1rem; padding: .6rem; font-weight: 600; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 0 .75rem; }
.sidebar-nav .rotulo { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #64748b; padding: 1rem .75rem .4rem; font-weight: 600; }
.sidebar-nav a { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; border-radius: 10px; color: #cbd5e1; text-decoration: none; font-weight: 500; margin-bottom: 2px; transition: background .15s, color .15s; }
.sidebar-nav a i { font-size: 1.1rem; width: 1.25rem; text-align: center; opacity: .85; }
.sidebar-nav a:hover { background: var(--lateral-2); color: #fff; }
.sidebar-nav a.active { background: rgba(59, 130, 246, .16); color: #fff; box-shadow: inset 3px 0 0 #3b82f6; }
.sidebar-nav a.active i { color: #60a5fa; opacity: 1; }
.sidebar-usuario { display: flex; align-items: center; gap: .7rem; padding: 1rem 1.1rem; border-top: 1px solid rgba(255, 255, 255, .07); }
.sidebar-usuario .nome { color: #fff; font-weight: 600; font-size: .9rem; }
.sidebar-usuario .perfil { font-size: .75rem; color: #94a3b8; }
.sidebar-usuario .btn-icone { color: #94a3b8; }
.sidebar-usuario .btn-icone:hover { color: #fff; background: var(--lateral-2); }
.avatar { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #60a5fa, #2563eb); color: #fff; font-weight: 700; font-size: .85rem; text-decoration: none; }
.avatar-sm { width: 34px; height: 34px; flex-basis: 34px; font-size: .78rem; }
.avatar:hover { color: #fff; }
.btn-icone { width: 40px; height: 40px; padding: 0; display: inline-grid; place-items: center; border-radius: 10px; font-size: 1.25rem; border: 0; }

/* Barra superior (celular) */
.app-topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem .75rem; padding-top: calc(.55rem + env(safe-area-inset-top)); background: rgba(15, 23, 42, .97); backdrop-filter: blur(8px); }
.app-topbar .btn-icone { color: #fff; }
.app-topbar .marca { font-size: 1rem; }
.app-topbar .marca-icone { width: 30px; height: 30px; border-radius: 9px; font-size: .9rem; }

/* Navegação inferior (celular) */
.app-bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1025; height: calc(var(--barra-inf) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: flex; justify-content: space-around; align-items: center; background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px); border-top: 1px solid var(--borda); box-shadow: 0 -4px 20px rgba(15, 23, 42, .06); }
.app-bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--suave); text-decoration: none; font-size: .68rem; font-weight: 500; padding: .35rem 0; }
.app-bottomnav a i { font-size: 1.3rem; line-height: 1; }
.app-bottomnav a.active { color: var(--cor); }
.app-bottomnav a.active i::before { font-weight: 700 !important; }
.app-bottomnav a.fab { flex: 0 0 auto; width: 54px; height: 54px; border-radius: 18px; background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; justify-content: center; margin: 0 .4rem; transform: translateY(-14px); box-shadow: 0 8px 20px rgba(37, 99, 235, .45); }
.app-bottomnav a.fab i { font-size: 1.5rem; }
@media (max-width: 991.98px) {
  .app-main { padding: 1rem 1rem calc(var(--barra-inf) + 1.5rem + env(safe-area-inset-bottom)); }
  body.sem-menu .app-main { padding-bottom: 1.5rem; }
}

/* ---------- Componentes ---------- */
.card { border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra); }
.card > .table-responsive, .card > .table-responsive > .table { border-radius: var(--raio); }
.card.p-2 { border-radius: var(--raio); }
.btn { font-weight: 500; border-radius: .6rem; }
.btn-primary { --bs-btn-bg: var(--cor); --bs-btn-border-color: var(--cor); --bs-btn-hover-bg: var(--cor-escura); --bs-btn-hover-border-color: var(--cor-escura); --bs-btn-active-bg: #1e40af; --bs-btn-active-border-color: #1e40af; --bs-btn-disabled-bg: var(--cor); --bs-btn-disabled-border-color: var(--cor); box-shadow: 0 2px 6px rgba(37, 99, 235, .25); }
.btn-outline-primary { --bs-btn-color: var(--cor); --bs-btn-border-color: var(--cor); --bs-btn-hover-bg: var(--cor); --bs-btn-hover-border-color: var(--cor); --bs-btn-active-bg: var(--cor); }
.btn-dark { --bs-btn-bg: var(--lateral); --bs-btn-border-color: var(--lateral); }
.btn-outline-secondary { --bs-btn-color: #475569; --bs-btn-border-color: #cbd5e1; --bs-btn-hover-bg: #f1f5f9; --bs-btn-hover-color: var(--texto); --bs-btn-hover-border-color: #cbd5e1; --bs-btn-active-bg: #e2e8f0; --bs-btn-active-color: var(--texto); background: #fff; }
.form-control, .form-select { border-color: #d7dee8; padding-top: .5rem; padding-bottom: .5rem; }
.form-control-sm, .form-select-sm { padding-top: .3rem; padding-bottom: .3rem; }
.form-control:focus, .form-select:focus { border-color: #93c5fd; box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .15); }
.form-label { font-weight: 500; font-size: .87rem; color: #334155; margin-bottom: .3rem; }
.form-check-input:checked { background-color: var(--cor); border-color: var(--cor); }
.badge { font-weight: 600; border-radius: .45rem; padding: .38em .6em; }
.alert { border-radius: var(--raio); border-width: 0 0 0 4px; }
.alert-success { border-color: #16a34a; } .alert-danger { border-color: #dc2626; } .alert-warning { border-color: #f59e0b; } .alert-info, .alert-primary { border-color: var(--cor); }
.modal-content { border: 0; border-radius: 18px; }
.nav-pills .nav-link { border-radius: 999px; color: #475569; font-weight: 500; }
.nav-pills .nav-link.active { background: var(--cor); }
.pagination { --bs-pagination-border-radius: .6rem; --bs-pagination-active-bg: var(--cor); --bs-pagination-active-border-color: var(--cor); flex-wrap: wrap; }
.progress { border-radius: 999px; background: #eef2f7; }
.progress-bar { border-radius: 999px; }
.list-group-item { border-color: var(--borda); }
.bg-orange { background-color: #f97316 !important; }
.badge-st { font-weight: 600; }
.atrasado { color: #dc2626; font-weight: 600; }
hr { border-color: var(--borda); opacity: 1; }

/* Tabelas */
.table { --bs-table-hover-bg: #f8fafc; margin-bottom: 0; }
.table td, .table th { vertical-align: middle; border-color: #eef2f6; }
.table > thead th, .table-light th { background: #f8fafc !important; color: var(--suave); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; border-bottom: 1px solid var(--borda); white-space: nowrap; }
.table > :not(caption) > * > * { padding: .7rem .8rem; }
.table-sm > :not(caption) > * > * { padding: .5rem .6rem; }

/* Tabela → cartões no celular */
@media (max-width: 767.98px) {
  .tabela-cards thead { display: none; }
  .tabela-cards, .tabela-cards tbody, .tabela-cards tr, .tabela-cards td { display: block; width: 100%; }
  .card:has(> .table-responsive:only-child > .tabela-cards), .card:has(> .tabela-cards:only-child) { background: transparent; border: 0; box-shadow: none; }
  .table-responsive:has(> .tabela-cards) { overflow: visible; }
  .tabela-cards tr { background: #fff; border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra); margin-bottom: .75rem; padding: .35rem .95rem; position: relative; }
  .tabela-cards > :not(caption) > * > * { padding: .35rem 0; border: 0; background: transparent !important; box-shadow: none; }
  .tabela-cards td { text-align: right !important; overflow-wrap: anywhere; }
  .tabela-cards td::after { content: ""; display: table; clear: both; }
  .tabela-cards td::before { content: attr(data-label); float: left; margin-right: 1rem; color: var(--suave); font-size: .78rem; font-weight: 500; text-align: left; line-height: 1.6; }
  .tabela-cards td:first-child a { text-decoration: none; }
  .tabela-cards td:empty { display: none; }
  .tabela-cards td:first-child { display: block; text-align: left !important; font-size: 1rem; padding-top: .6rem; padding-right: 5.5rem; }
  .tabela-cards td:first-child::before { display: none; }
  .tabela-cards td.acoes { position: absolute; top: .55rem; right: .8rem; width: auto; padding: 0; }
  .tabela-cards td.acoes::before { display: none; }
  .tabela-cards td.acoes-baixo { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .4rem; border-top: 1px solid #eef2f6 !important; margin-top: .3rem; padding: .6rem 0 .45rem; }
  .tabela-cards td.acoes-baixo::before { display: none; }
  .tabela-cards td.acoes-baixo .btn, .tabela-cards td.acoes .btn { min-width: 38px; min-height: 36px; }
  .tabela-cards tr.vazio td { text-align: center !important; padding: 1rem 0 !important; }
  .tabela-cards tr.vazio td::before { display: none; }
}

/* Cabeçalho das páginas */
.app-main > .d-flex:first-of-type h4, .app-main h4.mb-3, .app-main h4.mb-0 { font-size: 1.45rem; }
@media (max-width: 575.98px) {
  .app-main h4 { font-size: 1.25rem !important; }
  .app-main h3 { font-size: 1.4rem; }
  .app-main .card.p-4 { padding: 1.1rem !important; }
  .acoes-topo { width: 100%; }
  .acoes-topo .btn { flex: 1 1 auto; }
  .form-control, .form-select { font-size: 16px; } /* evita zoom automático no iPhone */
  .form-control-sm, .form-select-sm { font-size: 15px; }
}

/* Barra de salvar fixa no rodapé do formulário (celular) */
@media (max-width: 991.98px) {
  .barra-salvar { position: sticky; bottom: calc(var(--barra-inf) + env(safe-area-inset-bottom)); z-index: 1010; background: rgba(255, 255, 255, .95); backdrop-filter: blur(8px); margin: 1rem -1.1rem -1.1rem; padding: .75rem 1.1rem; border-top: 1px solid var(--borda); border-radius: 0 0 var(--raio) var(--raio); }
  .barra-salvar.solta { margin: 1rem -1rem 0; border-radius: 0; }
  .barra-salvar .btn-primary { width: 100%; padding: .65rem; }
}

/* ---------- Painel ---------- */
.stat { position: relative; overflow: hidden; }
.stat .num { font-size: 1.85rem; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
.stat .lbl { color: var(--suave); font-size: .82rem; font-weight: 500; margin-top: .25rem; }
.stat .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; flex: 0 0 42px; }
.ic-primary { background: #dbeafe; color: #1d4ed8; } .ic-info { background: #cffafe; color: #0e7490; } .ic-success { background: #dcfce7; color: #15803d; }
.ic-warning { background: #fef3c7; color: #b45309; } .ic-danger { background: #fee2e2; color: #b91c1c; }
@media (max-width: 575.98px) { .stat .num { font-size: 1.5rem; } .stat .ic { width: 36px; height: 36px; flex-basis: 36px; font-size: 1.05rem; } }
.titulo-card { font-size: .95rem; font-weight: 600; display: flex; align-items: center; gap: .45rem; }
.titulo-card i { color: var(--cor); }

/* ---------- Histórico ---------- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { border-left: 2px solid var(--borda); padding: 0 0 1.1rem 1.1rem; position: relative; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--cor); border: 2px solid #fff; box-shadow: 0 0 0 2px #bfdbfe; position: absolute; left: -7px; top: 4px; }
.timeline li.st::before { background: #f97316; box-shadow: 0 0 0 2px #fed7aa; }

/* ---------- Funil (Kanban) ---------- */
.kanban { display: flex; gap: .85rem; overflow-x: auto; padding-bottom: 1rem; -webkit-overflow-scrolling: touch; }
.kanban .col-k { min-width: 240px; flex: 1 0 240px; min-height: calc(100vh - 190px); background: #e8edf3; border-radius: var(--raio); padding: .75rem; scroll-snap-align: start; min-height: 200px; }
.kanban .item { background: #fff; border-radius: 12px; padding: .7rem .8rem; margin-bottom: .55rem; box-shadow: 0 1px 3px rgba(15, 23, 42, .08); font-size: .88rem; border: 1px solid transparent; cursor: grab; position: relative; }
.kanban .item:hover { border-color: #bfdbfe; }
.kanban .item a { text-decoration: none; color: inherit; }
.kanban .item .mover { position: absolute; top: .4rem; right: .4rem; }
.kanban .col-k.sobre { outline: 2px dashed #60a5fa; outline-offset: -4px; }
@media (max-width: 767.98px) {
  .kanban { margin: 0 -1rem; padding: 0 1rem 1rem; scroll-padding: 0 1rem; scroll-snap-type: x mandatory; }
  .kanban .col-k { min-width: 84vw; flex-basis: 84vw; min-height: 55vh; }
}
.kanban-abas { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .5rem; margin-bottom: .5rem; scrollbar-width: none; }
.kanban-abas::-webkit-scrollbar { display: none; }
.kanban-abas a { flex: 0 0 auto; text-decoration: none; }

/* ---------- Login / instalação ---------- */
body.sem-menu { min-height: 100vh; background: radial-gradient(1200px 600px at 10% -10%, #1e3a8a 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #1d4ed8 0%, transparent 55%), var(--lateral); }
body.sem-menu .app-main { max-width: none; display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1.5rem 1rem; }
.login-box { width: 100%; max-width: 420px; margin: 0 auto; }
.login-box .card { border: 0; border-radius: 22px; box-shadow: 0 25px 60px rgba(0, 0, 0, .35); padding: 2.25rem !important; }
.login-box .marca-icone { width: 48px; height: 48px; border-radius: 14px; font-size: 1.35rem; margin-bottom: 1rem; }
.login-box .form-control { padding: .7rem .9rem; }
.login-box .btn-primary { padding: .7rem; font-weight: 600; }
@media (max-width: 575.98px) { .login-box .card { padding: 1.6rem !important; } }

/* ---------- Lead ---------- */
.dados-lead dt { font-weight: 500; color: var(--suave); }
.dados-lead dd { font-weight: 500; }
.acoes-lead { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 575.98px) {
  .acoes-lead { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
  .acoes-lead .btn, .acoes-lead form { width: 100%; }
  .acoes-lead .btn { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .72rem; padding: .5rem .25rem; }
  .acoes-lead .btn i { font-size: 1.15rem; }
  .acoes-lead .rot-longo { display: none; }
}
@media (min-width: 576px) { .acoes-lead .rot-curto { display: none; } }

/* ---------- Diversos ---------- */
.rolagem-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chip-filtro { scrollbar-width: none; }
@media (hover: none) { .btn:hover { transform: none; } }
@media print { .app-sidebar, .app-topbar, .app-bottomnav { display: none !important; } body.com-menu .app-main { margin: 0; } }
/* Modo apresentação: esconde menus */
body.apresentacao .app-sidebar, body.apresentacao .app-topbar, body.apresentacao .app-bottomnav { display: none !important; }
body.apresentacao .app-main { margin-left: 0 !important; padding-bottom: 2rem !important; max-width: none; }
/* Filtros recolhíveis no celular */
@media (max-width: 767.98px) { .form-filtros:not(.aberto) .filtro-extra { display: none !important; } }
/* Lista-cartão dentro de outro cartão: mais leve */
@media (max-width: 767.98px) {
  .card.p-3 .tabela-cards tr { box-shadow: none; background: #f8fafc; border-color: #eef2f6; border-radius: 12px; margin-bottom: .5rem; }
  .card.p-3 .tabela-cards tr:last-child { margin-bottom: 0; }
}
/* Títulos de seção nos formulários */
form .card > h6.text-muted:not(.mb-0), form.card > h6.text-muted { font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; color: #475569 !important; font-weight: 700; padding-bottom: .55rem; margin-bottom: 1rem; border-bottom: 1px solid var(--borda); }
form.card > h6.text-muted:not(:first-of-type) { margin-top: .5rem; }
/* Tabela de unidades: nº do apto fixo ao rolar para o lado */
#tabUnidades th:first-child, #tabUnidades td:first-child { position: sticky; left: 0; z-index: 2; background: #fff; box-shadow: 1px 0 0 var(--borda); }
#tabUnidades thead th:first-child { z-index: 3; background: #f8fafc; }
@media (max-width: 575.98px) { #unBusca, #unFiltro { width: 100% !important; flex: 1 1 140px; } }
/* Etiquetas de status em tom suave */
.badge-st { border: 1px solid transparent; }
.badge-st.bg-secondary { background: #f1f5f9 !important; color: #475569; border-color: #e2e8f0; }
.badge-st.bg-info { background: #e0f2fe !important; color: #0369a1; border-color: #bae6fd; }
.badge-st.bg-primary { background: #dbeafe !important; color: #1d4ed8; border-color: #bfdbfe; }
.badge-st.bg-warning { background: #fef3c7 !important; color: #b45309; border-color: #fde68a; }
.badge-st.bg-orange { background: #ffedd5 !important; color: #c2410c; border-color: #fed7aa; }
.badge-st.bg-success { background: #dcfce7 !important; color: #15803d; border-color: #bbf7d0; }
.badge-st.bg-danger { background: #fee2e2 !important; color: #b91c1c; border-color: #fecaca; }
/* Variante em grade (números lado a lado) */
@media (max-width: 767.98px) {
  .tabela-cards.grade tr { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: .5rem; padding-bottom: .6rem; }
  .tabela-cards.grade td { text-align: left !important; font-weight: 600; }
  .tabela-cards.grade td::before { float: none; display: block; margin: 0; line-height: 1.3; font-weight: 500; }
  .tabela-cards.grade td:first-child { grid-column: 1 / -1; padding-right: 0; }
}
.card.border-start.border-4 { border-width: 1px 1px 1px 4px !important; border-color: var(--borda) !important; border-left-color: #f59e0b !important; }
.info-emp .valor { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; margin-top: .15rem; }
@media (max-width: 575.98px) { .info-emp .valor { font-size: 1rem; } .info-emp { padding: .8rem !important; } }
.table a:not(.btn) { text-decoration: none; font-weight: 500; }
.table a:not(.btn):hover { text-decoration: underline; }
.app-bottomnav { padding-left: max(0px, calc((100% - 520px) / 2)); padding-right: max(0px, calc((100% - 520px) / 2)); }
/* ---------- Conversa do WhatsApp ---------- */
.wa-chat { background: #efeae2; background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px); background-size: 14px 14px; border-radius: 12px; padding: .75rem; height: 440px; overflow-y: auto; display: flex; flex-direction: column; gap: .3rem; }
@media (max-width: 575.98px) { .wa-chat { height: 60vh; margin: 0 -.35rem; } }
.wa-vazio { margin: auto; text-align: center; color: #667781; font-size: .88rem; max-width: 320px; }
.wa-vazio i { font-size: 2rem; opacity: .5; }
.wa-dia { text-align: center; margin: .5rem 0; }
.wa-dia span { background: #fff; color: #54656f; font-size: .72rem; font-weight: 600; padding: .25rem .7rem; border-radius: 8px; box-shadow: 0 1px 1px rgba(0,0,0,.08); text-transform: uppercase; }
.wa-msg { display: flex; }
.wa-msg.eu { justify-content: flex-end; }
.wa-msg .balao { max-width: min(78%, 520px); background: #fff; border-radius: 10px; padding: .35rem .55rem .25rem; box-shadow: 0 1px 1px rgba(0,0,0,.1); font-size: .9rem; overflow-wrap: anywhere; }
.wa-msg.eu .balao { background: #d9fdd3; }
.wa-msg.ele .balao { border-top-left-radius: 3px; }
.wa-msg.eu .balao { border-top-right-radius: 3px; }
.wa-msg .autor { font-size: .72rem; font-weight: 600; color: #128c7e; }
.wa-msg .texto { white-space: pre-wrap; }
.wa-msg .hora { font-size: .68rem; color: #667781; text-align: right; margin-top: 1px; }
.wa-msg .hora i.lida { color: #53bdeb; }
.wa-msg img { max-width: 100%; max-height: 260px; border-radius: 8px; display: block; margin-bottom: .2rem; }
.wa-msg video { max-width: 100%; max-height: 260px; border-radius: 8px; }
.wa-msg audio { width: 240px; max-width: 100%; height: 40px; }
.wa-msg .doc { display: flex; gap: .4rem; align-items: center; background: rgba(0,0,0,.05); padding: .45rem .6rem; border-radius: 8px; text-decoration: none; color: inherit; }
.wa-enviar { display: flex; gap: .5rem; margin-top: .6rem; align-items: flex-end; }
.wa-enviar textarea { resize: none; border-radius: 20px; padding: .55rem .9rem; }
.wa-enviar .btn { border-radius: 50%; width: 44px; height: 44px; flex: 0 0 44px; padding: 0; }
.lista-conversas .item-conv { display: flex; gap: .75rem; padding: .75rem .25rem; border-bottom: 1px solid #eef2f6; text-decoration: none; color: inherit; align-items: center; }
.lista-conversas .item-conv:hover { background: #f8fafc; }
.lista-conversas .item-conv:last-child { border-bottom: 0; }
.lista-conversas .avatar { background: linear-gradient(135deg, #34d399, #059669); }
.lista-conversas .ultima { color: var(--suave); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Anexos das etapas (Proposta, Negociação, Fechado) */
.anexo-linha { display: flex; align-items: center; gap: .75rem; background: #fff; border: 1px solid var(--borda); border-radius: 12px; padding: .6rem .75rem; margin-bottom: .5rem; }
.anexo-linha:last-child { margin-bottom: 0; }
.anexo-linha.com-arquivo { border-color: #93c5fd; background: #f8fbff; }
.anexo-ic { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; display: grid; place-items: center; background: var(--cor-clara); color: var(--cor); font-size: 1.1rem; }
.anexo-arqs { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anexo-btn { position: relative; flex: 0 0 auto; white-space: nowrap; }
.anexo-input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.anexo-input:disabled { pointer-events: none; }
@media (max-width: 420px) { .anexo-ic { display: none; } }
.etapas-extra .etapa { container-type: inline-size; }
@container (max-width: 360px) {
  .anexo-ic { display: none; }
  .anexo-linha { gap: .5rem; padding: .55rem .6rem; }
  .anexo-btn span { display: none; }
}
/* Alertas de compromissos */
.alertas-compromissos { border-left: 4px solid #f59e0b; }
.alertas-compromissos .sino { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: #fef3c7; color: #b45309; animation: balanca 2.5s ease-in-out infinite; }
@keyframes balanca { 0%, 90%, 100% { transform: rotate(0); } 93% { transform: rotate(-14deg); } 96% { transform: rotate(12deg); } }
.alerta-item { display: flex; align-items: center; gap: .6rem; padding: .55rem .6rem; border: 1px solid var(--borda); border-radius: 12px; margin-top: .45rem; background: #fff; transition: opacity .25s, transform .25s; }
.alerta-item.saindo { opacity: 0; transform: translateX(20px); }
.alerta-ic { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; display: grid; place-items: center; }
.alerta-ciente { white-space: nowrap; }
.alerta-ciente .form-check-input { margin-top: 0; vertical-align: -2px; }
@media (max-width: 575.98px) {
  .alerta-item { flex-wrap: wrap; }
  .alerta-item > .flex-grow-1 { flex-basis: calc(100% - 50px); }
  .alerta-item .alerta-ciente { flex: 1; }
}
body.apresentacao .alertas-compromissos { display: none !important; }
/* Página pública do empreendimento (link do corretor) */
body.publico { background: var(--fundo); }
body.publico .app-main { max-width: 1200px; margin: 0 auto; padding-top: 1.25rem; padding-bottom: 2rem !important; }
.corretor-pub { border-radius: 999px !important; flex-wrap: wrap; }
@media (max-width: 575.98px) { .corretor-pub { width: 100%; border-radius: 16px !important; } .corretor-pub .btn { flex: 1; } }

/* ---------- Foto destaque do empreendimento (v24) ---------- */
.foto-destaque { width: 176px; aspect-ratio: 4/3; border-radius: .6rem; overflow: hidden; background: #e2e8f0; border: 1px dashed #cbd5e1; display: flex; align-items: center; justify-content: center; flex: none; }
.foto-destaque img { width: 100%; height: 100%; object-fit: cover; }
.foto-destaque > i { font-size: 2.2rem; color: #94a3b8; }
.estrela-destaque { position: relative; cursor: pointer; font-size: 1.15rem; color: #cbd5e1; margin: 0; }
.estrela-destaque input { position: absolute; opacity: 0; pointer-events: none; }
.estrela-destaque .bi-star-fill, .estrela-destaque input:checked ~ .bi-star { display: none; }
.estrela-destaque input:checked ~ .bi-star-fill { display: inline; color: #f59e0b; }
.estrela-destaque:hover { color: #f59e0b; }
.emp-thumb { width: 64px; height: 48px; border-radius: .5rem; object-fit: cover; background: #e2e8f0; flex: none; display: inline-flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 1.3rem; }
.emp-thumb-sm { width: 40px; height: 30px; font-size: 1rem; border-radius: .35rem; }
.emp-hero { display: block; position: relative; border-radius: 1rem; overflow: hidden; margin-bottom: 1rem; height: 300px; background: #e2e8f0; }
.emp-hero img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.emp-hero:hover img { transform: scale(1.02); }
.emp-hero .emp-hero-zoom { position: absolute; right: .75rem; bottom: .75rem; background: rgba(15, 23, 42, .6); color: #fff; border-radius: 999px; padding: .25rem .7rem; font-size: .8rem; }
@media (max-width: 767.98px) { .emp-hero { height: 190px; border-radius: .75rem; } }
@media (max-width: 991.98px) { .tabela-cards .emp-thumb { width: 56px; height: 42px; } }
.flex-none { flex: none; }
.min-w-0 { min-width: 0; }

/* ---------- Vitrine: site público da imobiliária (v25) ---------- */
body.vitrine { background: #f8fafc; }
body.vitrine .app-main { max-width: 1240px; width: 100%; margin-left: auto !important; margin-right: auto !important; padding-left: 1rem; padding-right: 1rem; }
.vit-container { max-width: 1240px; margin: 0 auto; padding: 0 1rem; }
.vit-topo { background: #fff; border-bottom: 1px solid var(--borda); position: sticky; top: 0; z-index: 1020; padding: .65rem 0; }
.vit-marca { display: flex; align-items: center; gap: .6rem; color: var(--texto); font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; min-width: 0; }
.vit-marca img { height: 44px; max-width: 180px; object-fit: contain; }
.vit-marca-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--cor); color: #fff; display: grid; place-items: center; flex: none; }
.vit-marca-nome { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 575.98px) { .vit-marca img { height: 36px; max-width: 130px; } .vit-marca img + .vit-marca-nome { display: none; } }
.vit-hero { position: relative; border-radius: 1.25rem; overflow: hidden; color: #fff; padding: 4.5rem 2.5rem 3rem;
  background: linear-gradient(120deg, rgba(15, 23, 42, .82), rgba(15, 23, 42, .45)), var(--vit-capa, linear-gradient(120deg, var(--cor-escura), var(--cor))); background-size: cover; background-position: center; }
.vit-hero h1 { font-size: clamp(1.7rem, 4vw, 2.8rem); font-weight: 800; max-width: 760px; }
.vit-hero .lead { max-width: 640px; opacity: .9; font-size: 1.1rem; }
.vit-busca { display: flex; gap: .5rem; background: #fff; padding: .5rem; border-radius: 1rem; max-width: 900px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.vit-busca .form-control, .vit-busca .form-select { border: 0; box-shadow: none; }
.vit-busca .form-select { max-width: 200px; border-left: 1px solid var(--borda); border-radius: 0; }
.vit-busca-campo { position: relative; display: flex; align-items: center; }
.vit-busca-campo i { position: absolute; left: .8rem; color: var(--suave); }
.vit-busca-campo .form-control { padding-left: 2.3rem; }
@media (max-width: 767.98px) {
  .vit-hero { padding: 2.5rem 1.25rem 1.5rem; border-radius: 1rem; }
  .vit-busca { flex-wrap: wrap; }
  .vit-busca-campo { flex-basis: 100%; }
  .vit-busca .form-select { max-width: none; flex: 1 1 40%; border: 1px solid var(--borda); border-radius: .6rem; }
  .vit-busca .btn { flex: 1 1 100%; }
}
.vit-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.vit-chips .chip { border: 1px solid var(--borda); background: #fff; border-radius: 999px; padding: .3rem .85rem; font-size: .85rem; color: var(--texto); }
.vit-chips .chip.ativo { background: var(--cor); border-color: var(--cor); color: #fff; }
.vit-filtros .form-select { width: auto; min-width: 150px; }
.vit-card { background: #fff; border-radius: 1rem; overflow: hidden; border: 1px solid var(--borda); display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.vit-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(15, 23, 42, .1); }
.vit-card-foto { position: relative; display: block; aspect-ratio: 16/10; background: #e2e8f0; overflow: hidden; }
.vit-card-foto img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.vit-card:hover .vit-card-foto img { transform: scale(1.04); }
.vit-sem-foto { position: absolute; inset: 0; display: grid; place-items: center; font-size: 3rem; color: #94a3b8; background: linear-gradient(135deg, var(--cor-clara), #e2e8f0); }
.vit-fase { position: absolute; top: .75rem; left: .75rem; }
.vit-tipo { position: absolute; bottom: .75rem; left: .75rem; background: rgba(15, 23, 42, .7); color: #fff; font-size: .75rem; padding: .15rem .6rem; border-radius: 999px; }
.vit-card-corpo { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; flex: 1; }
.vit-caract { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .25rem .9rem; font-size: .85rem; color: var(--suave); }
.vit-caract i { color: var(--cor); }
.vit-preco { white-space: nowrap; font-size: 1.25rem; font-weight: 800; color: var(--texto); letter-spacing: -.01em; }
.vit-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; background: linear-gradient(120deg, var(--cor-escura), var(--cor)); color: #fff; border-radius: 1.25rem; padding: 2rem; }
.vit-rodape { background: #0f172a; color: #94a3b8; padding: 2.5rem 0 1.5rem; margin-top: 2rem; font-size: .9rem; }
.vit-rodape a { color: #cbd5e1; text-decoration: none; }
.vit-rodape a:hover { color: #fff; }
body.vitrine .corretor-pub .avatar { background: var(--cor); }

/* ---------- Seleção de cidade com busca (v26) ---------- */
.ts-wrapper.single.input-active .ts-control > .item { display: none; }
.ts-wrapper.single .ts-control input { min-width: 6rem; }
.ts-wrapper .ts-control { min-height: calc(1.5em + .75rem + 2px); border-radius: var(--bs-border-radius); }
.ts-dropdown { border-radius: .6rem; box-shadow: 0 10px 30px rgba(15, 23, 42, .12); z-index: 1060; }
.ts-dropdown .active { background: var(--cor-clara); color: var(--texto); }
.ts-dropdown .highlight { background: #fde68a; border-radius: 2px; }

/* ---------- Vitrine: modo escuro (v38) ---------- */
.vit-tema { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--borda); display: grid; place-items: center; color: var(--texto); background: transparent; padding: 0; }
.vit-tema:hover { background: var(--cor-clara); color: var(--texto); }
html[data-bs-theme="dark"] body.vitrine {
  --fundo: #0b1220; --texto: #e2e8f0; --suave: #94a3b8; --borda: #243049; --cor-clara: rgba(var(--bs-primary-rgb), .18);
  --sombra: 0 1px 2px rgba(0, 0, 0, .35), 0 4px 16px rgba(0, 0, 0, .25);
  --bs-body-bg: #0b1220; --bs-body-color: #e2e8f0; --bs-secondary-color: #94a3b8; --bs-border-color: #243049;
  --bs-card-bg: #111a2b; --bs-tertiary-bg: #16213a; --bs-link-color: #93c5fd; --bs-link-hover-color: #bfdbfe;
  background: #0b1220; color: #e2e8f0;
}
html[data-bs-theme="dark"] body.vitrine .card { background: #111a2b; }
html[data-bs-theme="dark"] body.vitrine .vit-topo { background: #0f172a; border-color: #1e293b; }
html[data-bs-theme="dark"] body.vitrine .vit-marca { color: #f1f5f9; }
/* Logotipo: sem fundo (o PNG transparente aparece como é). Com a versão para o modo escuro, troca conforme o tema. */
.vit-marca .logo-escuro { display: none; }
html[data-bs-theme="dark"] body.vitrine .vit-marca .logo-claro { display: none; }
html[data-bs-theme="dark"] body.vitrine .vit-marca .logo-escuro { display: block; }
/* Prévia do logotipo na configuração: fundo quadriculado (claro) e escuro, para conferir a transparência */
.logo-prev { width: 120px; height: 48px; flex: none; border-radius: 8px; border: 1px solid var(--borda); display: grid; place-items: center; overflow: hidden; }
.logo-prev img { max-width: 110px; max-height: 40px; object-fit: contain; }
.logo-prev-claro { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Crect width='6' height='6' fill='%23e5e7eb'/%3E%3Crect x='6' y='6' width='6' height='6' fill='%23e5e7eb'/%3E%3C/svg%3E"); }
.logo-prev-escuro { background: #0f172a; }
html[data-bs-theme="dark"] body.vitrine .vit-card { background: #111a2b; border-color: #1e293b; }
html[data-bs-theme="dark"] body.vitrine .vit-card:hover { box-shadow: 0 12px 30px rgba(0, 0, 0, .45); }
html[data-bs-theme="dark"] body.vitrine .vit-card-foto, html[data-bs-theme="dark"] body.vitrine .emp-hero, html[data-bs-theme="dark"] body.vitrine .midia .thumb { background: #1e293b; }
html[data-bs-theme="dark"] body.vitrine .vit-sem-foto { background: linear-gradient(135deg, #1e293b, #0f172a); color: #475569; }
html[data-bs-theme="dark"] body.vitrine .vit-busca { background: #111a2b; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
html[data-bs-theme="dark"] body.vitrine .vit-busca .form-control, html[data-bs-theme="dark"] body.vitrine .vit-busca .form-select { background-color: transparent; color: #e2e8f0; }
html[data-bs-theme="dark"] body.vitrine .vit-chips .chip { background: #111a2b; border-color: #243049; color: #cbd5e1; }
html[data-bs-theme="dark"] body.vitrine .vit-chips .chip.ativo { background: var(--cor); border-color: var(--cor); color: #fff; }
html[data-bs-theme="dark"] body.vitrine .vit-preco, html[data-bs-theme="dark"] body.vitrine .text-body { color: #f1f5f9 !important; }
html[data-bs-theme="dark"] body.vitrine .vit-rodape { background: #060b14; }
html[data-bs-theme="dark"] body.vitrine .table > thead th, html[data-bs-theme="dark"] body.vitrine .table-light th { background: #16213a !important; color: #94a3b8; }
html[data-bs-theme="dark"] body.vitrine .espelho th { background: #111a2b; color: #94a3b8; }
html[data-bs-theme="dark"] body.vitrine .un-Disponível { background: #123524; color: #bbf7d0; border-color: #1f5135; }
html[data-bs-theme="dark"] body.vitrine .un-Reservado { background: #3b2f0d; color: #fde68a; border-color: #5c4712; }
html[data-bs-theme="dark"] body.vitrine .un-Vendido { background: #3b1414; color: #fca5a5; border-color: #5a1f1f; }
html[data-bs-theme="dark"] body.vitrine .un-Bloqueado { background: #1e293b; color: #94a3b8; border-color: #334155; }
html[data-bs-theme="dark"] body.vitrine .espelho .un .text-muted { color: inherit !important; opacity: .75; }
html[data-bs-theme="dark"] body.vitrine .btn-outline-secondary { --bs-btn-color: #cbd5e1; --bs-btn-border-color: #334155; --bs-btn-hover-bg: #1e293b; --bs-btn-hover-color: #fff; }
html[data-bs-theme="dark"] body.vitrine .nav-pills .nav-link:not(.active) { color: #cbd5e1; }

/* Seleção de várias unidades no espelho (v39) */
.espelho .un.selecionada { outline: 3px solid var(--cor); outline-offset: 1px; }
.barra-sel-un { position: fixed; left: 50%; transform: translateX(-50%); bottom: 1rem; z-index: 1040; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  background: #0f172a; color: #fff; border-radius: 14px; padding: .6rem .9rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); width: min(720px, calc(100% - 2rem)); }
@media (max-width: 991.98px) { .barra-sel-un { bottom: calc(var(--barra-inf) + .75rem); } }
