/* ==========================================================================
   COMPONENTS CSS - UI KIT PARA O SISTEMA SINDICATO WEB
   Botões, Cards, Modais, Tabelas, Filtros, Badges e Formulários
   ========================================================================== */

/* 1. BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--stp-blue-primary), var(--stp-navy));
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(19, 64, 116, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1b5394, #0b2545);
  box-shadow: 0 4px 12px rgba(19, 64, 116, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.btn-success:hover {
  background: linear-gradient(135deg, #059669, #047857);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
}

.btn-pix {
  background: linear-gradient(135deg, #00b4d8, #0077b6);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--pix-cyan-glow);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background: var(--bg-muted);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}

/* 2. CARDS & STATS TILES */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-normal);
  margin-bottom: 24px;
}
.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

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

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

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon.blue { background: #dbeafe; color: #1e40af; }
.stat-icon.green { background: #d1fae5; color: #065f46; }
.stat-icon.red { background: #fee2e2; color: #991b1b; }
.stat-icon.amber { background: #fef3c7; color: #92400e; }
.stat-icon.cyan { background: #cffafe; color: #155e75; }

.stat-info .stat-value {
  font-size: 26px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: var(--text-main);
  line-height: 1.1;
}
.stat-info .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* 3. DATA TABLES */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table-modern {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table-modern th {
  background: var(--bg-muted);
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.table-modern td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
  vertical-align: middle;
}

.table-modern tbody tr:hover {
  background: var(--bg-muted);
}

/* 4. STATUS BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: #f1f5f9; color: #475569; }
.badge-pix { background: #cffafe; color: #0e7490; }

/* 5. FORM CONTROLS & WIZARD */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 14px;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--stp-blue-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

/* File Upload Box */
.file-upload-box {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  background: var(--bg-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.file-upload-box:hover {
  border-color: var(--stp-blue-accent);
  background: rgba(37, 99, 235, 0.04);
}
.file-upload-box i {
  font-size: 28px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* 6. MODAL DIALOG */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 37, 69, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-backdrop.active {
  display: flex;
}

.modal-dialog {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: modalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-dialog.modal-lg {
  max-width: 900px;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
}
.modal-close:hover {
  color: var(--stp-red);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: var(--bg-muted);
}

/* 7. TOAST NOTIFICATIONS */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  min-width: 280px;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.25s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.toast-success { border-left: 5px solid #10b981; }
.toast.toast-error { border-left: 5px solid #ef4444; }
.toast.toast-info { border-left: 5px solid #3b82f6; }
.toast.toast-warning { border-left: 5px solid #f59e0b; }

/* 8. TABS COMPONENT */
.tab-nav {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 18px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}
.tab-btn:hover {
  color: var(--text-main);
}
.tab-btn.active {
  color: var(--stp-blue-accent);
}
.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--stp-blue-accent);
  border-radius: 3px 3px 0 0;
}

/* 9. SEARCH & FILTER TOOLBAR */
.filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.search-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-muted);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  flex: 1;
  min-width: 240px;
}
.search-input-group input {
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
  color: var(--text-main);
  font-size: 14px;
}

@media (max-width: 768px) {
  .form-grid-2, .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* 10. ESTILOS FINANCEIROS, CONTAS A RECEBER, RECIBOS & RELATÓRIOS */
.badge-cat-mensalidade {
  background: rgba(0, 102, 204, 0.15);
  color: #0066cc;
  border: 1px solid rgba(0, 102, 204, 0.3);
  font-weight: 600;
}
.badge-cat-praia {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-weight: 600;
}
.badge-cat-juridico {
  background: rgba(124, 58, 237, 0.15);
  color: #7c3aed;
  border: 1px solid rgba(124, 58, 237, 0.3);
  font-weight: 600;
}
.badge-cat-taxa {
  background: rgba(6, 182, 212, 0.15);
  color: #0891b2;
  border: 1px solid rgba(6, 182, 212, 0.3);
  font-weight: 600;
}
.badge-cat-outros {
  background: rgba(107, 114, 128, 0.15);
  color: #4b5563;
  border: 1px solid rgba(107, 114, 128, 0.3);
  font-weight: 600;
}

/* Documento de Recibo Oficial Sindical */
.recibo-oficial {
  background: #ffffff;
  color: #1a202c;
  border: 2px solid #0066cc;
  border-radius: 8px;
  padding: 24px;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  position: relative;
}

.recibo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #0066cc;
  padding-bottom: 16px;
  margin-bottom: 18px;
}

.recibo-logo-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.recibo-logo-img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 6px;
}

.recibo-entidade-titulo {
  font-size: 15px;
  font-weight: 800;
  color: #0b2545;
  text-transform: uppercase;
  line-height: 1.2;
}

.recibo-entidade-sub {
  font-size: 11px;
  color: #4a5568;
  margin-top: 2px;
}

.recibo-valor-box {
  background: #f0fdf4;
  border: 2px dashed #16a34a;
  padding: 10px 18px;
  border-radius: 8px;
  text-align: right;
}

.recibo-valor-label {
  font-size: 11px;
  font-weight: 700;
  color: #16a34a;
  text-transform: uppercase;
}

.recibo-valor-num {
  font-size: 22px;
  font-weight: 900;
  color: #15803d;
}

.recibo-corpo {
  font-size: 13px;
  line-height: 1.8;
  color: #2d3748;
  margin-bottom: 20px;
  text-align: justify;
}

.recibo-detalhes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 12px;
}

.recibo-assinaturas {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  margin-top: 30px;
  padding-top: 20px;
  text-align: center;
}

.recibo-assinatura-linha {
  border-top: 1px solid #718096;
  padding-top: 6px;
  font-size: 11px;
  color: #4a5568;
}

/* Estilos de Impressão */
@media print {
  body * {
    visibility: hidden;
  }
  .printable-area, .printable-area * {
    visibility: visible;
  }
  .printable-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 20px;
    background: #ffffff !important;
    color: #000000 !important;
  }
  .no-print {
    display: none !important;
  }
}

