﻿/* RESET */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #0a1626;
}

/* LAYOUT GENERAL */
.layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* SIDEBAR */
.sidebar {
    width: 260px;
    background: #0b1a2b;
    display: flex;
    flex-direction: column;
}

/* PARTE SUPERIOR */
.sidebar-top {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

/* PARTE INFERIOR (LOGIN) */
.sidebar-bottom {
    padding: 15px;
    background: #1f2f44;
}

/* MENÚ */
.menu-item {
    color: white;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 5px;
    transition: background 0.2s;
}

    .menu-item:hover {
        background: #162a44;
    }

/* BOTONES */
.btn-login {
    width: 100%;
    padding: 10px;
    background: #3fa7d6;
    border: none;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

    .btn-login:hover {
        background: #349ac2;
    }

/* LOGIN */
.login-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .login-box input {
        padding: 8px;
        border-radius: 5px;
        border: none;
    }

/* CONTENIDO PRINCIPAL */
.main-content {
    flex: 1;
    background: #0f2238;
    padding: 20px;
}

/* TITULOS */
.title {
    color: white;
}

/* SCROLL */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-thumb {
    background: #3fa7d6;
    border-radius: 4px;
}
/* =========================
   MOBILE HEADER
========================= */
.mobile-header {
    display: none;
    height: 50px;
    background: #0b1a2b;
    color: white;
    align-items: center;
    padding: 0 10px;
}

.mobile-title {
    margin-left: 10px;
    font-size: 16px;
}

.btn-menu {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
}

/* =========================
   TRANSICIÓN
========================= */
.sidebar {
    transition: transform 0.3s ease;
}

/* =========================
   MODO MÓVIL 🔥
========================= */
@media (max-width: 768px) {

    .layout {
        flex-direction: column;
    }

    .mobile-header {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: 50px;
        left: 0;
        height: calc(100vh - 50px);
        width: 260px;
        z-index: 1000;
        /* oculto por defecto */
        transform: translateX(-100%);
    }

        .sidebar.active {
            transform: translateX(0);
        }
    .main-content {
        flex: 1;
        padding: 15px;
        height: calc(100vh - 50px); /* 🔥 alto visible */
        overflow-y: auto; /* 🔥 scroll vertical */
    }
    .main-content {
        flex: 1;
        padding: 15px;
    }
}
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    gap: 10px;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: #0f2238;
    border-radius: 8px;
}

.chat-input {
    padding: 10px;
    border-radius: 6px;
    border: none;
}

.chat-btn {
    padding: 10px;
    background: #3fa7d6;
    border: none;
    color: white;
    border-radius: 6px;
}

.chat-msg {
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 8px;
    max-width: 100%;
}

    .chat-msg.user {
        background: #3fa7d6;
        align-self: flex-end;
        color: white;
    }

    .chat-msg.bot {
        background: #1f2f44;
        color: white;
    }
.menu-item {
    padding: 10px 15px;
}

.menu-link {
    text-decoration: none;
    color: #ccc;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

    .menu-link i {
        width: 18px;
        text-align: center;
    }

.menu-item:hover {
    background: #2a2a2a;
}

.menu-item.active {
    background: #0078d4;
}

    .menu-item.active .menu-link {
        color: #fff;
        font-weight: 600;
    }

/* CONTENEDOR GENERAL */
.ia-form-container {
    padding: 20px;
    color: #fff;
}

/* FILA */
.ia-form-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

    /* LABELS */
    .ia-form-row label {
        font-size: 13px;
        color: #cbd5e1;
    }

    /* INPUTS */
    .ia-form-row input,
    .ia-form-row textarea {
        padding: 6px 8px;
        border-radius: 6px;
        border: none;
        outline: none;
        font-size: 13px;
    }

/* TAMAÑOS ESPECÍFICOS */
#txtCondicion {
    width: 200px;
}

#txtSQL {
    width: 300px;
    height: 40px;
}

#txtPrioridad {
    width: 80px;
}

/* BOTÓN */
.chat-btn, .ia-form-row button, .ia-form-row input[type=submit] {
    background: #38bdf8;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
}

    .chat-btn:hover {
        background: #0ea5e9;
    }

.ia-form-container {
    background: #0f172a;
    border-radius: 10px;
}

/* CONTENEDOR con scroll */
.ia-table-container {
    max-height: 260px; /* 🔥 aprox 8 filas */
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: white;
}

/* TABLA */
.ia-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

    /* HEADER FIJO */
    .ia-table thead th {
        position: sticky;
        top: 0;
        background: #2c3e50;
        color: white;
        padding: 8px;
        text-align: left;
        z-index: 2;
    }

    /* CELDAS */
    .ia-table td {
        padding: 6px 8px;
        border-bottom: 1px solid #eee;
        color: #2c3e50;
    }

    /* FILAS alternas */
    .ia-table tr:nth-child(even) {
        background: #f9f9f9;
        color: #2c3e50;
    }

    /* HOVER tipo app moderna */
    .ia-table tr:hover td {
        background: #eef5ff;
        color: #2c3e50;
    }

/* SCROLL bonito */
.ia-table-container::-webkit-scrollbar {
    width: 6px;
}

.ia-table-container::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 4px;
}
@media (max-width: 768px) {

    /* SOLO cuando tenga muchas columnas */
    .ia-table-scroll {
        overflow-x: auto; /* 🔥 scroll horizontal */
        overflow-y: hidden;
    }

        .ia-table-scroll table {
            min-width: 600px; /* 🔥 fuerza ancho para activar scroll */
        }
}
