﻿html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
:root {
    --bs-body-font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}







/* LO MIO */

/* Versión en modo claro: 
    Con Variables de Estilo. Como debe ser.
*/
/* Versión en modo claro: Con Variables de Estilo. Como debe ser. */
:root {
    /*--sidebar-bg: linear-gradient(to right, #003d82, #4a90e2);*/ /* degradado azul */
    --sidebar-bg: #001f3f; /* azul oscuro corporativo */
    /*--titulo-bg: linear-gradient(135deg, #003d82, #4a90e2); */ /* degradado azul 135º */
    --titulo-bg: #002a5c; /* azul oscuro más profundo */
    --button-bg: linear-gradient(135deg, #003d82, #001f3f); /* degradado azul oscuro 315º */
    --sidebar-hover: #e8e8e8;
    --primary-blue: #003d82; /* azul corporativo más oscuro */
    --primary-blue-light: #2874a6; /* azul medio más oscuro */
    --accent-blue: #001f3f; /* azul acento muy oscuro */
    --text-white: #ffffff; /* blanco puro para contraste */
    --text-muted: #b0b0b0; /* gris más oscuro para textos secundarios */
    --border-subtle: rgba(255, 255, 255, 0.15); /* borde sutil más discreto */
}


/* Versión alternativa en modo claro: 
    Con Variables de Estilo. Como debe ser.
*/
.rootAlternativo {
    --sidebar-bg: linear-gradient(135deg, #00B9D5, #333333, #333333); /* degradado mas gris / celeste */
    --titulo-bg: linear-gradient(135deg, #00B9D5, #333333); /* degradado gris / celeste 135º */
    --button-bg: linear-gradient(135deg, #bbbbbb, #00B9D5); /* degradado gris / celeste 315º */
    --sidebar-hover: #f0f0f0;
    --primary-blue: #0056b3;
    --primary-blue-light: #4a90e2;
    --accent-blue: #003d82;
    --text-white: #ffffff; /* blanco puro para contraste */
    --text-muted: #d0d0d0; /* gris claro para textos secundarios */
    --border-subtle: rgba(255, 255, 255, 0.2); /* borde sutil en claro */
}



/* LOGIN: Contenedor centrado, gradiente */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: var(--titulo-bg);
}

/* Tarjeta */
.login-card {
    background-color: #ffffff;
    padding: 40px 30px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    width: 360px;
    max-width: 90%;
}

/* Animación de entrada */
.animate-fadein {
    animation: fadein 0.5s ease-out;
}

@keyframes fadein {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Inputs */
.input-group {
    position: relative;
}

.input-group input {
    padding-left: 36px;
    height: 45px;
    border-radius: 10px;
    border: 1px solid #ccc;
    font-size: 1rem;
}


/*------------------------------------RECARGAR-------------------------------------------------------------------------------*/
.reload-btn {
    width: 24px;
    height: 24px;
    border: 2px solid #0d6efd; /* color del circulito */
    border-radius: 50%;
    background: transparent;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

    .reload-btn::after {
        content: '';
        position: absolute;
        top: 2px;
        left: 50%;
        width: 6px;
        height: 6px;
        background: #0d6efd;
        border-radius: 50%;
        transform: translateX(-50%);
    }

    .reload-btn:hover {
        transform: rotate(90deg); /* efecto visual al pasar el mouse */
    }

/*-----------------------------------------------------------------------------------------------------------------------*/
/* Botón con degradado */
.btn-gradient {
    background: var(--button-bg);
    border: none;
    color: white;
    font-weight: bold;
    height: 45px;
    border-radius: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .btn-gradient:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    }

.btn-blue {
    background: var(--primary-blue);
    color: white;
}

.titulo-tabla {
    background: var(--titulo-bg);
}
/* Mensaje de error */
.alert {
    font-size: 0.9rem;
    text-align: center;
}


/* REDUCIR TAMAÑOS */
:root {
    --bs-body-font-size: 0.875rem;
    --bs-body-line-height: 1.4;
    --bs-border-radius: 0.25rem;
    --bs-btn-padding-y: 0.25rem;
    --bs-btn-padding-x: 0.75rem;
    --bs-form-label-font-size: 0.875rem;
}



.body-reducido .table-responsive {
    font-size: 13px;
}

    .body-reducido .table-responsive .table td {
        padding: 3px 8px;
        font-size: 13px;
    }

    .body-reducido .table-responsive .table th {
        padding: 6px 8px;
        font-weight: 600;
        font-size: 13px;
    }

    .body-reducido .table-responsive .table tr {
        cursor: pointer;
        user-select: none; /* ← Esto evita que se seleccione el texto */
        -webkit-user-select: none; /* Para Safari */
        -moz-user-select: none; /* Para Firefox */
    }


.modern-sidebar {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--sidebar-bg);
    width: 260px;
    position: fixed;
    left: 0;
    top: 0;
    overflow-y: auto;
    box-shadow: none;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo {
    max-width: 160px;
    height: auto;
    display: block;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.5rem;
}

.nav-section {
    margin-bottom: 0.5rem;
}

.nav-section-divider {
    height: 1px;
    background-color: var(--border-subtle);
    margin: 1rem 1.5rem;
}

.nav-item-modern {
    margin: 0.25rem 0.75rem;
}

.nav-link-modern {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.938rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

    .nav-link-modern:hover {
        background-color: var(--sidebar-hover);
        color: var(--accent-blue);
        transform: translateX(4px);
    }

    .nav-link-modern.active {
        background-color: var(--primary-blue-light);
        color: white;
        box-shadow: 0 2px 8px rgba(0, 61, 130, 0.2);
    }

        .nav-link-modern.active::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 3px;
            background-color: var(--primary-blue);
        }

.nav-icon {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
}

.nav-text {
    flex: 1;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

.logout-button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: rgba(220, 53, 69, 0.05);
    color: white;
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 8px;
    font-size: 0.938rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

    .logout-button:hover {
        background-color: #dc3545;
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
        border-color: #dc3545;
    }

/* Responsive */
@@media (max-width: 768px) {
    .modern-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }

    .navbar-toggler {
        display: block;
        position: fixed;
        top: 1rem;
        left: 1rem;
        width: 40px;
        height: 40px;
        z-index: 1001;
        background-color: var(--primary-blue);
        border: none;
        border-radius: 8px;
        cursor: pointer;
    }

        .navbar-toggler::before {
            content: '☰';
            color: white;
            font-size: 1.5rem;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .navbar-toggler:checked ~ .modern-sidebar {
            transform: translateX(0);
        }

        .navbar-toggler:checked::before {
            content: '×';
            font-size: 2rem;
        }
}

/* Scrollbar */
.modern-sidebar::-webkit-scrollbar {
    width: 6px;
}

.modern-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.modern-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 3px;
}

    .modern-sidebar::-webkit-scrollbar-thumb:hover {
        background: var(--text-muted);
    }


.contenedor-cabecera {
    position: relative;
}

    .contenedor-cabecera.desactivado::after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(200, 200, 200, 0.5); /* gris semitransparente */
        pointer-events: all; /* bloquea clics */
        cursor: not-allowed;
    }

    /* -----------------COMPONENTE ARTICULO ----------------*/
.dropdown-menu-up {
    position: fixed !important;
    bottom: auto !important;
    top: auto !important;
    z-index: 1062 !important;
    max-height: 200px;
    overflow-y: auto;
}


    /*

        POPUP

    */

/* Overlay */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 61, 130, 0.55); /* mismo color que otros overlays */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1100;

}

/* Card del popup */
.popup-card {
    background: #ffffff;
    border-radius: 16px;
    width: 95%;
    max-width: 450px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.2s ease-in-out;
}

/* Cabecera del popup */
.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    background: var(--titulo-bg);
    color: var(--text-white);
    padding: 1rem 1.5rem;
    font-size: 1.25rem;
    font-weight: bold;
}

.btn-close-popup {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-white);
    cursor: pointer;
}

    .btn-close-popup:hover {
        color: #ffcccc;
    }

/* Cuerpo del popup */
.popup-body {
    padding: 1.5rem;
    font-size: 1rem;
    text-align: center;
}

/* Footer del popup con botones */
.popup-footer {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 1.5rem 1.5rem 1.5rem;
}

.btn-success-gradient {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.75rem 2rem; /* Más alto y más ancho */
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

    .btn-success-gradient:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    }

.btn-danger-gradient {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 2rem; /* Más alto y más ancho */
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

    .btn-danger-gradient:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    }


.popup-pedidos {
    position: absolute;
    top: 110%;
    right: 0;
    z-index: 2000;
}

.popup-pedidos-card {
    background: #ffffff;
    width: 650px;
    max-width: 90vw;
    border-radius: 12px;
    box-shadow: 0 10px 35px rgba(0,0,0,0.25);
    overflow: hidden;
    animation: fadeInScale 0.15s ease-in-out;
}

.popup-pedidos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--titulo-bg);
    color: white;
    padding: 0.75rem 1rem;
    font-weight: bold;
}

.popup-pedidos-dropdown {
    position: absolute;
    top: 110%;
    right: 0;
    z-index: 2000;
}

.popup-pedidos-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999999;
}

/*  PEDIDOS SELECCIONADOR */
.popup-pedidos-body {
    padding: 0.5rem;
}

.popup-pedidos-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid #eee;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translateY(-5px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/*----------------------------------EDICION/CREACION LINEAS----------------------------------*/
/*----------------------------------EDICION/CREACION LINEAS----------------------------------*/
/* Contenedor principal del modal con flexbox */
.modal-lineas-container {
    flex: 1 1 auto;
    min-height: 0; /* permite que el contenedor se encoja */
    max-height: 100%; /* Altura maxima*/
    overflow-y: auto; /* Activar scroll */
    overflow-x: hidden; /* Desactivamos scroll */
    margin-bottom: 1rem;
}
.modal-lineas-container .table-responsive {
    height: auto;
    max-height: none;
    overflow: visible;
}

/* Tabla de líneas que crece para ocupar espacio disponible */
.tabla-lineas-flex {
    flex: 1 1 auto; /* Cambiado de nuevo a auto */
    min-height: 150px; /* Añadido: altura mínima para que se vea la tabla */
    overflow-y: auto;
    margin-bottom: 0;
}

/* Asegura que el contenedor de la tabla tenga altura */
.tabla-lineas-flex .table-responsive {
    height: 100%;
    overflow-y: auto;
}

/* Formulario de línea pegado abajo */
.formulario-linea-fixed {
    flex: 0 0 auto;
    max-height: 40vh; /* Limita la altura máxima del formulario */
    overflow-y: auto; /* Por si el formulario es muy alto */
    border-top: 2px solid #e5e5e5;
    background: white;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

/*---------------------------------EDICION/CREACION------------------------------------*/
/* ===== POPUP DE EDICIÓN/CREACIÓN CORPORATIVO ===== */
.corporate-modal,
.corporate-modal * {
    text-transform: none !important;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important;

}

/* Modal/Popup principal */
.corporate-modal,
.card.position-fixed {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1050;
    width: 90%;
    height: 90vh;
    background: #ffffff;
    border: 1px solid #d1d5db;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 0;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Cabecera del popup - AZUL CORPORATIVO */
.corporate-modal .card-header,
.card.position-fixed .card-header {
    background: var(--titulo-bg);
    color: white;
    padding: 1rem 1.5rem;
    border-bottom: 3px solid var(--accent-blue);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

    .corporate-modal .card-header h5,
    .card.position-fixed .card-header h5 {
        margin: 0;
        font-weight: 600;
        font-size: 1.1rem;
        letter-spacing: 0.025em;
        
        color: white;
    }

    /* Botones en la cabecera del modal */
    .corporate-modal .card-header .btn,
    .card.position-fixed .card-header .btn {
        padding: 0.5rem 1.5rem;
        border: none;
        font-weight: 600;
        font-size: 0.875rem;
        transition: all 0.15s ease;
    
        letter-spacing: 0.025em;
        border-radius: 4px;
    }

    .corporate-modal .card-header .btn-success,
    .card.position-fixed .card-header .btn-success {
        background: #0e7c4a;
        color: white;
    }

        .corporate-modal .card-header .btn-success:hover:not(:disabled),
        .card.position-fixed .card-header .btn-success:hover:not(:disabled) {
            background: #0a5c37;
            box-shadow: 0 4px 12px rgba(14, 124, 74, 0.3);
        }

    .corporate-modal .card-header .btn-secondary,
    .card.position-fixed .card-header .btn-secondary {
        background: white;
        color: var(--titulo-bg);
        border: 1px solid white;
    }

        .corporate-modal .card-header .btn-secondary:hover:not(:disabled),
        .card.position-fixed .card-header .btn-secondary:hover:not(:disabled) {
            background: #f5f5f5;
            border-color: #f5f5f5;
        }

    .corporate-modal .card-header .btn:disabled,
    .card.position-fixed .card-header .btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

/* Cuerpo del modal - FONDO GRIS CLARO */
.corporate-modal .card-body,
.card.position-fixed .card-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #fafafa;
}

/* Sección del formulario de cabecera - BLANCO */
.corporate-modal .container-fluid,
.card.position-fixed .container-fluid {
    background: #ffffff;
    padding: 1.2rem;
    border-radius: 0;
    margin-bottom: 1.5rem;
    border: 1px solid #e5e5e5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);

}

/* Labels del formulario */
.corporate-modal .form-label,
.card.position-fixed .form-label {
    font-weight: 600;
    color: #404040;
    font-size: 0.8125rem;
    margin-bottom: 0.25rem;
    letter-spacing: 0.025em;
}

/* Inputs del formulario */
.corporate-modal .form-control,
.corporate-modal .form-select,
.card.position-fixed .form-control,
.card.position-fixed .form-select {
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    background: white;
    color: #171717;
    border-radius: 4px;
}

    .corporate-modal .form-control:focus,
    .corporate-modal .form-select:focus,
    .card.position-fixed .form-control:focus,
    .card.position-fixed .form-select:focus {
        outline: none;
        border-color: var(--primary-blue);
        box-shadow: 0 0 0 3px rgba(0, 61, 130, 0.1);
    }

    .corporate-modal .form-control:disabled,
    .corporate-modal .form-select:disabled,
    .card.position-fixed .form-control:disabled,
    .card.position-fixed .form-select:disabled {
        background: #f5f5f5;
        color: #a3a3a3;
        cursor: not-allowed;
    }

/* Botones dentro del formulario */
.corporate-modal .container-fluid .btn,
.card.position-fixed .container-fluid .btn {
    padding: 0.5rem 1.25rem;
    border: 1px solid transparent;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    letter-spacing: 0.025em;
    cursor: pointer;
    border-radius: 4px;
}

.corporate-modal .container-fluid .btn-success,
.card.position-fixed .container-fluid .btn-success {
    background: #0e7c4a;
    color: white;
}

    .corporate-modal .container-fluid .btn-success:hover:not(:disabled),
    .card.position-fixed .container-fluid .btn-success:hover:not(:disabled) {
        background: #0a5c37;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(14, 124, 74, 0.3);
    }

.corporate-modal .container-fluid .btn-secondary,
.card.position-fixed .container-fluid .btn-secondary {
    background: white;
    color: #404040;
    border-color: #d1d5db;
}

    .corporate-modal .container-fluid .btn-secondary:hover:not(:disabled),
    .card.position-fixed .container-fluid .btn-secondary:hover:not(:disabled) {
        background: #f5f5f5;
    }

.corporate-modal .container-fluid .btn:disabled,
.card.position-fixed .container-fluid .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Tabla dentro del modal - BLANCO */
.corporate-modal .table-responsive,
.card.position-fixed .table-responsive {
    background: white;
    border-radius: 0;
    border: 1px solid #e5e5e5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Mantener estilos normales de tabla dentro del modal */
.corporate-modal .table thead.table-dark,
.card.position-fixed .table thead.table-dark {
    background: #2c3e50;
}

    .corporate-modal .table thead.table-dark th,
    .card.position-fixed .table thead.table-dark th {
        background: #2c3e50;
    }

/* Cabecera de sección de líneas - AZUL CORPORATIVO */
.corporate-modal .card-header.titulo-tabla,
.card.position-fixed .card-header.titulo-tabla {
    background: var(--titulo-bg);
    color: white;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--accent-blue);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    border-radius: 0;
}

    .corporate-modal .card-header.titulo-tabla h5,
    .card.position-fixed .card-header.titulo-tabla h5 {
        font-size: 0.938rem;
        font-weight: 600;
        letter-spacing: 0.05em;
        color: white;
        margin: 0;
    }

    /* Botones de la sección de líneas */
    .corporate-modal .card-header.titulo-tabla .btn,
    .card.position-fixed .card-header.titulo-tabla .btn {
        padding: 0.375rem 1rem;
        font-size: 0.813rem;
    }

    .corporate-modal .card-header.titulo-tabla .btn-success,
    .card.position-fixed .card-header.titulo-tabla .btn-success {
        background: #0e7c4a;
        color: white;
    }

    .corporate-modal .card-header.titulo-tabla .btn-danger,
    .card.position-fixed .card-header.titulo-tabla .btn-danger {
        background: #d32f2f;
        color: white;
    }

/* Card con formulario de línea - BLANCO */
.corporate-modal .card .card-body,
.card.position-fixed .card .card-body {
    background: white;
    padding: 1.25rem;
    border: 1px solid #e5e5e5;
    border-radius: 0;
}

/* Cards anidados dentro del modal */
.corporate-modal .card,
.card.position-fixed .card {
    background: white;
    border-color: #e5e5e5;
}

/* Mensajes de error */
.corporate-modal .alert-danger,
.card.position-fixed .alert-danger {
    background: #fef2f2;
    color: #7f1d1d;
    border-left: 4px solid #d32f2f;
    padding: 1rem 1.25rem;
    margin: 1rem;
    border-radius: 0;
    font-size: 0.875rem;
}

/* Mensajes de validación */
.corporate-modal .validation-message,
.corporate-modal .text-danger,
.card.position-fixed .validation-message,
.card.position-fixed .text-danger {
    color: #d32f2f;
    font-size: 0.8125rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Fondo oscuro (backdrop) */
.modal-backdrop.show,
.corporate-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1040;
    backdrop-filter: blur(2px);
}

@keyframes backdropFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Clase para deshabilitar secciones */
.corporate-modal .disabled-overlay,
.card.position-fixed .disabled-overlay {
    position: relative;
    pointer-events: none;
    opacity: 0.5;
}

/* Ajustes responsive */
@media (max-width: 768px) {
    .corporate-modal,
    .card.position-fixed {
        width: 95%;
        height: 95vh;
    }

        .corporate-modal .card-header,
        .card.position-fixed .card-header {
            flex-wrap: wrap;
            padding: 0.75rem 1rem;
        }

            .corporate-modal .card-header h5,
            .card.position-fixed .card-header h5 {
                font-size: 0.938rem;
            }

            .corporate-modal .card-header .btn,
            .card.position-fixed .card-header .btn {
                padding: 0.375rem 1rem;
                font-size: 0.813rem;
            }
}

/* Scrollbar del modal */
.corporate-modal .card-body::-webkit-scrollbar,
.card.position-fixed .card-body::-webkit-scrollbar {
    width: 8px;
}

.corporate-modal .card-body::-webkit-scrollbar-track,
.card.position-fixed .card-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.corporate-modal .card-body::-webkit-scrollbar-thumb,
.card.position-fixed .card-body::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 4px;
}

    .corporate-modal .card-body::-webkit-scrollbar-thumb:hover,
    .card.position-fixed .card-body::-webkit-scrollbar-thumb:hover {
        background: var(--accent-blue);
    }

/* Grupos de formulario en línea */
.corporate-modal .d-flex.flex-wrap,
.card.position-fixed .d-flex.flex-wrap {
    gap: 1rem;
}

.corporate-modal .d-flex.align-items-center,
.card.position-fixed .d-flex.align-items-center {
    margin-bottom: 0.5rem;
}

/* Clases de utilidad GetClaseDeshabilitado/GetClaseInvisible */
.corporate-modal .card.desactivado,
.card.position-fixed .card.desactivado {
    opacity: 0.5;
    pointer-events: none;
}


/* --------------------------------------- TABLA -------------------------------------------------------------*/

.table-responsive {
    border-radius: 0px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
   

}

/* Tabla base moderna */
.table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

    /* Cabecera de tabla moderna */
    .table thead.table-dark {
        background: #2c3e50;
        border: none;
    }

        .table thead.table-dark th {
            color: #ffffff;
            font-weight: 600;
            font-size: 0.813rem;
            letter-spacing: 0.5px;
            padding: 0.875rem 1rem;
            border: none;
            position: sticky;
            top: 0;
            z-index: 10;
            background: #2c3e50;
        }

    /* Filas del cuerpo de la tabla */
    .table tbody tr {
        background-color: #ffffff;
        border-bottom: 1px solid #e9ecef;
        transition: all 0.2s ease;
    }

        /* Hover en filas */
        .table tbody tr:hover {
            background-color: #f8f9fa;
            transform: translateX(2px);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        }

        /* Fila seleccionada */
        .table tbody tr.table-info {
            background-color: #e3f2fd !important;
            border-left: 3px solid var(--primary-blue);
        }

            .table tbody tr.table-info:hover {
                background-color: #bbdefb !important;
            }

    /* Celdas del cuerpo */
    .table tbody td {
        padding: 0.75rem 1rem;
        vertical-align: middle;
        font-size: 0.875rem;
        color: #2c3e50;
        border: none;
    }

/* Eliminar rayas zebra por defecto */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: #ffffff;
}

.table-striped tbody tr:nth-of-type(even) {
    background-color: #f8f9fa;
}

/* Alternativa: tabla con efecto de tarjetas */
.table-cards tbody tr {
    margin-bottom: 0.5rem;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

    .table-cards tbody tr:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

/* Celdas con texto muted más suave */
.table .text-muted {
    color: #6c757d !important;
    font-weight: 400;
}

/* Primera columna con más énfasis */
.table tbody td:first-child {
    font-weight: 600;
    color: var(--primary-blue);
}

/* Animación suave al cargar */
.table tbody tr {
    animation: fadeInRow 0.3s ease-out;
}

@keyframes fadeInRow {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar personalizado para tablas */
.table-responsive::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: #003d82; /* Tu azul oscuro */
    border-radius: 10px;
}

    .table-responsive::-webkit-scrollbar-thumb:hover {
        background: #002a5c; /* Azul más oscuro al hacer hover */
    }

/* Tabla compacta mejorada */
.table-sm tbody td {
    padding: 0.5rem 0.75rem;
}

.table-sm thead th {
    padding: 0.625rem 0.75rem;
}

/* Responsive: en móviles, reducir padding */
@media (max-width: 768px) {
    .table tbody td,
    .table thead th {
        padding: 0.5rem;
        font-size: 0.813rem;
    }
}

/* Badge o indicador en celdas */
.table .badge {
    padding: 0.35rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.75rem;
}

/* Estados visuales para datos */
.table .status-active {
    color: #28a745;
    font-weight: 600;
}

.table .status-inactive {
    color: #dc3545;
    font-weight: 600;
}

.table .status-pending {
    color: #ffc107;
    font-weight: 600;
}

/* Efecto de carga en tabla vacía */
.table-loading {
    position: relative;
    min-height: 200px;
}

    .table-loading::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(255, 255, 255, 0.8);
        display: flex;
        align-items: center;
        justify-content: center;
    }

/* Cabecera sticky mejorada con sombra al hacer scroll */
.table thead.sticky-top {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Alternativa de colores más claros para el header */
.table-header-light thead {
    background: #f8f9fa;
}

    .table-header-light thead th {
        color: #495057;
    }

/* Opción: tabla con bordes redondeados en las esquinas */
.table-rounded {
    border-radius: 12px;
    overflow: hidden;
}

    .table-rounded thead th:first-child {
        border-top-left-radius: 12px;
    }

    .table-rounded thead th:last-child {
        border-top-right-radius: 12px;
    }

/* Filas clickeables con cursor pointer */
.table tbody tr {
    cursor: pointer;
}

    /* Transición suave en cambio de color */
    .table tbody tr td {
        transition: background-color 0.2s ease, color 0.2s ease;
    }

    /* Indicador visual de fila activa más prominente */
    .table tbody tr.active-row {
        background: linear-gradient(90deg, #e3f2fd 0%, #ffffff 100%);
        border-left: 4px solid var(--primary-blue);
    }

/* Número de fila o identificador destacado */
.table .row-number {
    background-color: #f0f0f0;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-weight: 600;
    font-size: 0.75rem;
    display: inline-block;
    min-width: 30px;
    text-align: center;
}

/* Separador visual entre secciones de tabla */
.table tbody tr.section-divider {
    background-color: #e9ecef;
    font-weight: 600;
    color: #495057;
}

    .table tbody tr.section-divider:hover {
        background-color: #dee2e6;
    }
/*-----------ESTADISTICAS GENERALES-----------------------*/
/* Card contenedora principal */
.estadisticas-contenedor {
    background-color: #ffffff;
    border-radius: 20px; /* bordes redondeados grandes */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); /* sombra envolvente */
    padding: 2.5rem; /* margen interior amplio */
    margin-bottom: 2rem; /* separación con otras secciones */
    overflow: hidden;
}

    /* Cabecera de estadísticas */
    .estadisticas-contenedor h3 {
        margin: 0 0 2rem 0;
        font-weight: 600;
        font-size: 1.25rem;
        color: #333;
        text-align: center;
    }

/* Contenedor de las mini-cards */
.estadisticas-generales {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem; /* más separación entre mini-cards */
}

/* Mini-cards */
.estadistica-mini-card {
    background-color: #f9f9f9; /* fondo claro */
    border-radius: 16px; /* bordes redondeados */
    padding: 2rem 1.5rem; /* espacio interior más amplio */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08); /* sombra suave */
}

    .estadistica-mini-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    }

/* Icono encima del número */
.estadistica-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Valor destacado */
.estadistica-value {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}

/* Etiqueta */
.estadistica-label {
    text-align: center;
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* un naranja que contraste con azul */

/* =========================
   INFORMES
========================= */
.header-stock {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fechas-ventas {
    display: flex;
    gap: 0.3rem; /* espacio pequeño entre fechas */
}

.fecha-stock-input {
    width: 7rem;
    font-size: 0.75rem;
    padding: 0.15rem 0.25rem;
    height: 2rem;
}
.fecha-ventas-input {
    width: 7rem;
    font-size: 0.75rem;
    padding: 0.15rem 0.25rem;
    height: 2rem;
}



.informes-page {
    padding: 1.5rem;
}

.informes-header {
    background: var(--titulo-bg);
    color: var(--text-white);
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

    .informes-header h3 {
        margin: 0;
        font-weight: 600;
    }

/* Grid de cards */
.informes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(25rem, 1fr));
    gap: 1.5rem;
}

/* Card */
.informe-card {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 20rem;
}

    .informe-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 30px rgba(0,0,0,0.15);
    }

/* Título de la card */
.informe-card-header {
    width: 100%;
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;

    border-bottom: 2px solid var(--primary-blue);
    background: none;
    color: var(--primary-blue);
    border-radius: 0;
}


/* Icono */
.informe-card-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.informe-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

/* Footer */
.informe-card-footer {
    margin-top: 1rem;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

    .informe-card-footer .btn {
        flex-grow: 1;
    }

    .informe-card-footer input[type="date"] {
        width: 2.8rem; /* tamaño compacto */
        flex-shrink: 0;
    }



/* ========================= FORMULARIO DE INFORMES ========================= */

/* ========================= FORMULARIO DE INFORMES ========================= */
.informe-form-container {
    max-width: 80em;
    margin: 0 auto;
}

    .informe-form-container .form-label {
        color: #2c3e50;
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .informe-form-container .form-control {
        border-radius: 6px;
        border: 1px solid #d1d5db;
        padding: 0.6rem 0.9rem;
        font-size: 0.9rem;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

        .informe-form-container .form-control:focus {
            border-color: var(--primary-blue);
            box-shadow: 0 0 0 3px rgba(0, 61, 130, 0.1);
        }

.parametros-list {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.parametro-item {
    animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.parametros-list .input-group {
    background-color: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.parametros-list .input-group-text {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    font-weight: 600;
    min-width: 45px;
    justify-content: center;
}

.parametros-list .form-control {
    border: none;
    padding: 0.5rem 0.75rem;
}

    .parametros-list .form-control:focus {
        box-shadow: none;
        border: none;
    }

.parametros-list .btn-outline-danger {
    border: none;
    border-left: 1px solid #dee2e6;
    background-color: white;
    color: #dc3545;
    transition: all 0.2s ease;
}

    .parametros-list .btn-outline-danger:hover {
        background-color: #dc3545;
        color: white;
        border-left-color: #dc3545;
    }

.informe-form-container .btn-outline-primary {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

    .informe-form-container .btn-outline-primary:hover {
        background-color: var(--primary-blue);
        color: white;
    }



/*-----------------------------POPUP DE CARGA------------------------------------*/
/* ========================= POPUP DE CARGA ========================= */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 31, 63, 0.85);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.loading-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 3rem 4rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    animation: scaleIn 0.3s ease-out;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e5e5e5;
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-blue);
}

.loading-subtext {
    margin: 0;
    font-size: 0.938rem;
    color: #6c757d;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}