/* =================================
   SISTEMA RAG - DISEÑO MINIMALISTA
   Paleta: #008BCA #2C3E50 #5A6C7D #F8F9FA
   ================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: #F8F9FA;
    color: #2C3E50;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-weight: 300;
}

/* BARRA DE ESTADO DEL ALMACÉN */
.barra-estado-almacen {
    background: #008BCA;
    color: #FFFFFF;
    padding: 12px 40px;
    text-align: right;
    font-size: 0.9em;
    font-weight: 400;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.barra-estado-almacen:hover {
    background: #006A9E;
}

.barra-estado-almacen.sin-almacen {
    background: #D32F2F;
}

.barra-estado-almacen.sin-almacen:hover {
    background: #B71C1C;
}

.barra-estado-almacen span {
    text-transform: uppercase;
}

.barra-estado-almacen span::before {
    content: '➤ ';
    display: inline-block;
    margin-right: 8px;
    opacity: 0.9;
}

.contenedor {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    width: 100%;
    margin-top: 46px;
}

/* HEADER */
header {
    background: #FFFFFF;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 25px 40px;
    margin-bottom: 35px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

header .logo-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

header .logo-container img {
    height: 45px;
    width: auto;
    opacity: 0.95;
}

header .titulo-principal {
    flex: 1;
    text-align: right;
    padding-right: 50px;
}

header h1 {
    font-size: 2em;
    color: #2C3E50;
    font-weight: 300;
    letter-spacing: 3px;
    margin: 0;
}

/* INFO USUARIO Y LOGOUT */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 20px;
    background: #FAFBFC;
    border: 1px solid #DDE2E6;
}

.user-name {
    color: #5A6C7D;
    font-weight: 400;
    font-size: 0.9em;
    letter-spacing: 0.5px;
}

.btn-logout {
    background: #D32F2F;
    color: #FFFFFF;
    padding: 8px 18px;
    text-decoration: none;
    font-weight: 400;
    font-size: 0.85em;
    letter-spacing: 0.8px;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: #B71C1C;
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.2);
}

/* NAVEGACIÓN */
.navegacion-pestanas {
    background: #FFFFFF;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 0;
    margin-bottom: 35px;
    display: flex;
    gap: 0;
}

.boton-pestana {
    flex: 1;
    padding: 16px 20px;
    border: none;
    background: #FFFFFF;
    color: #5A6C7D;
    font-size: 0.9em;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.8px;
    border-bottom: 3px solid transparent;
}

.boton-pestana:hover {
    background: #FAFBFC;
    color: #2C3E50;
}

.boton-pestana.activo {
    background: #FFFFFF;
    color: #008BCA;
    border-bottom-color: #008BCA;
}

/* CONTENIDO */
.contenido-pestana {
    display: none;
}

.contenido-pestana.activo {
    display: block;
}

/* TARJETAS */
.tarjeta {
    background: #FFFFFF;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.tarjeta h2 {
    font-size: 1.4em;
    color: #2C3E50;
    margin-bottom: 25px;
    font-weight: 300;
    letter-spacing: 2px;
    padding-bottom: 15px;
    border-bottom: 1px solid #DDE2E6;
}

.tarjeta h3 {
    font-size: 1.1em;
    color: #5A6C7D;
    margin-bottom: 15px;
    margin-top: 25px;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* FORMULARIOS */
.grupo-formulario {
    margin-bottom: 25px;
}

.grupo-formulario label {
    display: block;
    margin-bottom: 8px;
    color: #5A6C7D;
    font-weight: 400;
    font-size: 0.9em;
    letter-spacing: 0.3px;
}

.entrada-texto,
.entrada-select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #DDE2E6;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #FAFBFC;
    color: #2C3E50;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 300;
}

.entrada-texto:focus,
.entrada-select:focus,
textarea:focus {
    outline: none;
    border-color: #008BCA;
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(0, 139, 202, 0.05);
}

.entrada-texto::placeholder,
textarea::placeholder {
    color: #B0BEC5;
}

/* BOTONES */
.boton-primario {
    background: #008BCA;
    color: #FFFFFF;
    padding: 12px 24px;
    border: none;
    font-size: 0.95em;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.8px;
}

.boton-primario:hover {
    background: #006A9E;
    box-shadow: 0 4px 12px rgba(0, 139, 202, 0.2);
}

.boton-primario:active {
    transform: translateY(1px);
}

.boton-secundario {
    background: #FAFBFC;
    color: #5A6C7D;
    padding: 12px 24px;
    border: 1px solid #DDE2E6;
    font-size: 0.95em;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.8px;
}

.boton-secundario:hover {
    background: #FFFFFF;
    border-color: #008BCA;
    color: #008BCA;
}

.boton-peligro {
    background: #D32F2F;
    color: #FFFFFF;
    padding: 12px 24px;
    border: none;
    font-size: 0.95em;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.8px;
}

.boton-peligro:hover {
    background: #B71C1C;
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.2);
}

.boton-pequeno {
    padding: 8px 16px;
    font-size: 0.85em;
}

.boton-activo {
    background: #008BCA;
    color: #FFFFFF;
    padding: 8px 16px;
    border: none;
    font-size: 0.85em;
    font-weight: 400;
    cursor: not-allowed;
    letter-spacing: 0.8px;
    opacity: 0.9;
}

/* CHAT */
.contenido-principal {
    display: flex;
    gap: 25px;
}

.panel-lateral {
    width: 300px;
    flex-shrink: 0;
}

.panel-chat {
    flex: 1;
}

.mensajes-chat {
    height: 500px;
    overflow-y: auto;
    padding: 20px;
    background: #FAFBFC;
    margin-bottom: 20px;
    border: 1px solid #DDE2E6;
}

.mensaje {
    margin-bottom: 20px;
    padding: 15px 18px;
    background: #FFFFFF;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.mensaje-usuario {
    background: #E3F2FD;
    border-left: 3px solid #008BCA;
}

.mensaje-asistente {
    background: #FFFFFF;
    border-left: 3px solid #DDE2E6;
}

.mensaje strong {
    display: block;
    margin-bottom: 8px;
    color: #2C3E50;
    font-weight: 400;
    font-size: 0.9em;
    letter-spacing: 0.5px;
}

.entrada-chat {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.entrada-chat input {
    flex: 1;
}

.entrada-chat button {
    white-space: nowrap;
}

/* LISTA DE ARCHIVOS */
.contador-documentos {
    padding: 12px 0;
    margin-bottom: 15px;
    color: #5A6C7D;
    font-size: 0.9em;
    font-weight: 400;
    border-bottom: 1px solid #DDE2E6;
}

.contador-documentos span {
    color: #008BCA;
    font-weight: 600;
    font-size: 1.1em;
}

.lista-archivos {
    max-height: 450px;
    overflow-y: auto;
    padding-right: 5px;
}

.item-archivo {
    padding: 15px;
    margin-bottom: 10px;
    background: #E8F4F9;
    border: 1px solid #B8D9EC;
    transition: all 0.3s ease;
}

.item-archivo:hover {
    background: #D5EBFA;
    box-shadow: 0 2px 8px rgba(0, 139, 202, 0.1);
}

.nombre-archivo {
    font-weight: 400;
    color: #2C3E50;
    font-size: 0.95em;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
}

.info-archivo {
    font-size: 0.85em;
    color: #7B8794;
}

.select-acciones-archivo {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #DDE2E6;
    background: #FFFFFF;
    color: #2C3E50;
    font-size: 0.85em;
    transition: all 0.3s ease;
}

.select-acciones-archivo:focus {
    outline: none;
    border-color: #008BCA;
    box-shadow: 0 0 0 3px rgba(0, 139, 202, 0.05);
}

.archivo-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.archivo-nombre {
    font-weight: 400;
    color: #2C3E50;
    font-size: 0.95em;
    letter-spacing: 0.3px;
}

.archivo-acciones {
    display: flex;
    gap: 8px;
}

.boton-icono {
    background: none;
    border: none;
    color: #5A6C7D;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.boton-icono:hover {
    color: #008BCA;
}

.archivo-metadata {
    font-size: 0.85em;
    color: #7B8794;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #DDE2E6;
}

/* ZONA DE ARRASTRE */
.zona-arrastre {
    border: 2px dashed #DDE2E6;
    padding: 50px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #FAFBFC;
    margin-bottom: 25px;
}

.zona-arrastre:hover,
.zona-arrastre.arrastrando {
    border-color: #008BCA;
    background: #F0F8FF;
}

.zona-arrastre p {
    margin: 0;
    color: #5A6C7D;
    font-size: 1em;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.texto-pequeno {
    font-size: 0.85em !important;
    color: #7B8794 !important;
    margin-top: 8px !important;
}

.entrada-archivo {
    display: none;
}

/* STORES */
.lista-stores {
    display: grid;
    gap: 15px;
}

.tarjeta-store {
    padding: 20px;
    background: #FAFBFC;
    border: 1px solid #DDE2E6;
    transition: all 0.3s ease;
}

.tarjeta-store:hover {
    background: #FFFFFF;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.tarjeta-store.activo {
    background: #E8F4F9;
    border: 2px solid #008BCA;
}

.tarjeta-store h3 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    font-weight: 400;
    color: #2C3E50;
    letter-spacing: 0.5px;
}

.info-store {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #DDE2E6;
}

.info-store div {
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #5A6C7D;
}

.info-store strong {
    font-weight: 400;
    color: #2C3E50;
}

.acciones-store {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* METADATA */
.campo-metadata {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    align-items: flex-start;
}

.campo-metadata input {
    flex: 1;
}

.campo-metadata button {
    padding: 12px 16px;
}

/* ESTADOS */
.estado-vacio {
    text-align: center;
    padding: 50px 20px;
    color: #7B8794;
    font-size: 0.95em;
    font-weight: 300;
}

.estado-cargando {
    text-align: center;
    padding: 30px;
    color: #5A6C7D;
}

/* NOTIFICACIONES */
.notificacion {
    position: fixed;
    top: 70px;
    right: 30px;
    padding: 16px 24px;
    background: #FFFFFF;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 2000;
    min-width: 300px;
    max-width: 500px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notificacion.exito {
    border-left-color: #66BB6A;
}

.notificacion.error {
    border-left-color: #EF5350;
}

.notificacion.info {
    border-left-color: #008BCA;
}

.notificacion-titulo {
    font-weight: 400;
    margin-bottom: 5px;
    color: #2C3E50;
    letter-spacing: 0.3px;
}

.notificacion-mensaje {
    color: #5A6C7D;
    font-size: 0.9em;
    font-weight: 300;
}

/* MODALES */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(44, 62, 80, 0.5);
    z-index: 3000;
    align-items: center;
    justify-content: center;
}

.modal.activo {
    display: flex;
}

.modal-contenido {
    background: #FFFFFF;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.modal-grande {
    max-width: 800px;
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid #DDE2E6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3em;
    color: #2C3E50;
    font-weight: 300;
    letter-spacing: 1.5px;
}

.modal-cerrar {
    background: none;
    border: none;
    font-size: 1.8em;
    color: #7B8794;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-cerrar:hover {
    color: #2C3E50;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #DDE2E6;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* FOOTER */
footer {
    background: #FFFFFF;
    border-top: 1px solid #DDE2E6;
    padding: 30px 40px;
    margin-top: 50px;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-info p {
    margin: 5px 0;
    color: #7B8794;
    font-size: 0.9em;
    font-weight: 300;
}

.footer-info strong {
    color: #2C3E50;
    font-weight: 400;
}

.footer-info a {
    color: #008BCA;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-info a:hover {
    color: #006A9E;
}

.logo-footer img {
    height: 40px;
    width: auto;
    opacity: 0.9;
}

/* SCROLLBAR PERSONALIZADO */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #F8F9FA;
}

::-webkit-scrollbar-thumb {
    background: #DDE2E6;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #B0BEC5;
}

/* =================================
   PÁGINA DE LOGIN
   ================================= */

body.login-page {
    background: #F8F9FA;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 20px;
}

.login-container {
    background: #FFFFFF;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 420px;
}

.login-header {
    background: #FFFFFF;
    padding: 50px 40px 30px 40px;
    text-align: center;
}

.login-header img {
    max-width: 200px;
    height: auto;
    margin-bottom: 35px;
    opacity: 0.95;
}

.login-header h1 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #2C3E50;
}

.login-body {
    padding: 0 40px 40px 40px;
    background: #FFFFFF;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #5A6C7D;
    font-weight: 400;
    font-size: 0.9em;
    letter-spacing: 0.3px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #DDE2E6;
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: #FAFBFC;
    color: #2C3E50;
    font-weight: 300;
}

.form-group input:focus {
    outline: none;
    border-color: #008BCA;
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(0, 139, 202, 0.05);
}

.form-group input::placeholder {
    color: #B0BEC5;
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: #008BCA;
    color: #FFFFFF;
    border: none;
    font-size: 0.95em;
    font-weight: 400;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.btn-login:hover {
    background: #006A9E;
    box-shadow: 0 4px 12px rgba(0, 139, 202, 0.2);
}

.btn-login:active {
    transform: translateY(1px);
}

.alert {
    padding: 14px 16px;
    margin-bottom: 24px;
    font-size: 14px;
    background: #FAFBFC;
}

.alert-error {
    background: #FFF5F5;
    color: #C62828;
    border-left: 3px solid #EF5350;
}

.alert-success {
    background: #F1F8F4;
    color: #2E7D32;
}

.login-footer {
    text-align: center;
    padding: 20px;
    background: #FAFBFC;
    color: #7B8794;
    font-size: 0.85em;
    font-weight: 300;
    letter-spacing: 0.3px;
}

.login-footer a {
    color: #008BCA;
    text-decoration: none;
    font-weight: 400;
    transition: color 0.2s ease;
}

.login-footer a:hover {
    color: #006A9E;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
    .contenedor {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .contenedor {
        padding: 0 15px;
    }

    header {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    header .titulo-principal {
        text-align: center;
        padding-right: 0;
    }

    header h1 {
        font-size: 1.5em;
    }

    .navegacion-pestanas {
        flex-direction: column;
    }

    .boton-pestana {
        border-right: none;
        border-bottom: 1px solid #DDE2E6;
    }

    .boton-pestana.activo {
        border-bottom: 3px solid #008BCA;
    }

    .contenido-principal {
        flex-direction: column;
    }

    .panel-lateral {
        width: 100%;
    }

    .user-info {
        flex-direction: column;
        gap: 10px;
    }

    .notificacion {
        right: 15px;
        left: 15px;
        min-width: auto;
    }
}

@media (max-width: 600px) {
    .login-header {
        padding: 40px 30px 25px 30px;
    }

    .login-body {
        padding: 0 30px 35px 30px;
    }

    .login-header h1 {
        font-size: 1.3em;
        letter-spacing: 2px;
    }

    .login-header img {
        max-width: 170px;
        margin-bottom: 30px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.2em;
        letter-spacing: 1.5px;
    }

    .tarjeta {
        padding: 20px;
    }

    .tarjeta h2 {
        font-size: 1.2em;
    }

    .boton-primario,
    .boton-secundario,
    .boton-peligro {
        padding: 10px 18px;
        font-size: 0.9em;
    }

    .mensajes-chat {
        height: 400px;
    }
}
