/* ============================================================
   SISTEMA DE GESTIÓN DE VENTAS DE MIEL - CSS NATIVO PURÍSIMO
   Sin Frameworks, Sin Importaciones Externas ni Dependencias de Red
   ============================================================ */

:root {
    --primary-color: #f59e0b;       /* Ámbar Miel */
    --primary-light: #fef3c7;       /* Crema Suave */
    --primary-hover: #d97706;
    --primary-dark: #b45309;
    --secondary-color: #451a03;     /* Caoba / Madera */
    --accent-color: #10b981;        /* Verde ARCA/AFIP */
    --accent-dark: #059669;
    --danger-color: #ef4444;        /* Rojo Alerta */
    --danger-light: #fee2e2;
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
    --sidebar-width: 260px;
    
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --touch-min-size: 48px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}


body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    display: flex;
    min-height: 100vh;
}

/* APP LAYOUT CON SIDEBAR LATERAL */
.app-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* SIDEBAR LATERAL PREMIUM */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #451a03 0%, #78350f 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 25px rgba(69, 26, 3, 0.2);
    padding: 24px 16px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 20px;
}

.sidebar-brand {
    font-size: 1.35rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.menu-item a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    transform: translateX(4px);
}

.menu-item.active a {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    box-shadow: var(--shadow-active);
    font-weight: 700;
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: var(--radius-md);
}

/* ÁREA PRINCIPAL DE CONTENIDO */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px 28px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* HEADER SUPERIOR EN MAIN CONTENT (MOBILE TOPBAR) */
.mobile-topbar {
    display: none;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.btn-toggle-sidebar {
    background: var(--primary-light);
    border: 1px solid #fde68a;
    color: var(--secondary-color);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* CARDS Y CONTENEDORES RESPONSIVE */
.grid-mobile {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 900px) {
    .grid-mobile {
        grid-template-columns: 1.8fr 1.2fr;
    }
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(226, 232, 240, 0.9);
    margin-bottom: 20px;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 18px;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    letter-spacing: -0.3px;
}

/* BOTONES PREMIUM */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--touch-min-size);
    padding: 12px 22px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 10px;
    box-shadow: var(--shadow-sm);
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    box-shadow: var(--shadow-active);
}
.btn-primary:hover { filter: brightness(1.05); }

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-excel {
    background: #166534;
    color: #ffffff;
}
.btn-pdf {
    background: #991b1b;
    color: #ffffff;
}

.btn-arca {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    font-size: 1.05rem;
    width: 100%;
}

.btn-interna {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: #ffffff;
    font-size: 1.05rem;
    width: 100%;
}

/* GRILLA DE PRODUCTOS */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

.product-card {
    background: linear-gradient(180deg, #ffffff 0%, #fffbeb 100%);
    border: 2px solid #fef3c7;
    border-radius: var(--radius-md);
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
}

.product-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 18px rgba(245, 158, 11, 0.15);
}

.product-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.product-price {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-top: 8px;
    background: #fff;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid #fde68a;
}

/* FORMULARIOS Y TABLAS DE REPORTES */
.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    min-height: var(--touch-min-size);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-color);
    font-size: 1rem;
    background-color: #fff;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
}

.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    text-align: left;
}

.data-table th {
    background: #f8fafc;
    padding: 14px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    border-bottom: 1.5px solid var(--border-color);
}

.data-table td {
    padding: 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.data-table tr:hover { background: #fafafa; }

/* CARRITO */
.cart-list { list-style: none; margin-bottom: 20px; }
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px dashed var(--border-color);
}
.cart-controls { display: flex; align-items: center; gap: 10px; }
.btn-qty {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid var(--border-color);
    background: #ffffff;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.alert-badge {
    padding: 10px 16px;
    border-radius: 30px;
    font-size: 0.88rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.kpi-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 18px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}
.kpi-value {
    font-size: 1.4rem;
    font-weight: 800;
    margin-top: 6px;
}

/* RESPONSIVE DESIGN FOR MOBILE DEVICES */
@media (max-width: 899px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    .mobile-topbar {
        display: flex;
    }
}
