/* ==========================================================================
   AMOR D+ | AJUSTES DE LAYOUT (topo enxuto, celular, cards de lead)
   Carregado por último para sobrepor main/components/auth.css
   ========================================================================== */

/* ---------- Estrutura: evita rolagem horizontal ---------- */
html, body { overflow-x: hidden; }
.main-wrapper {
  width: auto;
  min-width: 0;
}

/* ---------- Topo ---------- */
.topbar {
  gap: 1rem;
  padding: 0 1.5rem;
}
.topbar-left {
  gap: 0.75rem;
  min-width: 0;
  flex-shrink: 0;
}
.topbar-title h2 {
  font-size: 1.15rem;
  white-space: nowrap;
}
#btn-mobile-menu { display: none; }

.search-bar {
  flex: 1;
  width: auto;
  max-width: 440px;
  min-width: 0;
}

.topbar-actions {
  gap: 0.6rem;
  flex-shrink: 0;
}

.btn-new-lead { white-space: nowrap; }

.topbar-user-badge { min-width: 0; }
.topbar-user-text { text-align: left; min-width: 0; line-height: 1.2; }
.topbar-user-name,
.topbar-user-role {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

/* Rodapé da barra lateral: usuário em cima, links de admin embaixo */
.sidebar-footer {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
.sidebar-footer .user-info { min-width: 0; }
.sidebar-footer .user-name,
.sidebar-footer .user-role {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#sidebar-dev-portal-link a span { white-space: nowrap; }

/* ---------- Funil: as 5 etapas lado a lado (antes quebravam em 2 linhas) ---------- */
.kanban-board {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(270px, 1fr);
}

/* ---------- Cards de lead (painel): banner mais baixo ---------- */
.lead-card .house-media { height: 150px; }

/* ---------- Telas médias (sidebar recolhida) ---------- */
@media (max-width: 1200px) {
  .topbar-user-text { display: none; }
}
@media (max-width: 1024px) {
  #sidebar-dev-portal-link { display: none !important; }
}

/* ---------- Celular ---------- */
@media (max-width: 768px) {
  #btn-mobile-menu { display: flex; }
  .topbar {
    padding: 0 0.75rem;
    height: 60px;
  }
  .topbar-title h2 {
    font-size: 1rem;
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .btn-new-lead {
    padding: 0.5rem 0.8rem;
  }
  .btn-new-lead-label { display: none; }
  .topbar-user-badge {
    padding: 0.2rem;
    gap: 0.35rem;
  }
  .btn-logout { padding: 0.3rem 0.5rem; }

  /* Menu lateral aberto: mostra o rodapé completo e um fundo escuro */
  .sidebar { z-index: 120; }
  .sidebar.mobile-open #sidebar-dev-portal-link[style*="block"] { display: block !important; }
  .sidebar.mobile-open .nav-item { justify-content: flex-start; padding: 0.75rem 0.9rem; }
  .sidebar.mobile-open .nav-badge { display: inline-flex; margin-left: auto; }
  .sidebar.mobile-open .sidebar-header { justify-content: flex-start; padding: 1rem 1.25rem; }
  .sidebar.mobile-open .user-info { display: block; }
  .sidebar.mobile-open ~ .main-wrapper::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 110;
  }

  .houses-grid { grid-template-columns: 1fr; }
  .lead-card .house-media { height: 140px; }

  .dash-lead-quick-tabs { flex-wrap: nowrap; }

  /* Funil no celular: uma coluna por vez, deslizando para o lado */
  .kanban-board {
    grid-auto-columns: 85vw;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .kanban-col { scroll-snap-align: start; }
}

/* ---------- Visão Geral: aguardando primeiro contato ---------- */
.first-contact-panel { border-left: 4px solid #94a3b8; }
.first-contact-panel.has-pending { border-left-color: #f59e0b; }
.first-contact-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 0.9rem; }
.first-contact-title { font-size: 1.1rem; color: var(--primary-900); display: flex; align-items: center; gap: 0.5rem; }
.first-contact-count {
  background: #fef3c7; color: #92400e; border-radius: 999px;
  font-size: 0.78rem; font-weight: 800; padding: 0.1rem 0.6rem;
}
.first-contact-panel:not(.has-pending) .first-contact-count { background: #ecfdf5; color: #065f46; }
.first-contact-subtitle { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }
.first-contact-list { display: flex; flex-direction: column; gap: 0.6rem; }
.first-contact-empty {
  font-size: 0.85rem; color: #065f46; background: #ecfdf5;
  border: 1px dashed #a7f3d0; border-radius: var(--radius-md); padding: 0.85rem 1rem;
}
.first-contact-item {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: #fff; border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}
.first-contact-item.fc-warn { border-color: #fcd34d; background: #fffbeb; }
.first-contact-item.fc-late { border-color: #fca5a5; background: #fef2f2; }
.fc-main { min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.fc-name-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.fc-name { font-weight: 700; color: var(--primary-900); font-size: 0.95rem; }
.fc-name small { font-weight: 500; color: #64748b; }
.fc-badge { font-size: 0.68rem; font-weight: 800; padding: 0.1rem 0.5rem; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.03em; }
.fc-badge-new { background: #e0f2fe; color: #0369a1; }
.fc-badge-warn { background: #fef3c7; color: #92400e; }
.fc-badge-late { background: #fee2e2; color: #b91c1c; }
.fc-contact { font-size: 0.82rem; color: #334155; }
.fc-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; font-size: 0.75rem; color: #64748b; }
.fc-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }
.fc-btn-whats { background: #10b981; border-color: #10b981; color: #fff; }
.fc-btn-whats:hover { background: #059669; }
.first-contact-toggle {
  margin-top: 0.75rem; background: none; border: none; color: #0d9488;
  font-weight: 700; font-size: 0.82rem; cursor: pointer; padding: 0;
}
@media (max-width: 768px) {
  .first-contact-item { flex-direction: column; align-items: stretch; }
  .fc-actions { justify-content: stretch; }
  .fc-actions .btn { flex: 1; }
}

/* ---------- Proposta WhatsApp: fotos separadas por casa ---------- */
.upp-section {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  background: #ffffff;
}
.upp-section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 1.25rem; }
.upp-switch { display: flex; align-items: center; gap: 0.45rem; cursor: pointer; font-size: 0.88rem; color: var(--primary-900); }
.upp-switch-sm { font-size: 0.78rem; color: #475569; }
.upp-section.is-off .upp-switch-sm { opacity: 0.45; pointer-events: none; }
.upp-muted { color: #64748b; font-weight: 500; font-size: 0.78rem; }
.upp-body { display: flex; flex-direction: column; gap: 0.85rem; margin-top: 0.85rem; }
.upp-section.is-off .upp-body { margin-top: 0; }
.upp-body.is-busy { opacity: 0.55; pointer-events: none; }
.upp-house { border-top: 1px dashed var(--border-subtle); padding-top: 0.75rem; }
.upp-house:first-child { border-top: none; padding-top: 0; }
.upp-house-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.4rem 0.75rem; margin-bottom: 0.5rem; }
.upp-house-title { font-weight: 700; font-size: 0.88rem; color: var(--primary-900); display: flex; align-items: center; gap: 0.45rem; }
.upp-num {
  width: 22px; height: 22px; border-radius: 50%; background: #e11d48; color: #fff;
  font-size: 0.75rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.upp-house-tools { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.upp-link { background: none; border: none; color: #0d9488; font-weight: 700; font-size: 0.78rem; cursor: pointer; padding: 0; }
.upp-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 0.5rem; }
.upp-thumb {
  position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; padding: 0;
  border: 2px solid transparent; background: #e2e8f0; cursor: pointer; opacity: 0.45;
  transition: opacity var(--transition-fast), border-color var(--transition-fast);
}
.upp-thumb.on { opacity: 1; border-color: #10b981; }
.upp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upp-check {
  position: absolute; top: 5px; right: 5px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(255,255,255,0.9); border: 1px solid #cbd5e1; font-size: 0.72rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.upp-thumb.on .upp-check { background: #10b981; border-color: #10b981; }
.upp-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.6rem; border-top: 1px solid var(--border-subtle); padding-top: 0.75rem; }
.upp-summary { font-size: 0.82rem; color: #334155; }
.upp-summary.warn { color: #b45309; }
.upp-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.upp-btn-share { background: #25D366; border-color: #25D366; color: #fff; }
.upp-btn-share:hover { background: #1ebe5a; }
.upp-help { font-size: 0.75rem; color: #64748b; line-height: 1.45; margin: 0; }
@media (max-width: 768px) {
  .upp-thumbs { grid-template-columns: repeat(3, 1fr); }
  .upp-actions, .upp-actions .btn { width: 100%; }
}

/* ---------- Detalhes do idoso: casas indicadas ---------- */
.lead-houses-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.lead-houses-hint { font-size: 0.72rem; color: #64748b; }
.lead-houses-list { display: flex; flex-direction: column; gap: 0.5rem; }
.lead-houses-empty {
  font-size: 0.8rem; color: #64748b; background: #f8fafc;
  border: 1px dashed #cbd5e1; border-radius: var(--radius-md); padding: 0.75rem 0.9rem;
}
.lead-house-item {
  display: flex; align-items: center; gap: 0.7rem;
  background: #fff; border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  padding: 0.5rem 0.6rem;
}
.lead-house-item.missing { background: #fef2f2; border-color: #fecaca; }
.lh-num {
  width: 22px; height: 22px; border-radius: 50%; background: #e11d48; color: #fff;
  font-size: 0.72rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.lh-thumb { width: 56px; height: 42px; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: #e2e8f0; }
.lh-info { min-width: 0; flex: 1; }
.lh-name { font-weight: 700; font-size: 0.86rem; color: var(--primary-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lh-meta { font-size: 0.75rem; color: #475569; }
.lh-when { font-size: 0.7rem; color: #94a3b8; }
.lh-actions { display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0; }
.lh-remove { color: #ef4444; width: 30px; height: 30px; }
.lead-houses-add { display: flex; gap: 0.5rem; margin-top: 0.6rem; }
.lead-houses-add .form-input { flex: 1; min-width: 0; }
@media (max-width: 768px) {
  .lh-thumb { display: none; }
}

/* ==========================================================================
   ATENDIMENTOS POR DIA + RESUMO DO DIA (30/10/2026)
   ========================================================================== */
.day-group-header {
  grid-column: 1 / -1;
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem;
  margin-top: 0.75rem; padding: 0.5rem 0 0.4rem;
  border-bottom: 2px solid var(--border-subtle, #e2e8f0);
}
.day-group-header:first-child { margin-top: 0; }
.day-group-title { font-size: 1.1rem; font-weight: 800; color: var(--primary-900, #0f172a); }
.day-group-sub { font-size: 0.8rem; color: #64748b; margin-left: 0.35rem; }
.day-group-count {
  font-size: 0.75rem; font-weight: 700; color: #0369a1; background: #e0f2fe;
  border-radius: 999px; padding: 0.15rem 0.6rem; white-space: nowrap;
}
.day-group-empty {
  grid-column: 1 / -1; font-size: 0.85rem; color: #64748b;
  padding: 0.75rem 1rem; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: var(--radius-md, 10px);
}
.day-report {
  grid-column: 1 / -1;
  background: #f8fafc; border: 1px solid #e2e8f0; border-left: 4px solid #0f172a;
  border-radius: var(--radius-md, 10px); padding: 0.85rem 1rem; margin-bottom: 0.5rem;
}
.day-report-title { font-size: 0.85rem; font-weight: 800; color: #0f172a; margin-bottom: 0.6rem; }
.day-report-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem; }
.day-report-item {
  background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 0.55rem 0.7rem; display: flex; flex-direction: column; gap: 0.1rem;
}
.day-report-item strong { font-size: 1.35rem; color: #0f172a; line-height: 1.1; }
.day-report-item span { font-size: 0.72rem; color: #64748b; font-weight: 600; }
.day-report-item.dr-visit strong { color: #0369a1; }
.day-report-item.dr-closed strong { color: #059669; }

/* ==========================================================================
   CELULAR — ajustes extras (30/10/2026)
   ========================================================================== */
@media (max-width: 768px) {
  .content-area { padding: 0.75rem; }

  /* Banner do consultor: empilha e o seletor de perfil ocupa a largura */
  .dash-individual-banner { padding: 1rem !important; flex-direction: column; align-items: stretch !important; }
  .dash-individual-banner > div { min-width: 0; max-width: 100%; }
  .dash-individual-banner > div > div { min-width: 0; max-width: 100%; flex-wrap: wrap; }
  #dash-profile-select { width: 100% !important; max-width: 100%; min-width: 0 !important; }
  #dash-banner-name { font-size: 1.15rem !important; }

  /* KPIs em 2 colunas */
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 0.6rem; }
  .kpi-card { padding: 0.85rem; }
  .kpi-value { font-size: 1.5rem; }

  /* Painéis */
  .filter-panel { padding: 0.9rem; }
  .filter-row { flex-direction: column; align-items: stretch; }
  .filter-row .filter-group { min-width: 0 !important; width: 100%; }
  #btn-dash-new-lead { width: 100%; }

  /* Abas rápidas: deslizam de lado sem quebrar a página */
  .dash-lead-quick-tabs { -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .dash-lead-quick-tabs::-webkit-scrollbar { display: none; }
  .lead-tab-btn { flex-shrink: 0; }

  /* Cards de lead */
  .lead-card .house-footer { flex-wrap: wrap; gap: 0.6rem; }
  .lead-card .house-footer > div:last-child { width: 100%; }
  .lead-card .house-footer > div:last-child .btn { flex: 1; justify-content: center; }
  .lead-card .house-content > div[style*="monospace"] { flex-direction: column; align-items: flex-start !important; gap: 0.2rem; }
  .lead-overdue-action-bar { flex-direction: column; align-items: stretch; gap: 0.5rem; }

  /* Aguardando primeiro contato */
  .first-contact-item { flex-direction: column; align-items: stretch; }
  .fc-actions { width: 100%; display: flex; gap: 0.4rem; }
  .fc-actions .btn { flex: 1; }

  /* Resumo do dia em 2 colunas */
  .day-report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .day-group-header { flex-wrap: wrap; }
  .day-group-sub { display: block; margin-left: 0; }

  /* Janelas (modais): ocupam a tela e os formulários ficam em 1 coluna */
  .modal-backdrop { padding: 0.5rem; align-items: flex-end; }
  .modal-dialog, .modal-dialog.modal-lg { width: 100% !important; max-width: 100% !important; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .modal-body { overflow-y: auto; }
  .form-grid-2 { grid-template-columns: 1fr !important; }
  .modal-footer { flex-wrap: wrap; gap: 0.5rem; }
  .modal-footer > * { min-width: 0; }
  .modal-footer > div { display: flex; flex-wrap: wrap; gap: 0.5rem; width: 100%; }
  .modal-footer .btn { flex: 1 1 auto; justify-content: center; }

  /* Campos com fonte 16px: evita o zoom automático do iPhone ao tocar */
  input, select, textarea, .form-input, .form-select, .filter-select { font-size: 16px !important; }
}

@media (max-width: 768px) {
  /* Triagem: formulário e resultado um embaixo do outro */
  .triage-layout { grid-template-columns: 1fr !important; gap: 1rem !important; }
  .triage-layout > * { min-width: 0; }
  /* Legenda do mapa quebra em linhas */
  .map-legend { flex-wrap: wrap; gap: 0.5rem 0.9rem; }
}
@media (max-width: 768px) {
  .form-grid-2 { grid-template-columns: minmax(0, 1fr) !important; }
  .form-grid-2 > *, .modal-body > * { min-width: 0; }
  .modal-body select, .modal-body input, .modal-body textarea { width: 100%; max-width: 100%; }
}

/* ---------- Canais de WhatsApp ---------- */
.channels-title { font-size: 1.1rem; color: var(--primary-900, #0f172a); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.channels-sub { font-size: 0.8rem; color: #64748b; margin-top: 0.25rem; }
.channels-setup ol { margin: 0.75rem 0 0.75rem 1.2rem; font-size: 0.9rem; line-height: 1.6; }
.channels-list { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.9rem; }
.channel-card { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; padding: 0.8rem 1rem; border: 1px solid #e2e8f0; border-left: 4px solid #16a34a; border-radius: 10px; background: #fff; }
.channel-card.channel-off { border-left-color: #94a3b8; opacity: 0.75; }
.channel-name { font-weight: 800; color: #0f172a; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.channel-meta { font-size: 0.78rem; color: #64748b; margin-top: 0.15rem; word-break: break-word; }
.channel-status { font-size: 0.7rem; font-weight: 700; border-radius: 999px; padding: 0.1rem 0.5rem; background: #f1f5f9; color: #475569; }
.channel-status.on { background: #dcfce7; color: #166534; }
.channel-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }
.channels-messages { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem; }
.channel-msg { padding: 0.6rem 0.8rem; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 0.85rem; }
.channel-msg-body { margin-top: 0.2rem; color: #334155; word-break: break-word; }
@media (max-width: 768px) {
  .channel-card { flex-direction: column; align-items: stretch; }
  .channel-actions .btn { flex: 1; }
}

/* ---------- Equipe: acesso ao sistema ---------- */
.tm-login-box { border: 1px solid #bae6fd; background: #f0f9ff; border-radius: 10px; padding: 0.85rem 1rem; margin-top: 0.5rem; }
.tm-login-title { font-weight: 800; color: #0c4a6e; font-size: 0.9rem; }
.tm-login-sub { font-size: 0.75rem; color: #475569; margin: 0.2rem 0 0.6rem; }
.team-login-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.team-login-actions .btn { flex: 1; justify-content: center; }
.team-btn-off { color: #b91c1c; }
.team-inactive-row { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.45rem 0; border-top: 1px solid #e2e8f0; font-size: 0.85rem; }
.team-inactive-row small { color: #64748b; margin-left: 0.3rem; }

/* ===== Planilha Métricas ===== */
.met-head { display:flex; justify-content:space-between; align-items:flex-start; gap:1rem; flex-wrap:wrap; margin-bottom:1rem; }
.met-title { font-size:1.25rem; color:var(--primary-900,#0f172a); margin:0; }
.met-sub { font-size:.8rem; color:#64748b; margin-top:.25rem; }
.met-select { padding:.5rem .75rem; border:1px solid #cbd5e1; border-radius:8px; background:#fff; font-weight:600; }
.met-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.75rem; margin-bottom:1rem; }
.met-kpi { background:#fff; border:1px solid #e2e8f0; border-radius:12px; padding:.9rem 1rem; display:flex; flex-direction:column; gap:.15rem; }
.met-kpi span { font-size:.75rem; color:#64748b; font-weight:600; text-transform:uppercase; letter-spacing:.03em; }
.met-kpi strong { font-size:1.6rem; color:#0f172a; font-variant-numeric:tabular-nums; }
.met-kpi small { font-size:.75rem; color:#64748b; }
.met-kpi-hl { border-color:#16a34a; background:#f0fdf4; }
.met-kpi-hl strong { color:#166534; }
.met-panel { background:#fff; border:1px solid #e2e8f0; border-radius:12px; padding:1rem; margin-bottom:1rem; }
.met-panel h3 { font-size:1rem; margin:0 0 .75rem; color:#0f172a; }
.met-bars { display:flex; flex-direction:column; gap:.6rem; }
.met-bar-row { display:grid; grid-template-columns:minmax(140px,220px) 1fr 2.5rem; align-items:center; gap:.75rem; }
.met-bar-name { font-weight:700; font-size:.9rem; display:flex; flex-wrap:wrap; align-items:center; gap:.35rem; }
.met-bar-name small, .met-detail summary small { font-weight:500; color:#64748b; font-size:.75rem; width:100%; }
.met-bar-name i, .met-detail summary i { width:10px; height:10px; border-radius:3px; display:inline-block; }
.met-bar-track { background:#f1f5f9; border-radius:6px; height:14px; overflow:hidden; }
.met-bar-fill { height:100%; border-radius:6px; }
.met-bar-val { font-weight:800; font-size:1.1rem; text-align:right; font-variant-numeric:tabular-nums; }
.met-table-wrap { overflow-x:auto; }
.met-table { width:100%; border-collapse:collapse; font-size:.85rem; }
.met-table th { text-align:left; font-size:.72rem; text-transform:uppercase; color:#64748b; padding:.5rem; border-bottom:1px solid #e2e8f0; white-space:nowrap; }
.met-table td { padding:.55rem .5rem; border-bottom:1px solid #f1f5f9; font-variant-numeric:tabular-nums; }
.met-table td small { color:#64748b; }
.met-row { cursor:pointer; }
.met-row:hover { background:#f8fafc; }
.met-total td { font-weight:800; border-top:2px solid #e2e8f0; }
.met-badge { display:inline-block; min-width:1.8rem; text-align:center; background:#dcfce7; color:#166534; font-weight:800; border-radius:999px; padding:.1rem .5rem; }
.met-has { background:#f0fdf4; }
.met-hint { font-size:.75rem; color:#94a3b8; margin:.5rem 0 0; }
.met-detail summary { cursor:pointer; font-weight:700; display:flex; flex-wrap:wrap; align-items:center; gap:.4rem; }
.met-detail[open] summary { margin-bottom:.75rem; }
@media (max-width: 768px) {
  .met-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .met-kpi strong { font-size:1.3rem; }
  .met-bar-row { grid-template-columns:1fr 2rem; }
  .met-bar-track { grid-column:1 / -1; grid-row:2; }
}

/* ===== Card de atendimento sem foto ===== */
.lead-card-head { padding: 1rem 1.25rem 0.25rem; display: flex; flex-direction: column; gap: 0.5rem; border-bottom: 1px solid #f1f5f9; padding-bottom: 0.75rem; }
.lead-card-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.lead-card-status { margin-left: auto; font-size: 0.75rem; font-weight: 700; color: #0f172a; background: #f1f5f9; border-radius: 999px; padding: 0.2rem 0.65rem; white-space: nowrap; }
.lead-card-status.is-overdue { background: #dc2626; color: #fff; }
.lead-card-contact { font-size: 0.78rem; color: #475569; }
.lead-card-contact strong { color: #0f172a; }

/* ===== Visitas Gerais ===== */
.vis-head { display:flex; justify-content:space-between; align-items:flex-start; gap:1rem; flex-wrap:wrap; margin-bottom:.9rem; }
.vis-filters { display:flex; gap:.5rem; flex-wrap:wrap; }
.vis-chips { display:flex; flex-wrap:wrap; gap:.5rem; margin-bottom:1rem; }
.vis-chip { border:1px solid #e2e8f0; background:#fff; border-radius:999px; padding:.35rem .8rem; font-size:.82rem; cursor:pointer; color:#334155; }
.vis-chip strong { margin-left:.3rem; color:#0f172a; }
.vis-chip.on { background:#0f172a; color:#fff; border-color:#0f172a; }
.vis-chip.on strong { color:#fff; }
.vis-day { margin-bottom:1.1rem; }
.vis-day-title { font-weight:800; color:#0f172a; margin:0 0 .5rem; text-transform:capitalize; }
.vis-day-title span { font-weight:600; color:#64748b; font-size:.8rem; text-transform:none; margin-left:.4rem; }
.vis-row { display:grid; grid-template-columns:3.5rem 1fr auto; gap:.75rem; align-items:center; background:#fff; border:1px solid #e2e8f0; border-left:4px solid #64748b; border-radius:10px; padding:.7rem .9rem; margin-bottom:.45rem; }
.vis-time { font-weight:800; font-size:1rem; color:#0f172a; font-variant-numeric:tabular-nums; }
.vis-name { font-weight:700; color:#0f172a; }
.vis-name small { color:#64748b; font-weight:500; }
.vis-meta { font-size:.8rem; color:#475569; margin-top:.1rem; word-break:break-word; }
.vis-side { display:flex; flex-direction:column; align-items:flex-end; gap:.4rem; }
.vis-agent { color:#fff; font-size:.72rem; font-weight:700; border-radius:999px; padding:.15rem .6rem; white-space:nowrap; }
@media (max-width:768px) {
  .vis-row { grid-template-columns:3rem 1fr; }
  .vis-side { grid-column:1 / -1; flex-direction:row; justify-content:space-between; align-items:center; }
}

/* ===== Respostas Prontas ===== */
.rp-tabs { display:flex; gap:.4rem; overflow-x:auto; padding-bottom:.4rem; margin-bottom:.75rem; }
.rp-tab { flex:0 0 auto; border:1px solid #e2e8f0; background:#fff; border-radius:999px; padding:.4rem .85rem; font-size:.82rem; font-weight:600; color:#334155; cursor:pointer; white-space:nowrap; }
.rp-tab.on { background:#0f172a; color:#fff; border-color:#0f172a; }
.rp-dica { font-size:.85rem; color:#475569; padding:.7rem 1rem; }
.rp-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:.75rem; }
.rp-card { background:#fff; border:1px solid #e2e8f0; border-radius:12px; padding:1rem; display:flex; flex-direction:column; gap:.6rem; }
.rp-card-title { font-weight:800; color:#0f172a; font-size:.9rem; }
.rp-text { font-size:.88rem; color:#1e293b; line-height:1.5; background:#f0fdf4; border-radius:10px; padding:.7rem .85rem; flex:1; }
.rp-blank { background:#fef3c7; color:#92400e; border-radius:4px; padding:0 .2rem; }
.rp-actions { display:flex; gap:.5rem; justify-content:flex-end; flex-wrap:wrap; }
@media (max-width:768px) { .rp-list { grid-template-columns:1fr; } }

/* ===== Agendar visita na casa (WhatsApp) ===== */
.ag-box { background:#fff; border:1px solid #bbf7d0; border-radius:10px; padding:.7rem; margin:.4rem 0 .5rem; display:flex; flex-direction:column; gap:.45rem; }
.ag-title { font-weight:800; color:#166534; font-size:.8rem; }
.ag-row { display:flex; gap:.4rem; }
.ag-row .ag-input { flex:1; min-width:0; }
.ag-input { font-size:.8rem !important; padding:.4rem .5rem !important; }
.ag-wa-btn { background:#16a34a !important; border-color:#16a34a !important; color:#fff !important; font-weight:700; justify-content:center; }

/* ===== Copiar/enviar fotos da casa ===== */
.hpc-bar { background:#f0fdf4; border:1px solid #bbf7d0; border-radius:10px; padding:.55rem .65rem; display:flex; flex-direction:column; gap:.45rem; }
.hpc-hint { font-size:.72rem; color:#166534; }
.hpc-actions { display:flex; gap:.35rem; flex-wrap:wrap; }
.hpc-actions .btn { font-size:.72rem; padding:.3rem .6rem; }
.hpc-green { background:#16a34a !important; border-color:#16a34a !important; color:#fff !important; }
.hpc-check { position:absolute; top:3px; left:3px; background:rgba(255,255,255,.92); border-radius:4px; width:18px; height:18px; display:flex; align-items:center; justify-content:center; cursor:pointer; }
.hpc-check input { margin:0; width:13px; height:13px; cursor:pointer; }
.hpc-copy { position:absolute; top:3px; right:3px; background:rgba(22,163,74,.95); color:#fff; border:none; border-radius:4px; font-size:.58rem; font-weight:700; padding:2px 5px; cursor:pointer; }
.hpc-copy:hover { background:#15803d; }
