/* assets/css/style.css */

:root {
    --primary-green: #00C853;
    --primary-dark: #2E7D32;
    --blue-transfer: #2962FF;
    --bg-light: #F4F7FC;
    --text-dark: #374151;
    --text-gray: #9CA3AF;
    --sidebar-width: 250px;
    --cart-width: 400px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-light);
    margin: 0;
    overflow: hidden;
    color: var(--text-dark);
}

/* --- LAYOUT PRINCIPAL --- */
.layout-container { display: flex; height: 100vh; width: 100vw; }

/* --- SIDEBAR IZQUIERDA --- */
.sidebar {
    width: var(--sidebar-width); background: white; border-right: 1px solid #e5e7eb;
    display: flex; flex-direction: column; padding: 20px; flex-shrink: 0; transition: all 0.3s ease;
}
.sidebar.collapsed { width: 80px; padding: 20px 10px; }
.sidebar.collapsed .brand span, .sidebar.collapsed .menu-item span, .sidebar.collapsed .logout span { display: none; opacity: 0; }
.sidebar.collapsed .menu-item { justify-content: center; }

/* AQUÍ ESTABA EL ERROR: Cambiado de 1.4rem a 1.1rem */
.sidebar.collapsed .menu-item i { margin: 0; font-size: 1.1rem; } 

.sidebar.collapsed .brand { justify-content: center; margin-bottom: 30px; }

.brand { display: flex; align-items: center; font-size: 1.5rem; font-weight: 800; color: var(--primary-green); margin-bottom: 40px; }
.brand span { color: #333; margin-left: 5px; }

.menu-item {
    display: flex; align-items: center; padding: 12px 15px; margin-bottom: 8px;
    color: var(--text-gray); text-decoration: none; border-radius: 8px; font-weight: 600; transition: 0.3s;
}
.menu-item i { width: 25px; font-size: 1.1rem; }
.menu-item.active { background-color: #E8F5E9; color: var(--primary-dark); }
.menu-item:hover:not(.active) { background-color: #f3f4f6; color: #333; }
.logout { margin-top: auto; color: #ef4444; }

/* --- CONTENIDO CENTRAL --- */
.main-content { flex: 1; display: flex; flex-direction: column; padding: 20px 30px; overflow-y: auto; transition: all 0.3s ease; }
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.btn-toggle-menu { background: none; border: none; font-size: 1.5rem; color: #555; cursor: pointer; margin-right: 15px; padding: 5px; }
.btn-toggle-menu:hover { color: var(--primary-green); }

/* BUSCADOR */
.search-bar {
    background: white; border-radius: 12px; padding: 15px 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    display: flex; align-items: center; border: 1px solid #e5e7eb; margin-bottom: 30px; 
}
.search-bar input { border: none; outline: none; width: 100%; font-size: 1rem; margin-left: 10px; }

/* --- ESTILOS ESPECÍFICOS PARA INVENTARIO (TABLAS) --- */
.table-container { 
    background: white; border-radius: 12px; padding: 0; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.02); overflow: hidden; 
}
table { width: 100%; border-collapse: collapse; }
th { 
    text-align: left; padding: 18px; background: #f8f9fa; 
    color: #666; font-weight: 600; font-size: 0.9rem; border-bottom: 2px solid #eee; 
}
td { padding: 15px 18px; border-bottom: 1px solid #eee; color: #333; font-size: 0.95rem; }
tr:hover { background-color: #f1f5f9; }

/* Botones de acción en tabla */
.btn-action { 
    border: none; background: #e0e7ff; color: #2962FF; 
    width: 35px; height: 35px; border-radius: 8px; cursor: pointer; transition: 0.2s; 
    margin-right: 5px;
}
.btn-action:hover { background: #2962FF; color: white; }
.btn-delete { background: #fee2e2; color: #ef4444; }
.btn-delete:hover { background: #ef4444; color: white; }

/* Botón Flotante (+) */
.btn-add-floating {
    position: fixed; bottom: 30px; right: 30px;
    background: var(--primary-green); color: white;
    width: 60px; height: 60px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; box-shadow: 0 4px 15px rgba(0, 200, 83, 0.4);
    border: none; cursor: pointer; transition: transform 0.2s; z-index: 100;
}
.btn-add-floating:hover { transform: scale(1.1); background: var(--primary-dark); }

/* --- ESTILOS POS (CAJA) --- */
.grid-productos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; padding-bottom: 20px; }
.card-producto { background: white; border-radius: 16px; padding: 20px; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; border: 1px solid transparent; }
.card-producto:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); border-color: var(--primary-green); }

.cat-badge { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--primary-green); margin-bottom: 5px; display: block; }
.prod-name { font-weight: 600; font-size: 1rem; margin-bottom: 15px; color: #1f2937; height: 40px; overflow: hidden; }
.prod-price { font-size: 1.4rem; font-weight: 800; color: #111; }
.prod-unit { font-size: 0.9rem; color: #888; font-weight: 400; }

/* CARRITO */
.cart-panel { width: var(--cart-width); background: white; border-left: 1px solid #e5e7eb; display: flex; flex-direction: column; padding: 25px; flex-shrink: 0; }
.cart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.cart-items-container { flex: 1; overflow-y: auto; border-bottom: 1px solid #eee; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: #9CA3AF; text-align: center; }
.empty-state i { font-size: 3rem; margin-bottom: 15px; opacity: 0.5; }

.cart-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px dashed #eee; }
.cart-footer { margin-top: 20px; }
.total-label { color: #666; font-size: 0.9rem; margin-bottom: 5px; }
.total-amount { font-size: 2.5rem; font-weight: 800; color: var(--primary-dark); text-align: right; margin-bottom: 20px; display: block; }

.btn-pay { width: 100%; padding: 15px; border: none; border-radius: 12px; font-size: 1rem; font-weight: 600; color: white; margin-bottom: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: 0.2s; }
.btn-cash { background-color: var(--primary-green); }
.btn-cash:hover { background-color: var(--primary-dark); }
.btn-transfer { background-color: var(--blue-transfer); }
.btn-transfer:hover { background-color: #1565C0; }

/* --- MODALES --- */
.modal-pos-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(2px);
    display: none; justify-content: center; align-items: center; z-index: 2000;
}
.modal-pos {
    background: white; width: 400px; padding: 25px; border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2); text-align: center; animation: slideUp 0.3s ease-out;
}
@keyframes slideUp { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-title { font-size: 1.2rem; font-weight: 700; color: #333; margin-bottom: 20px; }
.modal-display {
    background: #f3f4f6; font-size: 2.5rem; font-weight: 800; color: var(--primary-dark);
    padding: 15px; border-radius: 12px; margin-bottom: 20px; text-align: right; border: 1px solid #ddd; width: 100%; box-sizing: border-box;
}

/* Formularios en Modal (Inventario) */
.form-group { margin-bottom: 15px; text-align: left; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; color: #555; font-size: 0.9rem; }
.form-input { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 1rem; box-sizing: border-box; outline: none; }
.form-input:focus { border-color: var(--primary-green); }
.row-form { display: flex; gap: 15px; }

/* Teclado Numérico */
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.num-btn { background: white; border: 1px solid #e5e7eb; padding: 15px; font-size: 1.5rem; border-radius: 10px; cursor: pointer; transition: 0.1s; font-weight: 600; color: #374151; }
.num-btn:active { background-color: #e5e7eb; transform: scale(0.95); }
.num-btn.confirm { background-color: var(--primary-green); color: white; border: none; }
.num-btn.cancel { background-color: #ef4444; color: white; border: none; font-size: 1rem; }
.vuelto-display { background: #222; color: #00e676; padding: 10px; border-radius: 8px; font-size: 1.5rem; margin-top: 15px; font-weight: bold; display: none; }

/* --- ESTILOS CIERRE DE CAJA --- */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white; padding: 25px; border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03); border: 1px solid #e5e7eb;
    text-align: center; transition: 0.3s;
}
.stat-card:hover { transform: translateY(-3px); border-color: var(--primary-green); }

.stat-title { font-size: 0.9rem; color: #666; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 2.2rem; font-weight: 800; color: #333; margin: 10px 0; }
.stat-icon { font-size: 2.5rem; margin-bottom: 10px; opacity: 0.2; }

/* Colores específicos por tarjeta */
.card-total { border-bottom: 4px solid var(--primary-green); }
.card-cash { border-bottom: 4px solid #F57F17; } /* Naranja */
.card-transf { border-bottom: 4px solid var(--blue-transfer); }

/* Caja de Arqueo (Input gigante) */
.arqueo-section {
    background: white; padding: 30px; border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03); margin-bottom: 30px;
    text-align: center; border: 1px solid #e5e7eb;
}

.input-money {
    font-size: 3rem; font-weight: bold; text-align: center; color: #333;
    border: 2px solid #ddd; border-radius: 15px; padding: 10px; width: 100%; max-width: 400px;
    outline: none; background: #f9fafb; margin-top: 10px;
}
.input-money:focus { border-color: var(--primary-green); background: white; }

/* Caja de Resultado (Diferencia) */
.diff-box {
    margin-top: 20px; padding: 15px; border-radius: 10px;
    font-size: 1.2rem; font-weight: bold; display: none; /* Oculto por defecto */
}
.diff-perfect { background-color: #E8F5E9; color: #2E7D32; border: 1px solid #C8E6C9; }
.diff-error { background-color: #FFEBEE; color: #C62828; border: 1px solid #FFCDD2; }
.diff-surplus { background-color: #E3F2FD; color: #1565C0; border: 1px solid #BBDEFB; }