/* --- ESTILOS GENERALES --- */
:root {
    --primary: #1e293b;
    --secondary: #334155;
    --accent: #3b82f6;
    --success: #16a34a;
    --danger: #dc2626;
    --bg: #f0f2f5;
    --white: #ffffff;
}

body { font-family: 'Segoe UI', sans-serif; margin: 0; background: var(--bg); color: #333; }

/* NAVBAR */
.navbar { background: var(--primary); padding: 10px 20px; display: flex; gap: 15px; align-items: center; }
/* Añade o modifica esta regla específica para el logo */
.navbar .logo { 
    color: white !important; /* El !important asegura que gane a otras reglas */
    font-weight: bold; 
    margin-right: 20px; 
    font-size: 1.1em; 
}
.navbar a { color: white; text-decoration: none; padding: 8px 15px; border-radius: 5px; background: var(--secondary); font-size: 0.9em; transition: 0.3s; }
.navbar a:hover { background: #475569; }
.navbar .active { background: var(--accent); }

/* --- DISEÑO ESPECÍFICO DEL INDEX (POS) --- */
.main-container { display: flex; padding: 20px; gap: 20px; align-items: flex-start; }

.productos { 
    flex: 2; 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); 
    gap: 15px; 
}

.ticket-area { 
    flex: 1; 
    border: 1px solid #000; 
    padding: 15px; 
    background: white; 
    min-height: 500px; 
    border-radius: 8px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 20px;
}

/* BOTONES DE PRODUCTO */
.btn-prod { 
    padding: 20px; 
    border: 1px solid #ddd; 
    border-radius: 8px; 
    cursor: pointer; 
    background: #fff; 
    transition: 0.2s; 
    font-size: 14px; 
    text-align: center;
}
.btn-prod:hover { background: #e2e8f0; transform: translateY(-2px); }

.btn-cobrar { 
    width: 100%; padding: 15px; background: var(--success); color: white; 
    font-weight: bold; border: none; border-radius: 5px; cursor: pointer; 
    margin-top: 10px; font-size: 1.1em; 
}

/* MODALES */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 1000;
}
.modal-content {
    background: white; width: 90%; max-width: 600px; margin: 5% auto;
    padding: 20px; border-radius: 10px; max-height: 80vh; overflow-y: auto;
}
.modal.open { display: block !important; }


/* IMPRESIÓN */
@media print {
    .no-print, .navbar { display: none !important; }
    body { background: white; }
    .main-container { display: block; padding: 0; }
    .ticket-area { border: none; box-shadow: none; width: 100%; position: static; }
    #ticket-imprimir { width: 80mm; font-family: 'Courier New', monospace; }
}

/* --- ESTILOS PARA MODALES --- */
.modal {
    display: none; /* Oculto por defecto */
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
}

/* Esta es la clase que activa el modal */
.modal.open {
    display: block !important;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 600px;
    margin: 5% auto;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-height: 80vh;
    overflow-y: auto;
}

/* Formulario */
        .container { max-width: 1000px; margin: 30px auto; background: white; padding: 25px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
        h2 { border-bottom: 2px solid #eee; padding-bottom: 10px; color: #1e293b; margin-top: 0; }

        .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 20px; }
        input { padding: 12px; border: 1px solid #ddd; border-radius: 6px; width: 100%; box-sizing: border-box; font-size: 1em; }
        input:focus { outline: none; border-color: #3b82f6; }
        
        button.btn-main { background: #2563eb; color: white; border: none; padding: 12px; border-radius: 6px; cursor: pointer; font-weight: bold; width: 100%; transition: 0.3s; }
        button.btn-main:hover { background: #1d4ed8; }

        /* Tabla */
        table { width: 100%; border-collapse: collapse; margin-top: 20px; }
        th { background: #f8f9fa; text-align: left; padding: 12px; border-bottom: 2px solid #ddd; color: #64748b; font-size: 0.85em; text-transform: uppercase; }
        td { padding: 12px; border-bottom: 1px solid #eee; vertical-align: middle; }
        
        /* Botones de acción */
        .btn-action { padding: 8px 12px; border: none; border-radius: 4px; cursor: pointer; font-size: 0.85em; font-weight: bold; }
        .btn-edit { background: #f59e0b; color: white; margin-right: 5px; }
        .btn-del { background: #dc2626; color: white; }
        
        .stock-ok { color: #16a34a; font-weight: bold; }
        .stock-low { color: #dc2626; font-weight: bold; background: #fee2e2; padding: 4px 8px; border-radius: 4px; display: inline-block; }

