        * { margin: 0; padding: 0; box-sizing: border-box; }
        :root {
            --primary: #b8860b;
            --primary-light: #d4a843;
            --primary-dark: #8b6508;
            --dark: #0f172a;
            --dark2: #ffffff;
            --dark3: #f3f4f6;
            --gray: #334155;
            --gray-light: #64748b;
            --light: #f8fafc;
            --white: #ffffff;
            --danger: #dc2626;
            --success: #16a34a;
            --warning: #f59e0b;
            --info: #2563eb;
            --sidebar-width: 260px;
        }
        html { background: var(--light); }
        body { font-family: 'Inter', sans-serif; background: var(--light); color: var(--dark); min-height: 100vh; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
        
        .login-container {
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, var(--light) 0%, var(--dark3) 60%, var(--dark2) 100%);
            position: relative;
            overflow: hidden;
        }
        .login-container::before {
            content: '';
            position: absolute;
            top: -50%; left: -50%;
            width: 200%; height: 200%;
            background: radial-gradient(circle at 30% 50%, rgba(184,134,11,0.08) 0%, transparent 50%),
                        radial-gradient(circle at 70% 80%, rgba(184,134,11,0.05) 0%, transparent 50%);
            animation: loginBgRotate 30s linear infinite;
        }
        @keyframes loginBgRotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
        @keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
        .login-card { animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
        .login-card {
            background: rgba(255,255,255,0.95);
            backdrop-filter: blur(20px);
            border: 1px solid rgba(184,134,11,0.15);
            border-radius: 24px;
            padding: 48px 40px;
            width: 420px;
            max-width: 95vw;
            position: relative;
            z-index: 1;
            box-shadow: 0 25px 60px rgba(15,23,42,0.12), 0 0 0 1px rgba(184,134,11,0.05);
        }
        .login-logo { text-align: center; margin-bottom: 16px; }
        .login-logo img { transition: transform 0.3s ease; }
        .login-logo img:hover { transform: scale(1.05); }
        .login-title { text-align: center; font-size: 28px; font-weight: 700; margin-bottom: 4px; letter-spacing: 2px; color: var(--dark); }
        .login-title span { color: var(--primary); }
        .login-subtitle { text-align: center; color: var(--gray); font-size: 14px; margin-bottom: 32px; }
        .login-error {
            display: none;
            background: rgba(239,68,68,0.1);
            border: 1px solid rgba(239,68,68,0.3);
            color: var(--danger);
            padding: 10px 16px;
            border-radius: 10px;
            font-size: 13px;
            margin-bottom: 16px;
            text-align: center;
        }
        .login-error.show { display: block; }
        .form-group { margin-bottom: 20px; }
        .form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--gray); margin-bottom: 6px; }
        .form-input {
            width: 100%;
            padding: 12px 16px;
            background: var(--dark3);
            border: 2px solid transparent;
            border-radius: 10px;
            color: var(--dark);
            font-size: 14px;
            font-family: 'Inter', sans-serif;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(184,134,11,0.12); background: var(--white); }
        .form-input::placeholder { color: #94a3b8; font-weight: 400; opacity: 1; }
        .form-input:hover { border-color: rgba(184,134,11,0.25); }
        .btn {
            padding: 12px 24px;
            border: none;
            border-radius: 10px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            font-family: 'Inter', sans-serif;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            position: relative;
            overflow: hidden;
        }
        .btn::after {
            content: '';
            position: absolute;
            inset: 0;
            background: rgba(255,255,255,0);
            transition: background 0.3s;
        }
        .btn:hover::after { background: rgba(255,255,255,0.08); }
        .btn:active::after { background: rgba(0,0,0,0.1); }
        .btn-primary {
            background: linear-gradient(135deg, var(--primary), var(--primary-dark));
            color: var(--white);
            width: 100%;
            justify-content: center;
            padding: 14px;
            font-size: 15px;
        }
        .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(184,134,11,0.35); }
        .btn-primary:active { transform: translateY(0); }
        .btn-secondary { background: var(--dark3); color: var(--dark); }
        .btn-secondary:hover { background: #e5e7eb; }
        .btn-danger { background: var(--danger); color: var(--white); }
        .btn-danger:hover { background: #b91c1c; transform: translateY(-1px); box-shadow: 0 4px 15px rgba(220,38,38,0.25); }
        .btn-success { background: var(--success); color: var(--white); }
        .btn-success:hover { background: #15803d; transform: translateY(-1px); box-shadow: 0 4px 15px rgba(22,163,74,0.25); }
        .btn-warning { background: var(--warning); color: var(--white); }
        .btn-warning:hover { background: #d97706; transform: translateY(-1px); box-shadow: 0 4px 15px rgba(245,158,11,0.25); }
        .btn-info { background: var(--info); color: var(--white); }
        .btn-info:hover { background: #1d4ed8; transform: translateY(-1px); box-shadow: 0 4px 15px rgba(37,99,235,0.25); }
        .btn-sm { padding: 8px 14px; font-size: 12px; border-radius: 8px; }
        .login-footer { text-align: center; margin-top: 24px; color: var(--gray); font-size: 11px; letter-spacing: 0.3px; }
        .login-footer-brand { color: var(--primary); font-weight: 700; }

        /* ============ LOADER ============ */
        .loader-overlay {
            position: fixed; inset: 0; z-index: 99999;
            background: #ffffff;
            display: flex; align-items: center; justify-content: center;
            transition: opacity 0.5s ease, visibility 0.5s ease;
        }
        .loader-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
        .loader-content {
            display: flex; flex-direction: column;
            align-items: center; gap: 0;
        }
        .loader-anim {
            position: relative;
            width: 170px; height: 170px;
            display: flex; align-items: center; justify-content: center;
        }
        .loader-texts {
            display: flex; flex-direction: column;
            align-items: center; gap: 8px;
            margin-top: 40px;
        }
        .loader-ring {
            position: absolute;
            width: 170px; height: 170px;
            border-radius: 50%;
            border: 3px solid transparent;
            border-top-color: #b8860b;
            border-right-color: #d4a843;
            animation: spin 1s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
        }
        .loader-ring::before {
            content: ''; position: absolute; inset: 6px;
            border-radius: 50%;
            border: 3px solid transparent;
            border-bottom-color: rgba(184,134,11,0.4);
            border-left-color: rgba(184,134,11,0.2);
            animation: spin 1.8s linear infinite reverse;
        }
        .loader-ring-inner {
            position: absolute; inset: 14px;
            border-radius: 50%;
            border: 2px solid transparent;
            border-left-color: rgba(212,168,67,0.3);
            animation: spin 2.5s linear infinite;
        }
        @keyframes spin { to { transform: rotate(360deg); } }
        .loader-logo {
            z-index: 1; border-radius: 50%; overflow: hidden;
            box-shadow: 0 0 40px rgba(184,134,11,0.2);
        }
        .loader-logo img {
            width: 100px; height: 100px; object-fit: contain;
            border-radius: 50%; border: 3px solid rgba(184,134,11,0.3);
            padding: 8px; background: rgba(255,255,255,0.08);
            backdrop-filter: blur(4px);
        }
        .loader-text {
            color: #d4a843; font-size: 14px;
            font-weight: 600; letter-spacing: 3px;
            text-shadow: 0 0 20px rgba(212,168,67,0.4);
            animation: pulse 1.5s ease-in-out infinite;
            margin: 0;
        }
        @keyframes pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
        .loader-brand {
            background: linear-gradient(135deg, #b8860b, #d4a843, #b8860b);
            background-size: 200% 200%;
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            font-size: 16px;
            font-weight: 800;
            letter-spacing: 6px;
            animation: shimmer 2s ease-in-out infinite;
            margin: 0;
        }
        @keyframes shimmer { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

        .app-layout { display: flex; min-height: 100vh; display: none; }
        .app-layout.active { display: flex; }

        .sidebar {
            width: var(--sidebar-width);
            background: var(--dark2);
            border-right: 1px solid var(--dark3);
            display: flex;
            flex-direction: column;
            position: fixed;
            top: 0; left: 0; bottom: 0;
            z-index: 100;
            transition: transform 0.3s;
        }
        .sidebar-header {
            padding: 20px;
            border-bottom: 1px solid var(--dark3);
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .sidebar-logo img { width: 48px; height: 48px; flex-shrink: 0; object-fit: contain; border-radius: 8px; }
        .sidebar-brand h2 { font-size: 14px; font-weight: 800; color: var(--primary); line-height: 1.2; letter-spacing: 1px; }
        .sidebar-brand small { font-size: 11px; color: var(--gray-light); letter-spacing: 2px; }
        .sidebar-sync {
            margin: 16px 20px;
            padding: 10px 14px;
            background: linear-gradient(135deg, rgba(239,68,68,0.08), rgba(239,68,68,0.03));
            border: 1px solid rgba(239,68,68,0.15);
            border-radius: 10px;
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
            color: var(--danger);
            backdrop-filter: blur(8px);
        }
        .sync-dot {
            width: 8px; height: 8px;
            background: var(--danger);
            border-radius: 50%;
            animation: syncPulse 2s infinite;
        }
        @keyframes syncPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
        .sidebar-nav { flex: 1; padding: 8px 12px; overflow-y: auto; }
        .nav-section { margin-bottom: 8px; }
        .nav-section-title {
            font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px;
            color: var(--gray-light); padding: 12px 12px 6px;
        }
        .nav-item {
            display: flex; align-items: center; gap: 10px; padding: 11px 14px;
            border-radius: 10px; cursor: pointer; transition: all 0.2s;
            color: var(--gray-light); font-size: 13px; font-weight: 500; margin-bottom: 2px;
        }
        .nav-item:hover { background: var(--dark3); color: var(--dark); }
        .nav-item.active {
            background: linear-gradient(135deg, rgba(184,134,11,0.15), rgba(184,134,11,0.03));
            color: var(--primary); border: 1px solid rgba(184,134,11,0.2);
            box-shadow: 0 2px 8px rgba(184,134,11,0.08);
        }
        .nav-item i { font-size: 16px; width: 20px; text-align: center; }
        .nav-item .badge {
            margin-left: auto; background: var(--primary); color: var(--white);
            font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 600;
        }
        .sidebar-footer {
            padding: 16px 20px; border-top: 1px solid var(--dark3);
            display: flex; align-items: center; gap: 10px;
        }
        .user-avatar {
            width: 36px; height: 36px; border-radius: 10px;
            background: linear-gradient(135deg, var(--primary), var(--primary-dark));
            display: flex; align-items: center; justify-content: center;
            font-weight: 700; font-size: 14px; color: var(--white);
            box-shadow: 0 2px 8px rgba(184,134,11,0.2);
        }
        .user-info { flex: 1; }
        .user-info h4 { font-size: 13px; font-weight: 600; }
        .user-info small { font-size: 11px; color: var(--gray); }
        .logout-btn {
            background: none; border: none; color: var(--gray);
            cursor: pointer; font-size: 18px; padding: 4px; transition: color 0.2s;
        }
        .logout-btn:hover { color: var(--danger); }

        .main-content {
            margin-left: var(--sidebar-width);
            width: calc(100% - var(--sidebar-width));
            min-width: 0;
            padding: 24px; overflow-y: auto; overflow-x: hidden; min-height: 100vh;
            background-image: radial-gradient(rgba(184,134,11,0.03) 1px, transparent 1px);
            background-size: 24px 24px;
        }
        .page-header {
            display: flex; align-items: center; justify-content: space-between;
            margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
        }
        .page-header h1 { font-size: 24px; font-weight: 700; color: var(--dark); }
        .page-header h1 i { color: var(--primary); margin-right: 8px; }
        .header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

        .stats-grid {
            display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 16px; margin-bottom: 24px;
        }
        .stat-card {
            background: var(--dark2); border: 1px solid var(--dark3);
            border-radius: 16px; padding: 20px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 1px 3px rgba(0,0,0,0.04);
        }
        .stat-card:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: 0 8px 30px rgba(184,134,11,0.15); }
        .stat-card .stat-icon {
            width: 44px; height: 44px; border-radius: 12px;
            display: flex; align-items: center; justify-content: center;
            font-size: 20px; margin-bottom: 14px;
        }
        .stat-card .stat-icon.gold { background: rgba(184,134,11,0.15); color: var(--primary); }
        .stat-card .stat-icon.green { background: rgba(34,197,94,0.15); color: var(--success); }
        .stat-card .stat-icon.blue { background: rgba(59,130,246,0.15); color: var(--info); }
        .stat-card .stat-icon.red { background: rgba(239,68,68,0.15); color: var(--danger); }
        .stat-card .stat-icon.orange { background: rgba(245,158,11,0.15); color: var(--warning); }
        .stat-card .stat-value { font-size: 28px; font-weight: 800; margin-bottom: 4px; color: var(--dark); }
        .stat-card .stat-label { font-size: 12px; color: var(--gray-light); }
        .stat-card .stat-change { font-size: 11px; margin-top: 8px; }
        .stat-card .stat-change.up { color: var(--success); }
        .stat-card .stat-change.down { color: var(--danger); }

        .card {
            background: var(--dark2); border: 1px solid var(--dark3);
            border-radius: 16px; overflow: hidden; margin-bottom: 24px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.04);
            transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
        .card-header {
            padding: 18px 22px; border-bottom: 1px solid var(--dark3);
            display: flex; align-items: center; justify-content: space-between;
            flex-wrap: wrap; gap: 10px;
            background: linear-gradient(180deg, rgba(184,134,11,0.03) 0%, transparent 100%);
        }
        .card-header h3 { font-size: 16px; font-weight: 600; }
        .card-body { padding: 22px; }

        .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
        .data-table {
            width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px;
        }
        .data-table thead th {
            padding: 12px 16px; text-align: left; font-weight: 600;
            color: var(--gray-light); font-size: 11px; text-transform: uppercase;
            letter-spacing: 0.8px; background: var(--dark3);
            border-bottom: 2px solid var(--dark3); white-space: nowrap;
        }
        .data-table tbody tr { transition: background 0.2s; }
        .data-table tbody tr:nth-child(even) { background: rgba(0,0,0,0.015); }
        .data-table tbody tr:hover { background: rgba(184,134,11,0.08); }
        .data-table tbody td {
            padding: 14px 16px; border-bottom: 1px solid var(--dark3); white-space: nowrap;
        }
        .data-table tbody tr:last-child td { border-bottom: none; }

        /* Compact stacked cells - desktop row, portátil column */
        .td-stack {
            display: flex; flex-direction: row; gap: 8px; white-space: normal;
        }
        .td-stack .td-secondary {
            font-size: 11px; color: var(--gray); line-height: 1.3;
        }
        .td-stack .td-secondary.td-warning { color: var(--warning); }
        .td-stack .td-secondary.td-success { color: var(--success); }
        .td-stack .td-secondary.td-danger { color: var(--danger); }

        .product-cell { display: flex; align-items: center; gap: 12px; }
        .product-thumb {
            width: 44px; height: 44px; border-radius: 10px; background: linear-gradient(135deg, var(--dark3) 0%, rgba(184,134,11,0.05) 100%);
            display: flex; align-items: center; justify-content: center;
            font-size: 20px; flex-shrink: 0;
            border: 1px solid rgba(184,134,11,0.08);
        }
        .product-info h4 { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
        .product-info small { font-size: 11px; color: var(--gray); }
        
        .status-badge {
            display: inline-flex; align-items: center; gap: 5px;
            padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
        }
        .status-badge.in-stock { background: rgba(34,197,94,0.15); color: var(--success); }
        .status-badge.low-stock { background: rgba(245,158,11,0.15); color: var(--warning); }
        .status-badge.out-stock { background: rgba(239,68,68,0.15); color: var(--danger); }
        .status-badge.active { background: rgba(34,197,94,0.15); color: var(--success); }
        .status-badge.inactive { background: rgba(239,68,68,0.15); color: var(--danger); }
        .status-badge.pending { background: rgba(245,158,11,0.15); color: var(--warning); }
        .status-badge.paid { background: rgba(34,197,94,0.15); color: var(--success); }
        .status-badge.overdue { background: rgba(239,68,68,0.15); color: var(--danger); }

        .actions-cell { display: flex; gap: 6px; }
        .action-btn {
            width: 32px; height: 32px; border: none; border-radius: 8px;
            cursor: pointer; display: flex; align-items: center; justify-content: center;
            font-size: 14px; transition: all 0.2s;
        }
        .action-btn.edit { background: rgba(59,130,246,0.15); color: var(--info); }
        .action-btn.edit:hover { background: rgba(59,130,246,0.3); }
        .action-btn.delete { background: rgba(239,68,68,0.15); color: var(--danger); }
        .action-btn.delete:hover { background: rgba(239,68,68,0.3); }
        .action-btn.view { background: rgba(184,134,11,0.15); color: var(--primary); }
        .action-btn.view:hover { background: rgba(184,134,11,0.3); }
        .action-btn.pay { background: rgba(34,197,94,0.15); color: var(--success); }
        .action-btn.pay:hover { background: rgba(34,197,94,0.3); }
        .action-btn.print { background: rgba(99,102,241,0.12); color: #4f46e5; }
        .action-btn.print:hover { background: rgba(99,102,241,0.22); }
        .action-btn.share { background: rgba(59,130,246,0.12); color: var(--info); }
        .action-btn.share:hover { background: rgba(59,130,246,0.22); }
        .action-btn.download { background: rgba(14,165,233,0.12); color: #0ea5e9; }
        .action-btn.download:hover { background: rgba(14,165,233,0.22); }

        .modal-overlay {
            display: none; position: fixed; inset: 0;
            background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
            z-index: 1000; align-items: center; justify-content: center; padding: 20px;
        }
        .modal-overlay.show { display: flex; }
        .modal {
            background: var(--white); border: 1px solid var(--dark3);
            border-radius: 24px; width: 560px; max-width: 95vw;
            max-height: 90vh; overflow-y: auto; overscroll-behavior: contain;
            box-shadow: 0 25px 80px rgba(0,0,0,0.2);
            animation: modalIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }
        @keyframes modalIn { from { opacity: 0; transform: scale(0.92) translateY(30px); } to { opacity: 1; transform: scale(1) translateY(0); } }
        .modal-header {
            padding: 20px 24px; border-bottom: 1px solid var(--dark3);
            display: flex; align-items: center; justify-content: space-between;
            background: linear-gradient(180deg, rgba(184,134,11,0.03) 0%, transparent 100%);
        }
        .modal-header h3 { font-size: 18px; font-weight: 700; }
        .modal-close {
            background: none; border: none; color: var(--gray);
            cursor: pointer; font-size: 20px; padding: 4px; transition: color 0.2s;
        }
        .modal-close:hover { color: var(--dark); }
        .modal-body { padding: 24px; }
        .modal-footer {
            padding: 16px 24px; border-top: 1px solid var(--dark3);
            display: flex; gap: 10px; justify-content: flex-end;
        }
        .modal-footer .btn { min-width: 100px; justify-content: center; }

        .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
        .form-row.three { grid-template-columns: 1fr 1fr 1fr; }
        .form-select {
            width: 100%; padding: 12px 16px; background: var(--dark3);
            border: 2px solid transparent; border-radius: 10px;
            color: var(--dark); font-size: 14px; font-family: 'Inter', sans-serif;
            cursor: pointer; appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
            background-repeat: no-repeat; background-position: right 14px center;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .form-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(184,134,11,0.12); background: var(--white); }
        .form-select:hover { border-color: rgba(184,134,11,0.25); }
        .form-select option { background: var(--dark2); color: var(--dark); }
        textarea.form-input { resize: vertical; min-height: 80px; }

        .pos-layout { display: grid; grid-template-columns: 1fr 380px; gap: 20px; }
        @media (min-width: 1400px) { .pos-products { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } }
        .pos-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
        .pos-product-card {
            background: var(--dark2); border: 1px solid var(--dark3);
            border-radius: 14px; padding: 20px 16px; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); text-align: center;
            box-shadow: 0 1px 3px rgba(0,0,0,0.04);
        }
        .pos-product-card:hover { border-color: var(--primary); transform: translateY(-4px); box-shadow: 0 8px 25px rgba(184,134,11,0.12); }
        .pos-product-card:active { transform: translateY(-1px); }
        .pos-product-card .pos-thumb {
            width: 64px; height: 64px; border-radius: 14px; background: linear-gradient(135deg, var(--dark3) 0%, rgba(184,134,11,0.05) 100%);
            margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; font-size: 30px;
            transition: transform 0.3s;
        }
        .pos-product-card:hover .pos-thumb { transform: scale(1.08); }
        .pos-product-card h4 { font-size: 13px; font-weight: 600; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .pos-product-card .pos-price { color: var(--primary); font-weight: 700; font-size: 15px; }
        .pos-product-card .pos-sku { font-size: 10px; color: var(--gray); margin-top: 4px; }
        .pos-product-card.pos-out-of-stock:hover { border-color: var(--gray); transform: none; box-shadow: none; }
        .pos-out-of-stock .pos-thumb { filter: grayscale(1); opacity: 0.5; }
        .pos-stock-badge {
            position: absolute; top: 8px; right: 8px; background: var(--danger); color: #fff;
            font-size: 9px; font-weight: 800; padding: 2px 8px; border-radius: 6px; letter-spacing: 0.5px;
        }
        .pos-product-card { position: relative; }

        .pos-cart {
            background: var(--dark2); border: 1px solid var(--dark3);
            border-radius: 16px; display: flex; flex-direction: column;
            height: calc(100vh - 120px); position: sticky; top: 24px;
        }
        .pos-cart-header {
            padding: 16px 20px; border-bottom: 1px solid var(--dark3);
            display: flex; align-items: center; justify-content: space-between;
        }
        .pos-cart-header h3 { font-size: 16px; }
        .cart-count {
            background: var(--primary); color: var(--white);
            width: 24px; height: 24px; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            font-size: 11px; font-weight: 700;
        }
        .pos-cart-items { flex: 1; overflow-y: auto; padding: 12px; -webkit-overflow-scrolling: touch; }
        .cart-item {
            display: flex; align-items: center; gap: 12px;
            padding: 12px; background: var(--dark3);
            border-radius: 12px; margin-bottom: 8px;
            transition: all 0.2s;
            border: 1px solid transparent;
        }
        .cart-item:hover { border-color: rgba(184,134,11,0.15); background: rgba(184,134,11,0.03); }
        .cart-item .ci-icon {
            width: 40px; height: 40px; border-radius: 10px; background: var(--dark);
            display: flex; align-items: center; justify-content: center;
            font-size: 18px; flex-shrink: 0;
        }
        .cart-item .ci-info { flex: 1; }
        .cart-item .ci-info h4 { font-size: 12px; font-weight: 600; }
        .cart-item .ci-info small { font-size: 11px; color: var(--gray); }
        .qty-control { display: flex; align-items: center; gap: 8px; }
        .qty-btn {
            width: 34px; height: 34px; border: none; border-radius: 8px;
            background: var(--dark); color: var(--white);
            cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px;
        }
        .qty-btn:hover { background: var(--primary); }
        .qty-val { font-size: 13px; font-weight: 600; min-width: 20px; text-align: center; }
        .ci-price { font-size: 13px; font-weight: 700; color: var(--primary); white-space: nowrap; }
        .ci-remove { background: none; border: none; color: var(--gray); cursor: pointer; font-size: 14px; padding: 4px; }
        .ci-remove:hover { color: var(--danger); }
        .pos-cart-footer { padding: 16px 20px; border-top: 1px solid var(--dark3); }
        .cart-total-row {
            display: flex; justify-content: space-between;
            margin-bottom: 8px; font-size: 13px; color: var(--gray-light);
        }
        .cart-total-row.total {
            font-size: 20px; font-weight: 700; color: var(--dark);
            margin-top: 12px; padding-top: 12px; border-top: 2px solid var(--primary);
        }
        .cart-total-row.total span:last-child { color: var(--primary); }
        .btn-edit-total {
            background: none; border: none; cursor: pointer;
            color: var(--gray-light); font-size: 12px; padding: 2px 6px;
            border-radius: 4px; transition: all 0.2s;
        }
        .btn-edit-total:hover { background: var(--dark3); color: var(--primary); }
        .size-row {
            display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
        }
        .size-row .size-select { padding: 8px 6px; font-size: 13px; }
        .btn-checkout {
            width: 100%; padding: 14px;
            background: linear-gradient(135deg, var(--primary), var(--primary-dark));
            color: var(--white); border: none; border-radius: 12px;
            font-size: 15px; font-weight: 700; cursor: pointer;
            font-family: 'Inter', sans-serif; margin-top: 12px;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative; overflow: hidden;
        }
        .btn-checkout:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(184,134,11,0.35); }
        .btn-checkout:active { transform: translateY(0); }
        .btn-checkout:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
        button, a, .nav-item, .action-btn, .qty-btn, .pos-product-card, .size-chip, .filter-select, .mobile-toggle, .modal-close, .page-btn { touch-action: manipulation; }

        .chart-container { position: relative; height: 280px; overflow-x: auto; }
        .bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 100%; padding: 20px 0; }
        .bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
        .bar {
            width: 100%; max-width: 50px;
            background: linear-gradient(180deg, var(--primary), var(--primary-dark));
            border-radius: 6px 6px 0 0; transition: height 0.5s ease; min-height: 4px;
        }
        .bar-label { font-size: 10px; color: var(--gray); text-align: center; }
        .bar-value { font-size: 11px; font-weight: 600; color: var(--dark); }

        .search-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
        .dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
        .reports-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
        .search-input-wrap { flex: 1; min-width: 200px; position: relative; }
        .search-input-wrap i {
            position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
            color: var(--gray-light); font-size: 16px;
            pointer-events: none;
        }
        .search-input-wrap .form-input { padding-left: 42px; }
        .filter-select {
            padding: 12px 16px; background: var(--dark3);
            border: 2px solid transparent; border-radius: 10px;
            color: var(--dark); font-size: 13px; font-family: 'Inter', sans-serif;
            min-width: 150px; cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            appearance: none;
        }
        .filter-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(184,134,11,0.12); background: var(--white); }
        .filter-select:hover { border-color: rgba(184,134,11,0.25); }

        .import-area {
            border: 2px dashed var(--gray-light); border-radius: 16px;
            padding: 40px; text-align: center; cursor: pointer; transition: all 0.3s; margin: 16px 0;
        }
        .import-area:hover { border-color: var(--primary); background: rgba(184,134,11,0.03); }
        .import-area i { font-size: 40px; color: var(--primary); margin-bottom: 12px; }
        .import-area h4 { margin-bottom: 6px; }
        .import-area p { color: var(--gray); font-size: 13px; }

        .pagination {
            display: flex; align-items: center; justify-content: space-between;
            padding: 16px 0; flex-wrap: wrap; gap: 10px;
        }
        .pagination-info { font-size: 12px; padding-left: 10px; color: var(--gray); }
        .pagination-btns { display: flex; gap: 4px; }
        .page-btn {
            width: 34px; height: 34px; border: 1px solid var(--dark3);
            border-radius: 8px; background: var(--dark2); color: var(--gray-light);
            cursor: pointer; display: flex; align-items: center; justify-content: center;
            font-size: 13px; font-weight: 500; transition: all 0.2s;
        }
        .page-btn:hover { border-color: var(--primary); color: var(--primary); }
        .page-btn.active { background: var(--primary); border-color: var(--primary); color: var(--white); }

        .page-section { display: none; }
        .page-section.active { display: block; }

        /* Toggle Switch */
        .switch { position: relative; display: inline-block; width: 42px; height: 22px; }
        .switch input { opacity: 0; width: 0; height: 0; }
        .switch .switch-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: var(--gray); border-radius: 22px; transition: 0.3s; }
        .switch .switch-slider::before { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: 0.3s; }
        .switch input:checked + .switch-slider { background: var(--success); }
        .switch input:checked + .switch-slider::before { transform: translateX(20px); }

        @media (max-width: 480px) {
            .login-card { padding: 32px 24px; }
            .login-title { font-size: 22px; }
            .login-subtitle { font-size: 12px; margin-bottom: 24px; }
            .login-logo img { width: 72px; height: 72px; }
        }

        .receipt {
            background: #ffffff; color: #0f172a; border-radius: 12px;
            padding: 24px; font-size: 12px; max-width: 300px; margin: 0 auto;
        }
        .receipt h2 { text-align: center; font-size: 16px; color: #0f172a; margin-bottom: 4px; }
        .receipt .receipt-sub { text-align: center; color: #666; margin-bottom: 16px; font-size: 11px; }
        .receipt table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
        .receipt th, .receipt td { padding: 4px 0; text-align: left; font-size: 11px; }
        .receipt th { border-bottom: 1px dashed #ccc; padding-bottom: 6px; }
        .receipt .receipt-total { border-top: 2px solid #0f172a; padding-top: 8px; font-weight: 700; font-size: 14px; }
        .receipt .receipt-footer { text-align: center; margin-top: 16px; font-size: 10px; color: #999; }
        #saleReceipt {
            max-width: 280px; margin: 0 auto; background: #fff;
            border: 1px solid #e5e7eb; border-radius: 4px;
            padding: 16px 14px; box-shadow: 0 1px 3px rgba(0,0,0,0.08);
            font-size: 11px; line-height: 1.4;
        }
        #saleReceipt .receipt { border: none; box-shadow: none; padding: 0; }

        .inv-group-row td { vertical-align: middle; padding: 14px 10px; }
        .inv-group-row h4 { margin: 0 0 2px 0; font-size: 14px; font-weight: 600; }
        .inv-group-row small { font-size: 11px; color: var(--gray-light); }
        .sizes-group { display: flex; flex-wrap: wrap; gap: 4px; max-width: 280px; }
        .size-chip {
            display: inline-flex; align-items: center; justify-content: center;
            min-width: 36px; padding: 3px 8px; border-radius: 6px;
            font-size: 12px; font-weight: 600; cursor: default;
            background: var(--dark3); color: var(--dark);
            border: 1px solid transparent; transition: all 0.2s;
        }
        .size-chip:hover { border-color: var(--primary); transform: translateY(-1px); }
        .size-chip.warning { background: #fef3c7; color: #92400e; border-color: #f59e0b; }
        .size-chip.danger { background: #fee2e2; color: #991b1b; border-color: #ef4444; }
        .mobile-toggle {
            display: none; background: none; border: none; color: var(--dark);
            font-size: 24px; cursor: pointer; padding: 8px;
        }
        .sidebar-backdrop {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.35);
            z-index: 90;
            opacity: 0;
            transition: opacity 0.2s ease;
        }
        .sidebar-backdrop.show { display: block; opacity: 1; }

        /* Dual layout: desktop vs compact thead/tr */
        .thead-compact { display: none; }
        .tr-compact { display: none; }

        /* ===== RESPONSIVE ===== */
        @media (max-width: 1800px) {
            .main-content { padding: 20px; }
            .data-table { font-size: 12px; }
            .data-table thead th,
            .data-table tbody td { padding: 10px 12px; }

            /* Show compact layout, hide desktop */
            .thead-desktop { display: none; }
            .thead-compact { display: table-row-group; }
            .tr-desktop { display: none; }
            .tr-compact { display: table-row; }

            /* Stack cells vertically in compact */
            .tr-compact .td-stack { flex-direction: column; gap: 2px; }
            .tr-compact td { white-space: normal; }

            /* Actions column: grid wrap */
            .data-table .actions-cell {
                flex-wrap: wrap;
                gap: 4px;
            }
            .data-table .actions-cell .action-btn {
                width: 28px;
                height: 28px;
                font-size: 12px;
            }
        }
        @media (max-width: 1100px) {
            .pos-layout { grid-template-columns: 1fr; }
            .pos-cart { position: static; height: auto; max-height: 400px; }
            .pos-cart-header { padding: 12px 14px; }
            .pos-cart-footer { padding: 12px 14px; }
            .pos-cart-items { max-height: 250px; padding: 8px; }
            .credit-summary { grid-template-columns: 1fr 1fr; }
        }
        @media (max-width: 900px) {
            .reports-grid { grid-template-columns: 1fr; }
            .chart-container { height: 220px; }
            .product-cell .product-info small { display: none; }
        }
        @media (max-width: 768px) {
            .sidebar { transform: translateX(-100%); }
            .sidebar.open { transform: translateX(0); }
            .main-content { margin-left: 0; width: 100%; padding: 16px 14px; }
            .mobile-toggle { display: block; }
            .page-header { flex-direction: column; align-items: flex-start; }
            .page-header h1 { font-size: 18px; }
            .form-row { grid-template-columns: 1fr; gap: 12px; }
            .form-row.three { grid-template-columns: 1fr; }
            .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
            .stat-card { padding: 16px; }
            .stat-card .stat-value { font-size: 22px; }
            .stat-card .stat-icon { width: 36px; height: 36px; font-size: 16px; margin-bottom: 10px; }
            .search-bar { flex-direction: column; }
            .search-input-wrap { min-width: 100%; }
            .filter-select { min-width: 100%; }
            .card-header { flex-direction: column; align-items: flex-start; padding: 14px 16px; }
            .card-body { padding: 14px; }
            .modal { width: 100% !important; max-width: 100vw !important; border-radius: 16px 16px 0 0; margin-top: auto; max-height: 92vh; }
            .modal-overlay { align-items: flex-end; padding: 0; }
            .modal-header { padding: 16px 18px; }
            .modal-body { padding: 16px 18px; }
            .modal-footer { padding: 14px 18px; flex-wrap: wrap; }
            .modal-footer .btn { flex: 1; min-width: 0; font-size: 12px; padding: 10px 12px; }
            .data-table thead th,
            .data-table tbody td { padding: 10px 8px; white-space: normal; }
            .data-table { font-size: 11px; }
            .dashboard-grid { grid-template-columns: 1fr; }
            .receipt { padding: 16px; }
            .pos-product-card { padding: 14px 10px; }
            .pos-product-card .pos-thumb { width: 48px; height: 48px; font-size: 22px; }
            .pos-product-card h4 { font-size: 12px; }
            .pos-product-card .pos-price { font-size: 13px; }
            .sizes-group { max-width: 100%; }
            .size-chip { min-width: 30px; padding: 2px 6px; font-size: 11px; }
            .actions-cell { gap: 4px; flex-wrap: wrap; }
            .action-btn { width: 36px; height: 36px; font-size: 14px; }
            .btn { font-size: 14px; padding: 12px 18px; }
            .form-input, .form-select, .filter-select, .btn, .search-input-wrap .form-input { font-size: 16px; }
            .pagination { flex-direction: column; align-items: center; }
            .credit-summary { grid-template-columns: 1fr; }
            #sizePickerGrid { grid-template-columns: 1fr 1fr !important; }
            .form-row .btn { width: 100%; }
            .header-actions .btn { flex: 1; text-align: center; min-width: 0; font-size: 11px; padding: 8px 12px; }
            .inv-group-row td { white-space: normal !important; }
            .size-row { flex-wrap: wrap; gap: 6px; }
            .size-row .size-select { min-width: 0; flex: 1 1 60px; }
            .size-row .size-stock { width: 60px !important; flex: none; }
            .pos-cart-header { padding: 12px 14px; }
            .pos-cart-footer { padding: 12px 14px; }
            .cart-item { flex-wrap: wrap; gap: 8px; }
            .cart-item .ci-info { min-width: calc(100% - 52px); }
            .cart-item .qty-control { margin-left: auto; }

            .table-wrapper { display: none !important; }
            .mobile-cards { display: flex !important; flex-direction: column; gap: 0; }
        }
        @media (max-width: 600px) {
            .credit-summary { grid-template-columns: 1fr; gap: 8px; }
            .credit-summary-item .value { font-size: 18px; }
            .stats-grid { gap: 8px; }
            .payment-method-label { min-width: calc(50% - 4px); flex: none; }
            .header-actions .btn { font-size: 12px; padding: 8px 12px; }
            #sizePickerGrid { grid-template-columns: 1fr 1fr !important; }
            .pos-products { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
            .main-content { padding: 14px 12px; }
        }
        @media (max-width: 480px) {
            .stats-grid { grid-template-columns: 1fr; }
            .main-content { padding: 12px 10px; }
            .page-header h1 { font-size: 16px; }
            .pos-products { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
            .pos-product-card { padding: 12px 8px; }
            .pos-product-card .pos-thumb { width: 40px; height: 40px; font-size: 18px; }
            .pos-product-card h4 { font-size: 11px; }
            .data-table thead th,
            .data-table tbody td { padding: 8px 6px; font-size: 10px; }
            .modal-header h3 { font-size: 15px; }
            .modal-body { padding: 12px 14px; }
            .form-row { gap: 8px; }
            .stat-card { padding: 12px; }
            .stat-card .stat-value { font-size: 18px; }
            .card-body { padding: 10px; }
            .card-header h3 { font-size: 14px; }
            #sizePickerGrid { grid-template-columns: 1fr 1fr !important; }
            .receipt { padding: 12px; font-size: 10px; }
            .btn { font-size: 14px; padding: 10px 14px; }
            .actions-cell .action-btn { width: 36px; height: 36px; font-size: 13px; }
            .user-avatar { width: 30px; height: 30px; font-size: 11px; }
            .toast-container { right: 10px; left: 10px; top: 10px; }
            .toast { min-width: unset; width: 100%; font-size: 12px; padding: 12px 16px; }
            .bar { max-width: 32px; }
            .import-area { padding: 24px 16px; }
            .import-area i { font-size: 30px; }
            .payment-method-label { min-width: 80px; padding: 10px 12px; font-size: 12px; }
            .cart-item { padding: 8px; gap: 6px; }
            .qty-btn { width: 30px; height: 30px; font-size: 14px; }
        }
        @media (max-width: 380px) {
            .pos-products { grid-template-columns: 1fr 1fr; gap: 6px; }
            .pos-product-card { padding: 10px 6px; }
            .stats-grid { gap: 8px; }
            .header-actions { flex-direction: column; width: 100%; }
            .header-actions .btn { width: 100%; font-size: 16px; }
            .form-input, .form-select, .filter-select, .btn { font-size: 16px; }
            .modal-header { padding: 12px 14px; }
            .modal-body { padding: 10px 12px; }
            .modal-footer { padding: 10px 12px; }
        }

        @media print {
            @page { size: 100mm auto; margin: 3mm; }
            body * { visibility: hidden; }
            #printReceiptSection, #printReceiptSection * { visibility: visible; }
            #printReceiptSection {
                display: flex !important; align-items: center; justify-content: center;
                position: fixed; inset: 0; background: #fff; z-index: 9999;
                -webkit-print-color-adjust: exact !important;
                print-color-adjust: exact !important;
                color-adjust: exact !important;
            }
            #printReceiptSection .receipt {
                max-width: 90mm; width: 100%; margin: 0 auto;
                font-size: 12.5px !important; line-height: 1.5 !important;
            }
            #printReceiptSection .receipt h2 { font-size: 20px !important; }
            #printReceiptSection .receipt .receipt-total { font-size: 17px !important; }
            #printReceiptSection .receipt .receipt-sub { font-size: 13px !important; }
            #printReceiptSection .receipt td,
            #printReceiptSection .receipt th { font-size: 13px !important; padding: 5px 0 !important; }
            #printReceiptSection img { max-width: 65px; max-height: 65px; }
        }
        @media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
        ::-webkit-scrollbar { width: 6px; height: 6px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: var(--dark3); border-radius: 3px; }
        ::-webkit-scrollbar-thumb:hover { background: var(--primary); }
        * { scrollbar-width: thin; scrollbar-color: var(--dark3) transparent; }

        .toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
        .toast {
            padding: 14px 20px; border-radius: 12px; font-size: 13px; font-weight: 500;
            animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: flex; align-items: center; gap: 10px; min-width: 300px;
            box-shadow: 0 8px 30px rgba(0,0,0,0.12);
            backdrop-filter: blur(12px);
        }
        @keyframes toastIn { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }
        @keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(100px); } }
        .toast.success { background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.25); color: #15803d; }
        .toast.error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.25); color: #b91c1c; }
        .toast.info { background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.25); color: #1d4ed8; }

        .empty-state { text-align: center; padding: 48px 20px; color: var(--gray); }
        .empty-state i { font-size: 52px; margin-bottom: 16px; color: var(--dark3); display:block; }
        .empty-state h3 { color: var(--gray-light); margin-bottom: 6px; font-size: 16px; }
        .empty-state p { font-size: 13px; color: var(--gray); }

        .credit-bar {
            height: 10px; background: var(--dark3); border-radius: 5px; overflow: hidden; margin-top: 6px;
        }
        .credit-bar-fill {
            height: 100%; border-radius: 5px; transition: width 0.5s;
        }
        .credit-bar-fill.safe { background: var(--success); }
        .credit-bar-fill.warning { background: var(--warning); }
        .credit-bar-fill.danger { background: var(--danger); }

        .credit-summary {
            display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 20px;
        }
        .credit-summary-item {
            background: var(--dark3); border-radius: 12px; padding: 16px; text-align: center;
        }
        .credit-summary-item .value { font-size: 22px; font-weight: 700; }
        .credit-summary-item .label { font-size: 11px; color: var(--gray); margin-top: 4px; }

        .payment-method-label {
            display: flex; align-items: center; gap: 6px; padding: 12px 16px;
            background: var(--dark3); border: 2px solid transparent; border-radius: 10px; cursor: pointer; flex: 1; min-width: 100px;
            transition: all 0.2s;
        }
        .payment-method-label:hover { border-color: rgba(184,134,11,0.2); }
        .payment-method-label input[type="radio"] { accent-color: var(--primary); }
        .payment-method-label input[type="radio"]:checked + span { color: var(--primary); font-weight: 600; }
        .payment-method-label:has(input[type="radio"]:checked) { border-color: var(--primary); background: rgba(184,134,11,0.05); }

        /* ============ MARCAS, CATEGORIAS Y TALLAS ============ */

        /* -- Stats Row -- */
        .bc-stats {
            display: grid; grid-template-columns: repeat(4, 1fr);
            gap: 16px; margin-bottom: 24px;
        }
        .bc-stat-card {
            background: var(--dark2); border: 1px solid var(--dark3);
            border-radius: 14px; padding: 20px 14px; text-align: center;
            transition: transform 0.2s, box-shadow 0.2s;
        }
        .bc-stat-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 24px rgba(0,0,0,0.06);
        }
        .bc-stat-icon {
            width: 44px; height: 44px; border-radius: 12px;
            display: flex; align-items: center; justify-content: center;
            font-size: 18px; margin: 0 auto 10px;
        }
        .bc-stat-icon.brand { background: rgba(184,134,11,0.12); color: var(--primary); }
        .bc-stat-icon.category { background: rgba(99,102,241,0.12); color: #6366f1; }
        .bc-stat-icon.size { background: rgba(16,185,129,0.12); color: #10b981; }
        .bc-stat-icon.product { background: rgba(59,130,246,0.12); color: #3b82f6; }
        .bc-stat-num { font-size: 26px; font-weight: 800; color: var(--dark); line-height: 1; }
        .bc-stat-label { font-size: 12px; color: var(--gray-light); margin-top: 4px; }

        /* -- Main 2-Column Layout -- */
        .bc-main-grid {
            display: grid; grid-template-columns: 1fr 380px;
            gap: 20px; align-items: start;
        }

        /* -- Shared Panel -- */
        .bc-panel {
            background: var(--dark2); border: 1px solid var(--dark3);
            border-radius: 14px; overflow: hidden;
        }
        .bc-panel-header {
            display: flex; align-items: center; gap: 10px;
            padding: 16px 20px; border-bottom: 1px solid var(--dark3);
            background: var(--dark2);
        }
        .bc-panel-header h3 {
            font-size: 14px; font-weight: 700; margin: 0;
            display: flex; align-items: center; gap: 8px;
            color: var(--dark);
        }
        .bc-panel-header .btn { margin-left: auto; flex-shrink: 0; width: auto; padding: 5px 10px; }
        .bc-panel-body {
            padding: 14px; max-height: 520px;
            overflow-y: auto; overflow-x: hidden;
        }
        .bc-panel-body::-webkit-scrollbar { width: 5px; }
        .bc-panel-body::-webkit-scrollbar-track { background: transparent; }
        .bc-panel-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }
        .bc-card-count {
            background: var(--dark3); color: var(--gray-light);
            font-size: 11px; font-weight: 700;
            padding: 2px 9px; border-radius: 20px;
        }

        /* -- Right Column (stacks brands + sizes) -- */
        .bc-side { display: flex; flex-direction: column; gap: 20px; }

        /* -- Department Sections -- */
        .bc-dept-section { margin-bottom: 16px; }
        .bc-dept-section:last-child { margin-bottom: 0; }
        .bc-dept-header {
            display: flex; align-items: center; gap: 10px;
            margin-bottom: 12px; padding: 10px 14px;
            background: var(--dark3); border-radius: 10px;
        }
        .bc-dept-title {
            font-size: 13px; font-weight: 700; color: var(--dark);
            white-space: nowrap;
        }
        .bc-dept-count {
            font-size: 11px; font-weight: 600; color: var(--gray-light);
            background: var(--dark2); padding: 2px 8px; border-radius: 10px;
        }
        .bc-dept-header .btn {
            margin-left: auto; flex-shrink: 0;
            width: auto; padding: 5px 10px; font-size: 11px;
            border-radius: 6px;
        }

        /* -- Category Cards Grid -- */
        .bc-cat-grid {
            display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
            gap: 10px;
        }
        .bc-cat-card {
            background: var(--dark3); border-radius: 10px;
            padding: 14px; transition: all 0.15s;
            border: 1px solid transparent;
        }
        .bc-cat-card:hover {
            border-color: rgba(99,102,241,0.2);
            box-shadow: 0 4px 12px rgba(0,0,0,0.04);
        }
        .bc-cat-card-top {
            display: flex; align-items: flex-start;
            justify-content: space-between; margin-bottom: 8px;
        }
        .bc-cat-icon { font-size: 20px; line-height: 1; }
        .bc-cat-card-actions {
            display: flex; gap: 2px;
            opacity: 0; transition: opacity 0.15s;
        }
        .bc-cat-card:hover .bc-cat-card-actions { opacity: 1; }
        .bc-cat-card-name {
            font-size: 13px; font-weight: 700;
            color: var(--dark); margin-bottom: 3px;
        }
        .bc-cat-card-meta {
            font-size: 10px; color: var(--gray-light);
            margin-bottom: 8px; line-height: 1.4;
        }
        .bc-cat-subs { display: flex; flex-wrap: wrap; gap: 4px; min-height: 18px; }
        .bc-sub-chip {
            background: rgba(99,102,241,0.08); color: #6366f1;
            font-size: 10px; font-weight: 600;
            padding: 2px 7px; border-radius: 5px;
        }
        .bc-sub-empty { font-size: 10px; color: var(--gray); font-style: italic; }
        .bc-empty-inline {
            grid-column: 1 / -1; text-align: center;
            padding: 16px 10px; color: var(--gray); font-size: 12px;
        }

        /* -- Brand Items -- */
        .bc-brand-item {
            display: flex; align-items: center; justify-content: space-between;
            padding: 12px 14px; border-radius: 10px; margin-bottom: 6px;
            background: var(--dark3); transition: background 0.15s;
        }
        .bc-brand-item:last-child { margin-bottom: 0; }
        .bc-brand-item:hover { background: rgba(184,134,11,0.05); }
        .bc-brand-info { flex: 1; min-width: 0; }
        .bc-brand-name { font-size: 13px; font-weight: 700; color: var(--dark); }
        .bc-brand-meta { font-size: 11px; color: var(--gray-light); margin-top: 2px; }
        .bc-brand-rels { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
        .bc-brand-actions {
            display: flex; gap: 2px; flex-shrink: 0; margin-left: 8px;
        }

        /* -- Relationship Badges -- */
        .bc-rel-badge {
            font-size: 10px; font-weight: 600; padding: 2px 8px;
            border-radius: 6px; display: inline-flex;
            align-items: center; gap: 3px; white-space: nowrap;
        }
        .bc-rel-badge.cat { background: rgba(99,102,241,0.1); color: #6366f1; }
        .bc-rel-badge.size { background: rgba(16,185,129,0.1); color: #10b981; }

        /* -- Size Chips Section -- */
        .bc-size-group { margin-bottom: 16px; }
        .bc-size-group:last-child { margin-bottom: 0; }
        .bc-size-group-title {
            font-size: 12px; font-weight: 700; color: var(--gray-light);
            margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
        }
        .bc-size-chips { display: flex; flex-wrap: wrap; gap: 6px; }
        .bc-size-chip {
            display: inline-flex; align-items: center; gap: 5px;
            padding: 6px 12px; border-radius: 8px;
            font-size: 12px; font-weight: 600;
            background: var(--dark3); color: var(--dark);
            border: 1px solid transparent; transition: all 0.15s;
        }
        .bc-size-chip.shoe { border-color: rgba(184,134,11,0.15); }
        .bc-size-chip.clothing { border-color: rgba(99,102,241,0.15); }
        .bc-size-chip.other { border-color: rgba(16,185,129,0.15); }
        .bc-size-linked {
            background: var(--primary); color: white;
            font-size: 9px; padding: 1px 6px;
            border-radius: 10px; font-weight: 700; line-height: 1.3;
        }
        .bc-size-remove {
            background: none; border: none; color: var(--gray-light);
            cursor: pointer; font-size: 14px; padding: 0 2px;
            line-height: 1; transition: color 0.15s;
        }
        .bc-size-remove:hover { color: var(--danger); }

        /* -- Empty State -- */
        .bc-empty-state {
            text-align: center; padding: 32px 20px; color: var(--gray);
        }
        .bc-empty-state i {
            font-size: 36px; margin-bottom: 10px;
            display: block; color: var(--dark3);
        }
        .bc-empty-state h4 { font-size: 13px; color: var(--gray-light); margin-bottom: 2px; }
        .bc-empty-state p { font-size: 12px; color: var(--gray); }

        /* -- Action Buttons (pencil / trash) -- */
        .bc-action-btn {
            width: 28px; height: 28px; border: none; border-radius: 7px;
            display: flex; align-items: center; justify-content: center;
            cursor: pointer; font-size: 12px; transition: all 0.15s;
            background: transparent;
        }
        .bc-action-btn.edit { color: var(--gray-light); }
        .bc-action-btn.edit:hover { background: rgba(99,102,241,0.1); color: #6366f1; }
        .bc-action-btn.delete { color: var(--gray-light); }
        .bc-action-btn.delete:hover { background: rgba(239,68,68,0.1); color: var(--danger); }

        /* -- Modal Pieces -- */
        .bc-modal-icon {
            width: 52px; height: 52px; border-radius: 14px;
            display: flex; align-items: center; justify-content: center;
            font-size: 22px; margin: 0 auto 12px;
        }
        .bc-modal-icon.brand { background: rgba(184,134,11,0.1); color: var(--primary); }
        .bc-modal-icon.category { background: rgba(99,102,241,0.1); color: #6366f1; }
        .bc-modal-icon.danger { background: rgba(239,68,68,0.1); color: var(--danger); }
        .bc-modal-title {
            font-size: 18px; font-weight: 700; text-align: center;
            margin-bottom: 4px; color: var(--dark);
        }
        .bc-modal-subtitle {
            font-size: 13px; color: var(--gray-light);
            text-align: center; margin-bottom: 20px;
        }
        .bc-modal-input-group { margin-bottom: 16px; }
        .bc-modal-input-group label {
            display: block; font-size: 12px; font-weight: 600;
            color: var(--gray-light); margin-bottom: 6px;
        }
        .bc-modal-input-group .form-input,
        .bc-modal-input-group .form-select { width: 100%; }
        .bc-modal-actions { display: flex; gap: 10px; margin-top: 24px; }
        .bc-modal-actions .btn {
            flex: 1; padding: 12px; border-radius: 10px;
            font-size: 14px; font-weight: 600;
        }

        /* -- Checkbox Groups in Modal -- */
        .bc-modal-section {
            margin-bottom: 16px; background: var(--dark3);
            border-radius: 10px; overflow: hidden;
        }
        .bc-modal-section-header {
            display: flex; align-items: center; gap: 8px;
            padding: 10px 14px; font-size: 13px;
            font-weight: 600; color: var(--dark);
        }
        .bc-check-count {
            margin-left: auto; background: var(--primary);
            color: white; font-size: 10px; font-weight: 700;
            padding: 2px 8px; border-radius: 20px;
        }
        .bc-check-list {
            display: flex; flex-wrap: wrap; gap: 6px;
            padding: 4px 0;
        }
        .bc-check-item {
            display: inline-flex; align-items: center; justify-content: center;
            padding: 5px 13px; border-radius: 20px; cursor: pointer;
            font-size: 12px; font-weight: 500; transition: all 0.2s;
            border: 1.5px solid #d1d5db; background: #fff; color: #555;
            user-select: none; white-space: nowrap;
        }
        .bc-check-item:hover {
            border-color: var(--primary); color: var(--primary);
            background: rgba(184,134,11,0.04);
        }
        .bc-check-item input[type="checkbox"] { display: none; }
        .bc-check-box { display: none; }
        .bc-check-item input:checked + .bc-check-box + span,
        .bc-check-item:has(input:checked) {
            color: #fff;
        }
        .bc-check-item:has(input:checked) {
            background: var(--primary); border-color: var(--primary);
        }

        /* ============ MOBILE CARDS ============ */
        .mobile-cards { display: none; }
        .mobile-card {
            background: var(--white); border: 1px solid var(--dark3); border-radius: 14px;
            padding: 16px; margin-bottom: 10px;
            transition: border-color 0.2s;
        }
        .mobile-card:hover { border-color: rgba(184,134,11,0.25); }

        .mobile-card-header {
            display: flex; align-items: center; justify-content: space-between;
            margin-bottom: 10px; gap: 8px;
        }
        .mobile-card-id {
            font-size: 14px; font-weight: 700; color: var(--primary);
        }
        .mobile-card-sub {
            font-size: 11px; color: var(--gray); margin-top: 2px;
        }

        .mobile-card-body {
            display: flex; flex-direction: column; gap: 6px;
            padding-bottom: 10px; border-bottom: 1px solid var(--dark3);
        }
        .mobile-card-row {
            display: flex; align-items: center; gap: 8px;
            font-size: 12px; color: var(--dark);
        }
        .mobile-card-row i { font-size: 12px; opacity: 0.45; flex-shrink: 0; }
        .mobile-card-row .mc-label { color: var(--gray); min-width: 70px; flex-shrink: 0; }
        .mobile-card-row .mc-value { font-weight: 500; }
        .mobile-card-row .mc-value.truncate {
            max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        }

        .mobile-card-footer {
            display: flex; align-items: center; justify-content: space-between;
            padding-top: 10px; gap: 10px;
        }
        .mobile-card-total {
            font-size: 16px; font-weight: 700; color: var(--dark);
        }
        .mobile-card-total small {
            display: block; font-size: 11px; font-weight: 500; color: var(--gray);
        }
        .mobile-card-profit {
            font-size: 11px; font-weight: 600; color: var(--success);
        }

        .mobile-card-chips {
            display: flex; flex-wrap: wrap; gap: 5px;
        }

        /* Boton grande de acciones */
        .mobile-actions-btn {
            width: 44px; height: 44px; border: none; border-radius: 12px;
            background: var(--dark3); color: var(--dark); cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            font-size: 20px; transition: all 0.2s; position: relative; flex-shrink: 0;
        }
        .mobile-actions-btn:hover { background: rgba(184,134,11,0.12); color: var(--primary); }
        .mobile-actions-btn:active { transform: scale(0.95); }

        /* Dropdown de acciones */
        .mobile-actions-dropdown {
            position: fixed; bottom: 0; left: 0; right: 0;
            background: var(--white); border-radius: 20px 20px 0 0;
            box-shadow: none;
            z-index: 1100; padding: 0;
            transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .mobile-actions-dropdown.open { transform: translateY(0); box-shadow: 0 -8px 40px rgba(0,0,0,0.2); }

        .mad-overlay {
            display: none; position: fixed; inset: 0;
            background: rgba(0,0,0,0.5); z-index: 1099;
        }
        .mad-overlay.open { display: block; }

        .mad-header {
            display: flex; align-items: center; justify-content: space-between;
            padding: 16px 20px; border-bottom: 1px solid var(--dark3);
        }
        .mad-header span {
            font-size: 14px; font-weight: 600; color: var(--dark);
        }
        .mad-close {
            width: 32px; height: 32px; border: none; border-radius: 8px;
            background: var(--dark3); cursor: pointer; display: flex;
            align-items: center; justify-content: center; font-size: 16px; color: var(--gray);
        }

        .mad-actions { padding: 8px 12px 20px; display: flex; flex-direction: column; gap: 4px; }
        .mad-action-btn {
            display: flex; align-items: center; gap: 14px;
            padding: 14px 16px; border: none; border-radius: 12px;
            background: transparent; cursor: pointer; transition: background 0.15s;
            font-size: 14px; color: var(--dark); text-align: left; width: 100%;
        }
        .mad-action-btn i {
            width: 40px; height: 40px; border-radius: 10px;
            display: flex; align-items: center; justify-content: center;
            font-size: 16px; flex-shrink: 0;
        }
        .mad-action-btn span { font-weight: 500; }
        .mad-action-btn:hover { background: rgba(0,0,0,0.04); }

        .mad-action-btn.edit i { background: rgba(59,130,246,0.12); color: var(--info); }
        .mad-action-btn.view i { background: rgba(184,134,11,0.12); color: var(--primary); }
        .mad-action-btn.delete i { background: rgba(239,68,68,0.12); color: var(--danger); }
        .mad-action-btn.pay i { background: rgba(34,197,94,0.12); color: var(--success); }
        .mad-action-btn.print i { background: rgba(99,102,241,0.12); color: #4f46e5; }
        .mad-action-btn.download i { background: rgba(14,165,233,0.12); color: #0ea5e9; }
        .mad-action-btn.convert i { background: rgba(184,134,11,0.12); color: var(--primary); }
        .mad-action-btn.danger span { color: var(--danger); }

        .mad-info { padding: 12px 20px; border-bottom: 1px solid var(--dark3); }
        .mad-info-title {
            font-size: 11px; font-weight: 600; color: var(--gray);
            text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
        }
        .mad-info-row {
            display: flex; justify-content: space-between; align-items: center;
            padding: 8px 0; font-size: 13px;
        }
        .mad-info-row + .mad-info-row { border-top: 1px solid rgba(0,0,0,0.04); }
        .mad-info-label { color: var(--gray); }
        .mad-info-value { font-weight: 600; color: var(--dark); text-align: right; }

        .mad-section-title {
            font-size: 11px; font-weight: 600; color: var(--gray);
            text-transform: uppercase; letter-spacing: 0.5px;
            padding: 12px 20px 4px;
        }

        /* Card variantes por tipo */
        .mobile-card.inventario .mc-stock-chip {
            display: inline-flex; align-items: center; gap: 3px;
            padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 600;
            background: var(--dark3); color: var(--dark);
        }
        .mobile-card.inventario .mc-stock-chip.danger { background: rgba(239,68,68,0.12); color: var(--danger); }
        .mobile-card.inventario .mc-stock-chip.warning { background: rgba(245,158,11,0.12); color: var(--warning); }

        .mobile-card.credito-bar {
            display: flex; flex-direction: column; gap: 8px;
        }
        .mobile-card.credito-bar .mc-bar-track {
            width: 100%; height: 6px; border-radius: 10px; background: var(--dark3);
        }
        .mobile-card.credito-bar .mc-bar-fill {
            height: 100%; border-radius: 10px; transition: width 0.4s;
        }
        .mobile-card.credito-bar .mc-bar-fill.safe { background: var(--success); }
        .mobile-card.credito-bar .mc-bar-fill.warning { background: var(--warning); }
        .mobile-card.credito-bar .mc-bar-fill.danger { background: var(--danger); }

        .mobile-card-footer-info {
            display: flex; align-items: center; gap: 6px;
            font-size: 12px; color: var(--gray);
        }
        .mobile-card-footer-info i { font-size: 12px; }

        .mobile-card-avatar {
            width: 36px; height: 36px; border-radius: 10px;
            background: rgba(184,134,11,0.12); color: var(--primary);
            display: flex; align-items: center; justify-content: center;
            font-size: 13px; font-weight: 700; flex-shrink: 0;
        }

        /* ============ RESPONSIVE ============ */
        @media (max-width: 1200px) {
            .bc-main-grid { grid-template-columns: 1fr 320px; }
        }
        @media (max-width: 1100px) {
            .bc-main-grid { grid-template-columns: 1fr; }
            .bc-side { flex-direction: row; gap: 16px; }
            .bc-side .bc-panel { flex: 1; }
        }
        @media (max-width: 768px) {
            .bc-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
            .bc-side { flex-direction: column; }
            .bc-cat-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
            .bc-dept-header { flex-wrap: wrap; }
        }
        @media (max-width: 600px) {
            .bc-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
            .bc-stat-card { padding: 14px 10px; }
            .bc-stat-num { font-size: 22px; }
            .bc-stat-icon { width: 38px; height: 38px; font-size: 16px; }
            .bc-cat-grid { grid-template-columns: 1fr; }
            .bc-main-grid { gap: 12px; }
            .bc-panel-header { padding: 14px 16px; }
            .bc-panel-body { padding: 12px; }
        }
        @media (max-width: 380px) {
            .bc-stats { grid-template-columns: 1fr 1fr; gap: 6px; }
            .bc-stat-num { font-size: 20px; }
            .bc-brand-item { padding: 10px 12px; }
        }

        /* ============ CUSTOM DROPDOWN ============ */
        .cd-wrap { position: relative; width: 100%; }
        .cd-trigger {
            display: flex; align-items: center; gap: 8px;
            padding: 10px 14px; background: var(--dark3); border: 1px solid var(--dark3);
            border-radius: 10px; cursor: pointer; transition: all 0.2s; min-height: 42px;
            font-size: 14px; color: var(--gray-light);
        }
        .cd-trigger:hover { border-color: rgba(184,134,11,0.3); }
        .cd-trigger.cd-open { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(184,134,11,0.1); }
        .cd-trigger.cd-has-value { color: var(--dark); font-weight: 500; }
        .cd-icon { font-size: 14px; opacity: 0.5; }
        .cd-trigger.cd-has-value .cd-icon { opacity: 0.8; color: var(--primary); }
        .cd-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .cd-chevron { font-size: 10px; opacity: 0.4; transition: transform 0.2s; }
        .cd-trigger.cd-open .cd-chevron { transform: rotate(180deg); }

        .cd-list {
            position: absolute; top: calc(100% + 4px); left: 0; right: 0;
            background: var(--dark2); border: 1px solid var(--dark3); border-radius: 10px;
            box-shadow: 0 8px 30px rgba(0,0,0,0.15); z-index: 100;
            opacity: 0; visibility: hidden; transform: translateY(-8px);
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            max-height: 280px; overflow: hidden;
        }
        .cd-list.cd-open { opacity: 1; visibility: visible; transform: translateY(0); }

        .cd-search { padding: 8px; border-bottom: 1px solid var(--dark3); }
        .cd-search-input {
            width: 100%; padding: 8px 12px; background: var(--dark3); border: 1px solid transparent;
            border-radius: 8px; color: var(--dark); font-size: 13px; outline: none;
        }
        .cd-search-input:focus { border-color: var(--primary); }
        .cd-search-input::placeholder { color: var(--gray-light); }

        .cd-items { max-height: 200px; overflow-y: auto; padding: 4px; }
        .cd-items::-webkit-scrollbar { width: 5px; }
        .cd-items::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }

        .cd-item {
            display: flex; align-items: center; gap: 8px;
            padding: 9px 12px; border-radius: 8px; cursor: pointer;
            font-size: 13px; transition: background 0.15s; color: var(--dark);
        }
        .cd-item:hover { background: rgba(184,134,11,0.08); }
        .cd-item.cd-selected { background: rgba(184,134,11,0.12); color: var(--primary); font-weight: 600; }
        .cd-item i { font-size: 13px; opacity: 0.6; }
        .cd-item.cd-selected i { opacity: 1; color: var(--primary); }
        .cd-empty { padding: 16px; text-align: center; color: var(--gray); font-size: 12px; }
