/* main.css - Modern Premium Design System */
:root {
    /* Frosted Light Glass Palette */
    --primary: #6366f1;
    --primary-container: #e0e7ff;
    --primary-solid: #4f46e5;
    --primary-solid-rgb: 79, 70, 229;
    --secondary: #64748b;
    --secondary-container: #f1f5f9;
    --tertiary: #f59e0b;
    --tertiary-container: #fef3c7;
    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.7);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: rgba(99, 102, 241, 0.1);
    --sidebar-bg: #ffffff;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;

    /* Frosted Shadows & Glows */
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 12px 24px rgba(99, 102, 241, 0.08);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.08);
    --glass-border: 1px solid rgba(255, 255, 255, 0.8);
    --inner-glow: inset 0 1px 1px rgba(255, 255, 255, 0.5);

    /* Layout */
    --sidebar-width: 280px;
    --top-bar-height: 80px;
    --bottom-nav-height: 85px;
    --border-radius-lg: 24px;
    --border-radius-md: 16px;
    --border-radius-sm: 12px;
    --safe-bottom: env(safe-area-inset-bottom);
}

/* --- Temas de Color --- */
body.theme-emerald {
    --primary: #10b981;
    --primary-container: #dcfce7;
    --primary-solid: #059669;
    --primary-solid-rgb: 5, 150, 105;
    --shadow-md: 0 12px 24px rgba(16, 185, 129, 0.12);
}

body.theme-purple {
    --primary: #8b5cf6;
    --primary-container: #ede9fe;
    --primary-solid: #7c3aed;
    --primary-solid-rgb: 124, 58, 237;
    --shadow-md: 0 12px 24px rgba(139, 92, 246, 0.12);
}

body.theme-orange {
    --primary: #f59e0b;
    --primary-container: #fef3c7;
    --primary-solid: #d97706;
    --primary-solid-rgb: 217, 119, 6;
    --shadow-md: 0 12px 24px rgba(245, 158, 11, 0.12);
}

body.theme-rose {
    --primary: #f43f5e;
    --primary-container: #ffe4e6;
    --primary-solid: #e11d48;
    --primary-solid-rgb: 225, 29, 72;
    --shadow-md: 0 12px 24px rgba(244, 63, 94, 0.12);
}

body.theme-dark {
    --primary: #6366f1;
    --primary-container: rgba(99, 102, 241, 0.15);
    --primary-solid: #818cf8;
    --primary-solid-rgb: 129, 140, 248;
    --bg-main: #0f172a;
    --bg-surface: #1e293b;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --sidebar-bg: #0f172a;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-md: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.theme-preview {
    transition: all 0.2s ease;
}

.theme-option input:checked+.theme-preview {
    box-shadow: 0 0 0 3px var(--primary-solid) !important;
    transform: scale(1.1);
}

/* Utilitarios de búsqueda */
.search-hidden {
    display: none !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

h1,
h2,
h3,
h4,
.logo {
    font-family: 'Manrope', 'Inter', sans-serif;
    letter-spacing: -0.02em;
    font-weight: 700;
}

/* --- Layout Structure --- */
.app-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding-bottom: 20px;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Premium Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 10000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
    border-right: 1px solid var(--border-color);
    overflow: hidden;
}

.sidebar-header {
    padding: 32px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-close {
    display: none;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--primary-solid);
    width: 38px;
    height: 38px;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
}

.mobile-close:hover {
    background: var(--primary-solid);
    color: #ffffff;
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
}

.mobile-close:active {
    transform: scale(0.95);
}

.mobile-close i {
    width: 20px;
    height: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.025em;
}

.logo i {
    color: var(--primary-light);
}

.sidebar-nav {
    flex: 1;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-container) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--primary-container);
    border-radius: 10px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.nav-link i {
    width: 20px;
    height: 20px;
    opacity: 0.6;
}

.nav-link:hover {
    background: rgba(99, 102, 241, 0.05);
    color: var(--primary-solid);
    transform: translateX(4px);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary-solid) 0%, var(--primary-container) 100%);
    color: #fff;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
}

.nav-link.active i {
    opacity: 1;
}

/* --- Top Bar --- */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--top-bar-height);
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    display: flex;
    align-items: center;
    padding: 0 32px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.02);
}

.mobile-toggle {
    display: none;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    cursor: pointer;
    padding: 10px;
    margin-right: 12px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.mobile-toggle:hover {
    background: var(--primary-container);
    color: var(--primary-solid);
    transform: scale(1.05);
}

.top-bar-title h1 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
}

/* --- Content Area --- */
.content-area {
    padding: 32px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Glassmorphism Classes */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: var(--glass-border);
    box-shadow: var(--shadow-md), var(--inner-glow);
    border-radius: var(--border-radius-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-4px);
    background: var(--bg-surface);
    border: 1px solid var(--primary-solid);
}

.data-table-container {
    background: var(--bg-surface);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease;
}

.data-table-container:hover {
    box-shadow: var(--shadow-md);
}

.premium-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    margin-top: -8px;
}

.premium-table th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.premium-table tr {
    transition: transform 0.2s ease, background 0.2s ease;
}

.premium-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.02);
    transform: scale(1.005);
}

.premium-table td {
    padding: 16px;
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    vertical-align: middle;
}

.premium-table tbody tr:last-child td {
    border-bottom: none;
}

.mini-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--primary-container);
    color: var(--primary-solid);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--primary-solid);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--primary-container);
    border-color: var(--primary-solid);
    transform: rotate(5deg);
}

.text-id {
    font-family: 'monospace';
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--secondary);
}

.text-price {
    font-weight: 700;
    color: var(--text-main);
}

/* --- Dashboard Grid --- */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-surface);
    padding: 28px;
    border-radius: var(--border-radius-lg);
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, transparent 100%);
    pointer-events: none;
}

.stat-info h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-info p {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--primary-solid);
    font-family: 'Manrope', sans-serif;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon i {
    width: 24px;
    height: 24px;
}

.stat-icon.purple {
    background: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
}

.stat-icon.orange {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.stat-icon.red {
    background: rgba(244, 63, 94, 0.1);
    color: #e11d48;
}

.stat-icon.indigo {
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
}

.badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Badges de tipo de log en Auditoría */
.badge-type-venta      { background: #dcfce7; color: #166534; }
.badge-type-egreso     { background: #fee2e2; color: #991b1b; }
.badge-type-abono      { background: #dbeafe; color: #1e40af; }
.badge-type-eliminacion{ background: #fce7f3; color: #9d174d; }
.badge-type-tasa       { background: #fef3c7; color: #92400e; }
.badge-type-inventario { background: #e0e7ff; color: #3730a3; }
.badge-type-cliente    { background: #d1fae5; color: #065f46; }
.badge-type-sistema    { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }

.bg-success {
    background: #dcfce7;
    color: #166534;
}

.bg-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* Dashboard Chart */
#salesTrendsChart {
    filter: drop-shadow(0 0 10px rgba(192, 193, 255, 0.1));
}

/* Buttons */
.btn {
    padding: 14px 24px;
    border-radius: var(--border-radius-sm);
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    font-family: 'Inter', sans-serif;
}

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

.btn i {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-solid) 0%, var(--primary-container) 100%);
    color: #fff;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.2);
}

.btn-outline {
    background: rgba(192, 193, 255, 0.05);
    color: var(--primary);
    border: 1px solid rgba(192, 193, 255, 0.2);
}

.btn-outline:hover {
    background: rgba(192, 193, 255, 0.1);
    border-color: var(--primary);
}

.btn-success {
    background: rgba(34, 197, 94, 0.1);
    color: #34d399;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

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

.btn-sm {
    padding: 10px 16px;
    font-size: 0.8rem;
    border-radius: 10px;
}

/* POS / Sales Styling */
.product-item-card {
    margin-bottom: 8px;
    transition: transform 0.2s ease, background 0.2s ease, border-left-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.product-item-card:hover {
    transform: translateX(4px);
    background: var(--bg-surface);
}

.product-item-card:active {
    transform: scale(0.97);
    background: var(--bg-main);
}

/* Bottom Navigation */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-height) + var(--safe-bottom));
    background: var(--bg-surface);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    padding: 0 20px calc(8px + var(--safe-bottom));
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
}

.nav-plus-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-solid) 0%, var(--primary-container) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-top: -30px;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.2);
    border: 2px solid var(--bg-surface);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bottom-nav-link:active .nav-plus-icon {
    transform: scale(0.9) rotate(90deg);
}

.bottom-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s;
}

.bottom-nav-link i {
    font-size: 1.4rem;
    opacity: 0.6;
}

.bottom-nav-link.active {
    color: var(--primary-solid);
}

.bottom-nav-link.active i {
    opacity: 1;
}

/* Inputs */
input,
select,
textarea {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input:focus,
select:focus,
textarea:focus {
    background: var(--bg-surface);
    border-color: var(--primary-solid) !important;
    color: var(--text-main) !important;
    box-shadow: 0 0 0 4px rgba(var(--primary-solid-rgb), 0.15) !important;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-container i {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.search-container input {
    padding-left: 48px !important;
    width: 100%;
}

/* Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 11000 !important;
    padding: 20px;
    animation: fadeIn 0.25s ease-out;
}

.modal-overlay.active {
    display: flex !important;
}

.modal {
    background: var(--bg-surface);
    width: 95%;
    max-width: 500px;
    max-height: 90vh;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    z-index: 10000;
    animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface);
    flex-shrink: 0;
}

.modal-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

.close-modal {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.3s;
}

.close-modal:hover {
    background: rgba(244, 63, 94, 0.1);
    color: var(--danger);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-fadeIn {
    animation: fadeInUp 0.2s ease-out forwards;
}

@media (prefers-reduced-motion: reduce) {
    .section-fadeIn {
        animation: none;
        opacity: 1;
    }
}

/* BCV styling */
#bcv-value {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Inventory Table Responsive */
.inventory-table-responsive {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    border-radius: 16px;
    overflow: hidden;
}

@media (min-width: 769px) {
    .inventory-table-responsive thead tr {
        background: var(--bg-main);
        border-bottom: 2px solid var(--border-color);
    }

    .inventory-table-responsive th {
        text-align: left;
        padding: 16px 12px;
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.85rem;
    }

    .inventory-table-responsive td {
        padding: 16px 12px;
        border-bottom: 1px solid var(--border-color);
        vertical-align: middle;
    }

    .inventory-table-responsive tr:hover {
        background: var(--bg-surface);
        transition: background 0.2s ease;
    }
}

@media (max-width: 768px) {
    .inventory-table-responsive thead {
        display: none;
    }

    .inventory-table-responsive tbody tr {
        display: block;
        background: var(--bg-card);
        margin-bottom: 16px;
        border-radius: 16px;
        padding: 16px;
        box-shadow: var(--shadow-sm);
        border: 1px solid var(--border-color);
    }

    .inventory-table-responsive td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        padding: 10px 0;
        border-bottom: 1px dashed var(--border-color);
        min-height: 45px;
    }

    .inventory-table-responsive td:last-child {
        border-bottom: none;
        padding-top: 15px;
        margin-top: 5px;
        justify-content: center;
        gap: 20px;
    }

    .inventory-table-responsive td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        font-size: 0.7rem;
        text-transform: uppercase;
        background: var(--bg-main);
        padding: 2px 8px;
        border-radius: 6px;
        min-width: 80px;
    }

    .inventory-table-responsive td span {
        text-align: right;
        word-break: break-word;
        font-size: 0.9rem;
    }

    /* Ajustes específicos para columnas */
    .inventory-table-responsive td[data-label="💲 Precio"] div {
        align-items: flex-end !important;
    }

    .inventory-table-responsive .header-actions {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start !important;
    }

    .inventory-table-responsive .header-actions .btn {
        flex: 0 0 auto;
    }
}

/* Dolar Indicator */
.dolar-indicator {
    position: fixed;
    top: calc(10px + env(safe-area-inset-top));
    right: calc(10px + env(safe-area-inset-right));
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 700;
    color: white;
    z-index: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.dolar-icon {
    font-size: 1.1rem;
}

.dolar-value {
    font-family: 'Manrope', sans-serif;
    color: #fff;
    font-weight: 800;
}

.dolar-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.btn-icon-tiny {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon-tiny:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.btn-icon-tiny:active {
    transform: scale(0.9);
}

.dolar-date {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spinning {
    animation: spin 1s linear infinite;
}

/* Mobile Dolar Indicator */
@media screen and (max-width: 768px) {
    .dolar-indicator {
        padding: 4px 10px;
        top: calc(10px + env(safe-area-inset-top));
        right: 8px;
        min-height: 28px;
        z-index: 150;
        font-size: 11px;
        gap: 4px;
        border-radius: 20px;
    }

    .dolar-label,
    .dolar-date {
        display: none;
    }

    .dolar-actions {
        display: none;
        margin-left: 4px;
    }

    .dolar-indicator.expanded {
        border-radius: 20px;
        padding-right: 10px;
    }

    .dolar-indicator.expanded .dolar-actions {
        display: flex;
    }

    .mobile-only {
        display: flex !important;
    }
}

@media screen and (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: '';
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* ============================================
   RESPONSIVE GENERAL (Mobile First)
   ============================================ */

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 250px;
    }

    .sidebar {
        transform: translateX(-100%);
    }

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

    .main-content {
        margin-left: 0;
        padding-bottom: calc(var(--bottom-nav-height) + 60px);
    }

    .bottom-nav {
        display: flex;
    }

    .top-bar {
        padding: 0 16px;
    }

    .mobile-toggle {
        display: flex;
    }

    .mobile-close {
        display: flex;
    }

    .content-area {
        padding: 16px;
    }

    .section-header {
        flex-direction: column;
        gap: 12px;
    }

    .section-header button {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .sales-terminal {
        grid-template-columns: 1fr !important;
    }

    .grid-2-cols {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    .bottom-nav {
        display: flex;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 16px;
        min-height: 90px;
    }

    .stat-info p {
        font-size: 1.25rem;
        word-break: normal;
        overflow-wrap: break-word;
    }

    .modal {
        width: 100%;
        margin: 10px;
        max-height: 95vh;
        overflow-y: auto;
    }

    #recent-sales-dashboard {
        display: block !important;
    }
    #recent-sales-dashboard .table-responsive {
        max-height: 400px;
        overflow-y: auto;
    }

    .data-table-container {
        background: var(--bg-surface);
        padding: 16px;
        border: 1px solid var(--border-color);
        box-shadow: var(--shadow-sm);
        border-radius: var(--border-radius-lg);
    }
}

/* ============================================
   VENTAS - CARRITO RESPONSIVE (CORREGIDO)
   ============================================ */
/* Desktop: carrito lateral */
@media (min-width: 1025px) {
    .cart-panel {
        position: sticky !important;
        top: 20px !important;
        align-self: start !important;
        max-height: calc(100vh - 120px) !important;
        overflow-y: auto !important;
        background: var(--bg-surface);
        padding: 24px !important;
        border-radius: var(--border-radius-lg) !important;
        border: 1px solid var(--border-color) !important;
        box-shadow: var(--shadow-md) !important;
        display: flex !important;
        flex-direction: column;
    }

    .cart-header {
        cursor: default !important;
        padding-bottom: 15px !important;
        border-bottom: 2px solid var(--bg-main) !important;
        margin-bottom: 12px;
    }

    .cart-toggle-btn, #cart-last-item {
        display: none !important;
    }

    #cart-full-list {
        max-height: none !important;
        overflow: visible !important;
        display: block !important;
        flex: 1 !important;
    }

    .cart-items {
        max-height: 380px !important; /* Altura máxima para evitar que el carrito sea eterno */
        overflow-y: auto !important;
        margin-bottom: 12px;
        padding-right: 10px !important;
        scrollbar-width: thin;
        scrollbar-color: var(--primary-light) transparent;
    }

    /* Estilo de la barra de scroll para Chrome/Safari */
    .cart-items::-webkit-scrollbar {
        width: 6px;
    }
    .cart-items::-webkit-scrollbar-thumb {
        background: var(--primary-container);
        border-radius: 10px;
    }
    .cart-items::-webkit-scrollbar-track {
        background: transparent;
    }

    .cart-item {
        padding: 12px 0 !important;
        border-bottom: 1px solid var(--bg-main) !important;
    }

    .cart-totals {
        display: flex !important;
        justify-content: space-between !important;
        gap: 10px;
        background: var(--primary-container);
        padding: 15px !important;
        border-radius: 12px;
        margin-bottom: 12px;
    }

    .cart-totals div {
        flex: 1 !important;
        text-align: center;
    }

    .cart-totals span {
        display: block !important;
        font-size: 1.2rem !important;
        font-weight: 700;
        color: var(--primary-solid);
    }

    .payment-buttons {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }

    .payment-buttons .deudor-btn, 
    .payment-buttons .btn-success[onclick*="debt"] {
        grid-column: 1 / -1 !important;
        background: #059669 !important;
        color: white !important;
    }

    .sales-terminal {
        display: grid !important;
        grid-template-columns: 1.6fr 1fr !important;
        gap: 10px;
        align-items: start !important;
    }
}

/* Tablet y Móvil: carrito fijo abajo, SIN espacio extra */
@media (max-width: 1024px) {

    /* Layout de una columna */
    .sales-terminal {
        display: block !important;
        padding-bottom: 0 !important;
    }

    /* Espacio al fondo para no quedar oculto por el carrito */
    .products-column {
        padding-bottom: 80px !important;
    }

    /* Productos en grid responsive */
    #pos-products {
        display: grid !important;
        gap: 10px;
        padding-bottom: 20px !important;
    }

    @media (min-width: 768px) and (max-width: 1024px) {
        #pos-products {
            grid-template-columns: repeat(2, 1fr) !important;
        }
    }

    @media (max-width: 767px) {
        #pos-products {
            grid-template-columns: 1fr !important;
        }
    }

    /* ===== CARRITO FIJO AL FONDO (body-level, via JS) ===== */
    .cart-panel {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        z-index: 5000 !important;  /* Bajo del modal (11000) pero sobre el contenido */
        background: var(--bg-surface);
        border-radius: 24px 24px 0 0 !important;
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2) !important;
        display: flex !important;
        flex-direction: column;
        max-height: 85vh !important;
        transition: all 0.2s ease; /* Sin transición de posición */
    }

    /* Contraído: solo el header visible */
    .cart-panel:not(.expanded) {
        /* El header mide ~56px; el resto está oculto con display:none */
        height: auto !important;
    }

    /* Expandido: altura limitada, cabecera siempre visible para poder cerrar */
    .cart-panel.expanded {
        max-height: 80vh !important;
        border-radius: 24px 24px 0 0 !important;
    }

    /* Cabecera SIEMPRE visible (no ocultar cuando expandido) */
    .cart-panel.expanded .cart-header {
        display: flex !important;
    }


    /* HEADER: siempre visible, permite abrir/cerrar */
    .cart-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center;
        padding: 10px 16px;
        cursor: pointer;
        background: var(--bg-surface);
        border-radius: 24px 24px 0 0 !important;
        border-bottom: 1px solid var(--border-color) !important;
        flex-shrink: 0;
        min-height: 56px !important;
        /* Nunca ocultar */
        position: relative !important;
        z-index: 2 !important;
    }

    .cart-header h3 {
        margin: 0 !important;
        font-size: 1rem !important;
        font-weight: 700;
    }

    /* Botón de chevron SIEMPRE visible y accesible */
    .cart-toggle-btn {
        background: var(--primary-container);
        border: none;
        width: 38px !important;
        height: 38px !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: var(--primary-solid);
        flex-shrink: 0;
        /* Apunta hacia arriba cuando está cerrado */
        transition: all 0.2s ease;
    }

    .cart-panel.expanded .cart-toggle-btn {
        transform: rotate(180deg) !important;
    }

    /* Ocultar el resumen del último item */
    #cart-last-item {
        display: none !important;
    }

    /* CONTENIDO INTERIOR: scroll y se oculta al contraer */
    #cart-full-list {
        flex: 1 !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        background: var(--bg-surface);
    }

    .cart-panel:not(.expanded) #cart-full-list {
        display: none !important;
    }

    .cart-panel.expanded #cart-full-list {
        display: block !important;
        padding: 12px 16px 0 16px !important;
        max-height: calc(85vh - 200px) !important;
        overflow-y: auto !important;
    }

    /* Items del carrito */
    .cart-items {
        max-height: 180px !important;
        overflow-y: auto !important;
        margin-bottom: 12px;
    }

    .cart-item {
        padding: 10px 0 !important;
        border-bottom: 1px solid var(--border-color) !important;
    }

    /* FOOTER: siempre visible dentro del panel */
    .cart-footer {
        flex-shrink: 0;
        padding: 12px 16px 20px 16px !important;
        background: var(--bg-surface);
        border-top: 1px solid var(--border-color) !important;
    }

    /* Ocultar footer cuando está contraído */
    .cart-panel:not(.expanded) .cart-footer {
        display: none !important;
    }

    /* Totales */
    .cart-totals {
        display: flex !important;
        justify-content: space-between !important;
        margin-bottom: 12px;
        padding: 10px 16px;
        background: var(--primary-container);
        border-radius: 12px;
    }

    .cart-totals div {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        flex: 1 !important;
        text-align: center;
    }

    .cart-totals div small {
        font-size: 0.6rem;
        font-weight: 700;
        opacity: 0.7;
        text-transform: uppercase;
    }

    .cart-totals div span {
        font-weight: 700;
        font-size: 0.6rem;
        color: var(--primary-solid);
    }

    /* Botón PAGAR */
    .payment-buttons {
        display: flex !important;
        justify-content: center;
        width: 100% !important;
        grid-template-columns: unset !important;
    }

    .payment-buttons .btn {
        min-height: 50px !important;
        font-size: 1rem !important;
        padding: 10px 16px;
        width: 100% !important;
        max-width: 340px !important;
    }

    /* Buscador */
    #pos-search {
        padding: 12px 40px 12px 14px !important;
        font-size: 0.6rem;
        border-radius: 12px;
    }

    .sales-terminal .btn-primary[onclick*="startScanning"] {
        height: 48px !important;
        width: 48px !important;
        border-radius: 12px;
    }

    #pos-pagination {
        margin-bottom: 12px;
    }

    #pos-pagination .btn {
        height: 44px !important;
        min-width: 44px !important;
    }

    /* Móvil pequeño */
    @media (max-width: 480px) {
        .payment-buttons .btn {
            font-size: 0.9rem;
            padding: 10px 16px;
            min-height: 48px;
        }
    }

/* Modo Ventas */
.sales-mode .bottom-nav {
    display: none !important;
}

.sales-mode .dolar-indicator {
    display: none !important;
}

.sales-mode .content-area {
    padding-top: 10px !important;
}

.sales-mode .cart-panel {
    display: flex !important;
}

/* Utilidades extras */
.sync-banner {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 12px);
    right: 12px;
    z-index: 999;
}

.audit-week-group {
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .audit-week-group {
        margin-bottom: 16px;
    }

    .audit-timeline .premium-table tr {
        padding: 12px !important;
        margin-bottom: 12px;
    }

    .audit-timeline .premium-table td {
        padding: 8px 0 !important;
        font-size: 0.6rem;
        min-height: auto !important;
    }
}

#import-dropzone:hover {
    background: rgba(99, 102, 241, 0.1) !important;
    border-color: var(--primary-light) !important;
    transform: translateY(-2px);
}

#import-dropzone:active {
    transform: translateY(0);
}

.stats-grid-modal {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .stats-grid-modal {
        grid-template-columns: 1fr;
    }
}

.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .config-grid {
        grid-template-columns: 1fr;
    }
}

/* Toast Notifications Above Everything */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100000 !important; /* Más alto que el modal que tiene 11000 */
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: var(--bg-surface);
    color: var(--text-main);
    padding: 16px 24px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    border-left: 5px solid var(--primary);
    pointer-events: auto;
    animation: toastSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-weight: 600;
}

.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-success { border-left-color: var(--success); }

.toast.hide {
    animation: toastSlideOut 0.5s forwards;
}

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* ===== CLIENT SELECTOR (MODAL BASED) ===== */
.client-selector-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.client-selector-box:hover {
    border-color: var(--primary);
    background: var(--bg-main);
}

.client-modal-item {
    transition: background 0.2s;
}

.client-modal-item:hover {
    background: var(--bg-main) !important;
    color: var(--primary-solid);
}
/* ============================================
   BOTTOM SHEET (Menú "Más")
   ============================================ */
.bottom-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 12000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.bottom-sheet-overlay.active {
    display: flex;
}

/* Defensa: asegurar que overlay y todo su contenido estén 100% ocultos sin .active */
.bottom-sheet-overlay:not(.active) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.bottom-sheet-overlay:not(.active) * {
    visibility: hidden !important;
}

.bottom-sheet {
    background: var(--bg-surface);
    width: 100%;
    max-width: 500px;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: none; /* oculto por defecto, solo se muestra con overlay activo */
    flex-direction: column;
    max-height: 80vh;
    padding-bottom: calc(16px + var(--safe-bottom));
}

.bottom-sheet-overlay.active .bottom-sheet {
    display: flex;
    transform: translateY(0);
}

.bottom-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 8px;
    position: relative;
}

.bottom-sheet-handle {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
}

.bottom-sheet-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    margin: 0;
}

.bottom-sheet-close {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.bottom-sheet-close:hover {
    background: rgba(244, 63, 94, 0.1);
    color: var(--danger);
    border-color: var(--danger);
}

.bottom-sheet-nav {
    display: flex;
    flex-direction: column;
    padding: 8px 16px 16px;
    gap: 4px;
    overflow-y: auto;
}

.bottom-sheet-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.bottom-sheet-link i {
    width: 22px;
    height: 22px;
    color: var(--primary-solid);
    opacity: 0.8;
}

.bottom-sheet-link:hover,
.bottom-sheet-link:active {
    background: var(--primary-container);
    border-color: var(--border-color);
    transform: translateX(4px);
}

/* En desktop el bottom sheet no es necesario */
@media (min-width: 1025px) {
    .bottom-sheet-overlay {
        display: none !important;
    }
}

/* ============================================
   RESPONSIVE TABLE (genérica para todas las tablas)
   ============================================ */
@media (max-width: 768px) {
    .responsive-table thead {
        display: none;
    }

    .responsive-table tbody tr {
        display: block;
        background: var(--bg-card);
        margin-bottom: 16px;
        border-radius: 16px;
        padding: 16px;
        box-shadow: var(--shadow-sm);
        border: 1px solid var(--border-color);
    }

    .responsive-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        padding: 10px 0;
        border-bottom: 1px dashed var(--border-color);
        min-height: 45px;
    }

    .responsive-table td:last-child {
        border-bottom: none;
        padding-top: 15px;
        margin-top: 5px;
        justify-content: center;
        gap: 20px;
    }

    .responsive-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        font-size: 0.7rem;
        text-transform: uppercase;
        background: var(--bg-main);
        padding: 2px 8px;
        border-radius: 6px;
        min-width: 80px;
    }

    .responsive-table td:last-child::before {
        content: none;
    }

    .responsive-table td > * {
        text-align: right;
        word-break: break-word;
        font-size: 0.9rem;
    }
}

/* ============================================
   RESPONSIVE TABLE MODAL (para historiales dentro de modales)
   ============================================ */
@media (max-width: 768px) {
    .responsive-table-modal thead {
        display: none;
    }

    .responsive-table-modal tbody tr {
        display: block;
        background: var(--bg-card);
        margin-bottom: 12px;
        border-radius: 14px;
        padding: 14px;
        box-shadow: var(--shadow-sm);
        border: 1px solid var(--border-color);
    }

    .responsive-table-modal td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        padding: 8px 0;
        border-bottom: 1px dashed var(--border-color);
        min-height: 40px;
    }

    .responsive-table-modal td:last-child {
        border-bottom: none;
        padding-top: 12px;
        margin-top: 4px;
        justify-content: flex-end;
        gap: 12px;
    }

    .responsive-table-modal td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        font-size: 0.7rem;
        text-transform: uppercase;
        background: var(--bg-main);
        padding: 2px 8px;
        border-radius: 6px;
        min-width: 80px;
    }

    .responsive-table-modal td:last-child::before {
        content: none;
    }

    .responsive-table-modal td > * {
        text-align: right;
        word-break: break-word;
        font-size: 0.9rem;
    }

    /* Botones más grandes dentro del modal historial */
    .responsive-table-modal td .btn {
        min-height: 44px;
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    /* Reduce padding del modal en móvil para más espacio */
    .modal-content:has(.responsive-table-modal) {
        padding: 16px;
    }

    /* Lista de historial en móvil */
    .client-history-list {
        max-height: 50vh;
        overflow-y: auto;
    }
}

/* ============================================
   FASE 2: ALTO — A2 + A3 (Toasts móvil + Touch targets)
   ============================================ */
@media (max-width: 768px) {
    /* A2: Toasts en parte inferior centrada */
    .toast-container {
        top: auto;
        bottom: calc(var(--bottom-nav-height) + 12px);
        right: 12px;
        left: 12px;
        align-items: center;
    }

    .toast {
        width: 100%;
        max-width: 100%;
        min-width: unset;
        justify-content: center;
        text-align: center;
        font-size: 0.9rem;
        padding: 14px 18px;
    }

    /* A3: Touch targets mínimo 44×44px */
    .btn-sm,
    .btn-icon,
    .btn-icon-tiny {
        min-height: 44px;
        min-width: 44px;
    }

    .btn-icon-tiny {
        width: 44px;
        height: 44px;
    }

    .btn-sm {
        padding: 10px 16px;
    }

    .btn-outline.btn-sm,
    .btn-primary.btn-sm {
        min-height: 44px;
    }

    /* Badges de código más grandes para touch */
    .inventory-table-responsive td span[style*="padding:3px 6px"] {
        padding: 10px 16px;
        font-size: 0.6rem;
    }

    /* Mini-avatar más grande */
    .mini-avatar {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    /* Paginación: iconos en lugar de texto */
    .pagination-controls button {
        min-height: 44px;
        min-width: 44px;
        padding: 8px;
    }

    .pagination-controls span {
        font-size: 0.8rem;
        padding: 8px 12px;
    }

    /* ============================================
       INVENTARIO - Responsive fixes Galaxy S20
       ============================================ */
    /* Header: solo iconos en botones */
    .btn-text-full {
        display: none;
    }

    /* Alerts de stock: ancho completo */
    .inv-alert {
        width: 100%;
        min-width: 0 !important;
        flex: none !important;
    }

    /* Pestañas de filtro: más compactas */
    .inv-tabs button {
        padding: 5px 10px !important;
        font-size: 0.72rem !important;
        border-radius: 16px !important;
    }

    /* Botones de acción: touch target 44px */
    .inv-action-btn {
        min-width: 44px !important;
        min-height: 44px !important;
        padding: 10px !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Códigos de producto: no forzar nowrap */
    .inventory-table-responsive td span {
        overflow-wrap: anywhere;
        word-break: normal;
        white-space: normal;
    }

    /* Precio: evitar desbordamiento */
    .inventory-table-responsive td[data-label="💲 Precio"] div {
        align-items: flex-start !important;
        overflow-wrap: anywhere;
    }

    /* Asegurar que la tabla no desborde */
    .inventory-table-responsive {
        table-layout: fixed;
        min-width: 0;
    }

    .inventory-table-responsive td {
        overflow-wrap: anywhere;
    }
}

/* ============================================
   SIDEBAR OVERLAY (tap to close)
   ============================================ */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 9999;
    display: none;
    animation: fadeIn 0.2s ease-out;
}

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

@media (min-width: 1025px) {
    .sidebar-overlay {
        display: none !important;
    }
}
