/* ============================================= */
/*    COMPONENTES GLOBAIS UI (components.css)    */
/*  BARRA DE PESQUISA SUPERIOR-BARRA DE FILTROS  */
/*    BOTÕES GENÉRICOS - FORMULÁRIOS - SWITCH    */
/*  PAGINAÇÃO - MODAIS GERAIS - MODAL CONSÓRCIO  */
/* ============================================= */

/* --- BARRA DE PESQUISA SUPERIOR --- */
.search-bar { position: relative; display: flex; align-items: center; background: #f5f6fa; border-radius: 20px; padding: 5px 15px; border-color: var(--azul); border: 1px solid; }
.search-bar input { border: none; background: none; padding: 5px 30px 5px 5px; width: 200px; outline: none; }
.search-bar img { position: absolute; right: 15px; width: 24px; height: 24px; pointer-events: none; }

/* --- BARRA DE FILTROS --- */
.filter-bar { display: flex; justify-content: space-between; align-items: center; background: var(--amareloclaro); padding: 15px 20px; border-radius: 0 0 8px 8px; margin-bottom: 20px; margin-top: -20px; border-top: none; box-shadow: 0 2px 4px rgba(0,0,0,0.1); z-index: 10; color: var(--azul); }
.filter-section { display: flex; align-items: center; gap: 10px; }
.filter-section label { color: var(--azul); font-weight: bold; }
.filter-select { padding: 8px 12px; border-radius: 4px; background: white; color: var(--azul); font-weight: bold; cursor: pointer; min-width: 150px; transition: background-color 0.3s ease, color 0.3s ease; }
.filter-select:focus { outline: none; border-color: var(--laranja); box-shadow: 0 0 0 2px rgba(246, 219, 23, 0.2); }

/* Cores das opções do Filtro Select */
.filter-select option { background: #ffffff; color: #000000; font-weight: normal; }
.filter-select option.select-status-paga, .filter-select option.select-status-recebida { background-color: var(--verde); color: white; font-weight: bold; }
.filter-select option.select-status-paralisada { background-color: var(--rosabebe); color: white; font-weight: bold; }
.filter-select option.select-status-cancelada { background-color: var(--vermelho); color: white; font-weight: bold; }
.filter-select option.select-status-estorno { background-color: var(--grafite); color: white; font-weight: bold; }
.filter-select option.select-status-pendente { background-color: var(--laranja); color: white; font-weight: bold; }
.filter-select option.select-status-parcial { background: var(--verdeescuro); color: white; font-weight: bold; }
.filter-select option:checked { background: var(--azul); color: var(--amarelo); }

/* --- BOTÕES GENÉRICOS --- */
.btn { padding: 5px 15px; border: none; border-radius: 4px; cursor: pointer; font-size: 0.9em; transition: all 0.3s; }
.btn:hover { opacity: 0.9; }
.btn-edit { background: var(--amarelo); color: var(--azul); font-weight: bold; }
.btn-details { background: var(--cinzaclaro); color: black; }
.btn-delete { background: var(--vermelho); color: white; font-weight: bold; }
.btn-pay { background: var(--verde); color: white; font-weight: bold; }
.btn-download { background: var(--azul); color: white; border: none; cursor: pointer; padding: 0px 20px; border-radius: 4px; display: flex; align-items: center; justify-content: center; }
.btn-download img { width: 24px; height: 24px; filter: brightness(0) invert(1); }
.attachment-btn { background: var(--verde); border: none; cursor: pointer; padding: 0px 20px; border-radius: 4px; display: flex; align-items: center; justify-content: center; }
.attachment-btn img { width: 24px; height: 24px; filter: brightness(0) invert(1); }
.btn-x { position: absolute; right: 20px; top: 5px; background: none; border: none; font-size: 30px; font-weight: bold; cursor: pointer; }
.btn-x:hover { color: var(--vermelho); }

/* Float Action Button (Botão Flutuante +)
.fab { position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px; border-radius: 50%; background: var(--amarelo); color: var(--azul); border: none; font-size: 31px; padding: 5px 10px 10px 10px; font-weight: bold; cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.2); display: flex; align-items: center; justify-content: center; transition: all 0.3s; z-index: 1000; }
.fab:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.fab:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(0,0,0,0.2); } */


/* --- FORMULÁRIOS --- */
.form-row { display: flex; gap: 20px; margin-bottom: 10px; width: 100%; }
.form-row-flex { display: flex; gap: 20px; margin-bottom: 15px; }
.form-row-flex .form-group { flex: 1; margin-bottom: 0; }
.form-col-60 { flex: 0 0 60%; }
.form-col-30 { flex: 0 0 30%; }
.form-control { width: 100%; padding: 8px; margin-top: 5px; border: 1px solid #ddd; border-radius: 4px; }
.form-group { margin-bottom: 10px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 500; }
textarea.form-control { min-height: 60px; resize: vertical; }
.form-control[type="date"] { height: 35px; }
.form-inline { display: flex; align-items: center; gap: 10px; }
.form-inline label { margin: 0; white-space: nowrap; }
.form-inline .form-control { flex: 1; min-width: 100px; }

.radio-group, .checkbox-group { display: flex; align-items: center; gap: 10px; }
.radio-group label, .checkbox-group label { font-weight: normal; }
.radio-group input, .checkbox-group input { margin-right: 5px; }
label.required:after { content: "*"; color: red; margin-left: 4px; font-weight: bold; }

/* Switch (Botão liga/desliga) */
.switch { position: relative; display: inline-block; width: 60px; height: 34px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 26px; width: 26px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--azul); }
input:checked + .slider:before { transform: translateX(26px); }

/* --- PAGINAÇÃO --- */
.pagination-controls { display: flex; justify-content: center; align-items: center; margin-top: 20px; }
.pagination-controls button { background-color: var(--azul); color: white; border: none; padding: 8px 12px; margin: 0 5px; font-size: 14px; cursor: pointer; border-radius: 5px; }
.pagination-controls button[disabled] { background-color: #d1d1d1; cursor: not-allowed; }
.pagination-controls .pagination-info { font-size: 12px; color: rgba(0, 0, 0, 0.6); margin: 0 10px; }

/* --- MODAIS GENÉRICOS (Avisos e Confirmações) --- */
.modal, .calendarModal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6); z-index: 1002 !important; backdrop-filter: blur(2px); }
#modal-generico { z-index: 1003 !important; }
#loading { z-index: 9999; }
.modal-content { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: white; padding: 25px; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); width: 90%; max-width: 500px; }
.modal-delete-content { max-width: 450px; text-align: center; }
.modal-delete-buttons { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.close-button { position: absolute; top: 20px; right: 24px; font-size: 18px; font-weight: bold; cursor: pointer; color: #333; transition: color 0.2s ease-in-out; }
.close-button:hover { color: red; }

/* ======================================================== */
/* 🔹 MODAL ESPECÍFICO DE CONSÓRCIO (Overlay e Container)   */
/* ======================================================== */

.modal_consorcio {
  display: none; /* Mantém oculto até clicar no botão */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1002;
  padding: 0; 
  box-sizing: border-box;
}

.modal_consorcio-content {
  background-color: #fff;
  width: 90%;
  max-width: 1100px;
  border-radius: 8px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* Centraliza perfeitamente */
  margin: 0; 
  max-height: 90vh; 
  display: flex;
  flex-direction: column; 
  padding: 0; 
  overflow: hidden; 
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.modal_consorcio-content h2 {
  text-align: center;
  padding: 20px 20px 10px 20px;
  margin: 0;
  flex-shrink: 0; 
  border-bottom: 1px solid #eee; 
  background-color: #fff; 
}

#consorcio-form {
  display: flex;
  flex-direction: column;
  flex: 1; 
  overflow: hidden; 
  padding: 0;
  margin: 0;
}

.modal-body-scroll {
  flex: 1; 
  overflow-y: auto; 
  padding: 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--azul) #f1f1f1;
}

.modal-body-scroll::-webkit-scrollbar { width: 8px; }
.modal-body-scroll::-webkit-scrollbar-track { background: #f1f1f1; }
.modal-body-scroll::-webkit-scrollbar-thumb { background: var(--azul); border-radius: 4px; }
.modal-body-scroll::-webkit-scrollbar-thumb:hover { background: #002888; }

.modal-footer {
  padding: 15px 20px;
  background-color: #f9f9f9; 
  border-top: 1px solid #ddd;
  flex-shrink: 0; 
  margin-top: 0 !important; 
  z-index: 10;
  display: flex;
  justify-content: flex-end; 
  gap: 10px; 
}


/* --- RESPONSIVIDADE COMPONENTES --- */
@media (max-width: 768px) {
    .filter-bar { flex-direction: column; gap: 15px; }
    .filter-section { width: 100%; }
    .filter-select { flex-grow: 1; }
    .modal-content { width: 95%; margin: 20px auto; padding: 10px; }
    .form-row { flex-direction: column; gap: 10px; }
    .form-col-60, .form-col-30 { flex: 0 0 100%; }
    .fab { bottom: 20px; right: 20px; width: 50px; height: 50px; }
    .modal-delete-buttons { flex-direction: column; gap: 5px; }
    .modal-delete-content { width: 95%; padding: 15px; }
}

@media (max-width: 480px) {
    .card-actions { flex-wrap: wrap; }
    .btn { flex: 1 1 auto; min-width: 80px; }
}