/* estilos.css - VERSIÓN FINAL COMPLETA */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --background-color: #f8f9fa;
    --surface-color: #ffffff;
    --text-color: #212529;
    --border-color: #dee2e6;
    --shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    font-size: 15px;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 260px;
    background-color: var(--surface-color);
    padding: 25px;
    height: 100vh;
    box-shadow: 0 0 30px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    position: fixed;
    border-right: 1px solid var(--border-color);
}

.logo-container {
    text-align: center;
    margin-bottom: 35px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo-container img {
    max-width: 90px;
    border-radius: 50%;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.logo-container h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--secondary-color);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.sidebar nav a.active, .sidebar nav a:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.footer-yotta {
    margin-top: auto;
    text-align: center;
    font-size: 0.85em;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.footer-yotta a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* --- MAIN CONTENT --- */
.main-content {
    margin-left: 260px;
    padding: 30px;
    width: calc(100% - 260px);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.btn-logout {
    background-color: #dc3545;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s;
}
.btn-logout:hover {
    background-color: #c82333;
}

/* --- GRIDS & CARDS --- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.kpi-card {
    background-color: var(--surface-color);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.kpi-card h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.kpi-card .value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
}

.chart-container {
    background-color: var(--surface-color);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    height: 400px;
    border: 1px solid var(--border-color);
}

/* --- ESTILOS PARA LA LISTA DE CONVERSACIONES --- */
.lista-conversaciones {
    background: var(--surface-color);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.lista-conversaciones table {
    width: 100%;
    border-collapse: collapse;
}

.lista-conversaciones th, .lista-conversaciones td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.lista-conversaciones th {
    font-weight: 600;
}

.lista-conversaciones a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

/* --- ESTILOS PARA LA VISTA DE CHAT INDIVIDUAL --- */
.chat-window {
    height: 65vh;
    overflow-y: auto;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 20px;
    background-color: #fdfdfd;
    display: flex;
    flex-direction: column;
}

.msg {
    padding: 12px 18px;
    margin-bottom: 10px;
    border-radius: 20px;
    max-width: 75%;
    line-height: 1.5;
    word-wrap: break-word;
}

.msg .fecha {
    font-size: 0.75em;
    color: #6c757d;
    margin-top: 5px;
    display: block;
    text-align: right;
}

.cliente {
    background-color: #e9ecef;
    color: #343a40;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.bot {
    background-color: var(--primary-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.bot .fecha {
    color: rgba(255, 255, 255, 0.7);
}

/* --- ESTILOS PARA EL FORMULARIO DE LIVE CHAT --- */
.live-chat-form {
    display: flex;
    gap: 10px;
}

.live-chat-form textarea {
    flex-grow: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    resize: none;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
}

.live-chat-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.live-chat-form button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

.live-chat-form button:hover {
    background-color: #0b5ed7;
}

/* --- ESTILOS PARA EL LOGIN --- */
.login-body {
    height: 100vh;
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    width: 100%;
}

.login-box {
    background: #fff;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    width: 340px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.login-box h2 {
    color: #333;
    margin-bottom: 25px;
    font-weight: 600;
}

.login-box .error {
    color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.2);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 0.9em;
}

.login-box input[type="text"],
.login-box input[type="password"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.login-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.login-box button:hover {
    background: #0b5ed7;
}