/* ============================================================
   APARTAMENTOS.CSS - Estilo completo do módulo Apartamentos
   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 Apartamentos)
    1) Remover menu duplicado nas seções (mantém apenas o menu superior)
    2) Dar "borda direita" e reforçar formatação dos popups/modais
    ============================================================ */

 /* (1) Se existir #submenu-apartamentos DUPLICADO dentro de seções/cards, ocultar */
 .secao-apartamentos #submenu-apartamentos,
 .card-parametrizacao #submenu-apartamentos,
 .card-checklists #submenu-apartamentos,
 .card-entregas #submenu-apartamentos {
   display: none !important;
 }

 /* Mantém o submenu do topo visível (caso esteja dentro do header) */
 #apartamentos-header #submenu-apartamentos {
   display: flex !important;
 }

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

#apartamentos-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-apartamentos {
  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-apartamentos {
  padding: 25px 35px;
  display: none;
  background: #f9fafb;
}

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

/* ============================= */
/* TABS PARAMETRIZAÇÃO           */
/* ============================= */

.tabs-param {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab-param {
  background: #e6e9ef;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  font-weight: 600;
  font-size: 14px;
  transition: 0.2s;
  color: #111827;
}

.tab-param:hover {
  background: #d5dae3;
}

.tab-param.active {
  background: #3498db;
  color: #fff;
}

.tab-content-param {
  display: none;
}

.tab-content-param.active {
  display: block;
}

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

.card-parametrizacao,
.card-checklists,
.card-entregas {
  background: #fff;
  border-radius: 10px;
  padding: 25px 30px;
  margin-bottom: 25px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.06);
}

.card-parametrizacao h3,
.card-checklists h3,
.card-entregas h3 {
  margin-bottom: 10px;
  font-weight: 700;
  color: #2c3e50;
  font-size: 20px;
}

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

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

.form-torres,
.form-empreiteiros {
  margin-top: 20px;
}

.form-row-torres {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

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

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

.form-field label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

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

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

.form-field input[type="color"] {
  height: 42px;
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-salvar {
  background: #3498db;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}

.btn-salvar:hover {
  background: #2980b9;
}

.btn-cancelar {
  background: #9ca3af;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}

.btn-cancelar:hover {
  background: #6b7280;
}

/* ============================= */
/* STATUS MESSAGES               */
/* ============================= */

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

.status-msg.success {
  background: #ecfdf5;
  border-left: 4px solid #10b981;
  color: #065f46;
  display: block;
}

.status-msg.error {
  background: #fef2f2;
  border-left: 4px solid #ef4444;
  color: #991b1b;
  display: block;
}

/* ============================= */
/* LISTA DE EMPREENDIMENTOS      */
/* ============================= */

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

.form-row-empreendimento {
  display: grid;
  grid-template-columns: 2fr 2fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}

.empreendimento-item {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 15px 20px;
  margin-bottom: 15px;
  transition: all 0.2s;
}

.empreendimento-item:hover {
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

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

.empreendimento-nome {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.empreendimento-info {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 5px;
}

.empreendimento-item.inativo {
  opacity: 0.6;
  background: #f3f4f6;
}

.empreendimento-item.inativo .empreendimento-nome::after {
  content: " (Inativo)";
  color: #ef4444;
  font-size: 14px;
  font-weight: normal;
}

/* ============================= */
/* LISTA DE TORRES               */
/* ============================= */

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

.torre-item {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 15px 20px;
  margin-bottom: 15px;
  transition: all 0.2s;
}

.torre-item:hover {
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

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

.torre-nome {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

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

.btn-acao {
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-inativar {
  background: #fbbf24;
  color: #78350f;
}

.btn-inativar:hover {
  background: #f59e0b;
}

.btn-remover {
  background: #ef4444;
  color: #fff;
}

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

.torre-info {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 8px;
}

.torre-item.inativa {
  opacity: 0.6;
  background: #f3f4f6;
}

.torre-item.inativa .torre-nome::after {
  content: " (Inativa)";
  color: #ef4444;
  font-size: 14px;
  font-weight: normal;
}

/* ============================= */
/* VISUALIZAÇÃO DE APARTAMENTOS  */
/* ============================= */

.visualizacao-apartamentos {
  margin-top: 30px;
}

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

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

.torre-vis-titulo {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}

.torre-vis-info {
  font-size: 13px;
  color: #6b7280;
}

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

.pavimento-vis-label {
  font-size: 14px;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: #f3f4f6;
  border-radius: 6px;
  display: inline-block;
}

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

.chip-vis-apto,
.chip-visualizacao {
  min-width: 65px;
  height: 65px;
  background: #10b981;
  border: 2px solid #059669;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  padding: 6px;
}

.chip-vis-apto:hover,
.chip-visualizacao:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.chip-vis-apto-num {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 3px;
}

.chip-vis-apto-status {
  font-size: 8px;
  color: rgba(255,255,255,0.9);
  text-align: center;
  line-height: 1.1;
}

/* Chip Inativo */
.chip-vis-apto.inativo,
.chip-visualizacao.inativo {
  background: #9ca3af;
  border-color: #6b7280;
  opacity: 0.7;
}

.chip-vis-apto.inativo::before,
.chip-visualizacao.inativo::before {
  content: '🔒';
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 12px;
}

/* Chip Removido - deixa buraco */
.chip-vis-apto.removido,
.chip-visualizacao.removido {
  visibility: hidden;
  pointer-events: none;
}

/* ============================= */
/* LISTA DE EMPREITEIROS         */
/* ============================= */

.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: 5px;
}

.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.5;
  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;
}

/* ============================= */
/* CHECKLISTS                    */
/* ============================= */

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

.filtros-checklist,
.filtros-entregas {
  display: flex;
  gap: 12px;
}

.inp-filtro {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  min-width: 200px;
}

.resumo-checklist {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 25px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.resumo-item-check {
  background: rgba(255,255,255,0.15);
  padding: 15px;
  border-radius: 8px;
  text-align: center;
}

.resumo-item-check .numero {
  font-size: 32px;
  font-weight: 800;
  display: block;
  margin-bottom: 5px;
}

.resumo-item-check .label {
  font-size: 13px;
  opacity: 0.9;
}

.area-checklists,
.area-entregas {
  margin-top: 20px;
}

.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-num {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.chip-apto-info {
  font-size: 9px;
  color: rgba(255,255,255,0.8);
  text-align: center;
  margin-top: 2px;
  line-height: 1.2;
}

.chip-apto.com-empreiteiro {
  border-width: 3px;
}

.chip-apto.finalizado {
  opacity: 0.7;
}

.chip-apto.finalizado::after {
  content: '✓';
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 16px;
  color: #fff;
  font-weight: bold;
}

/* ============================= */
/* ENTREGAS                      */
/* ============================= */

.legenda-entregas {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.legenda-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #4b5563;
}

.cor-legenda {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.estatisticas-entregas {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 25px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.estat-item {
  text-align: center;
  padding: 12px;
  background: #fff;
  border-radius: 8px;
}

.estat-numero {
  font-size: 28px;
  font-weight: 800;
  display: block;
  margin-bottom: 5px;
}

.estat-label {
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
}

.estat-numero.aprovado { color: #10b981; }
.estat-numero.reprovado { color: #ef4444; }
.estat-numero.pendencias { color: #fbbf24; }
.estat-numero.vistoria { color: #ec4899; }

/* Cores dos chips por status */
.chip-apto.aprovado {
  background: #10b981;
  border-color: #059669;
}

.chip-apto.reprovado {
  background: #ef4444;
  border-color: #dc2626;
}

.chip-apto.pendencias {
  background: #fbbf24;
  border-color: #f59e0b;
}

.chip-apto.vistoria-dia {
  background: #ec4899;
  border-color: #db2777;
}

/* ============================= */
/* MODAIS                        */
/* ============================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  animation: fadeIn 0.2s forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

.modal-card {
  background: white;
  width: 95%;
  max-width: 650px;
  max-height: 90vh;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  animation: slideUp 0.3s ease-out;
  margin: 20px;
}

 /* (3) Borda direita (assinatura visual) — igual você pediu */
 .modal-card {
   border-right: 6px solid var(--primary);
 }

@media (max-width: 768px) {
  .modal-card {
    width: 98%;
    margin: 10px;
    max-height: 95vh;
  }
}

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

.modal-header {
  padding: 20px 25px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-radius: 12px 12px 0 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: white;
}

.btn-fechar-modal {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: white;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.btn-fechar-modal:hover {
  background: rgba(255,255,255,0.2);
}

.modal-body {
  padding: 25px;
  overflow-y: auto;
}


 /* Reforço de "cara de sistema" no conteúdo (inputs e blocos) */
 .modal-body .modal-form-field input,
 .modal-body .modal-form-field select,
 .modal-body .modal-form-field textarea {
   border: 1px solid #d1d5db;
   border-radius: 8px;
   background: #fff;
   transition: border-color 0.2s, box-shadow 0.2s;
 }

 .modal-body .modal-form-field input:focus,
 .modal-body .modal-form-field select:focus,
 .modal-body .modal-form-field textarea:focus {
   outline: none;
   border-color: var(--primary);
   box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.12);
 }

.modal-form-field {
  margin-bottom: 18px;
}

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

.modal-form-field input,
.modal-form-field select,
.modal-form-field textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

.modal-form-field textarea {
  resize: vertical;
  min-height: 80px;
}

.modal-footer {
  padding: 20px 25px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #f9fafb;
  border-radius: 0 0 12px 12px;
}

 /* ============================================================
    (3) SUPORTE A POPUPS "LEGADOS" (caso ainda existam no HTML/JS)
    Se seu código estiver usando .popup/.popup-content/.popup-header,
    isso aqui recupera a formatação + borda direita.
    ============================================================ */

 .popup,
 .popup-overlay {
   position: fixed;
   inset: 0;
   background: rgba(0,0,0,0.5);
   backdrop-filter: blur(2px);
   display: flex;
   align-items: center;
   justify-content: center;
   z-index: 2000;
 }

 .popup-content,
 .popup-card {
   background: #fff;
   width: 95%;
   max-width: 650px;
   max-height: 90vh;
   border-radius: 12px;
   display: flex;
   flex-direction: column;
   box-shadow: 0 20px 50px rgba(0,0,0,0.3);
   border-right: 6px solid var(--primary);
   overflow: hidden;
 }

 .popup-header {
   padding: 20px 25px;
   display: flex;
   justify-content: space-between;
   align-items: center;
   background: linear-gradient(135deg, #667eea, #764ba2);
   color: #fff;
 }

 .popup-body {
   padding: 25px;
   overflow-y: auto;
 }

 .popup-footer {
   padding: 20px 25px;
   border-top: 1px solid #e5e7eb;
   display: flex;
   justify-content: flex-end;
   gap: 10px;
   background: #f9fafb;
 }

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

@media (max-width: 900px) {
  .secao-apartamentos {
    padding: 20px 15px;
  }

  #apartamentos-header {
    padding: 15px;
  }

  .titulo-modulo {
    font-size: 22px;
  }

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

  .lista-empreiteiros {
    grid-template-columns: 1fr;
  }

  .resumo-checklist {
    grid-template-columns: 1fr;
  }

  .chips-apartamentos {
    justify-content: center;
  }
}

@media (max-width: 600px) {
  #submenu-apartamentos {
    flex-direction: column;
  }

  .sub-btn {
    width: 100%;
    justify-content: flex-start;
  }

  .cabecalho-checklist,
  .cabecalho-entregas {
    flex-direction: column;
    align-items: flex-start;
  }

  .filtros-checklist,
  .filtros-entregas {
    width: 100%;
    flex-direction: column;
  }

  .inp-filtro {
    width: 100%;
  }
}

/* ============================= */
/* LOADING                       */
/* ============================= */

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.texto-vazio {
  text-align: center;
  padding: 40px 20px;
  color: #6b7280;
  font-size: 15px;
}

.texto-vazio .icone {
  font-size: 48px;
  margin-bottom: 15px;
  opacity: 0.5;
}

/* ============================= */
/* SEÇÃO MEDIÇÕES                */
/* ============================= */

.card-medicoes {
  background: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

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

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

.estatisticas-medicoes {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.area-medicoes {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Cor Revistoria */
.chip-apto.revistoria {
  background: #f97316;
  border-color: #ea580c;
}

/* Chip removido - deixa buraco */
.chip-visualizacao.removido {
  visibility: hidden;
  pointer-events: none;
}


/* ============================= */
/* SISTEMA DE VISTORIA           */
/* ============================= */

.vistoria-ambientes {
  border-top: 2px solid #e5e7eb;
  padding-top: 20px;
  margin-top: 20px;
}

.select-ambiente {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 10px;
}

.btn-adicionar-ambiente,
.btn-gerar-resumo {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.2s;
}

.btn-adicionar-ambiente {
  background: #3b82f6;
  color: white;
}

.btn-adicionar-ambiente:hover {
  background: #2563eb;
}

.btn-gerar-resumo {
  background: #10b981;
  color: white;
}

.btn-gerar-resumo:hover {
  background: #059669;
}

#listaAmbientes {
  margin-bottom: 15px;
}

.ambiente-vistoria {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
}

.ambiente-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e5e7eb;
}

.ambiente-nome {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}

.btn-remover-ambiente {
  background: #ef4444;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-remover-ambiente:hover {
  background: #dc2626;
}

.ambiente-descricao {
  margin-bottom: 15px;
}

.ambiente-descricao textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  min-height: 80px;
  resize: vertical;
  font-family: inherit;
}

.ambiente-fotos {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.foto-preview {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #e5e7eb;
}

.foto-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-remover-foto {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-remover-foto:hover {
  background: #dc2626;
}

.btn-adicionar-foto {
  width: 100px;
  height: 100px;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #f9fafb;
  transition: all 0.2s;
  font-size: 12px;
  color: #6b7280;
}

.btn-adicionar-foto:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #3b82f6;
}

.historico-vistorias {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 15px;
  margin-top: 20px;
}

.historico-item {
  padding: 10px;
  background: white;
  border-radius: 6px;
  margin-top: 8px;
  font-size: 13px;
}

/* Modal Resumo */
.modal-resumo-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  max-width: 800px;
  max-height: 85vh;
  overflow-y: auto;
  width: 95%;
}

.resumo-ambiente {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.resumo-fotos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 15px;
}

.resumo-foto {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #e5e7eb;
}

.btn-copiar-whatsapp,
.btn-gerar-pdf {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-copiar-whatsapp {
  background: #25d366;
  color: white;
}

.btn-copiar-whatsapp:hover {
  background: #128c7e;
}

.btn-gerar-pdf {
  background: #ef4444;
  color: white;
}

.btn-gerar-pdf:hover {
  background: #dc2626;
}

/* Chip removido - mantém espaço */
.chip-apto.removido {
  visibility: hidden;
  pointer-events: none;
}

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

.estatisticas-checklists {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 25px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.estat-check-item {
  text-align: center;
  padding: 12px;
  background: #fff;
  border-radius: 8px;
}

.estat-check-numero {
  font-size: 28px;
  font-weight: 800;
  display: block;
  margin-bottom: 5px;
}

.estat-check-label {
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
}

.estat-check-numero.total { color: #667eea; }
.estat-check-numero.andamento { color: #3b82f6; }
.estat-check-numero.finalizados { color: #10b981; }

