/* SISTEMA DE ALERTAS GLOBAL - PORTAL DE EMPLEO */
:root {
    --color-principal: #004a85;
    --color-oscuro: #003366;
    --color-acento: #ffcc00;
    --color-success: #10b981;
    --color-error: #ef4444;
    --color-warning: #f59e0b;
    --color-info: #3b82f6;
    --color-loading: #8b5cf6;
}

/* CONTENEDOR PRINCIPAL */
#contenedor-alertas-global {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 100%;
    pointer-events: none;
}

/* ALERTA INDIVIDUAL */
.alerta-global {
    position: relative;
    min-width: 320px;
    max-width: 380px;
    background: linear-gradient(to right, #ffffff 0%, #f0fdf4 70%);
    border-left: 4px solid var(--color-principal);
    border-radius: 8px;
    padding: 14px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: all;
    font-family: 'Segoe UI', 'Inter', sans-serif;
    font-size: 13px;
}

.alerta-global.mostrar {
    transform: translateX(0);
    opacity: 1;
}

.alerta-global.ocultando {
    transform: translateX(400px);
    opacity: 0;
}

/* TIPOS DE ALERTA */
.alerta-global.tipo-exito {
    border-left-color: var(--color-success);
    background: linear-gradient(to right, #f0fdf4 0%, #dcfce7 70%);
}

.alerta-global.tipo-error {
    border-left-color: var(--color-error);
    background: linear-gradient(to right, #fef2f2 0%, #fee2e2 70%);
}

.alerta-global.tipo-advertencia {
    border-left-color: var(--color-warning);
    background: linear-gradient(to right, #fffbeb 0%, #fef3c7 70%);
}

.alerta-global.tipo-info {
    border-left-color: var(--color-info);
    background: linear-gradient(to right, #eff6ff 0%, #dbeafe 70%);
}

.alerta-global.tipo-carga {
    border-left-color: var(--color-loading);
    background: linear-gradient(to right, #f5f3ff 0%, #ede9fe 70%);
}

.alerta-global.tipo-confirmacion {
    border-left-color: var(--color-acento);
    background: linear-gradient(to right, #fefce8 0%, #fef9c3 70%);
}

/* CABECERA */
.cabecera-alerta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.titulo-alerta {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.icono-alerta {
    font-size: 16px;
}

.icono-modulo {
    margin-right: 4px;
    font-size: 14px;
}

/* BOTÓN CERRAR */
.btn-cerrar-alerta {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-cerrar-alerta:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #374151;
}

/* CUERPO */
.cuerpo-alerta {
    color: #4b5563;
    line-height: 1.4;
    font-size: 12.5px;
}

/* BARRA DE PROGRESO */
.barra-progreso {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--color-principal);
    width: 100%;
    border-radius: 0 0 8px 8px;
    transform-origin: left;
}

.alerta-global.tipo-exito .barra-progreso {
    background: var(--color-success);
}

.alerta-global.tipo-error .barra-progreso {
    background: var(--color-error);
}

/* BOTONES DE CONFIRMACIÓN */
.contenedor-botones-confirmacion {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: flex-end;
}

.btn-confirmar-alerta {
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-confirmar {
    background: var(--color-success);
    color: white;
}

.btn-confirmar:hover {
    background: #0da271;
}

.btn-cancelar {
    background: #6b7280;
    color: white;
}

.btn-cancelar:hover {
    background: #4b5563;
}

/* TAMAÑOS */
.alerta-global.tam-sm {
    min-width: 280px;
    max-width: 320px;
    padding: 12px 14px;
}

.alerta-global.tam-lg {
    min-width: 400px;
    max-width: 450px;
    padding: 16px 18px;
}

/* ANIMACIÓN DE CARGA */
.icono-cargando {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--color-loading);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* RESPONSIVE */
@media (max-width: 480px) {
    #contenedor-alertas-global {
        left: 10px;
        right: 10px;
        top: 10px;
    }
    
    .alerta-global {
        min-width: unset;
        max-width: 100%;
    }
}

/* --- ESTILOS DE BOTONES STANDARIZADOS (UNIFICACIÓN) --- */
.button_red {
  background: #dc3545 !important; /* Fallback */
  background: linear-gradient(135deg, #dc3545 0%, #bb2d3b 100%) !important;
  color: white !important;
  border: none !important;
  box-shadow: 0 2px 6px rgba(220, 53, 69, 0.2) !important;
  font-size: 0.95rem !important;
  border-radius: 8px !important;
  padding: 10px 24px !important;
  transition: all 0.2s ease !important;
}

.button_red:hover {
  background: linear-gradient(135deg, #bb2d3b 0%, #a71d2a 100%) !important;
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4) !important;
  transform: translateY(-2px) !important;
}

.button_green {
  background: #198754 !important; /* Fallback */
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: white !important;
  border: none !important;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2) !important;
  font-size: 0.95rem !important;
  border-radius: 8px !important;
  padding: 10px 24px !important;
  transition: all 0.2s ease !important;
}

.button_green:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4) !important;
  transform: translateY(-2px) !important;
}

.button_blue {
  background: #0d6efd !important; /* Fallback */
  background: linear-gradient(135deg, #004a85 0%, #003366 100%) !important;
  color: white !important;
  border: none !important;
  box-shadow: 0 2px 6px rgba(0, 92, 164, 0.2) !important;
  font-size: 0.95rem !important;
  border-radius: 8px !important;
  padding: 10px 24px !important;
  transition: all 0.2s ease !important;
}

.button_blue:hover {
  background: linear-gradient(135deg, #003366 0%, #002244 100%) !important;
  box-shadow: 0 4px 12px rgba(0, 92, 164, 0.4) !important;
  transform: translateY(-2px) !important;
}

.button_orange {
  background: #fd7e14 !important; /* Fallback */
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
  color: white !important;
  border: none !important;
  box-shadow: 0 2px 6px rgba(249, 115, 22, 0.2) !important;
  font-size: 0.95rem !important;
  border-radius: 8px !important;
  padding: 10px 24px !important;
  transition: all 0.2s ease !important;
}

.button_orange:hover {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%) !important;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4) !important;
  transform: translateY(-2px) !important;
}

/* --- SCROLLBAR ESTANDARIZADO --- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--color-principal) 0%, var(--color-oscuro) 100%);
  border-radius: 5px;
  border: 2px solid #f1f5f9;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--color-oscuro) 0%, #002244 100%);
}

/* --- TABLAS CON PAGINACIÓN GLOBAL: sin scroll vertical, conservar horizontal --- */
.contenedor-tabla-responsive:has(table[data-paginacion-global-iniciada="true"]) {
  overflow-y: hidden !important;
  overflow-x: auto !important;
  max-height: none !important;
  height: auto !important;
}
