/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    /* Colores tema claro */
    --primary-color: #7c3aed;
    --primary-light: #a78bfa;
    --primary-dark: #5b21b6;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    --bg-color: #f8fafc;
    --sidebar-bg: #1e293b;
    --card-bg: #ffffff;
    --text-color: #334155;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    
    /* Transición para cambio de tema */
    --transition: all 0.3s ease;
}

/* Tema oscuro */
.dark-theme {
    --primary-color: #8b5cf6;
    --primary-light: #a78bfa;
    --primary-dark: #6d28d9;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    --bg-color: #0f172a;
    --sidebar-bg: #1e293b;
    --card-bg: #1e293b;
    --text-color: #e2e8f0;
    --text-light: #94a3b8;
    --border-color: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: var(--transition);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    z-index: 100;
    box-shadow: var(--shadow);
}

.logo {
    display: flex;
    align-items: center;
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo i {
    font-size: 28px;
    color: var(--primary-light);
    margin-right: 12px;
}

.logo h2 {
    font-size: 18px;
    font-weight: 700;
}

.nav-menu {
    flex: 1;
    padding: 20px 0;
}

.nav-menu ul {
    list-style: none;
}

.nav-menu li {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    margin: 4px 0;
}

.nav-menu li:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-menu li.active {
    background-color: rgba(124, 58, 237, 0.2);
    border-left: 4px solid var(--primary-color);
    color: var(--primary-light);
}

.nav-menu li i {
    font-size: 18px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.nav-menu li span {
    font-size: 15px;
    font-weight: 500;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.theme-switch i {
    font-size: 18px;
    color: #e2e8f0;
}

.theme-switch .fa-sun {
    margin-right: 12px;
}

.theme-switch .fa-moon {
    margin-left: 12px;
}

.switch-container {
    position: relative;
    display: inline-block;
}

.switch-container input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    background-color: #475569;
    border-radius: 24px;
    cursor: pointer;
    transition: var(--transition);
}

.switch:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: var(--transition);
}

input:checked + .switch {
    background-color: var(--primary-color);
}

input:checked + .switch:before {
    transform: translateX(26px);
}

.version {
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
}

/* Contenido Principal */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-color);
    cursor: pointer;
    margin-right: 16px;
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notification {
    position: relative;
    cursor: pointer;
}

.notification i {
    font-size: 22px;
    color: var(--text-light);
}

.notification .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--danger-color);
    color: white;
    font-size: 12px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 15px;
}

.user-role {
    font-size: 13px;
    color: var(--text-light);
}

.user-profile i {
    color: var(--text-light);
}

/* Contenido del Módulo */
.module-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.module {
    display: none;
}

.module.active {
    display: block;
}

/* Dashboard */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
}

.stat-icon i {
    font-size: 28px;
    color: white;
}

.stat-info h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 4px;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-change {
    font-size: 13px;
    color: var(--text-light);
}

.stat-change .fa-arrow-up {
    color: var(--secondary-color);
}

.stat-change .fa-arrow-down {
    color: var(--danger-color);
}

.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.chart-container {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.chart-container h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

.chart-placeholder {
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-placeholder canvas {
    width: 100% !important;
    height: 100% !important;
}

.recent-activity {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.recent-activity h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
}

.activity-icon.success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--secondary-color);
}

.activity-icon.warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.activity-icon.info {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
}

.activity-details {
    flex: 1;
}

.activity-details p {
    font-weight: 500;
    margin-bottom: 4px;
}

.activity-time {
    font-size: 13px;
    color: var(--text-light);
}

.activity-amount {
    font-weight: 600;
    font-size: 16px;
}

/* Inventario */
.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.module-header h2 {
    font-size: 24px;
    font-weight: 700;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.module-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.search-bar {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-bar i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.search-bar input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-color);
    font-size: 15px;
    transition: var(--transition);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-options select {
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-color);
    font-size: 14px;
    cursor: pointer;
    min-width: 180px;
}

.filter-options select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.table-container {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background-color: rgba(124, 58, 237, 0.05);
}

.data-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:hover {
    background-color: rgba(124, 58, 237, 0.03);
}

.product-cell {
    display: flex;
    align-items: center;
}

.product-image {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.product-image i {
    color: white;
    font-size: 18px;
}

.product-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.product-sku {
    font-size: 12px;
    color: var(--text-light);
}

.stock-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stock-number {
    font-weight: 600;
    width: 30px;
}

.stock-bar {
    flex: 1;
    height: 6px;
    background-color: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    min-width: 80px;
}

.stock-level {
    height: 100%;
}

.stock-level.high {
    background-color: var(--secondary-color);
    width: 80%;
}

.stock-level.medium {
    background-color: var(--warning-color);
    width: 50%;
}

.stock-level.low {
    background-color: var(--danger-color);
    width: 30%;
}

.stock-level.critical {
    background-color: var(--danger-color);
    width: 15%;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
}

.status-badge.active {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--secondary-color);
}

.status-badge.warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.status-badge.error {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon.edit {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
}

.btn-icon.edit:hover {
    background-color: rgba(59, 130, 246, 0.2);
}

.btn-icon.delete {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.btn-icon.delete:hover {
    background-color: rgba(239, 68, 68, 0.2);
}

.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.pagination {
    display: flex;
    gap: 8px;
}

.pagination-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
}

.pagination-btn:hover {
    border-color: var(--primary-color);
}

.pagination-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.records-info {
    font-size: 14px;
    color: var(--text-light);
}

/* Facturación */
.billing-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
}

.billing-left {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.customer-info, .products-selection {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.customer-info h3, .products-selection h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-light);
}

.form-group input {
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 15px;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.products-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: var(--transition);
}

.product-item:hover {
    border-color: var(--primary-color);
}

.product-item-info {
    display: flex;
    align-items: center;
}

.product-image-small {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.product-image-small i {
    color: white;
    font-size: 16px;
}

.product-price {
    font-size: 14px;
    color: var(--text-light);
}

.product-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-quantity {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
}

.btn-quantity:hover {
    border-color: var(--primary-color);
}

.quantity-input {
    width: 50px;
    height: 32px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-color);
    color: var(--text-color);
}

.btn-add {
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-add:hover {
    background-color: var(--primary-dark);
}

.billing-right {
    position: sticky;
    top: 24px;
    align-self: start;
}

.invoice-summary {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.invoice-summary h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

.invoice-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.invoice-number span, .invoice-date span {
    font-size: 14px;
    color: var(--text-light);
    display: block;
}

.invoice-number strong, .invoice-date strong {
    font-size: 18px;
}

.invoice-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.invoice-item-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.invoice-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-color);
}

.item-name {
    display: flex;
    flex-direction: column;
}

.item-name small {
    font-size: 12px;
    color: var(--text-light);
}

.item-quantity, .item-total {
    text-align: center;
    font-weight: 500;
}

.invoice-totals {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 16px;
    border-top: 2px solid var(--border-color);
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 15px;
}

.total-row.grand-total {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.payment-methods h4 {
    font-size: 16px;
}

.payment-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.payment-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.payment-option input {
    display: none;
}

.payment-option:has(input:checked) {
    border-color: var(--primary-color);
    background-color: rgba(124, 58, 237, 0.05);
}

.payment-icon {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text-light);
}

.payment-option:has(input:checked) .payment-icon {
    color: var(--primary-color);
}

.cash-payment {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cash-payment label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
}

.cash-payment input {
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 16px;
    font-weight: 600;
}

.cash-change {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    color: var(--secondary-color);
}

.invoice-actions {
    display: flex;
    gap: 12px;
}

.btn-secondary {
    flex: 1;
    padding: 12px;
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-secondary:hover {
    background-color: rgba(124, 58, 237, 0.05);
}

/* Placeholder para otros módulos */
.placeholder-module {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.placeholder-module i {
    font-size: 64px;
    color: var(--primary-light);
    margin-bottom: 20px;
}

.placeholder-module h3 {
    font-size: 24px;
    margin-bottom: 12px;
}

.placeholder-module p {
    font-size: 16px;
    color: var(--text-light);
    max-width: 400px;
}

/* Responsive */
@media (max-width: 1200px) {
    .billing-container {
        grid-template-columns: 1fr;
    }
    
    .billing-right {
        position: static;
    }
}

@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: -260px;
        height: 100vh;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .stats-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .module-tools {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-bar {
        min-width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .payment-options {
        grid-template-columns: 1fr;
    }
    
    .invoice-item-header, .invoice-item {
        grid-template-columns: 2fr 1fr 1fr;
        font-size: 13px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .module-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .module-header h2 {
        font-size: 20px;
    }
}

@media (max-width: 576px) {
    .module-content {
        padding: 16px;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .header {
        padding: 16px;
    }
    
    .user-info {
        display: none;
    }
    
    .user-profile i {
        display: none;
    }
    
    .invoice-actions {
        flex-direction: column;
    }
}

/* Invenatrios */

/* Estilos para vista de tarjetas de productos */
.view-toggle {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    padding: 12px;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.view-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.view-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.view-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.products-grid.list-view {
    grid-template-columns: 1fr;
}

.product-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.dark-theme .product-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.product-card-header {
    padding: 20px 20px 0;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.product-card-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.product-card-image i {
    font-size: 32px;
    color: white;
}

.product-card-info {
    flex: 1;
}

.product-card-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-category {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.product-card-code {
    font-size: 12px;
    color: var(--text-light);
    background-color: rgba(124, 58, 237, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.product-card-body {
    padding: 16px 20px;
    flex: 1;
}

.product-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.product-stat {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
}

.stat-price {
    color: var(--primary-color);
}

.product-stock {
    margin-top: 16px;
}

.stock-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.stock-bar-container {
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.stock-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.stock-bar.high {
    background-color: var(--secondary-color);
}

.stock-bar.medium {
    background-color: var(--warning-color);
}

.stock-bar.low {
    background-color: var(--danger-color);
}

.stock-bar.critical {
    background-color: var(--danger-color);
    width: 15% !important;
}

.stock-level-text {
    font-size: 12px;
    color: var(--text-light);
    text-align: right;
}

.product-card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.card-action-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.card-action-btn.view {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
}

.card-action-btn.view:hover {
    background-color: rgba(59, 130, 246, 0.2);
}

.card-action-btn.edit {
    background-color: rgba(124, 58, 237, 0.1);
    color: var(--primary-color);
}

.card-action-btn.edit:hover {
    background-color: rgba(124, 58, 237, 0.2);
}

.card-action-btn.delete {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.card-action-btn.delete:hover {
    background-color: rgba(239, 68, 68, 0.2);
}

.no-products {
    text-align: center;
    padding: 60px 20px;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.no-products i {
    font-size: 64px;
    color: var(--primary-light);
    margin-bottom: 20px;
}

.no-products h3 {
    font-size: 24px;
    margin-bottom: 12px;
}

.no-products p {
    font-size: 16px;
    color: var(--text-light);
    max-width: 400px;
    margin: 0 auto;
}

/* Modal de Detalle del Producto */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-container {
    background-color: var(--card-bg);
    border-radius: 16px;
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-color);
    border: none;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    background-color: var(--danger-color);
    color: white;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-danger:hover {
    background-color: var(--danger-color);
    color: white;
}

/* Estilos para el detalle del producto */
.product-detail-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.product-detail-header {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.product-detail-image {
    width: 120px;
    height: 120px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.product-detail-image i {
    font-size: 48px;
    color: white;
}

.product-detail-basic {
    flex: 1;
}

.product-detail-basic h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
}

.product-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.product-detail-meta span {
    font-size: 14px;
    color: var(--text-light);
    background-color: var(--bg-color);
    padding: 6px 12px;
    border-radius: 20px;
}

.product-detail-status {
    display: flex;
    gap: 16px;
    align-items: center;
}

.stock-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 16px;
}

.stock-indicator i {
    color: var(--primary-color);
}

.product-detail-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.tab-btn:hover {
    color: var(--primary-color);
    background-color: rgba(124, 58, 237, 0.05);
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px 3px 0 0;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

.product-detail-info {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.info-section h4 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--primary-color);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-label {
    font-weight: 500;
    color: var(--text-light);
}

.info-value {
    font-weight: 600;
    text-align: right;
}

.info-item-full {
    margin-bottom: 16px;
}

.info-item-full .info-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-light);
}

.info-item-full .info-value {
    display: block;
    font-weight: normal;
    text-align: left;
    line-height: 1.6;
}

/* Historial del producto */
.product-history h4 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--primary-color);
}

.history-table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.history-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.history-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.history-table tbody tr:hover {
    background-color: rgba(124, 58, 237, 0.03);
}

.history-table tbody tr:last-child td {
    border-bottom: none;
}

.history-type {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.history-type.add {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--secondary-color);
}

.history-type.remove {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.history-type.sale {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
}

.history-type.adjust {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.no-history {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.no-history i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Ajuste de stock */
.stock-adjustment h4 {
    font-size: 18px;
    margin-bottom: 24px;
    color: var(--primary-color);
}

.adjustment-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 500px;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
}

.qty-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.adjustment-form input[type="number"] {
    flex: 1;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 16px;
    text-align: center;
    font-weight: 600;
}

.adjustment-form textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 15px;
    resize: vertical;
    font-family: inherit;
}

.adjustment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.current-stock-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background-color: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.current-stock-info span {
    display: flex;
    justify-content: space-between;
}

.adjustment-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Responsive para el modal */
@media (max-width: 768px) {
    .modal-container {
        max-height: 95vh;
    }
    
    .product-detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .product-detail-meta {
        justify-content: center;
    }
    
    .product-detail-status {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .product-detail-tabs {
        flex-wrap: wrap;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-footer {
        flex-wrap: wrap;
    }
    
    .modal-footer button {
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-card-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .product-card-info {
        text-align: center;
    }
    
    .product-card-footer {
        flex-direction: column;
    }
}

/* estilo para las tres vistas inventario   */  
/* Estilos para las tres vistas */
.view-toggle {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    padding: 12px;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
}

.view-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    flex: 1;
    min-width: 120px;
    justify-content: center;
}

.view-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.view-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.active-view {
    display: block !important;
}

/* Vista de Lista */
.products-list {
    display: none;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.list-item {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.list-item:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.list-item-image {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.list-item-image i {
    font-size: 24px;
    color: white;
}

.list-item-info {
    flex: 1;
    min-width: 0;
}

.list-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.list-item-name {
    font-size: 18px;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.list-item-category {
    font-size: 14px;
    color: var(--text-light);
    background-color: var(--bg-color);
    padding: 4px 12px;
    border-radius: 20px;
}

.list-item-details {
    display: flex;
    gap: 24px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.list-item-detail {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.detail-value {
    font-weight: 600;
    font-size: 16px;
}

.list-item-stock {
    flex: 1;
    max-width: 200px;
}

.list-item-actions {
    display: flex;
    gap: 8px;
}

/* Vista de Tabla */
.table-container {
    display: none;
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.data-table thead {
    background-color: rgba(124, 58, 237, 0.05);
}

.data-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:hover {
    background-color: rgba(124, 58, 237, 0.03);
}

.table-product-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-product-image {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.table-product-image i {
    color: white;
    font-size: 18px;
}

.table-product-info {
    min-width: 0;
}

.table-product-name {
    font-weight: 500;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.table-product-sku {
    font-size: 12px;
    color: var(--text-light);
}

.table-stock-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-stock-number {
    font-weight: 600;
    width: 30px;
    text-align: center;
}

.table-stock-bar {
    flex: 1;
    height: 6px;
    background-color: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    min-width: 80px;
}

.table-stock-level {
    height: 100%;
}

.table-stock-level.high {
    background-color: var(--secondary-color);
    width: 80%;
}

.table-stock-level.medium {
    background-color: var(--warning-color);
    width: 50%;
}

.table-stock-level.low {
    background-color: var(--danger-color);
    width: 30%;
}

.table-stock-level.critical {
    background-color: var(--danger-color);
    width: 15%;
}

.table-action-buttons {
    display: flex;
    gap: 8px;
}

/* Formulario de Producto */
.product-form {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.form-section {
    background-color: var(--bg-color);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border-color);
}

.form-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.form-section h3 i {
    font-size: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-group label::after {
    content: '*';
    color: var(--danger-color);
    opacity: 0;
}

.form-group label.required::after {
    opacity: 1;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-color);
    font-size: 15px;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.form-group input[type="color"] {
    height: 48px;
    padding: 4px;
    cursor: pointer;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 16px;
    color: var(--text-light);
    font-weight: 500;
}

.input-with-icon input {
    padding-left: 40px;
    width: 100%;
}

.input-with-icon .input-icon:last-child {
    left: auto;
    right: 16px;
}

.input-with-icon input:last-child {
    padding-right: 40px;
}

.color-picker {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-picker input[type="color"] {
    width: 60px;
    height: 48px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    padding: 2px;
}

#colorHex {
    font-family: monospace;
    font-weight: 600;
    color: var(--text-color);
    background-color: var(--card-bg);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    min-width: 100px;
    text-align: center;
}

.icon-selector {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.icon-option {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.icon-option i {
    font-size: 20px;
    color: var(--text-light);
}

.icon-option:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.icon-option.selected {
    border-color: var(--primary-color);
    background-color: rgba(124, 58, 237, 0.1);
}

.icon-option.selected i {
    color: var(--primary-color);
}

/* Botones del formulario */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* Responsive para el formulario */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .icon-selector {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .list-item-actions {
        align-self: flex-end;
    }
    
    .view-btn {
        min-width: 100px;
    }
}

@media (max-width: 576px) {
    .view-toggle {
        flex-direction: column;
    }
    
    .view-btn {
        min-width: 100%;
    }
    
    .icon-selector {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .list-item-details {
        flex-direction: column;
        gap: 12px;
    }
    
    .list-item-stock {
        max-width: 100%;
    }
}