:root {
    --primary: #2c3e50;
    --accent: #3498db;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f1c40f;
    --light: #ecf0f1;
    --dark: #34495e;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', sans-serif; }
body { display: flex; background-color: #f4f7f6; min-height: 100vh; }

/* Navegación */
.sidebar { width: 250px; background-color: var(--primary); color: white; padding: 20px; position: fixed; height: 100%; z-index: 100; }
.sidebar h2 { text-align: center; margin-bottom: 30px; border-bottom: 2px solid var(--accent); padding-bottom: 10px; }
.sidebar ul { list-style: none; }
.sidebar button { width: 100%; padding: 12px; background: none; border: none; color: white; text-align: left; cursor: pointer; border-radius: 5px; margin-bottom: 5px; font-size: 15px; }
.sidebar button:hover { background: var(--accent); }

/* Contenido Principal */
.content { margin-left: 250px; padding: 30px; width: calc(100% - 250px); }
section { display: none; }
section.active { display: block; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Cards y Dashboard */
.cards-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 20px; }
.card { background: white; padding: 20px; border-radius: 10px; box-shadow: var(--shadow); position: relative; }
.card-ingreso { border-left: 5px solid var(--success); }
.card-gasto { border-left: 5px solid var(--danger); }
.card-resaltada { background: #e8f4fd; border-left: 5px solid var(--accent); }

/* Formularios */
form { background: white; padding: 20px; border-radius: 10px; display: flex; flex-wrap: wrap; gap: 10px; box-shadow: var(--shadow); margin-bottom: 20px; align-items: center; }
input, select { padding: 10px; border: 1px solid #ddd; border-radius: 5px; flex: 1; min-width: 120px; }
.fila-producto { display: flex; gap: 10px; width: 100%; margin-bottom: 5px; }

/* Botones */
.btn-main { padding: 10px 20px; background: var(--accent); color: white; border: none; border-radius: 5px; font-weight: bold; cursor: pointer; }
.btn-danger { background: var(--danger); color: white; border: none; padding: 5px 10px; border-radius: 3px; cursor: pointer; }
button:active { transform: scale(0.98); }

/* Tablas */
.table-wrapper { background: white; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); margin-top: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #eee; }
th { background: var(--light); color: var(--primary); }

/* Buscador Inteligente */
.sugerencias-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    border-radius: 0 0 5px 5px;
    box-shadow: var(--shadow);
}
.sugerencias-dropdown div { padding: 10px; cursor: pointer; border-bottom: 1px solid #eee; font-size: 14px; }
.sugerencias-dropdown div:hover { background-color: var(--light); }

/* Footer Inventario */
.floating-inventory { position: fixed; bottom: 20px; right: 20px; background: var(--primary); color: white; padding: 15px; border-radius: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); z-index: 99; }

@media (max-width: 768px) {
    .sidebar { width: 100%; position: relative; height: auto; }
    .content { margin-left: 0; width: 100%; }
    body { flex-direction: column; }
}
/* Estilos para el botón de hamburguesa */
.menu-toggle {
    display: none; /* Se oculta en computadoras */
    position: fixed;
    top: 15px;
    right: 15px;
    font-size: 24px;
    background: #333;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    z-index: 1100;
    cursor: pointer;
}

/* Reglas exclusivas para Celulares (Pantallas menores a 768px) */
@media (max-width: 768px) {
    .menu-toggle {
        display: block; /* Aparece el botón en celular */
    }

    .sidebar {
        position: fixed;
        left: -100%; /* Esconde el menú a la izquierda */
        top: 0;
        width: 250px;
        height: 100%;
        transition: 0.3s;
        z-index: 1000;
    }

    /* Clase que activaremos con JS para mostrar el menú */
    .sidebar.active {
        left: 0; /* Desplaza el menú hacia adentro */
    }

    .content {
        margin-left: 0 !important; /* Quita el margen lateral en celular */
        padding-top: 60px; /* Espacio para que el botón no tape el título */
    }
}


