/* ============================================
   TBL Module - Estilos específicos de tablas
   ============================================ */

:root {
  --tbl-primary: #408cbc;
  --tbl-primary-dark: #2a5f7d;
  --tbl-success: #28a745;
  --tbl-danger: #dc3545;
  --tbl-info: #10e4f4;
  --tbl-warning: #ffc107;
}

/* Tabla Maestro - Estilos específicos del módulo TBL */
#tblCab {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  border: none;
}

#tblCab thead {
  background: linear-gradient(135deg, var(--tbl-primary) 0%, var(--tbl-primary-dark) 100%);
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

#tblCab tbody tr {
  cursor: pointer;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

#tblCab tbody tr:hover {
  background-color: rgba(64, 140, 188, 0.08);
  transform: translateX(2px);
}

#tblCab tbody tr.selected-row {
  background-color: #e3f2fd !important;
  border-left-color: var(--tbl-primary);
  box-shadow: inset 0 0 0 1px rgba(64, 140, 188, 0.2);
}

/* Tabla Detalle - Estilos específicos */
#tblDet {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

#tblDet thead {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: #495057;
  font-weight: 600;
  border-bottom: 2px solid var(--tbl-primary);
}

/* Dropdown de acciones - Estilo consistente con cld.php */
#tblDet .dropdown-toggle {
  background: linear-gradient(135deg, var(--tbl-primary) 0%, var(--tbl-primary-dark) 100%);
  border: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

#tblDet .dropdown-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#tblDet .dropdown-menu {
  border: none;
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
  border-radius: 8px;
  padding: 0.5rem 0;
  min-width: 180px;
  animation: dropdownFade 0.2s ease-out;
}

#tblDet .dropdown-item {
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

#tblDet .dropdown-item:hover {
  background-color: #f8f9fa;
  transform: translateX(5px);
}

#tblDet .dropdown-item i {
  width: 20px;
  text-align: center;
}

/* Modal específico de Tablas */
#mdaTbl .modal-content {
  border: none;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  overflow: hidden;
}

#mdaTbl .modal-header {
  padding: 1.2rem 1.5rem;
  border: none;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--tbl-primary) 0%, var(--tbl-primary-dark) 100%);
  color: white;
}

#mdaTbl .modal-header .close {
  color: white;
  opacity: 0.8;
  text-shadow: none;
}

#mdaTbl .modal-header .close:hover {
  opacity: 1;
}

#mdaTbl .modal-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
}

#mdaTbl .modal-title {
  font-weight: 600;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
}

#mdaTbl .modal-body {
  padding: 1.8rem;
}

#mdaTbl .modal-footer {
  border-top: 1px solid #dee2e6;
  padding: 1rem 1.5rem;
  background-color: #f8f9fa;
}

/* Formulario - Estilos específicos */
#mdaTbl .form-group {
  margin-bottom: 1.2rem;
}

#mdaTbl label {
  font-weight: 600;
  color: #495057;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

#mdaTbl label i {
  color: var(--tbl-primary);
}

#mdaTbl .form-control {
  border-radius: 8px;
  border: 1px solid #ced4da;
  padding: 0.6rem 1rem;
  transition: all 0.3s ease;
}

#mdaTbl .form-control:focus {
  border-color: var(--tbl-primary);
  box-shadow: 0 0 0 3px rgba(64, 140, 188, 0.15);
}

#mdaTbl .form-control[readonly] {
  background-color: #f8f9fa;
  border-color: #dee2e6;
  color: #6c757d;
  font-weight: 600;
}

/* Badges y estados específicos */
#tblCab .badge {
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
  font-weight: 500;
}

#tblDet .badge {
  font-size: 0.75rem;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
}

/* Animaciones específicas del módulo */
@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-right {
  animation: slideInRight 0.3s ease-out;
}

/* Responsive específico */
@media (max-width: 768px) {
  #tblDet .dropdown-toggle {
    width: 32px;
    height: 32px;
  }
  
  #mdaTbl .modal-body {
    padding: 1.2rem;
  }
  
  #tblCab tbody tr {
    font-size: 0.9rem;
  }
}