/* =============================================
   GRUPO GP BMR - Estilos del sistema
   ============================================= */

:root {
    --gpbmr-primary: #1a5276;
    --gpbmr-primary-light: #2980b9;
    --gpbmr-accent: #27ae60;
    --gpbmr-warning: #f39c12;
    --gpbmr-danger: #e74c3c;
    --gpbmr-dark: #1c2833;
    --gpbmr-gray: #f4f6f9;
    --sidebar-width: 220px;
    --navbar-height: 56px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--gpbmr-gray);
    margin: 0;
    padding-top: var(--navbar-height);
}

/* Navbar */
.bg-gpbmr {
    background: linear-gradient(135deg, var(--gpbmr-primary), var(--gpbmr-primary-light)) !important;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.sidebar .nav-link {
    color: #adb5bd;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.sidebar .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
    border-left-color: var(--gpbmr-accent);
}

.sidebar .nav-link i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

/* Main content */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: calc(100vh - var(--navbar-height));
}

/* Cards de estadísticas */
.stat-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: white;
}

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--gpbmr-dark);
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #7f8c8d;
}

/* Cards generales */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.card-header {
    background: white;
    border-bottom: 1px solid #eee;
    border-radius: 12px 12px 0 0 !important;
    padding: 16px 20px;
}

/* Botones grandes para touch */
.btn-lg-touch {
    padding: 12px 24px;
    font-size: 1.1rem;
    border-radius: 10px;
}

/* Tabla responsive */
.table th {
    background: var(--gpbmr-gray);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #7f8c8d;
    border: none;
}

.table td {
    vertical-align: middle;
    padding: 12px;
}

/* Badges */
.badge-stock-ok { background: #d5f5e3; color: #1e8449; }
.badge-stock-low { background: #fdebd0; color: #d35400; }
.badge-stock-out { background: #fadbd8; color: #c0392b; }

/* Login page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gpbmr-primary) 0%, var(--gpbmr-primary-light) 100%);
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.login-card h2 {
    color: var(--gpbmr-primary);
    font-weight: 700;
}

.login-card .form-control {
    padding: 14px;
    font-size: 1rem;
    border-radius: 10px;
}

.login-card .btn-primary {
    padding: 14px;
    font-size: 1.1rem;
    border-radius: 10px;
    background: var(--gpbmr-primary);
    border-color: var(--gpbmr-primary);
}

/* Punto de venta */
.pos-product-btn {
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pos-product-btn:hover {
    border-color: var(--gpbmr-primary-light);
    background: #eaf2f8;
}

.pos-product-btn .product-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.pos-product-btn .product-price {
    color: var(--gpbmr-accent);
    font-weight: 700;
}

/* Cart */
.cart-table {
    font-size: 0.9rem;
}

.cart-total {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--gpbmr-primary);
}

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }
}

/* Overlay para sidebar en mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.sidebar-overlay.show {
    display: block;
}

/* Alert personalizado */
.alert-gpbmr {
    border-radius: 10px;
    border: none;
}

/* Input de búsqueda en ventas */
.search-input {
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid #e8e8e8;
}

.search-input:focus {
    border-color: var(--gpbmr-primary-light);
    box-shadow: 0 0 0 3px rgba(41,128,185,0.15);
}

/* Impresión (hoja de producción de fórmulas) */
@media print {
    .navbar, .sidebar, .sidebar-overlay, .no-print, #toast-container { display: none !important; }
    body { background: #fff; padding-top: 0 !important; }
    .main-content { margin-left: 0 !important; width: 100% !important; }
    .card { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; }
}
