/* ═══════════════════════════════════════════════════════════════════ */
/* API WHATSAPP + RAG - ESTILOS SIMPLES Y FUNCIONALES                 */
/* ═══════════════════════════════════════════════════════════════════ */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f0f9ff 0%, #e3f2fd 100%);
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* HEADER                                                              */
/* ═══════════════════════════════════════════════════════════════════ */

header {
    background: linear-gradient(135deg, #1565c0 0%, #1e88e5 100%);
    color: white;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
}

header h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* ESTADÍSTICAS (STATS GRID)                                          */
/* ═══════════════════════════════════════════════════════════════════ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 8px rgba(30, 136, 229, 0.15);
    text-align: center;
    border-top: 4px solid #1e88e5;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(30, 136, 229, 0.25);
}

.stat-label {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 12px;
    font-weight: 500;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e88e5;
    display: block;
    margin: 10px 0;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* SECCIONES                                                           */
/* ═══════════════════════════════════════════════════════════════════ */

.section {
    background: white;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 8px rgba(30, 136, 229, 0.15);
}

.section h2 {
    font-size: 1.8rem;
    color: #1e88e5;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* BOTONES                                                             */
/* ═══════════════════════════════════════════════════════════════════ */

button {
    padding: 12px 24px;
    margin: 5px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Botón primario */
#btn-recargar {
    background: #1e88e5;
    color: white;
}

#btn-recargar:hover {
    background: #1565c0;
}

#btn-recargar:disabled {
    background: #90caf9;
}

/* Botón secundario */
.secondary {
    background: #e3f2fd;
    color: #1e88e5;
    border: 2px solid #1e88e5;
}

.secondary:hover {
    background: #1e88e5;
    color: white;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* TABLA                                                               */
/* ═══════════════════════════════════════════════════════════════════ */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

thead {
    background: #f5f5f5;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
}

tbody tr:hover {
    background: #f9f9f9;
}

tbody tr:last-child td {
    border-bottom: none;
}

.loading,
.alert {
    text-align: center;
    color: #666;
    padding: 20px;
}

.loading {
    font-style: italic;
}

.alert.error {
    color: #f44336;
    background: #ffcdd2;
    border-left: 4px solid #f44336;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* INFORMACIÓN                                                         */
/* ═══════════════════════════════════════════════════════════════════ */

.section p {
    margin: 12px 0;
    color: #555;
    line-height: 1.8;
}

.section strong {
    color: #1e88e5;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* FOOTER                                                              */
/* ═══════════════════════════════════════════════════════════════════ */

footer {
    background: #f5f5f5;
    border-top: 2px solid #e0e0e0;
    padding: 30px;
    text-align: center;
    color: #666;
    margin-top: 50px;
}

footer p {
    margin: 8px 0;
    font-size: 0.95rem;
}

footer strong {
    color: #1e88e5;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* RESPONSIVE                                                          */
/* ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    header h1 {
        font-size: 1.6rem;
    }
    
    header p {
        font-size: 0.95rem;
    }
    
    .section {
        padding: 20px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    button {
        width: 100%;
    }
    
    header h1 {
        font-size: 1.3rem;
    }
}