/* estilos.css */

/* Fuente y colores base */
:root {
    --color-primario: #2c3e50;
    --color-secundario: #3498db;
    --color-acento: #27ae60;
    --color-fondo: #f5f7fa;
    --color-texto: #333;
    --color-blanco: #fff;
}

/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--color-fondo);
    color: var(--color-texto);
    line-height: 1.6;
}

/* Encabezado */
h1 {
    text-align: center;
    color: var(--color-primario);
    margin-top: 20px;
}

/* Menú principal */
.menu {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap; /* permite que los botones se acomoden en varias filas */
}

button {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    background: var(--color-secundario);
    color: var(--color-blanco);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    background: #1d6fa5;
    transform: translateY(-2px);
}

/* Tarjetas (formularios, reporte, inventario) */
.formulario {
    max-width: 700px;
    margin: 20px auto;
    background: var(--color-blanco);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    animation: fadeIn 0.5s ease;
    text-align: center;
    overflow-x: auto; /* scroll horizontal si la tabla es muy ancha */
}

/* Títulos */
h2 {
    color: var(--color-primario);
    margin-bottom: 20px;
    font-size: 22px;
    border-bottom: 2px solid var(--color-secundario);
    padding-bottom: 8px;
}

/* Inputs */
label {
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
    color: var(--color-texto);
    text-align: left;
}

input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    transition: border 0.3s ease;
}

input:focus {
    border-color: var(--color-secundario);
    outline: none;
}

/* Reporte */
#totalVentas {
    font-size: 20px;
    color: var(--color-acento);
    font-weight: bold;
    margin-top: 10px;
}

/* Tabla de reporte */
#tablaVentas {
    margin: 20px auto;
    border-collapse: collapse;
    width: 80%; /* ancho controlado */
}

#tablaVentas th, #tablaVentas td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center; /* centramos contenido */
}

#tablaVentas th {
    background-color: var(--color-secundario);
    color: var(--color-blanco);
    font-weight: 600;
}

#tablaVentas tr:nth-child(even) {
    background-color: #f9f9f9;
}

#tablaVentas tr:hover {
    background-color: #eef6fc;
}

/* Tabla de inventario */
#tablaInventario {
    margin: 20px auto;
    border-collapse: collapse;
    width: 80%; /* ancho controlado */
}

#tablaInventario th, #tablaInventario td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center; /* centramos contenido */
}

#tablaInventario th {
    background-color: var(--color-secundario);
    color: var(--color-blanco);
    font-weight: 600;
}

#tablaInventario tr:nth-child(even) {
    background-color: #f9f9f9;
}

#tablaInventario tr:hover {
    background-color: #eef6fc;
}

/* Animaciones */
@keyframes fadeIn {
    from {opacity: 0; transform: translateY(10px);}
    to {opacity: 1; transform: translateY(0);}
}

/* Responsividad */
@media (max-width: 768px) {
    h1 {
        font-size: 20px;
    }

    h2 {
        font-size: 18px;
    }

    button {
        width: 100%; /* botones ocupan todo el ancho en móviles */
        margin-bottom: 10px;
    }

    #tablaVentas, #tablaInventario {
        width: 100%; /* tablas ocupan todo el ancho en móviles */
    }
}