        :root { --primary: #1e40af; --secondary: #f3f4f6; --text-dark: #1f2937; --text-light: #6b7280; --border: #e5e7eb; --success: #16a34a; --danger: #dc2626; --warning: #d97706; --info: #0ea5e9; --bg: #f8fafc; }

        * { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', system-ui, sans-serif; }

        body { background: var(--bg); color: var(--text-dark); display: flex; height: 100vh; overflow: hidden; flex-direction: row; }

        

        .mobile-header { display: none; }

        .sidebar { width: 260px; background: #0f172a; color: white; display: flex; flex-direction: column; z-index: 10; overflow-y: auto;}

        .brand { padding: 24px 20px; border-bottom: 1px solid #1e293b; display: flex; flex-direction: column; align-items: center; gap: 12px; cursor: pointer; user-select: none; position: relative;}

        #appLogoImg { max-width: 80px; max-height: 80px; border-radius: 8px; display: none; object-fit: cover; }

        

        .nav-item { padding: 16px 20px; cursor: pointer; transition: 0.2s; border-left: 4px solid transparent; font-weight: 600;}

        .nav-item:hover { background: #1e293b; }

        .nav-item.active { background: #1e293b; border-left-color: #38bdf8; color: #38bdf8;}

        .workspace { flex: 1; padding: 24px; overflow-y: auto; position: relative;}

        .view-section { display: none; animation: fadeIn 0.3s; }

        .view-section.active { display: block; }

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

        

        .card { background: white; padding: 24px; border-radius: 12px; border: 1px solid var(--border); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); margin-bottom: 24px; }

        .grid-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }

        .item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }

        

        h2 { font-size: 20px; margin-bottom: 16px; color: var(--text-dark); }

        input, select, textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; margin-bottom: 16px; outline: none; transition: border 0.2s;}

        input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1); }

        label { display: block; font-size: 13px; font-weight: 600; color: var(--text-light); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px;}

        

        .btn { padding: 10px 20px; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 14px; transition: 0.2s; display: inline-flex; align-items: center; justify-content: center; gap: 6px;}

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

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

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

        .btn-outline { background: white; color: var(--primary); border: 1px solid var(--primary); }

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

        .btn-info { background: #e0f2fe; color: var(--info); }

        .btn-sm { padding: 6px 10px; font-size: 12px; }

        

        .table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

        table { width: 100%; border-collapse: collapse; }

        th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }

        th { background: var(--secondary); font-weight: 600; color: var(--text-light); font-size: 13px; text-transform: uppercase; }

        

        .modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 10000; backdrop-filter: blur(4px); padding: 10px; }

        .modal-box { background: white; padding: 30px; border-radius: 16px; width: 100%; max-width: 580px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); max-height: 90vh; overflow-y: auto;}

        .hidden { display: none !important; }

        .flex-between { display: flex; justify-content: space-between; align-items: center; }

        .badge { padding: 4px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; background: var(--secondary); color: var(--text-dark); display: inline-block;}

        .stat-card { background: white; padding: 20px; border-radius: 12px; border: 1px solid var(--border); border-left: 4px solid var(--primary); flex: 1; min-width: 130px;}

        .stat-card h3 { font-size: 13px; color: var(--text-light); margin-bottom: 8px; text-transform: uppercase; font-weight:bold;}

        .stat-card .val { font-size: 20px; font-weight: 800; color: var(--text-dark); }

        

        .fullscreen-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg); z-index: 20000; display: flex; align-items: center; justify-content: center; flex-direction: column; }

        .login-card { background: white; padding: 35px; border-radius: 16px; border: 1px solid var(--border); box-shadow: 0 10px 25px rgba(0,0,0,0.1); width: 100%; max-width: 400px; text-align: center; position: relative;}



        #licenseBlocker { position: absolute; top:0; left:0; width:100%; height:100%; background:rgba(248, 250, 252, 0.98); z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; display: none;}



        /* --- Subscription plan selector cards (Monthly / Quarterly / Yearly) --- */

        .plan-option { flex:1; border:2px solid var(--border); border-radius:10px; padding:12px 6px 10px; cursor:pointer; text-align:center; position:relative; background:white; transition: border-color 0.15s, background 0.15s; }

        .plan-option:hover { border-color: var(--primary); }

        .plan-option.selected { border-color: var(--primary); background: #eef2ff; }

        .plan-option .plan-name { font-size:11px; font-weight:700; color:var(--text-dark); text-transform:uppercase; letter-spacing:0.5px; }

        .plan-option .plan-orig { display:none; font-size:11px; color:var(--text-light); text-decoration:line-through; }

        .plan-option .plan-offer { display:block; font-size:17px; font-weight:800; color:var(--primary); margin-top:2px; }

        .plan-option .plan-badge { position:absolute; top:-9px; left:50%; transform:translateX(-50%); background:var(--success); color:white; font-size:9px; font-weight:700; padding:2px 8px; border-radius:99px; white-space:nowrap; }

        

        @media (max-width: 768px) {

            body { flex-direction: column; }

            .mobile-header { display: flex; justify-content: space-between; align-items: center; background: #0f172a; color: white; padding: 10px 15px; width: 100%; z-index: 100; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }

            .sidebar { position: fixed; bottom: 0; left: 0; width: 100%; height: 65px; flex-direction: row; z-index: 1000; overflow-x: auto; overflow-y: hidden; border-top: 1px solid #1e293b; padding: 0; background: #0f172a; justify-content: flex-start; white-space: nowrap; box-shadow: 0 -2px 10px rgba(0,0,0,0.15); }

            .sidebar::-webkit-scrollbar { display: none; }

            .sidebar .brand { display: none; }

            .nav-item { padding: 8px 14px; font-size: 11px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; flex: 0 0 auto; border-left: none; border-top: 3px solid transparent; text-align: center; border-radius: 0; }

            .nav-item.active { border-top-color: #38bdf8; background: #1e293b; border-left-color: transparent; }

            .sidebar > div:last-child { display: none; }

            .workspace { padding: 12px; margin-bottom: 95px !important; padding-bottom: 50px !important; padding-top: 10px; }

            .grid-layout { grid-template-columns: 1fr; gap: 15px; }

            .card { padding: 15px; margin-bottom: 15px; }

            .item-grid { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); }

            table { font-size: 12px; white-space: nowrap; }

            th, td { padding: 8px 10px; }

            #cartCard { position: relative !important; top: 0 !important; height: auto !important; max-height: none !important; display: flex; flex-direction: column; margin-bottom: 120px !important; padding-bottom: 35px !important; box-shadow: 0 4px 15px rgba(0,0,0,0.08); }

            #cartList { flex: 1; overflow-y: auto; padding-bottom: 10px; max-height: 250px; }

            .modal-box { padding: 20px; }

            .user-logout-btn { display: none; }

        }



        /* --- Billing Checkout Action Buttons (Enhanced for Mobile & Desktop) --- */

        .billing-checkout-btns { display: flex; flex-wrap: nowrap; gap: 10px; margin-top: 6px; }

        .billing-checkout-btns .btn { flex: 1; font-size: 14px; font-weight: 700; padding: 12px 10px; min-height: 48px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); transition: transform 0.1s, box-shadow 0.15s; }

        .billing-checkout-btns .btn:active { transform: scale(0.98); }

        .billing-checkout-btns .btn-primary { background: linear-gradient(135deg, #1e40af, #2563eb); }

        .billing-checkout-btns .btn-success { background: linear-gradient(135deg, #15803d, #16a34a); }



        @media (max-width: 768px) {

            .billing-checkout-btns { gap: 12px; margin-top: 10px; margin-bottom: 20px; }

            .billing-checkout-btns .btn { font-size: 15px; padding: 14px 10px; min-height: 52px; border-radius: 10px; }

        }



        /* --- Mobile Floating Quick Cart Bar --- */

        #mobileCartFloatingBar {

            display: none;

            position: fixed;

            bottom: 75px;

            left: 15px;

            right: 15px;

            background: linear-gradient(135deg, #0f172a, #1e40af);

            color: white;

            padding: 12px 18px;

            border-radius: 50px;

            box-shadow: 0 4px 20px rgba(0,0,0,0.3);

            font-size: 14px;

            font-weight: 700;

            z-index: 990;

            cursor: pointer;

            align-items: center;

            justify-content: space-between;

            border: 1px solid rgba(255,255,255,0.2);

            animation: slideUpFloating 0.25s ease-out;

        }

        @keyframes slideUpFloating {

            from { transform: translateY(20px); opacity: 0; }

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

        }



        .help-tabs { display:flex; gap:10px; margin-bottom:15px; border-bottom:2px solid var(--border); padding-bottom:10px; }

        .help-tab { background:none; border:none; padding:5px 15px; font-weight:bold; color:var(--text-light); cursor:pointer; font-size:14px;}

        .help-tab.active { color:var(--primary); border-bottom:2px solid var(--primary); margin-bottom:-12px; }

        .help-content h3 { font-size: 15px; color: var(--primary); margin-top: 15px; margin-bottom: 8px; border-bottom: 1px dashed var(--border); padding-bottom: 5px; }

        .help-content p { margin-bottom: 10px; line-height: 1.6; }

        .help-content b { color: var(--text-dark); }

        .contact-box { background: #f0f9ff; border: 1px solid #bae6fd; padding: 15px; border-radius: 8px; margin-top: 20px; text-align: center; }

        

        .toast-msg { visibility: hidden; min-width: 250px; background-color: #10b981; color: #fff; text-align: center; border-radius: 8px; padding: 12px; position: fixed; z-index: 99999; left: 50%; transform: translateX(-50%); bottom: 30px; font-size: 14px; font-weight: bold; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }

        .toast-msg.show { visibility: visible; animation: fadein 0.5s, fadeout 0.5s 2.5s; }

        @keyframes fadein { from {bottom: 0; opacity: 0;} to {bottom: 30px; opacity: 1;} }

        @keyframes fadeout { from {bottom: 30px; opacity: 1;} to {bottom: 0; opacity: 0;} }



        /* Plugin Toggles */

        .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: 34px; }

        .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(--success); }

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

        .plugin-item { display:flex; justify-content:space-between; align-items:center; padding:15px; background:#f8fafc; border:1px solid var(--border); border-radius:8px; margin-bottom:10px; }



        /* AI Hub & Voice Assistant Styles */

        .ai-pulse { animation: micPulse 1.2s infinite; background: #ef4444 !important; }

        @keyframes micPulse { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }

        .ai-badge-risk { background: #fee2e2; color: #dc2626; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }

        .ai-badge-warning { background: #fef3c7; color: #d97706; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }

        .ai-badge-good { background: #dcfce7; color: #16a34a; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }

        
        /* Auth Screen Tabs (Sign In / Sign Up) */
        .auth-tabs {
            display: flex;
            background: #f1f5f9;
            padding: 4px;
            border-radius: 10px;
            margin-bottom: 18px;
            border: 1px solid var(--border);
        }
        .auth-tab-btn {
            flex: 1;
            padding: 10px 12px;
            border: none;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 700;
            cursor: pointer;
            background: transparent;
            color: #64748b;
            transition: all 0.2s ease;
        }
        .auth-tab-btn.active {
            background: white;
            color: var(--primary);
            box-shadow: 0 2px 6px rgba(0,0,0,0.08);
        }

        .sub-type-selector { display:flex; gap:8px; background:#f1f5f9; padding:4px; border-radius:10px; margin-bottom:14px; }

        .sub-type-btn { flex:1; padding:8px 12px; border:none; border-radius:8px; font-size:12px; font-weight:700; cursor:pointer; background:transparent; color:#64748b; transition:0.2s; }

        .sub-type-btn.active { background:white; color:#0b57d0; box-shadow:0 2px 4px rgba(0,0,0,0.06); }

        .ai-stat-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap:14px; margin-bottom:20px; }

        .ai-card { background:white; border-radius:12px; border:1px solid var(--border); padding:16px; position:relative; overflow:hidden; }

        .ai-card::before { content:''; position:absolute; top:0; left:0; width:4px; height:100%; background:#0b57d0; }

        .ai-card.risk::before { background:#dc2626; }

        .ai-card.warn::before { background:#d97706; }

        .ai-card.success::before { background:#16a34a; }

        /* ---- Label Designer ---- */
        .lbl-layout { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 16px; align-items: start; }
        .lbl-panel label { font-size: 11px; }
        .lbl-panel select, .lbl-panel input[type=number], .lbl-panel input[type=text] { margin-bottom: 8px; }
        .lbl-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
        .lbl-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin-bottom: 10px; }
        .lbl-checks label { display: flex; align-items: center; gap: 6px; font-size: 12px; text-transform: none; margin: 0; }
        .lbl-checks input { width: auto; margin: 0; }
        .lbl-note { font-size: 11px; background: #fef3c7; border: 1px solid #fcd34d; color: #92400e; padding: 8px 10px; border-radius: 8px; margin: 8px 0; line-height: 1.5; }
        .lbl-preview-wrap { background: #e2e8f0; border-radius: 8px; padding: 16px; overflow: auto; display: flex; justify-content: center; }
        #lblPreview { transform-origin: top center; }
        .lbl-copies { width: 70px; padding: 6px; margin: 0; font-size: 13px; }
        @media (max-width: 860px) { .lbl-layout { grid-template-columns: 1fr; } }

        /* ---- Enterprise Features Styles ---- */
        .sub-tab-bar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
        .sub-tab-btn { padding: 8px 14px; border: 1px solid var(--border); background: white; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--text-dark); transition: 0.2s; white-space: nowrap; }
        .sub-tab-btn:hover { background: #f1f5f9; }
        .sub-tab-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
        .report-sub-view { display: none; }
        .report-sub-view.active { display: block; }
        .loyalty-badge { display: inline-flex; align-items: center; gap: 6px; background: #fef3c7; border: 1px solid #fde68a; color: #92400e; padding: 4px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; margin-top: 6px; }
        .ca-banner { background: #eff6ff; border-left: 4px solid #3b82f6; color: #1e40af; padding: 10px 14px; border-radius: 6px; font-size: 12px; font-weight: 600; margin-bottom: 15px; display: none; }
        .ledger-row-dr { color: #dc2626; font-weight: 600; }
        .ledger-row-cr { color: #16a34a; font-weight: 600; }
