body {
    font-family: 'Open Sans', sans-serif;
    background-color: #f5f5f5;
}

h1,
h2,
h3,
h4,
h5,
h6,
.title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    /* más sólido para títulos */
    letter-spacing: 0.02rem;
    /* un poco de aire */
    line-height: 1.3;
}

.card-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    /* texto normal */
    line-height: 1.2;
    /* mejora lectura */
    color: #333;
    /* gris oscuro, mejor que negro puro */
}

.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.15) !important;
}

p:not(.font-monospace) {
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    /* texto normal */
    line-height: 1.2;
    /* gris oscuro, mejor que negro puro */
    color: #333;
}

span:not(.font-monospace) {
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    /* texto normal */
    line-height: 1.2;
    /* gris oscuro, mejor que negro puro */
}

/* Navbar*/
.navbar-custom {
    background: #0d6efd !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 0.8rem 1rem;
    border-bottom: none !important;
}

.navbar-brand {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    color: white !important;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
}

.navbar-brand img {
    height: 40px;
    margin-right: 10px;
}

.nav-link {
    font-family: 'Montserrat', sans-serif;
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 400;
    padding: 0.5rem 1rem !important;
    margin: 0 0.2rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.dropdown-menu {
    font-family: 'Montserrat', sans-serif;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 0.5rem;
    background-color: #2c3e50;
}

.dropdown-item {
    color: #ecf0f1 !important;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background-color: #3498db !important;
    color: white !important;
}

.dropdown-item i {
    color: #3498db !important;
    transition: all 0.2s;
}

.dropdown-item:hover i {
    color: white !important;
}

.user-icon {
    font-size: 1.5rem;
    color: white;
    transition: all 0.3s;
}

.user-icon:hover {
    transform: scale(1.1);

}

/* Efecto para el ítem activo del menú */
.nav-item.active .nav-link {
    position: relative;
}

.nav-item.active .nav-link::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background-color: #ffffff;
    border-radius: 3px;
}

/* Cambia el color del ícono del menú hamburguesa a blanco */
.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5) !important;
    background-color: transparent !important;
    /* Asegura que el fondo sea transparente */
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.1rem rgba(255, 255, 255, 0.25) !important;
    /* Estilo para el estado focus */
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* Contenedor de la tabla (scroll horizontal en móvil) */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    -webkit-overflow-scrolling: touch;
    /* Scroll suave en iOS */
}

/* Barra de scroll (moderna) */
.table-responsive::-webkit-scrollbar {
    height: 6px;
    background: #f8f9fa;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 4px;
}

/* Tabla base */
.table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

/* Cabecera */
.table thead th {
    background-color: #2c3e50;
    color: white;
    font-weight: 500;
    padding: 0.75rem 1rem;
    /* Más consistente con Bootstrap */
    position: sticky;
    top: 0;
    /* Fija la cabecera al hacer scroll */
    white-space: nowrap;
}

/* Filas */
.table tbody tr {
    transition: all 0.2s ease;
    background-color: white;
}

/* Efecto hover (solo en dispositivos con mouse) */
@media (hover: hover) {
    .table tbody tr:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        background-color: #f8f9fa;
    }
}

/* Celdas */
.table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-top: 1px solid #dee2e6;
}

/* Optimización para móvil */
@media (max-width: 767.98px) {

    .table thead th,
    .table tbody td {
        padding: 0.5rem 0.75rem;
        /* Menos espacio en móvil */
    }

    .table thead th {
        white-space: normal;
        /* Permite multilínea si es necesario */
    }

    .table-responsive {
        box-shadow: none;
        /* Mejor rendimiento en móvil */
        border-radius: 0;
    }
}

/* Zebra striping opcional (para tablas largas) */
.table-striped tbody tr:nth-child(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.upload-card {
    border: 2px dashed #0d6efd;
    transition: all 0.3s;
    background-color: #f8fafc;
}

.upload-card:hover {
    background-color: #e9f5ff;
    border-color: #0b5ed7;
}

.file-info-card {
    border-left: 4px solid #0d6efd;
}

.table-container {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.05);
}

.status-badge {
    font-size: 0.8rem;
    padding: 0.35em 0.65em;
}

.import-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.import-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.2);
}

.amount-positive {
    color: #198754;
    font-weight: 500;
}

.amount-negative {
    color: #dc3545;
    font-weight: 500;
}

.card-header-custom {
    background-color: #0d6efd;
    color: white;
    font-weight: 500;
}

.pagination .page-item.active .page-link {
    background-color: #2c3e50;
    border-color: #2c3e50;
}

.pagination .page-link {
    color: #2c3e50;
}

/** Estilo para clicar en la fila que accede a la ventana modal de pagos */
.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Spinner de carga */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/************* TOAST ***********************/
/* Contenedor de toasts - FIXED para móvil */
.jupon-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 90%;
    max-width: 400px;
}

/* Toast base - OCULTO inicialmente */
.jupon-toast {
    background: white;
    border-left: 5px solid #0d6efd;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    display: none;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.4s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    visibility: hidden;
}

.jupon-toast.show {
    display: flex;
    opacity: 1;
    transform: translateX(0);
    visibility: visible;
}

/* IMPORTANTE: Forzar estilos en móvil */
@media (max-width: 768px) {
    .jupon-toast-container {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: calc(100% - 20px);
        max-width: none;
    }

    .jupon-toast {
        max-width: 100%;
        z-index: 99999;
        position: fixed;
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
}

/* Barra de progreso - FORZAR estilos */
.jupon-toast .progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 100%;
    background: #0d6efd;
    animation: progressBar 5s linear forwards;
    z-index: 999999;
    transform-origin: left;
}

/* Icono */
.jupon-toast-icon {
    padding: 18px 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
    background-color: #0d6efd;
}

/* Contenido */
.jupon-toast-content {
    padding: 15px;
    flex-grow: 1;
}

.jupon-toast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.jupon-toast-title {
    font-weight: 600;
    margin: 0;
    font-size: 16px;
    color: #2c3e50;
}

.jupon-toast-time {
    font-size: 12px;
    color: #7f8c8d;
}

.jupon-toast-message {
    color: #34495e;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Botón de cerrar */
.jupon-toast-close {
    background: none;
    border: none;
    font-size: 16px;
    color: #7f8c8d;
    cursor: pointer;
    padding: 10px 15px;
    flex-shrink: 0;
    transition: color 0.2s;
    align-self: flex-start;
}

.jupon-toast-close:hover {
    color: #e74c3c;
}

/* Variantes de toast */
.jupon-toast.success {
    border-left-color: #198754;
}

.jupon-toast.success .jupon-toast-icon {
    background-color: #198754;
}

.jupon-toast.success .progress-bar {
    background: #198754;
}

.jupon-toast.info {
    border-left-color: #0d6efd;
}

.jupon-toast.info .jupon-toast-icon {
    background-color: #0d6efd;
}

.jupon-toast.info .progress-bar {
    background: #0d6efd;
}

.jupon-toast.warning {
    border-left-color: #ffc107;
}

.jupon-toast.warning .jupon-toast-icon {
    background-color: #ffc107;
}

.jupon-toast.warning .progress-bar {
    background: #ffc107;
}

.jupon-toast.danger {
    border-left-color: #dc3545;
}

.jupon-toast.danger .jupon-toast-icon {
    background-color: #dc3545;
}

.jupon-toast.danger .progress-bar {
    background: #dc3545;
}

/* Animación */
@keyframes progressBar {
    0% {
        transform: scaleX(1);
    }

    100% {
        transform: scaleX(0);
    }
}

/* Estilo para la descarga de un fichero en las secciones de detalle*/
.document-preview {
    transition: all 0.3s ease;
    border-left: 4px solid #0d6efd;
}

.document-preview:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.document-icon {
    font-size: 2rem;
    color: #6c757d;
}