/* =========================================
   PAYER LATAM - TEMA CORPORATIVO (FINAL V3)
   ========================================= */

/* 1. ESTRUCTURA Y COLORES GLOBALES */
body, .wrapper, .main-panel, .content {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
    font-family: 'Nunito', sans-serif, system-ui;
}

/* 2. SIDEBAR (Barra Lateral) */
.sidebar, .sidebar-wrapper {
    background: #1a2b49 !important;
    background: linear-gradient(180deg, #1a2b49 0%, #0f172a 100%) !important;
    box-shadow: 2px 0 10px rgba(0,0,0,0.5) !important;
}
.sidebar-background { display: none !important; }

.sidebar .nav li a, .sidebar .nav li a i, .sidebar .nav li a p { color: #cbd5e1 !important; }

/* Ítem Activo */
.sidebar[data-color] .sidebar-wrapper,
.sidebar .nav li.active > a,
.sidebar[data-color="purple"] .nav li.active > a {
    background-color: #2dce89 !important;
    box-shadow: 0 4px 20px 0px rgba(0,0,0,0.14), 0 7px 10px -5px rgba(45,206,137,0.4) !important;
    color: #1a2b49 !important; font-weight: bold;
}
.sidebar .nav li.active { background: transparent !important; box-shadow: none !important; }

/* 3. PANELES Y TABLAS */
.card, .card-header, .modal-content, .modal-header {
    background-color: #1e293b !important;
    border-color: #334155 !important; color: #fff !important;
}
.table thead th { border-bottom: 2px solid #2dce89 !important; color: #2dce89 !important; }
.table td { border-top: 1px solid #334155 !important; color: #e2e8f0 !important; }

/* 4. FORMULARIOS */
.form-control, input, select, textarea {
    background-color: #0f172a !important; border: 1px solid #475569 !important; color: #ffffff !important;
}
label, .bmd-label-floating { color: #94a3b8 !important; }

/* 5. BOTONES VERDES (GLOW) */
.btn-danger {
    background-color: #2dce89 !important; border-color: #2dce89 !important;
    color: #0f172a !important; font-weight: bold;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
}
.btn-danger:hover {
    background-color: #26af74 !important; color: #fff !important;
    box-shadow: 0 0 15px rgba(45,206,137,0.6) !important; /* Glow intenso */
    transform: translateY(-1px);
}
.btn-danger:focus, .btn-danger:active { box-shadow: none !important; }

/* 6. MODAL FOTO Y EDITOR */
input[type="file"].custom-file-input { display: none; }
.custom-file-label {
    display: inline-block; padding: 10px; cursor: pointer; background: #1e293b;
    color: #2dce89; border: 1px dashed #2dce89; border-radius: 5px; width: 100%; text-align: center;
}
.custom-file-label:hover { background: rgba(45,206,137,0.1); }

/* Editor Código */
.note-editor .note-codable {
    background-color: #1e1e1e !important; color: #d4d4d4 !important;
    min-height: 600px !important; height: 600px !important; resize: vertical !important;
}
.note-editable { background: #fff !important; color: #333 !important; }

/* 7. INTERACCIÓN MOUSE (HOVER) */
td div[onclick]:hover {
    border-color: #2dce89 !important; cursor: pointer;
    box-shadow: 0 0 15px rgba(45,206,137,0.3); transform: translateY(-2px);
    transition: all 0.2s;
}
a.editable-click:hover { color: #2dce89 !important; border-bottom: 1px dashed #2dce89; text-decoration: none; }


/* ==========================================================================
   SOLUCIÓN DEFINITIVA A LOS ERRORES VISUALES
   ========================================================================== */

/* A) ELIMINAR LAS 3 BARRAS DE SCROLL (NUCLEAR) */
/* Ocultamos TODAS las barras de desplazamiento por defecto */
::-webkit-scrollbar {
    display: none;
    width: 0;
    background: transparent;
}

/* Solo permitimos la barra del HTML principal si es estrictamente necesaria */
html {
    scrollbar-width: thin; /* Firefox */
    overflow-y: auto;
}
/* Re-habilitamos visualmente solo la barra principal con un estilo discreto */
html::-webkit-scrollbar {
    display: block; width: 8px;
}
html::-webkit-scrollbar-track { background: #0f172a; }
html::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

/* Forzamos que los paneles internos NO tengan scroll */
.main-panel, .wrapper, .sidebar-wrapper, .perfect-scrollbar-on {
    height: auto !important; 
    overflow: visible !important; 
}
/* El contenedor visual (Iframe) sí scrollea, pero sin barra visible */
#contenedor-visual {
    overflow-y: scroll !important;
    scrollbar-width: none;
}

/* B) MATAR EL CHECKBOX FANTASMA DE SWEETALERT */
/* Ocultamos cualquier input, checkbox o label dentro del popup */
.swal2-popup .swal2-input,
.swal2-popup .swal2-file,
.swal2-popup .swal2-textarea,
.swal2-popup .swal2-select,
.swal2-popup .swal2-radio,
.swal2-popup .swal2-checkbox,
.swal2-popup label {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute;
    z-index: -9999;
}

/* =======================================================
   ZONA DRAG & DROP (MODAL)
   ======================================================= */
.drop-zone {
    width: 100%;
    max-width: 100%;
    padding: 40px 20px;
    background-color: #162035; /* Un poco más oscuro que el modal */
    border: 2px dashed #2dce89; /* Borde verde Payer */
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

/* Efecto al pasar el mouse o arrastrar un archivo encima */
.drop-zone:hover, 
.drop-zone.dragover {
    background-color: rgba(45, 206, 137, 0.1); /* Fondo verde muy sutil */
    border-color: #26af74;
    transform: scale(1.02); /* Pequeño efecto de pulsación */
}

.drop-zone i {
    font-size: 50px;
    color: #2dce89;
    margin-bottom: 10px;
    transition: color 0.3s;
}

.drop-zone p {
    color: #cbd5e1;
    margin: 0;
    font-size: 14px;
    font-weight: 500;
}

.drop-zone small {
    color: #64748b;
    display: block;
    margin-top: 5px;
}

/* Estado cuando ya hay archivo seleccionado */
.drop-zone.has-file {
    border-style: solid;
    background-color: rgba(45, 206, 137, 0.05);
}



/* =======================================================
   9. ALERTAS PREMIUM (ESTILO TOAST NOTIFICATIONS)
   ======================================================= */
.payer-alert {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-radius: 8px;
    min-width: 360px;
    max-width: 100%;
    border: none;
    color: #ffffff;
    font-family: 'Nunito', sans-serif;
    animation: slideInDown 0.4s ease-out forwards;
    margin-bottom: 1.5rem;
}

/* Fondo verde plano con sombra verde brillante (Glow) */
.payer-alert-success {
    background-color: #48bb78 !important; 
    box-shadow: 0 10px 20px -5px rgba(72, 187, 120, 0.5) !important;
}

/* Fondo rojo plano con sombra roja brillante (Glow) */
.payer-alert-danger {
    background-color: #f43f5e !important; 
    box-shadow: 0 10px 20px -5px rgba(244, 63, 94, 0.5) !important;
}

/* El truco maestro: Color negro con opacidad para que 
   el ícono parezca verde oscuro y la palomita deje ver el fondo */
.payer-alert .alert-icon {
    font-size: 26px;
    margin-right: 12px;
    color: rgba(0, 0, 0, 0.15) !important; 
}

.payer-alert .alert-text {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.2px;
    margin: 0;
    flex-grow: 1;
}

.payer-alert .close-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    margin-left: 20px;
    opacity: 0.8;
    cursor: pointer;
    padding: 0;
    outline: none;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
}

.payer-alert .close-btn:hover {
    opacity: 1;
}

/* Animación de entrada suave */
@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* MATAR EL SCROLL FANTASMA DE LA PLANTILLA (Perfect Scrollbar) */
.ps-scrollbar-x-rail,
.ps-scrollbar-y-rail,
.ps-scrollbar-x,
.ps-scrollbar-y {
    display: none !important;
    visibility: hidden !important;
}

/* Devolver el scroll natural al contenedor principal */
.main-panel {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* ==========================================================================
   CUSTOM SCROLLBAR - ESTILO DARK PREMIUM
   ========================================================================== */

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #475569 #0f172a;
}

/* Chrome, Edge, Safari y Opera */
::-webkit-scrollbar {
    width: 10px; /* Ancho de la barra vertical */
    height: 10px; /* Alto de la barra horizontal (si aparece) */
}

/* El carril (fondo de la barra) */
::-webkit-scrollbar-track {
    background: #0f172a; /* Azul muy oscuro, igual al fondo del panel */
    border-radius: 8px;
}

/* La pastilla (el manejador que arrastras) */
::-webkit-scrollbar-thumb {
    background: #475569; /* Gris azulado sutil */
    border-radius: 8px;
    border: 2px solid #0f172a; /* Crea un efecto de margen interno para que no se vea tan gruesa */
}

/* Efecto hover al pasar el mouse sobre la pastilla */
::-webkit-scrollbar-thumb:hover {
    background: #64748b; /* Se ilumina un poco al interactuar */
}