/* 
    Sistema de Gestión de Inventario de Farmacia
    Estilos generales
*/

/* Variables y raíz */
:root {
    --primary-color: #2C3E50;
    --secondary-color: #27AE60;
    --danger-color: #E74C3C;
    --warning-color: #F39C12;
    --info-color: #3498DB;
    --light-color: #ECF0F1;
    --dark-color: #2C3E50;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 80px;
    --header-height: 60px;
    --transition-speed: 0.3s;
}


/* Estilos globales */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    min-height: 100vh;
    overflow-x: hidden;
    transition: padding-left var(--transition-speed) ease;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.wrapper {
    display: flex;
    min-height: 100vh;
}

#content.expanded {
    width: calc(100% - var(--sidebar-collapsed-width));
    margin-left: var(--sidebar-collapsed-width);
}


/* Navbar */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 5px var(--shadow-color);
    padding: 10px 20px;
    margin-bottom: 20px;
}

.page-title h4 {
    margin: 0;
    color: var(--primary-color);
}

.user-img-small {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
    background-color: #fff;
}

.user-dropdown .dropdown-menu {
    min-width: 200px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.content-wrapper {
    padding: 20px;
}

/* Tarjetas y componentes */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 6px var(--shadow-color);
    margin-bottom: 20px;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

.card-title {
    margin-bottom: 0;
    color: var(--primary-color);
}

.card-icon {
    font-size: 20px;
    margin-right: 10px;
    color: var(--secondary-color);
}

.dashboard-card {
            border-left: 4px solid Var(--primary-color);
            border-radius: 8px;
            transition: all 0.3s ease;
            box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
        }

.dashboard-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 0.5rem 1.5rem 0 rgba(58, 59, 69, 0.2);
        }

.dashboard-card .card-body {
    padding: 20px;
}

.activity-item {
            position: relative;
            padding-left: 2rem;
            border-left: 1px solid #e3e6f0;
            margin-bottom: 1.5rem;
        }
        
        .activity-item:last-child {
            margin-bottom: 0;
            border-left: 1px solid transparent;
        }
        
        .activity-item::before {
            content: "";
            position: absolute;
            left: -0.5rem;
            width: 1rem;
            height: 1rem;
            border-radius: 50%;
            background-color: var(--primary);
            top: 0.25rem;
        }
        
        .activity-item.sale::before { background-color: var(--success); }
        .activity-item.stock::before { background-color: var(--info); }
        .activity-item.report::before { background-color: var(--warning); }
        

        .stock-progress {
            height: 20px;
            border-radius: 4px;
            overflow: hidden;
        }
        
        .stock-progress .progress-bar {
            transition: width 0.6s ease;
        }
        .top-product-item {
            margin-bottom: 1rem;
        }
        
        .top-product-item:last-child {
            margin-bottom: 0;
        }

.dashboard-card .card-title {
    font-size: 14px;
    font-weight: 600;
    color: #777;
}

.text-right{
    text-align: center !important;
}

.progress-sm {
            height: 0.5rem;
        }

.card-value {
            font-size: 1.75rem;
            font-weight: 700;
        }

.chart-container {
            position: relative;
            height: 300px;
        }

.dashboard-card .card-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.dashboard-card .card-icon {
    font-size: 40px;
    opacity: 0.2;
    position: absolute;
    top: 15px;
    right: 15px;
}

.card-primary {
    border-left-color: var(--primary-color);
}

.card-success {
    border-left-color: var(--secondary-color);
}

.card-warning {
    border-left-color: var(--warning-color);
}

.card-danger {
    border-left-color: var(--danger-color);
}

/* Tablas */
.table-responsive {
    border-radius: 5px;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
    color: #333;
}

.table th {
    background-color: #f8f9fa;
    color: var(--primary-color);
    border-top: none;
    font-weight: 600;
}

.table td {
    vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Tablas responsivas para móvil */
@media only screen and (max-width: 767px) {
    .table-responsive-stack tr {
        display: flex;
        flex-direction: column;
        border-bottom: 3px solid #ddd;
        margin-bottom: 15px;
    }
    
    .table-responsive-stack td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
        display: block;
        text-align: right;
    }
    
    .table-responsive-stack td:last-child {
        border-bottom: none;
    }
    
    .table-responsive-stack .table-responsive-stack-thead {
        font-weight: 700;
        padding-right: 10px;
        text-align: left;
        position: absolute;
        top: 0;
        left: 0;
        width: 45%;
    }
    
    .table-responsive-stack th {
        display: none;
    }
}

/* Botones */
.btn {
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #1a252f;
    border-color: #1a252f;
    box-shadow: 0 4px 8px rgba(44, 62, 80, 0.2);
}

.btn-success {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-success:hover, .btn-success:focus {
    background-color: #219653;
    border-color: #219653;
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.2);
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-danger:hover, .btn-danger:focus {
    background-color: #c0392b;
    border-color: #c0392b;
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.2);
}

.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
    color: #fff;
}

.btn-warning:hover, .btn-warning:focus {
    background-color: #d35400;
    border-color: #d35400;
    box-shadow: 0 4px 8px rgba(243, 156, 18, 0.2);
    color: #fff;
}

.btn-outline-secondary {
    color: #6c757d;
    border-color: #6c757d;
}

.btn-outline-secondary:hover, .btn-outline-secondary:focus {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    text-align: center;
    line-height: 40px;
    border-radius: 50%;
}

.btn-rounded {
    border-radius: 50px;
    padding-left: 20px;
    padding-right: 20px;
}

.btn-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 24px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

/* Formularios */
.form-control {
    border-radius: 5px;
    border: 1px solid #ddd;
    font-size: 14px;
}

.form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(39, 174, 96, 0.25);
}

.custom-select {
    border-radius: 5px;
    border: 1px solid #ddd;
    font-size: 14px;
}

.input-group-text {
    background-color: #f8f9fa;
    border-color: #ddd;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 5px;
    color: #555;
}

.form-group {
    margin-bottom: 15px;
}

/* Paginación */
.pagination {
    margin-top: 20px;
    justify-content: center;
}

.page-item.active .page-link {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.page-link {
    color: var(--secondary-color);
}

.page-link:hover {
    color: #219653;
}

/* Alertas y badges */
.alert {
    border-radius: 5px;
}

.badge {
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 50px;
}

.badge-primary {
    background-color: var(--primary-color);
}

.badge-success {
    background-color: var(--secondary-color);
}

.badge-warning {
    background-color: var(--warning-color);
}

.badge-danger {
    background-color: var(--danger-color);
}

/* Utilidades */
.text-primary {
    color: var(--primary-color) !important;
}

.text-success {
    color: var(--secondary-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-muted {
    color: #6c757d !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-success {
    background-color: var(--secondary-color) !important;
}

.bg-warning {
    background-color: var(--warning-color) !important;
}

.bg-danger {
    background-color: var(--danger-color) !important;
}

.shadow-sm {
    box-shadow: 0 2px 4px var(--shadow-color) !important;
}

.shadow {
    box-shadow: 0 4px 8px var(--shadow-color) !important;
}

.shadow-lg {
    box-shadow: 0 8px 16px var(--shadow-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

.border-success {
    border-color: var(--secondary-color) !important;
}

.border-warning {
    border-color: var(--warning-color) !important;
}

.border-danger {
    border-color: var(--danger-color) !important;
}

/* Animaciones */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.5s ease-in-out;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}


@media (max-width: 767px) {
    .dashboard-card .card-value {
        font-size: 20px;
    }
    
    .dashboard-card .card-icon {
        font-size: 30px;
    }
    
    .btn-float {
        width: 50px;
        height: 50px;
        font-size: 20px;
        bottom: 20px;
        right: 20px;
    }
}

/* Utilidades adicionales */
.cursor-pointer {
    cursor: pointer;
}

.overflow-hidden {
    overflow: hidden;
}

.transition {
    transition: all var(--transition-speed) ease;
}

.hover-raise:hover {
    transform: translateY(-3px);
}

.hover-shadow:hover {
    box-shadow: 0 8px 15px var(--shadow-color);
}

/* Para pantallas pequeñas en móvil */
@media (max-width: 575px) {
    .container-fluid {
        padding-right: 10px;
        padding-left: 10px;
    }
    
    .card {
        border-radius: 8px;
    }
    
    .form-group label {
        font-size: 13px;
    }
}


/* ======================
   SIDEBAR PRINCIPAL (DESKTOP)
   ====================== */
#sidebar {
    width: var(--sidebar-width);
    transition: all var(--transition-speed) ease;
    background: var(--primary-color);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    box-shadow: 2px 0 10px var(--shadow-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Sidebar colapsado */
#sidebar.collapsed {
    width: var(--sidebar-collapsed-width) !important;
}

#sidebar.collapsed .sidebar-header h3,
#sidebar.collapsed .user-name,
#sidebar.collapsed .sidebar-menu span {
    display: none !important;
    opacity: 0;
    width: 0;
    height: 0;
    overflow: hidden;
    transition: all var(--transition-speed) ease;
}

#sidebar.collapsed .sidebar-menu li a {
    justify-content: center !important;
    padding: 12px 0 !important;
}

#sidebar.collapsed .sidebar-menu li a i {
    margin-right: 0;
    font-size: 1.3rem;
}

#sidebar.collapsed .user-info {
    justify-content: center;
    padding: 15px 0;
}

/* Encabezado del sidebar */
.sidebar-header {
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-width: var(--sidebar-collapsed-width);
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    white-space: nowrap;
    transition: opacity var(--transition-speed) ease;
}

/* Botón de toggle - Diseño mejorado */
.btn-sidebar-toggle {
    background: transparent;
    color: white;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
    flex-shrink: 0;
}

.btn-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-sidebar-toggle i {
    font-size: 1rem;
    transition: transform var(--transition-speed) ease;
}

#sidebar.collapsed .btn-sidebar-toggle i {
    transform: rotate(180deg) !important;
}

/* Información de usuario */
.user-info {
    padding: 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: padding var(--transition-speed) ease;
    min-width: var(--sidebar-collapsed-width);
}

.user-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
    background-color: #fff;
    flex-shrink: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    transition: opacity var(--transition-speed) ease;
    white-space: nowrap;
    overflow: hidden;
}

.user-name small {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    transition: opacity var(--transition-speed) ease;
}

/* Menú del sidebar */
.sidebar-menu {
    list-style: none;
    padding: 15px 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu li a {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all var(--transition-speed) ease;
    border-left: 3px solid transparent;
    white-space: nowrap;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-left: 3px solid var(--secondary-color);
}

.sidebar-menu li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: margin var(--transition-speed) ease;
}

.sidebar-menu li a span {
    transition: all var(--transition-speed) ease;
}

#sidebar.collapsed .sidebar-menu li a span {
    opacity: 0;
    width: 0;
    display: inline-block;
    overflow: hidden;
}

/* Ajustar contenido principal cuando el sidebar cambia */
.main-content {
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-speed) ease;
    width: calc(100% - var(--sidebar-width));
    padding-top: var(--header-height);
}

#sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

/* Estilos para la fecha de vencimiento */
.vencido {
    color: #dc3545;
    font-weight: bold;
}

.por-vencer {
    color: #ffc107;
    font-weight: bold;
}

/* ======================
   SIDEBAR MÓVIL (ESTILO MEJORADO)
   ====================== */
.top-bar-mobile {
    display: none;
    padding: 10px 15px;
    background: var(--primary-color);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    height: var(--header-height);
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 5px var(--shadow-color);
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: var(--primary-color);
    z-index: 1002;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    transition: left var(--transition-speed) ease;
    padding-bottom: 20px;
}

.mobile-sidebar.active {
    left: 0;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-speed) ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Botón de toggle móvil */
.btn-mobile-toggle {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
}

.btn-mobile-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-mobile-toggle i {
    font-size: 1.25rem;
}

.user-info-mobile {
    display: flex;
    align-items: center;
}

.user-info-mobile img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.user-info-mobile span {
    font-size: 14px;
    font-weight: 500;
}

/* Menú móvil */
.mobile-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-sidebar ul li a {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.mobile-sidebar ul li a:hover,
.mobile-sidebar ul li.active a {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-left: 3px solid var(--secondary-color);
}

.mobile-sidebar ul li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

/* Media Queries */
@media (max-width: 991px) {
    /* Vista móvil/tablet */
    .top-bar-mobile {
        display: flex;
    }
    
    #sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    body {
        padding-top: var(--header-height);
    }

    .mobile-sidebar {
        top: var(--header-height);
        height: calc(100vh - var(--header-height));
    }
    
    .sidebar-overlay {
        top: var(--header-height);
    }
    
    body.sidebar-open {
        overflow: hidden;
    }
}

@media (min-width: 992px) {
    /* Vista desktop */
    .mobile-sidebar,
    .sidebar-overlay,
    .top-bar-mobile {
        display: none !important;
    }
    
    #sidebar {
        display: flex;
    }
    
    #sidebar.collapsed .sidebar-menu li a {
        justify-content: center;
    }
    
    #sidebar.collapsed .sidebar-menu li a i {
        margin-right: 0;
    }
}

/* ======================
   NAVBAR SUPERIOR
   ====================== */
.navbar {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 900;
    background-color: #fff;
    box-shadow: 0 2px 5px var(--shadow-color);
    height: var(--header-height);

    left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    transition: left var(--transition-speed) ease, width var(--transition-speed) ease;
}

#sidebar.collapsed + #content .navbar {
    left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

.page-title h4 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--primary-color);
}


/* Ajustes para el navbar */
.navbar {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    z-index: 900;
    transition: left var(--transition-speed) ease;
}

#sidebar.collapsed + .navbar {
    left: var(--sidebar-collapsed-width);
}

.page-title h4 {
    margin: 0;
    font-size: 1.25rem;
}

/* ======================
   PAGINA PRODUCTOS
   ====================== */
/* Estilos base para todos los dispositivos */
.product-status {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
}

.status-inactive {
    background-color: #e2e3e5;
    color: #383d41;
}

.status-out-of-stock {
    background-color: #f8d7da;
    color: #721c24;
}

.status-bajo_stock {
    background-color: rgb(248, 246, 215);
    color: #856404;
    font-weight: bold;
}

.stock-low {
    color: rgb(203, 206, 17);
    font-weight: bold;
}

.stock-out {
    color: #721c24;
    font-weight: bold;
}

/* Mejoras para la tabla */
.table-responsive {
    min-height: 300px;
    overflow-x: auto;
}

.description-cell {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Búsqueda mejorada */
.search-container {
    position: relative;
}

.search-icon {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #6c757d;
}

.search-input {
    padding-left: 35px;
}

/* Efectos hover para filas */
.product-list-item:hover {
    background-color: #f8f9fa;
    transition: background-color 0.2s;
}

/* Estilos responsive para móviles */
@media (max-width: 767.98px) {
    /* Ocultar sidebar y ajustar contenido principal */
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .container-fluid {
        padding: 1rem;
    }
    
    /* Ajustes para filtros y pestañas */
    .card-body .row {
        flex-direction: column;
    }
    
    .card-body .col-md-6 {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .nav-pills {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
        overflow-x: visible;
        white-space: normal;
        padding-bottom: 0;
    }
    
    .nav-item {
        display: block;
        float: none;
        margin: 0;
    }
    .nav-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 0.75rem 0.5rem;
        border-radius: 0.5rem;
        background-color: #f8f9fa;
        color: #495057;
        border: 1px solid #dee2e6;
        height: 100%;
    }

    .nav-link.active {
        background-color: #007bff;
        color: white;
        border-color: #007bff;
    }
    
    .nav-link .badge {
        margin-top: 0.25rem;
        background-color: white;
        color: inherit;
        font-size: 0.9em;
    }
    
    .nav-link.active .badge {
        background-color: rgba(255,255,255,0.2);
        color: white;
    }
    
    /* Ajustar el tamaño de los textos */
    .nav-link {
        font-size: 0.8rem;
    }
    
    /* Asegurar que no haya scroll horizontal */
    #estadoTabs {
        overflow-x: hidden;
    }
    
    /* Estilos para la tabla en móvil */
    table {
        width: 100%;
        border-collapse: collapse;
    }
    
    table thead {
        display: none;
    }
    
    table tr {
        display: block;
        margin-bottom: 1.5rem;
        border: 1px solid #dee2e6;
        border-radius: 0.5rem;
        padding: 0.75rem 1rem; /* Reducir padding vertical */
        background: #fff;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    
    table td {
        
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border-bottom: 1px solid #f0f0f0;
        font-size: 0.9rem;
    }
    
    table td:last-child {
        border-bottom: none;
    }
    
    table td:before {
        content: attr(data-label);
        font-weight: 600;
        color: #495057;
        margin-right: 1rem;
        flex: 0 0 100px;
        text-align: left;
        font-size: 0.85rem;
    }
    
    table td > *:not(:before) {
        flex: 1;
        text-align: right;
    }
    
    /* Estilo especial para el campo Nombre/Código */
    table td:nth-of-type(1) {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
        padding: 0.5rem 0 0; /* Reducir espacio superior */
    }
    
    table td:nth-of-type(1):before {
        display: none; /* Oculta el texto "Producto" */
        content: none; /* Elimina el contenido generado */
    }
    
    table td:nth-of-type(1) .font-weight-bold {
        display: flex;
        justify-content: space-between;
        font-size: 1rem;
        line-height: 1.2;
    }
    
    table td:nth-of-type(1) .font-weight-bold:before {
        font-weight: 600;
        color: #495057;
        margin-right: 1rem;
    }
    
    table td:nth-of-type(1) small {
        display: flex;
        justify-content: space-between;
        font-size: 0.8rem;
        color: #6c757d;
        margin-top: 0;
    }
    
    table td:nth-of-type(1) small:before {
        font-weight: 600;
        color: #495057;
        margin-right: 1rem;
    }
    
    /* Ajustes para la descripción */
    
    table td:nth-of-type(2) {
        white-space: normal;
        word-break: break-word;
        text-overflow: clip;
        overflow: visible;
        max-width: 100%;
    }
    
    /* Ajustes para los botones de acción */
    table td:last-child .btn-group {
        display: flex;
        justify-content: flex-end;
        width: 100%;
    }

    
    /* Tabla de PRODUCTOS */
    .table-productos td:nth-of-type(1):before { content: none; }
    .table-productos td:nth-of-type(1) .font-weight-bold:before { content: "Nombre"; }
    .table-productos td:nth-of-type(1) small:before { content: "Código"; }
    .table-productos td:nth-of-type(2):before { content: "Descripción"; }
    .table-productos td:nth-of-type(3):before { content: "Categoría"; }
    .table-productos td:nth-of-type(4):before { content: "Precio Compra"; }
    .table-productos td:nth-of-type(5):before { content: "Precio Venta"; }
    .table-productos td:nth-of-type(6):before { content: "Stock disponible"; }
    .table-productos td:nth-of-type(7):before { content: "Vencimiento"; }
    .table-productos td:nth-of-type(8):before { content: "Estado"; }
    .table-productos td:nth-of-type(9):before { content: "Mayoreo"; }
    .table-productos td:nth-of-type(10):before { content: "Acciones"; }

    /* Tabla de PERFIL */
    .table-perfil td:nth-of-type(1).font-weight-bold:before  { content: "Boleta"; }
    .table-perfil td:nth-of-type(2):before { content: "Fecha"; }
    .table-perfil td:nth-of-type(3):before { content: "Total"; }
    .table-perfil td:nth-of-type(4):before { content: "Método pago"; }
    .table-perfil td:nth-of-type(5):before { content: "Acciones"; }


     /* Tabla de SUGERENCIAS */
    .table-sugerencias td:nth-of-type(1) .font-weight-bold:before { content: "Producto Sugerido"; }
    .table-sugerencias td:nth-of-type(2):before { content: "Descripción"; }
    .table-sugerencias td:nth-of-type(3):before { content: "Usuario"; }
    .table-sugerencias td:nth-of-type(4):before { content: "Fecha"; }
    .table-sugerencias td:nth-of-type(5):before { content: "Estado"; }
    .table-sugerencias td:nth-of-type(5):before { content: "Acciones"; }
    
    
    
    /* Estilos para la tabla de CATEGORÍAS */
    .table-categorias td:nth-of-type(1) .font-weight-bold:before { content: "Nombre"; }
    .table-categorias td:nth-of-type(2):before { content: "Descripción"; }
    .table-categorias td:nth-of-type(3):before { content: "Productos"; }
    .table-categorias td:nth-of-type(4):before { content: "Estado"; }
    .table-categorias td:nth-of-type(5):before { content: "Acciones"; }

     /* Tabla de PROVEEDORES */
    .table-proveedores td:nth-of-type(1).font-weight-bold:before  { content: "Nombre"; }
    .table-proveedores td:nth-of-type(2):before { content: "Contacto"; }
    .table-proveedores td:nth-of-type(3):before { content: "Teléfono"; }
    .table-proveedores td:nth-of-type(4):before { content: "Correo"; }
    .table-proveedores td:nth-of-type(5):before { content: "Estado"; }
    .table-proveedores td:nth-of-type(6):before { content: "Acciones"; }

    /* Tabla de USUARIOS */
    .table-usuarios td:nth-of-type(1).font-weight-bold:before  { content: "Foto"; }
    .table-usuarios td:nth-of-type(2):before { content: "Nombre"; }
    .table-usuarios td:nth-of-type(3):before { content: "Usuario"; }
    .table-usuarios td:nth-of-type(4):before { content: "Correo"; }
    .table-usuarios td:nth-of-type(5):before { content: "Rol"; }
    .table-usuarios td:nth-of-type(6):before { content: "Estado"; }
    .table-usuarios td:nth-of-type(7):before { content: "Acciones"; }
    
    /* Tabla de REPORTES - Productos con stock bajo */
    .table-reporte-stock td:nth-of-type(1).font-weight-bold:before  { content: "#"; }
    .table-reporte-stock td:nth-of-type(2):before { content: "Producto"; }
    .table-reporte-stock td:nth-of-type(3):before { content: "Código"; }
    .table-reporte-stock td:nth-of-type(4):before { content: "Stock Actual"; }
    .table-reporte-stock td:nth-of-type(5):before { content: "Stock Máximo"; }
    .table-reporte-stock td:nth-of-type(6):before { content: "%"; }
    
    /* Tabla de REPORTES - Productos agotados */
    .table-reporte-agotados td:nth-of-type(1).font-weight-bold:before  { content: "#"; }
    .table-reporte-agotados td:nth-of-type(2):before { content: "Producto"; }
    .table-reporte-agotados td:nth-of-type(3):before { content: "Código"; }
    .table-reporte-agotados td:nth-of-type(4):before { content: "Precio Compra"; }
    .table-reporte-agotados td:nth-of-type(5):before { content: "Precio Venta"; }
    .table-reporte-agotados td:nth-of-type(6):before { content: "Estado"; }
    
    /* Tabla de REPORTES - Productos por vencer */
    .table-reporte-vencimiento td:nth-of-type(1).font-weight-bold:before  { content: "#"; }
    .table-reporte-vencimiento td:nth-of-type(2):before { content: "Producto"; }
    .table-reporte-vencimiento td:nth-of-type(3):before { content: "Código"; }
    .table-reporte-vencimiento td:nth-of-type(4):before { content: "Stock"; }
    .table-reporte-vencimiento td:nth-of-type(5):before { content: "Fecha Vencimiento"; }
    .table-reporte-vencimiento td:nth-of-type(6):before { content: "Días Restantes"; }
    .table-reporte-vencimiento td:nth-of-type(7):before { content: "Estado"; }

    /* Tabla de REPORTES - Sugerencias de nuevos productos */
    .table-reporte-sugerencia td:nth-of-type(1).font-weight-bold:before  { content: "#"; }
    .table-reporte-sugerencia td:nth-of-type(2):before { content: "Producto sugerido"; }
    .table-reporte-sugerencia td:nth-of-type(3):before { content: "Descripción"; }
    .table-reporte-sugerencia td:nth-of-type(4):before { content: "Sugerido por"; }
    .table-reporte-sugerencia td:nth-of-type(5):before { content: "Fecha"; }
    .table-reporte-sugerencia td:nth-of-type(6):before { content: "Estado"; }
    
    /* Tabla de REPORTES - Inventario completo */
    .table-reporte-inventario td:nth-of-type(1).font-weight-bold:before  { content: "#"; }
    .table-reporte-inventario td:nth-of-type(2):before { content: "Producto"; }
    .table-reporte-inventario td:nth-of-type(3):before { content: "Código"; }
    .table-reporte-inventario td:nth-of-type(4):before { content: "Precio Compra"; }
    .table-reporte-inventario td:nth-of-type(5):before { content: "Precio Venta"; }
    .table-reporte-inventario td:nth-of-type(6):before { content: "Stock"; }
    .table-reporte-inventario td:nth-of-type(7):before { content: "Estado"; }
    
    /* Tabla de REPORTES - Ventas */  
    .table-reporte-ventas td:nth-of-type(1) .font-weight-bold:before { content: "N° Boleta"; }
    .table-reporte-ventas td:nth-of-type(2):before { content: "Fecha"; }
    .table-reporte-ventas td:nth-of-type(3):before { content: "Vendedor"; }
    .table-reporte-ventas td:nth-of-type(4):before { content: "Método Pago"; }
    .table-reporte-ventas td:nth-of-type(5):before { content: "Total"; }
    .table-reporte-ventas td:nth-of-type(6):before { content: "Estado"; }
    .table-reporte-ventas td:nth-of-type(7):before { content: "Acciones"; }
    .table-reporte-ventas tfoot td:nth-of-type(2):before { content: "Total paginacion: ";font-weight: bold;}
    .table-reporte-ventas tfoot td:nth-of-type(3):before { display: none;}

}


/* Estilos para tablet (768px - 991px) - Versión corregida */
@media (min-width: 768px) and (max-width: 991.98px) {
/* Ocultar sidebar y ajustar contenido principal */
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .container-fluid {
        padding: 1rem;
    }
    
    /* Ajustes para filtros y pestañas */
    .card-body .row {
        flex-direction: column;
    }
    
    .card-body .col-md-6 {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .nav-pills {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
        overflow-x: visible;
        white-space: normal;
        padding-bottom: 0;
    }
    
    .nav-item {
        display: block;
        float: none;
        margin: 0;
    }
    .nav-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 0.75rem 0.5rem;
        border-radius: 0.5rem;
        background-color: #f8f9fa;
        color: #495057;
        border: 1px solid #dee2e6;
        height: 100%;
    }

    .nav-link.active {
        background-color: #007bff;
        color: white;
        border-color: #007bff;
    }
    
    .nav-link .badge {
        margin-top: 0.25rem;
        background-color: white;
        color: inherit;
        font-size: 0.9em;
    }
    
    .nav-link.active .badge {
        background-color: rgba(255,255,255,0.2);
        color: white;
    }
    
    /* Ajustar el tamaño de los textos */
    .nav-link {
        font-size: 0.8rem;
    }
    
    /* Asegurar que no haya scroll horizontal */
    #estadoTabs {
        overflow-x: hidden;
    }
    
    /* Estilos para la tabla en móvil */
    table {
        width: 100%;
        border-collapse: collapse;
    }
    
    table thead {
        display: none;
    }
    
    table tr {
        display: block;
        margin-bottom: 1.5rem;
        border: 1px solid #dee2e6;
        border-radius: 0.5rem;
        padding: 0.75rem 1rem; /* Reducir padding vertical */
        background: #fff;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    
    table td {
        
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border-bottom: 1px solid #f0f0f0;
        font-size: 0.9rem;
    }
    
    table td:last-child {
        border-bottom: none;
    }
    
    table td:before {
        content: attr(data-label);
        font-weight: 600;
        color: #495057;
        margin-right: 1rem;
        flex: 0 0 100px;
        text-align: left;
        font-size: 0.85rem;
    }
    
    table td > *:not(:before) {
        flex: 1;
        text-align: right;
    }
    
    /* Estilo especial para el campo Nombre/Código */
    table td:nth-of-type(1) {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
        padding: 0.5rem 0 0; /* Reducir espacio superior */
    }
    
    table td:nth-of-type(1):before {
        display: none; /* Oculta el texto "Producto" */
        content: none; /* Elimina el contenido generado */
    }
    
    table td:nth-of-type(1) .font-weight-bold {
        display: flex;
        justify-content: space-between;
        font-size: 1rem;
        line-height: 1.2;
    }
    
    table td:nth-of-type(1) .font-weight-bold:before {
        font-weight: 600;
        color: #495057;
        margin-right: 1rem;
    }
    
    table td:nth-of-type(1) small {
        display: flex;
        justify-content: space-between;
        font-size: 0.8rem;
        color: #6c757d;
        margin-top: 0;
    }
    
    table td:nth-of-type(1) small:before {
        font-weight: 600;
        color: #495057;
        margin-right: 1rem;}
    
    
    table td:nth-of-type(2) {
        white-space: normal;
        word-break: break-word;
        text-overflow: clip;
        overflow: visible;
        max-width: 100%;
    }
    
    /* Ajustes para los botones de acción */
    table td:last-child .btn-group {
        display: flex;
        justify-content: flex-end;
        width: 100%;
    }

    /* Tabla de PRODUCTOS */
    .table-productos td:nth-of-type(1):before { content: none; }
    .table-productos td:nth-of-type(1) .font-weight-bold:before { content: "Nombre"; }
    .table-productos td:nth-of-type(1) small:before { content: "Código"; }
    .table-productos td:nth-of-type(2):before { content: "Descripción"; }
    .table-productos td:nth-of-type(3):before { content: "Categoría"; }
    .table-productos td:nth-of-type(4):before { content: "Precio Compra"; }
    .table-productos td:nth-of-type(5):before { content: "Precio Venta"; }
    .table-productos td:nth-of-type(6):before { content: "Stock disponible"; }
    .table-productos td:nth-of-type(7):before { content: "Vencimiento"; }
    .table-productos td:nth-of-type(8):before { content: "Estado"; }
    .table-productos td:nth-of-type(9):before { content: "Mayoreo"; }
    .table-productos td:nth-of-type(10):before { content: "Acciones"; }

    /* Tabla de PERFIL */
    .table-perfil td:nth-of-type(1).font-weight-bold:before  { content: "Boleta"; }
    .table-perfil td:nth-of-type(2):before { content: "Fecha"; }
    .table-perfil td:nth-of-type(3):before { content: "Total"; }
    .table-perfil td:nth-of-type(4):before { content: "Método pago"; }
    .table-perfil td:nth-of-type(5):before { content: "Acciones"; }


     /* Tabla de SUGERENCIAS */
    .table-sugerencias td:nth-of-type(1) .font-weight-bold:before { content: "Producto Sugerido"; }
    .table-sugerencias td:nth-of-type(2):before { content: "Descripción"; }
    .table-sugerencias td:nth-of-type(3):before { content: "Usuario"; }
    .table-sugerencias td:nth-of-type(4):before { content: "Fecha"; }
    .table-sugerencias td:nth-of-type(5):before { content: "Estado"; }
    .table-sugerencias td:nth-of-type(5):before { content: "Acciones"; }
    
    
    
    /* Estilos para la tabla de CATEGORÍAS */
    .table-categorias td:nth-of-type(1) .font-weight-bold:before { content: "Nombre"; }
    .table-categorias td:nth-of-type(2):before { content: "Descripción"; }
    .table-categorias td:nth-of-type(3):before { content: "Productos"; }
    .table-categorias td:nth-of-type(4):before { content: "Estado"; }
    .table-categorias td:nth-of-type(5):before { content: "Acciones"; }

     /* Tabla de PROVEEDORES */
    .table-proveedores td:nth-of-type(1).font-weight-bold:before  { content: "Nombre"; }
    .table-proveedores td:nth-of-type(2):before { content: "Contacto"; }
    .table-proveedores td:nth-of-type(3):before { content: "Teléfono"; }
    .table-proveedores td:nth-of-type(4):before { content: "Correo"; }
    .table-proveedores td:nth-of-type(5):before { content: "Estado"; }
    .table-proveedores td:nth-of-type(6):before { content: "Acciones"; }

    /* Tabla de USUARIOS */
    .table-usuarios td:nth-of-type(1).font-weight-bold:before  { content: "Foto"; }
    .table-usuarios td:nth-of-type(2):before { content: "Nombre"; }
    .table-usuarios td:nth-of-type(3):before { content: "Usuario"; }
    .table-usuarios td:nth-of-type(4):before { content: "Correo"; }
    .table-usuarios td:nth-of-type(5):before { content: "Rol"; }
    .table-usuarios td:nth-of-type(6):before { content: "Estado"; }
    .table-usuarios td:nth-of-type(7):before { content: "Acciones"; }
    
    /* Tabla de REPORTES - Productos con stock bajo */
    .table-reporte-stock td:nth-of-type(1).font-weight-bold:before  { content: "#"; }
    .table-reporte-stock td:nth-of-type(2):before { content: "Producto"; }
    .table-reporte-stock td:nth-of-type(3):before { content: "Código"; }
    .table-reporte-stock td:nth-of-type(4):before { content: "Stock Actual"; }
    .table-reporte-stock td:nth-of-type(5):before { content: "Stock Máximo"; }
    .table-reporte-stock td:nth-of-type(6):before { content: "%"; }
    
    /* Tabla de REPORTES - Productos agotados */
    .table-reporte-agotados td:nth-of-type(1).font-weight-bold:before  { content: "#"; }
    .table-reporte-agotados td:nth-of-type(2):before { content: "Producto"; }
    .table-reporte-agotados td:nth-of-type(3):before { content: "Código"; }
    .table-reporte-agotados td:nth-of-type(4):before { content: "Precio Compra"; }
    .table-reporte-agotados td:nth-of-type(5):before { content: "Precio Venta"; }
    .table-reporte-agotados td:nth-of-type(6):before { content: "Estado"; }
    
    /* Tabla de REPORTES - Productos por vencer */
    .table-reporte-vencimiento td:nth-of-type(1).font-weight-bold:before  { content: "#"; }
    .table-reporte-vencimiento td:nth-of-type(2):before { content: "Producto"; }
    .table-reporte-vencimiento td:nth-of-type(3):before { content: "Código"; }
    .table-reporte-vencimiento td:nth-of-type(4):before { content: "Stock"; }
    .table-reporte-vencimiento td:nth-of-type(5):before { content: "Fecha Vencimiento"; }
    .table-reporte-vencimiento td:nth-of-type(6):before { content: "Días Restantes"; }
    .table-reporte-vencimiento td:nth-of-type(7):before { content: "Estado"; }

    /* Tabla de REPORTES - Sugerencias de nuevos productos */
    .table-reporte-sugerencia td:nth-of-type(1).font-weight-bold:before  { content: "#"; }
    .table-reporte-sugerencia td:nth-of-type(2):before { content: "Producto sugerido"; }
    .table-reporte-sugerencia td:nth-of-type(3):before { content: "Descripción"; }
    .table-reporte-sugerencia td:nth-of-type(4):before { content: "Sugerido por"; }
    .table-reporte-sugerencia td:nth-of-type(5):before { content: "Fecha"; }
    .table-reporte-sugerencia td:nth-of-type(6):before { content: "Estado"; }
    
    /* Tabla de REPORTES - Inventario completo */
    .table-reporte-inventario td:nth-of-type(1).font-weight-bold:before  { content: "#"; }
    .table-reporte-inventario td:nth-of-type(2):before { content: "Producto"; }
    .table-reporte-inventario td:nth-of-type(3):before { content: "Código"; }
    .table-reporte-inventario td:nth-of-type(4):before { content: "Precio Compra"; }
    .table-reporte-inventario td:nth-of-type(5):before { content: "Precio Venta"; }
    .table-reporte-inventario td:nth-of-type(6):before { content: "Stock"; }
    .table-reporte-inventario td:nth-of-type(7):before { content: "Estado"; }
    
    /* Tabla de REPORTES - Ventas */  
    .table-reporte-ventas td:nth-of-type(1) .font-weight-bold:before { content: "N° Boleta"; }
    .table-reporte-ventas td:nth-of-type(2):before { content: "Fecha"; }
    .table-reporte-ventas td:nth-of-type(3):before { content: "Vendedor"; }
    .table-reporte-ventas td:nth-of-type(4):before { content: "Método Pago"; }
    .table-reporte-ventas td:nth-of-type(5):before { content: "Total"; }
    .table-reporte-ventas td:nth-of-type(6):before { content: "Estado"; }
    .table-reporte-ventas td:nth-of-type(7):before { content: "Acciones"; }
    .table-reporte-ventas tfoot td:nth-of-type(2):before { content: "Total paginacion: ";font-weight: bold;}
    .table-reporte-ventas tfoot td:nth-of-type(3):before { display: none;}

}


/* Estilos para PC */
@media (min-width: 992px) {
    /* Restaurar el ancho completo del sidebar */
    .sidebar {
        width: 250px;
    }
    
    .main-content {
        margin-left: 250px;
    }
    
    /* Asegurar que la tabla ocupe todo el ancho */
    table {
        width: 100%;
    }
}