/* ============================================================
   SERVICOS.CSS - Estilo completo do módulo Serviços
   Seguindo o padrão do sistema CF Obras
   ============================================================ */

:root {
  --primary: #667eea;
  --secondary: #764ba2;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #fbbf24;
  --info: #3b82f6;
  --bg-color: #f9fafb;
  --text-main: #1f2937;
  --border-color: #e5e7eb;
}

/* ============================================================
   CORREÇÕES PONTUAIS (Modal Serviços)
   ============================================================ */

/* Remover menu duplicado dentro de seções */
.secao-servicos #submenu-servicos,
.card-servicos #submenu-servicos {
  display: none !important;
}

/* Mantém o submenu do topo visível */
#servicos-header #submenu-servicos {
  display: flex !important;
}

/* ------------------------- */
/* CABEÇALHO LOCAL          */
/* ------------------------- */

#servicos-header {
  padding: 20px 30px;
  background: #f5f7fa;
  border-bottom: 1px solid #ddd;
}

.titulo-modulo {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 15px;
  color: #2c3e50;
}

/* ------------------------- */
/* SUBMENU TOP              */
/* ------------------------- */

#submenu-servicos {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.sub-btn {
  background: #e6e9ef;
  border: none;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  color: #2c3e50;
  transition: 0.2s;
}

.sub-btn:hover {
  background: #d5d9e3;
}

.sub-btn.active {
  background: #667eea;
  color: #fff;
}

/* ============================= */
/* SEÇÕES PRINCIPAIS             */
/* ============================= */

.secao-servicos {
  padding: 25px 35px;
  display: none;
  background: #f9fafb;
}

.secao-servicos.active {
  display: block;
}

/* ============================= */
/* CARDS                         */
/* ============================= */

.card-servicos {
  background: #fff;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}

.card-servicos h3 {
  font-size: 22px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-text {
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ============================= */
/* FORMULÁRIOS                   */
/* ============================= */

.form-servicos,
.form-empreiteiros {
  margin-bottom: 20px;
}

.form-grid-servico,
.form-grid-empreiteiro {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.form-field {
  display: flex;
  flex-direction: column;
}

.form-field-full {
  grid-column: 1 / -1;
}

.form-field label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.form-field input,
.form-field select {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: 0.2s;
  font-family: inherit;
}

.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input[type="color"] {
  height: 44px;
  cursor: pointer;
}

/* ============================= */
/* MÚLTIPLOS SERVIÇOS EMPREITEIRO */
/* ============================= */

.servicos-empreiteiro-lista {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  min-height: 60px;
}

.servico-empreiteiro-item {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.servico-empreiteiro-item:last-child {
  margin-bottom: 0;
}

.select-tipo-servico {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: 0.2s;
}

.select-tipo-servico:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-remover-servico {
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 15px;
  font-size: 16px;
  cursor: pointer;
  transition: 0.2s;
  min-width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-remover-servico:hover {
  background: #dc2626;
  transform: scale(1.05);
}

.btn-adicionar-servico {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  width: 100%;
  margin-top: 10px;
}

.btn-adicionar-servico:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ============================= */
/* TAG NÃO ORÇADO                */
/* ============================= */

.tag-nao-orcado {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #78350f;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 8px;
  display: inline-block;
}

/* ============================= */
/* BOTÕES                        */
/* ============================= */

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-salvar,
.btn-cancelar {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.btn-salvar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.btn-salvar:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-cancelar {
  background: #e5e7eb;
  color: #374151;
}

.btn-cancelar:hover {
  background: #d1d5db;
}

.btn-editar,
.btn-excluir {
  padding: 8px 16px !important;
  border: none !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.btn-editar {
  background: #3b82f6 !important;
  color: #fff !important;
}

.btn-editar:hover {
  background: #2563eb !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3) !important;
}

.btn-excluir {
  background: #ef4444 !important;
  color: #fff !important;
}

.btn-excluir:hover {
  background: #dc2626 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3) !important;
}

/* ============================= */
/* MENSAGENS DE STATUS           */
/* ============================= */

.status-msg {
  margin-top: 15px;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  display: none;
}

.status-msg.show {
  display: block;
}

.status-msg.success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #10b981;
}

.status-msg.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #ef4444;
}

/* ============================= */
/* LISTAS                        */
/* ============================= */

.lista-servicos {
  margin-top: 25px;
}

.lista-servicos h4,
.lista-empreiteiros h4 {
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 15px;
}

/* --- Estilo Específico para Serviços (Lista Linear) --- */
.servico-item {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: 0.2s;
}

.servico-item:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.servico-info {
  flex: 1;
}

.servico-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.servico-insumo {
  font-size: 24px;
}

.servico-codigo {
  background: #667eea;
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.servico-descricao {
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
}

.servico-detalhes {
  display: flex;
  gap: 15px;
  margin-top: 6px;
  font-size: 13px;
  color: #6b7280;
  flex-wrap: wrap;
}

.servico-detalhes span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.valor-unitario {
  font-weight: 700;
  color: #10b981;
  font-size: 14px;
}

.servico-acoes {
  display: flex;
  gap: 8px;
}

/* ============================= */
/* LISTA DE EMPREITEIROS (NOVO ESTILO - IDÊNTICO A APARTAMENTOS) */
/* ============================= */

.lista-empreiteiros {
  margin-top: 25px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 15px;
}

.empreiteiro-card {
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  padding: 18px;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.empreiteiro-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: var(--cor-empreiteiro);
}

.empreiteiro-card:hover {
  box-shadow: 0 6px 15px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.empreiteiro-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.empreiteiro-nome {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}

.empreiteiro-razao {
  font-size: 12px;
  color: #6b7280;
}

.empreiteiro-acoes {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Botões de ação (padrão CF Obras - compacto e premium) */
.empreiteiro-acoes .btn-acao {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.25);
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.12);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.empreiteiro-acoes .btn-acao:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.16);
  filter: brightness(1.03);
}

.empreiteiro-acoes .btn-acao:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(17, 24, 39, 0.12);
}

.empreiteiro-acoes .btn-acao:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25), 0 10px 22px rgba(17, 24, 39, 0.16);
}

/* Cores por ação */
.empreiteiro-acoes .btn-editar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.empreiteiro-acoes .btn-funcionarios {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
}

.empreiteiro-acoes .btn-inativar {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #78350f;
}

.empreiteiro-acoes .btn-remover {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
}

/* Estado inativo: suaviza */
.empreiteiro-card.inativo .empreiteiro-acoes .btn-acao {
  filter: grayscale(0.1) saturate(0.85);
}


.empreiteiro-info {
  font-size: 13px;
  color: #4b5563;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.empreiteiro-info strong {
  color: #111827;
  min-width: 50px;
}

.empreiteiro-valor {
  background: #ecfdf5;
  color: #047857;
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 15px;
  margin-top: 10px;
  text-align: center;
}

.empreiteiro-card.inativo {
  opacity: 0.6;
  background: #f9fafb;
}

.empreiteiro-card.inativo::after {
  content: 'INATIVO';
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ef4444;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: bold;
}

/* ============================= */
/* CABEÇALHO E FILTROS           */
/* ============================= */

.cabecalho-servicos {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.filtros-servicos {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.inp-filtro {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  min-width: 200px;
  cursor: pointer;
  transition: 0.2s;
}

.inp-filtro:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ============================= */
/* ESTATÍSTICAS                  */
/* ============================= */

.estatisticas-servicos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
}

.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.stat-card h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  opacity: 0.9;
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 5px;
}

.stat-card .stat-label {
  font-size: 12px;
  opacity: 0.8;
}

/* ============================= */
/* ÁREA DE SERVIÇOS              */
/* ============================= */

.area-servicos {
  display: grid;
  gap: 15px;
}

.servico-card-grande {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  transition: 0.2s;
}

.servico-card-grande:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #667eea;
}

/* ============================= */
/* EMPTY STATE                   */
/* ============================= */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #9ca3af;
}

.empty-state svg {
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state h4 {
  font-size: 18px;
  color: #6b7280;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  color: #9ca3af;
}

/* ============================= */
/* RESPONSIVIDADE                */
/* ============================= */

@media (max-width: 768px) {
  #servicos-header {
    padding: 15px 20px;
  }

  .secao-servicos {
    padding: 15px 20px;
  }

  .card-servicos {
    padding: 20px;
  }

  .form-grid-servico,
  .form-grid-empreiteiro {
    grid-template-columns: 1fr;
  }

  .cabecalho-servicos {
    flex-direction: column;
    align-items: stretch;
  }

  .filtros-servicos {
    flex-direction: column;
  }

  .inp-filtro {
    width: 100%;
  }

  .servico-item,
  .empreiteiro-item {
    flex-direction: column;
    align-items: stretch;
  }

  .servico-acoes,
  .empreiteiro-acoes {
    margin-top: 15px;
    justify-content: flex-end;
  }
  
  .lista-empreiteiros {
    grid-template-columns: 1fr;
  }
}

/* ============================= */
/* SEÇÃO DE FUNCIONÁRIOS         */
/* ============================= */

.secao-funcionarios {
  background: white;
  border-radius: 16px;
  padding: 25px;
  margin-top: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 2px solid #f0f0f0;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cabecalho-funcionarios {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid #f0f0f0;
}

.cabecalho-funcionarios h3 {
  font-size: 20px;
  font-weight: 700;
  color: #2d3748;
  margin: 0;
}

.btn-fechar-funcionarios {
  padding: 8px 16px;
  background: #f56565;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-fechar-funcionarios:hover {
  background: #c53030;
  transform: scale(1.05);
}

.form-grid-funcionario {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 25px;
}

.lista-funcionarios {
  margin-top: 25px;
}

.funcionario-card {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.funcionario-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: #667eea;
}

.funcionario-card.inativo {
  opacity: 0.6;
  background: #f7fafc;
}

.funcionario-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

.funcionario-nome {
  font-size: 18px;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 5px;
}

.funcionario-funcao {
  display: inline-block;
  padding: 4px 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 5px;
}

.funcionario-info {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  font-size: 14px;
  color: #4a5568;
}

.funcionario-info strong {
  margin-right: 8px;
  font-size: 16px;
}

.funcionario-acoes {
  display: flex;
  gap: 8px;
}

/* ============================= */
/* BOTÕES NOS CARDS EMPREITEIROS */
/* ============================= */

.empreiteiro-card {
  position: relative;
}

.empreiteiro-acoes {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-acao {
  padding: 6px 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-acao:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-acao.btn-editar {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  padding: 6px 8px;
}

.btn-acao.btn-editar:hover {
  box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.btn-acao.btn-funcionarios {
  background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
}

.btn-acao.btn-funcionarios:hover {
  box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.btn-acao.btn-inativar {
  background: linear-gradient(135deg, #f6ad55 0%, #ed8936 100%);
  padding: 6px 8px;
}

.btn-acao.btn-inativar:hover {
  box-shadow: 0 4px 12px rgba(246, 173, 85, 0.3);
}

.btn-acao.btn-remover {
  background: linear-gradient(135deg, #fc8181 0%, #f56565 100%);
  padding: 6px 8px;
}

.btn-acao.btn-remover:hover {
  box-shadow: 0 4px 12px rgba(245, 101, 101, 0.3);
}

/* ============================= */
/* RESPONSIVIDADE ATUALIZADA     */
/* ============================= */

@media (max-width: 768px) {
  .form-grid-funcionario {
    grid-template-columns: 1fr;
  }
  
  .cabecalho-funcionarios {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  
  .btn-fechar-funcionarios {
    width: 100%;
  }
  
  .empreiteiro-header {
    flex-direction: column;
    gap: 10px;
  }
  
  .empreiteiro-acoes {
    justify-content: flex-start;
    width: 100%;
  }
  
  .btn-acao {
    font-size: 11px;
    padding: 5px 8px;
  }
  
  .btn-acao.btn-funcionarios {
    flex: 1;
    min-width: 120px;
  }
}

/* ============================= */
/* SEÇÃO DE METAS DE PRODUÇÃO    */
/* ============================= */

.form-metas {
  margin-top: 25px;
}

.form-grid-metas {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 25px;
}

.filtros-metas {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filtros-metas .inp-filtro {
  flex: 1;
  min-width: 200px;
}

.acoes-metas {
  display: flex;
  gap: 12px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.btn-metas {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-metas.btn-selecionar {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  color: white;
}

.btn-metas.btn-limpar {
  background: linear-gradient(135deg, #f56565 0%, #c53030 100%);
  color: white;
}

.btn-metas.btn-salvar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-metas:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn-metas:active {
  transform: translateY(0);
}

/* Grid de Apartamentos */
#gridApartamentosMetas {
  background: #f8fafc;
  border: 2px dashed #cbd5e0;
  border-radius: 12px;
  padding: 20px;
  min-height: 300px;
}

.torre-checklist {
  margin-bottom: 30px;
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.torre-checklist-header {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e5e7eb;
}

.pavimento-grupo {
  margin-bottom: 20px;
}

.pavimento-label {
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 8px;
}

.chips-apartamentos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-apto {
  min-width: 70px;
  height: 70px;
  background: #d1d5db;
  border: 2px solid #9ca3af;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  padding: 5px;
}

.chip-apto:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.chip-apto.selecionado {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #667eea;
  border-width: 3px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* ✅ Apartamentos removidos - mantém espaço mas fica invisível (buraco) */
.chip-apto.removido {
  visibility: hidden;
  pointer-events: none;
}

.chip-apto-num {
  font-size: 16px;
  font-weight: 800;
}

/* Empty State Metas */
.empty-state-metas {
  text-align: center;
  padding: 80px 20px;
  color: #a0aec0;
}

.empty-state-metas svg {
  margin: 0 auto 20px;
  opacity: 0.4;
}

.empty-state-metas h4 {
  color: #4a5568;
  font-size: 18px;
  margin-bottom: 10px;
  font-weight: 600;
}

.empty-state-metas p {
  color: #718096;
  font-size: 14px;
}

/* Lista de Metas Cadastradas */
.secao-lista-metas {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 3px solid #e2e8f0;
}

.secao-lista-metas h3 {
  color: #2d3748;
  font-size: 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.filtros-lista-metas {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.filtros-lista-metas .inp-filtro {
  flex: 1;
  min-width: 200px;
}

#listaMetasCadastradas {
  display: grid;
  gap: 20px;
}

.meta-card {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.meta-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  border-color: #667eea;
}

.meta-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 2px solid #f0f0f0;
}

.meta-card-title {
  font-size: 18px;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.meta-card-subtitle {
  font-size: 14px;
  color: #718096;
  font-weight: 500;
}

.meta-card-acoes {
  display: flex;
  gap: 8px;
}

.meta-card-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.meta-card-info-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #4a5568;
}

.meta-card-info-item strong {
  color: #2d3748;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-apartamentos-lista {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 2px solid #f0f0f0;
}

.meta-apto-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
  transition: all 0.2s ease;
}

.meta-apto-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 3px 10px rgba(102, 126, 234, 0.5);
}

/* Indicador de Quantidade */
.contador-selecionados {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #edf2f7;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 15px;
}

.contador-selecionados .numero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
}

/* Responsividade Metas */
@media (max-width: 1024px) {
  .form-grid-metas {
    grid-template-columns: 1fr;
  }
  
  .chips-apartamentos {
    gap: 6px;
  }
  
  .chip-apto {
    min-width: 65px;
    height: 65px;
  }
}

@media (max-width: 768px) {
  .form-grid-metas {
    grid-template-columns: 1fr;
  }
  
  .filtros-metas {
    flex-direction: column;
  }
  
  .filtros-metas .inp-filtro {
    width: 100%;
  }
  
  .acoes-metas {
    flex-direction: column;
  }
  
  .btn-metas {
    width: 100%;
    justify-content: center;
  }
  
  .chips-apartamentos {
    gap: 6px;
  }
  
  .chip-apto {
    min-width: 60px;
    height: 60px;
  }
  
  .chip-apto-num {
    font-size: 14px;
  }
  
  .meta-card-info {
    grid-template-columns: 1fr;
  }
  
  .filtros-lista-metas {
    flex-direction: column;
  }
  
  .filtros-lista-metas .inp-filtro {
    width: 100%;
  }
}

/* Badges de Tipo de Área nas Metas */
.tipo-area-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 10px;
  vertical-align: middle;
}

.badge-ua {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.badge-aci {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.badge-ace {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
}

.btn-editar {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  color: white;
}

.btn-editar:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(250, 112, 154, 0.4);
}

.meta-local-badge {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  color: #333;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-block;
  margin: 4px;
}

/* ============================================
   SISTEMA DE QR CODE
   ============================================ */

.form-qrcode {
  margin-top: 20px;
}

.form-grid-qrcode {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.qrcode-preview {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 30px;
  margin: 20px 0;
  text-align: center;
}

.qrcode-preview h4 {
  margin: 0 0 20px 0;
  color: #1f2937;
}

#qrcodeCanvas {
  margin: 20px auto;
  display: inline-block;
}

.qrcode-info {
  margin: 20px 0;
  padding: 15px;
  background: #f9fafb;
  border-radius: 8px;
  text-align: left;
  line-height: 1.8;
}

.qrcode-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

.scanner-section {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 2px solid #e5e7eb;
}

.scanner-section h4 {
  margin-bottom: 10px;
  color: #1f2937;
}

.scanner-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 20px 0;
}

.inp-codigo {
  flex: 1;
  min-width: 200px;
  padding: 10px 15px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.95rem;
}

#videoCamera {
  width: 100%;
  max-width: 500px;
  margin: 20px auto;
  display: block;
  border-radius: 12px;
}

.resultado-scan {
  margin-top: 20px;
}

.scan-resultado-card {
  background: white;
  border: 2px solid #10b981;
  border-radius: 12px;
  padding: 20px;
}

.scan-resultado-card h4 {
  color: #10b981;
  margin: 0 0 15px 0;
}

.scan-resultado-card p {
  margin: 10px 0;
  color: #4b5563;
}

.scan-acoes {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s;
}

.btn-warning:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* ============================================
   CHAT MULTI-NÍVEL
   ============================================ */

.chat-container {
  display: flex;
  height: 600px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  margin-top: 20px;
}

.chat-sidebar {
  width: 350px;
  background: #f9fafb;
  border-right: 2px solid #e5e7eb;
  display: flex;
  flex-direction: column;
}

.chat-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 2px solid #e5e7eb;
}

.chat-sidebar-header h4 {
  margin: 0;
  color: #1f2937;
  font-size: 1.2rem;
}

.btn-nova-conversa {
  background: #667eea;
  color: white;
  border: none;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s;
}

.btn-nova-conversa:hover {
  background: #5568d3;
  transform: scale(1.1);
}

.chat-filters {
  padding: 15px;
  border-bottom: 2px solid #e5e7eb;
}

.chat-search {
  padding: 15px;
  border-bottom: 2px solid #e5e7eb;
}

.search-input {
  width: 100%;
  padding: 10px 15px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.9rem;
}

.search-input:focus {
  outline: none;
  border-color: #667eea;
}

.lista-conversas {
  flex: 1;
  overflow-y: auto;
}

.conversa-item {
  display: flex;
  gap: 12px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.3s;
  border-bottom: 1px solid #e5e7eb;
  position: relative;
}

.conversa-item:hover {
  background: white;
}

.conversa-item.ativa {
  background: white;
  border-left: 4px solid #667eea;
}

.conversa-avatar {
  width: 45px;
  height: 45px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.conversa-info {
  flex: 1;
  min-width: 0;
}

.conversa-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.conversa-assunto {
  font-weight: 600;
  color: #1f2937;
  font-size: 0.95rem;
}

.conversa-hora {
  font-size: 0.75rem;
  color: #9ca3af;
}

.conversa-preview {
  font-size: 0.85rem;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tipo-badge {
  display: inline-block;
  padding: 2px 6px;
  background: #e5e7eb;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #6b7280;
  margin-right: 5px;
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: white;
}

.chat-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
}

.placeholder-icon {
  font-size: 4rem;
  margin-bottom: 15px;
}

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 2px solid #f3f4f6;
}

.chat-info h4 {
  color: #1f2937;
  font-size: 1.2rem;
  margin: 0 0 5px 0;
}

.chat-info p {
  color: #6b7280;
  font-size: 0.9rem;
  margin: 0;
}

.chat-actions {
  display: flex;
  gap: 10px;
}

.btn-chat-action {
  background: #f3f4f6;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 1.1rem;
}

.btn-chat-action:hover {
  background: #e5e7eb;
}

.chat-mensagens {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.mensagem {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-width: 70%;
}

.minha-mensagem {
  align-self: flex-end;
}

.outra-mensagem {
  align-self: flex-start;
}

.mensagem-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
}

.mensagem-autor {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
}

.mensagem-hora {
  font-size: 0.75rem;
  color: #9ca3af;
}

.mensagem-conteudo {
  background: #f3f4f6;
  padding: 12px 15px;
  border-radius: 12px;
  color: #1f2937;
  line-height: 1.5;
  word-wrap: break-word;
}

.minha-mensagem .mensagem-conteudo {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.chat-input-container {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  padding: 15px 20px;
  border-top: 2px solid #f3f4f6;
  background: white;
}

.btn-anexar {
  background: #f3f4f6;
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.btn-anexar:hover {
  background: #e5e7eb;
}

.chat-input {
  flex: 1;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 15px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: none;
  min-height: 42px;
  max-height: 120px;
  transition: all 0.3s;
}

.chat-input:focus {
  outline: none;
  border-color: #667eea;
}

.btn-enviar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.btn-enviar:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.empty-state-chat {
  padding: 40px;
  text-align: center;
  color: #9ca3af;
}

/* Badges de tipo de área */
.tipo-area-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: 10px;
}

.badge-ua {
  background: #dbeafe;
  color: #1e40af;
}

.badge-aci {
  background: #fef3c7;
  color: #92400e;
}

.badge-ace {
  background: #d1fae5;
  color: #065f46;
}

@media (max-width: 768px) {
  .chat-container {
    flex-direction: column;
    height: auto;
    min-height: 600px;
  }
  
  .chat-sidebar {
    width: 100%;
    max-height: 300px;
  }
  
  .scan-acoes {
    flex-direction: column;
  }
  
  .scan-acoes button {
    width: 100%;
  }
}

/* Gerador de QR Code */
.form-qrcode {
  background: white;
  padding: 25px;
  border-radius: 12px;
  border: 2px solid #e5e7eb;
}

.form-grid-qrcode {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.qrcode-preview {
  background: white;
  padding: 30px;
  border-radius: 12px;
  border: 2px solid #667eea;
  text-align: center;
  margin-top: 30px;
}

.qrcode-preview h4 {
  margin: 0 0 20px 0;
  color: #1f2937;
  font-size: 1.3rem;
}

#qrcodeCanvas {
  margin: 20px auto;
  display: inline-block;
}

.qrcode-info {
  background: #f9fafb;
  padding: 20px;
  border-radius: 8px;
  margin: 20px auto;
  text-align: left;
  max-width: 400px;
  border-left: 4px solid #667eea;
}

.qrcode-info p {
  margin: 10px 0;
  font-size: 0.95rem;
  color: #4b5563;
}

.qrcode-info strong {
  color: #1f2937;
}

.qrcode-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 25px;
}

.btn-secundario {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-secundario:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

/* ================================================= */
/* CORREÇÃO: BOTÕES E CHIPS PADRÃO APARTAMENTOS     */
/* ================================================= */

/* Botões de ação nas metas - Padrão igual apartamentos */
.meta-card-acoes {
  display: flex;
  gap: 8px;
}

.meta-card-acoes .btn-acao {
  min-width: 40px;
  height: 40px;
  padding: 8px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  background: #f3f4f6;
}

.meta-card-acoes .btn-acao:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.meta-card-acoes .btn-editar {
  background: #3b82f6;
  color: white;
}

.meta-card-acoes .btn-editar:hover {
  background: #2563eb;
}

.meta-card-acoes .btn-remover {
  background: #ef4444;
  color: white;
}

.meta-card-acoes .btn-remover:hover {
  background: #dc2626;
}

/* Chips de apartamentos nas metas - Padrão igual apartamentos */
.chip-apto-meta {
  min-width: 55px !important;
  height: 55px !important;
  background: #667eea !important;
  border: 2px solid #5568d3 !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  padding: 8px !important;
  cursor: default !important;
}

/* Seção de apartamentos nas metas */
.meta-apartamentos-section {
  margin: 15px 0;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
}

.torre-meta-group {
  margin: 10px 0;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

/* Cards de meta */
.meta-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid #e5e7eb;
  transition: all 0.2s;
}

.meta-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.meta-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 2px solid #f3f4f6;
}

.meta-card-title {
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 10px;
}

.meta-card-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin-top: 6px;
}

.tipo-area-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.badge-ua {
  background: #dbeafe;
  color: #1e40af;
}

.badge-aci {
  background: #fef3c7;
  color: #92400e;
}

.badge-ace {
  background: #d1fae5;
  color: #065f46;
}

.meta-card-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 15px;
}

.meta-card-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-card-info-item strong {
  font-size: 12px;
  color: #6b7280;
  font-weight: 600;
}

.meta-card-info-item span {
  font-size: 14px;
  color: #1f2937;
  font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
  .chip-apto-meta {
    min-width: 50px !important;
    height: 50px !important;
    font-size: 13px !important;
  }
  
  .meta-card-acoes .btn-acao {
    min-width: 36px;
    height: 36px;
    font-size: 16px;
  }

/* ============================================
   📎 CHAT - ANEXOS (Preview + Mensagens)
   ============================================ */
.anexo-preview{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  padding:8px 10px;
  margin:6px 0 0 0;
}
.anexo-chip{
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border:1px solid rgba(0,0,0,0.12);
  border-radius:999px;
  background:rgba(255,255,255,0.6);
}
.anexo-nome{ font-size:12px; }
.anexo-remover{
  border:none;
  background:transparent;
  cursor:pointer;
  font-size:16px;
  line-height:1;
  opacity:0.75;
}
.anexo-remover:hover{ opacity:1; }

.msg-anexos{
  margin-top:8px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.anexo-link{
  display:inline-flex;
  align-items:center;
  gap:8px;
  text-decoration:none;
}
.anexo-thumb{
  width:64px;
  height:64px;
  object-fit:cover;
  border-radius:10px;
  border:1px solid rgba(0,0,0,0.12);
}  
}
