        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            background: #f5f7fa;
            color: #1a202c;
            overflow-x: hidden;
        }

        /* Layout Container */
        .app-container {
            display: flex;
            min-height: 100vh;
            overflow-x: hidden;
        }

        /* Sidebar */
        .sidebar {
            width: 260px;
            min-width: 260px;
            background: #1a202c;
            color: white;
            display: flex;
            flex-direction: column;
            position: fixed;
            height: 100vh;
            left: 0;
            top: 0;
            z-index: 1000;
            transition: transform 0.3s ease, width 0.22s ease, min-width 0.22s ease;
        }

        .sidebar-header {
            padding: 24px 20px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            display: flex;
            align-items: center;
            gap: 12px;
            flex-shrink: 0;
        }

        .sidebar-minimize-btn {
            display: none;
        }

        .sidebar-logo {
            width: 40px;
            height: 40px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            background: white;
        }
        .sidebar-logo img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .sidebar-title {
            flex: 1;
        }

        .sidebar-title h1 {
            font-size: 17px;
            font-weight: 700;
            margin-bottom: 2px;
            color: #fff;
        }

        .sidebar-title p {
            font-size: 10px;
            color: rgba(255, 255, 255, 0.55);
            text-transform: uppercase;
            letter-spacing: 0.08em;
        }

        .sidebar-nav {
            flex: 1;
            padding: 16px 12px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .nav-item {
            display: grid;
            grid-template-columns: auto 1fr;
            align-items: center;
            gap: 12px;
            padding: 12px 14px;
            color: rgba(255, 255, 255, 0.75);
            text-decoration: none;
            transition: all 0.18s;
            cursor: pointer;
            border-radius: 10px;
            border-left: 3px solid transparent;
        }

        .nav-item:hover {
            background: rgba(255, 255, 255, 0.08);
            color: white;
        }

        .nav-item.active {
            background: rgba(102, 126, 234, 0.2);
            color: white;
            border-left-color: #667eea;
            box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
        }

        .nav-item-icon {
            width: 22px;
            height: 22px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            opacity: 0.9;
        }

        .nav-item > span:last-child {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            min-width: 0;
            font-size: 14px;
            font-weight: 500;
        }

        .sidebar-footer {
            padding: 16px 12px;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
        }

        .user-profile {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 14px;
            background: rgba(255, 255, 255, 0.06);
            border-radius: 10px;
            margin-bottom: 12px;
            border: 1px solid rgba(255, 255, 255, 0.08);
        }

        .user-avatar {
            width: 42px;
            height: 42px;
            border-radius: 50%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 16px;
            color: white;
            flex-shrink: 0;
        }

        .user-info {
            flex: 1;
            min-width: 0;
        }

        .user-name {
            font-size: 14px;
            font-weight: 600;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            color: #fff;
        }

        .user-role {
            font-size: 11px;
            color: rgba(255, 255, 255, 0.6);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-top: 2px;
        }

        .btn-change-password {
            width: 100%;
            padding: 10px 14px;
            margin-bottom: 8px;
            background: rgba(102, 126, 234, 0.15);
            color: #a5b4fc;
            border: 1px solid rgba(102, 126, 234, 0.3);
            border-radius: 8px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            transition: all 0.18s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .btn-change-password:hover {
            background: rgba(102, 126, 234, 0.25);
            color: #c7d2fe;
            border-color: rgba(102, 126, 234, 0.4);
        }

        .btn-logout-sidebar {
            width: 100%;
            padding: 10px 14px;
            background: rgba(239, 68, 68, 0.12);
            color: #fca5a5;
            border: 1px solid rgba(239, 68, 68, 0.25);
            border-radius: 8px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            transition: all 0.18s;
        }

        .btn-logout-sidebar:hover {
            background: rgba(239, 68, 68, 0.22);
            color: #fecaca;
            border-color: rgba(239, 68, 68, 0.35);
        }

        /* Main Content Area */
        .main-content-wrapper {
            flex: 1;
            min-width: 0; /* Allow flex child to shrink and prevent overflow */
            margin-left: 260px;
            display: flex;
            flex-direction: column;
            min-height: 100vh;
            overflow-x: hidden;
            transition: margin-left 0.22s ease;
        }

        /* Desktop: minimize sidebar to icon rail (wider main area) */
        @media (min-width: 1025px) {
            .sidebar-minimize-btn {
                display: flex;
                align-items: center;
                justify-content: center;
                width: 34px;
                height: 34px;
                padding: 0;
                margin-left: auto;
                flex-shrink: 0;
                background: rgba(255, 255, 255, 0.08);
                border: 1px solid rgba(255, 255, 255, 0.12);
                border-radius: 8px;
                color: rgba(255, 255, 255, 0.9);
                cursor: pointer;
                transition: background 0.15s ease, border-color 0.15s ease;
            }

            .sidebar-minimize-btn:hover {
                background: rgba(255, 255, 255, 0.14);
                border-color: rgba(255, 255, 255, 0.2);
            }

            .sidebar-minimize-icon {
                font-size: 12px;
                line-height: 1;
            }

            #appContainer.sidebar-minimized .sidebar {
                width: 72px;
                min-width: 72px;
            }

            #appContainer.sidebar-minimized .main-content-wrapper {
                margin-left: 72px;
            }

            #appContainer.sidebar-minimized .sidebar-title {
                display: none;
            }

            #appContainer.sidebar-minimized .sidebar-header {
                flex-direction: column;
                justify-content: flex-start;
                align-items: center;
                padding: 16px 10px;
                gap: 10px;
            }

            #appContainer.sidebar-minimized .sidebar-minimize-btn {
                margin-left: 0;
                order: 2;
            }

            #appContainer.sidebar-minimized .sidebar-logo {
                order: 1;
            }

            #appContainer.sidebar-minimized .sidebar-nav {
                padding: 12px 8px;
            }

            #appContainer.sidebar-minimized .nav-item {
                grid-template-columns: 1fr;
                justify-items: center;
                padding: 12px 8px;
                gap: 0;
            }

            #appContainer.sidebar-minimized .nav-item > span:not(.nav-item-icon) {
                display: none;
            }

            #appContainer.sidebar-minimized .nav-item-icon {
                width: 26px;
                height: 26px;
                font-size: 18px;
            }

            #appContainer.sidebar-minimized .user-info {
                display: none;
            }

            #appContainer.sidebar-minimized .user-profile {
                justify-content: center;
                padding: 10px;
            }

            #appContainer.sidebar-minimized .sidebar-footer {
                padding: 12px 8px;
            }

            #appContainer.sidebar-minimized .btn-change-password {
                font-size: 0;
                padding: 10px;
                position: relative;
            }

            #appContainer.sidebar-minimized .btn-change-password::after {
                content: '🔑';
                font-size: 16px;
                line-height: 1;
            }

            #appContainer.sidebar-minimized .btn-logout-sidebar {
                font-size: 0;
                padding: 10px;
            }

            #appContainer.sidebar-minimized .btn-logout-sidebar::after {
                content: '🚪';
                font-size: 16px;
                line-height: 1;
            }
        }

        /* Top Header */
        .top-header {
            background: white;
            padding: 16px 32px;
            border-bottom: 1px solid #e2e8f0;
            display: flex;
            align-items: center;
            justify-content: space-between;
            position: sticky;
            top: 0;
            z-index: 100;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        }

        .header-left {
            display: flex;
            align-items: center;
            gap: 16px;
        }

        .page-title {
            font-size: 24px;
            font-weight: 700;
            color: #1a202c;
        }

        .header-right {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .btn-header {
            padding: 8px 16px;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            border: none;
        }

        .btn-primary-header {
            background: #667eea;
            color: white;
        }

        .btn-primary-header:hover {
            background: #5568d3;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
        }

        .btn-secondary-header {
            background: rgba(255,255,255,0.12);
            color: #fff;
            border: 1px solid rgba(255,255,255,0.25);
        }

        .btn-secondary-header:hover {
            background: rgba(255,255,255,0.22);
            color: #fff;
        }

        .btn-secondary-header:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }

        .btn-secondary-header:disabled:hover {
            background: rgba(255,255,255,0.12);
        }

        /* Top header (light bg) — override for visibility */
        .top-header .btn-secondary-header {
            background: #f1f5f9;
            color: #475569;
            border: 1px solid #e2e8f0;
        }

        .top-header .btn-secondary-header:hover {
            background: #e2e8f0;
            color: #1e293b;
        }

        .top-header .btn-secondary-header:disabled:hover {
            background: #f1f5f9;
        }

        /* Card headers, content cards, and modals (white bg) — light-theme override */
        .card-header .btn-secondary-header,
        .content-card .btn-secondary-header,
        .modal-body .btn-secondary-header,
        .modal-content .btn-secondary-header {
            background: #f1f5f9;
            color: #475569;
            border: 1px solid #e2e8f0;
        }

        .card-header .btn-secondary-header:hover,
        .content-card .btn-secondary-header:hover,
        .modal-body .btn-secondary-header:hover,
        .modal-content .btn-secondary-header:hover {
            background: #e2e8f0;
            color: #1e293b;
        }

        .card-header .btn-secondary-header:disabled:hover,
        .content-card .btn-secondary-header:disabled:hover,
        .modal-body .btn-secondary-header:disabled:hover,
        .modal-content .btn-secondary-header:disabled:hover {
            background: #f1f5f9;
        }

        /* Search buttons — more visible primary-style color */
        .btn-search,
        .btn-header.btn-search {
            background: #3b82f6 !important;
            color: white !important;
            border: 1px solid #2563eb !important;
        }
        .btn-search:hover,
        .btn-header.btn-search:hover {
            background: #2563eb !important;
            color: white !important;
            box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
        }

        /* Content Area */
        .content-area {
            flex: 1;
            min-width: 0; /* Prevent horizontal overflow */
            padding: 32px;
            overflow-y: auto;
            overflow-x: hidden;
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        /* Settings page — horizontal sub-tabs */
        .settings-subnav {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-bottom: 20px;
            padding: 6px;
            background: #e2e8f0;
            border-radius: 10px;
            border: 1px solid #cbd5e1;
        }

        .settings-subnav-btn {
            padding: 10px 14px;
            border: none;
            background: transparent;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 600;
            color: #475569;
            cursor: pointer;
            font-family: inherit;
            transition: background 0.15s, color 0.15s, box-shadow 0.15s;
        }

        .settings-subnav-btn:hover {
            background: rgba(255, 255, 255, 0.55);
            color: #1e293b;
        }

        .settings-subnav-btn.active {
            background: #fff;
            color: #4f46e5;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
        }

        /**
         * Settings sub-panels: unmounted panels use display:none (no layout cost).
         * After a panel has loaded once, `--mounted` keeps it in an absolute stack when hidden
         * so switching back does not force a full relayout of huge <select> trees.
         */
        .settings-subpanels-stack {
            position: relative;
            width: 100%;
            min-height: 120px;
            contain: layout style;
        }

        .settings-subpanel:not(.settings-subpanel--mounted):not(.active) {
            display: none;
        }

        .settings-subpanel:not(.settings-subpanel--mounted).active {
            display: block;
        }

        .settings-subpanel.settings-subpanel--mounted {
            display: block;
        }

        .settings-subpanel.settings-subpanel--mounted:not(.active) {
            position: absolute;
            left: 0;
            right: 0;
            top: 0;
            width: 100%;
            box-sizing: border-box;
            visibility: hidden;
            opacity: 0;
            pointer-events: none;
            z-index: 0;
        }

        .settings-subpanel.settings-subpanel--mounted.active {
            position: relative;
            visibility: visible;
            opacity: 1;
            pointer-events: auto;
            z-index: 1;
        }

        /* Stats Cards */
        .stats-grid {
            display: flex;
            gap: 12px;
            margin-bottom: 20px;
        }

        .stat-card {
            background: white;
            padding: 14px 18px;
            border-radius: 10px;
            border: 1px solid #e2e8f0;
            display: flex;
            align-items: center;
            gap: 14px;
            position: relative;
            overflow: hidden;
            transition: box-shadow 0.15s;
        }
        .stat-card:hover {
            box-shadow: 0 4px 16px rgba(0,0,0,0.08);
        }
        .stat-card-icon {
            width: 40px;
            height: 40px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            font-size: 18px;
        }
        .stat-card-body { flex: 1; min-width: 0; }
        .stat-label {
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            margin-bottom: 3px;
        }
        .stat-value {
            font-size: 26px;
            font-weight: 700;
            line-height: 1;
        }
        .stat-card-total  .stat-card-icon { background: #eff6ff; }
        .stat-card-total  .stat-label     { color: #3b82f6; }
        .stat-card-total  .stat-value     { color: #1e40af; }
        .stat-card-total::after           { content:''; position:absolute; left:0; top:0; bottom:0; width:3px; background:#3b82f6; border-radius:10px 0 0 10px; }

        .stat-card-pending .stat-card-icon { background: #fffbeb; }
        .stat-card-pending .stat-label     { color: #d97706; }
        .stat-card-pending .stat-value     { color: #92400e; }
        .stat-card-pending::after          { content:''; position:absolute; left:0; top:0; bottom:0; width:3px; background:#f59e0b; border-radius:10px 0 0 10px; }

        .stat-card-won .stat-card-icon { background: #f0fdf4; }
        .stat-card-won .stat-label     { color: #16a34a; }
        .stat-card-won .stat-value     { color: #14532d; }
        .stat-card-won::after          { content:''; position:absolute; left:0; top:0; bottom:0; width:3px; background:#22c55e; border-radius:10px 0 0 10px; }

        /* Main Content Card */
        .content-card {
            background: white;
            border-radius: 12px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            border: 1px solid #e2e8f0;
            overflow: hidden;
            max-width: 100%;
        }

        .card-header {
            padding: 24px;
            border-bottom: 1px solid #e2e8f0;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .card-title {
            font-size: 20px;
            font-weight: 700;
            color: #1a202c;
        }

        .card-body {
            padding: 24px;
        }

        /* Deals Filters and Search */
        .deals-filters {
            margin-bottom: 24px;
            padding: 20px;
            background: #f7fafc;
            border-radius: 8px;
            border: 1px solid #e2e8f0;
        }

        .search-box {
            margin-bottom: 16px;
        }

        .search-box input {
            width: 100%;
            padding: 12px 16px;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            font-size: 14px;
            transition: all 0.2s;
        }

        .search-box input:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }

        .filters-row {
            display: flex;
            gap: 12px;
            flex-wrap: wrap;
            align-items: center;
        }

        .filters-row select,
        .filters-row input[type="date"] {
            padding: 8px 12px;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            font-size: 14px;
            background: white;
            cursor: pointer;
        }

        .filters-row select:focus,
        .filters-row input[type="date"]:focus {
            outline: none;
            border-color: #667eea;
        }

        .btn-filter-clear {
            padding: 8px 16px;
            background: #f7fafc;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            font-size: 14px;
            cursor: pointer;
            color: #4a5568;
            transition: all 0.2s;
        }

        .btn-filter-clear:hover {
            background: #edf2f7;
            border-color: #cbd5e0;
        }

        .deals-count {
            margin-top: 12px;
            font-size: 13px;
            color: #718096;
            font-weight: 500;
        }

        /* Activities table - same overflow handling */
        .activities-table-container {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            max-width: 100%;
        }

        /* Deals Table */
        .deals-table-container {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            border-radius: 8px;
            border: 1px solid #e2e8f0;
            max-width: 100%;
            background: #fff;
        }

        .deals-table-container.deals-table-container--modern {
            border-radius: 14px;
            border: 1px solid #e8ecf1;
            box-shadow:
                0 1px 2px rgba(15, 23, 42, 0.04),
                0 10px 40px rgba(15, 23, 42, 0.07);
        }

        .deals-table {
            width: 100%;
            min-width: 0;
            table-layout: fixed;
            border-collapse: collapse;
            background: white;
        }

        .deals-table.deals-table--modern thead {
            background: linear-gradient(180deg, #fafbfd 0%, #f4f6f9 100%);
        }

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

        .deals-table.deals-table--modern tbody tr:not(.selected):not(.deal-row--approval-changes):not(.deal-row--approval-approved):not(.deal-row--approval-rejected):not(.deal-row--approval-awaiting):not(.deal-row--approval-launched):nth-child(even) {
            background-color: rgba(248, 250, 252, 0.65);
        }

        .deals-table.deals-table--modern tbody tr:not(.selected):not(.deal-row--approval-changes):not(.deal-row--approval-approved):not(.deal-row--approval-rejected):not(.deal-row--approval-awaiting):not(.deal-row--approval-launched):nth-child(even):hover {
            background-color: #f8fafc;
        }

        .deals-table.deals-table--modern col.col-deal-id { width: 7rem; max-width: 8.5rem; }
        .deals-table.deals-table--modern col.col-company { width: 22%; }
        .deals-table.deals-table--modern col.col-request-type { width: 9rem; max-width: 10.5rem; }
        .deals-table.deals-table--modern col.col-super-admin { width: 15%; }
        .deals-table.deals-table--modern col.col-location { width: 8.75rem; }
        .deals-table.deals-table--modern col.col-status { width: 6rem; }
        .deals-table.deals-table--modern col.col-source { width: 7rem; max-width: 8.5rem; }
        .deals-table.deals-table--modern col.col-assigned { width: 11%; }
        .deals-table.deals-table--modern col.col-date { width: 5.5rem; max-width: 6.75rem; }
        .deals-table.deals-table--modern col.col-actions { width: 6rem; max-width: 7.75rem; }

        .deals-table.deals-table--modern th.deals-th-static {
            cursor: default;
            color: #94a3b8;
            font-weight: 700;
        }

        .deals-table.deals-table--modern th.deals-th-static:hover {
            background: transparent;
        }

        .deals-table td.deals-td-date {
            white-space: nowrap;
            font-size: 12px;
            font-variant-numeric: tabular-nums;
            color: #64748b;
            letter-spacing: 0.02em;
        }

        .deals-table td.deals-col-super-admin {
            font-size: 12.5px;
            color: #334155;
        }

        .deals-table.deals-table--modern .deal-chips-row {
            gap: 3px;
        }

        .deals-table.deals-table--modern .deal-status-badge {
            padding: 2px 8px;
            border-radius: 999px;
            font-size: 11px;
        }

        .deals-table.deals-table--modern .deal-source-badge {
            padding: 2px 6px;
            border-radius: 999px;
            font-size: 10px;
        }

        .deals-table.deals-table--modern .table-actions {
            gap: 6px;
        }

        .deals-table.deals-table--modern .table-actions .btn-icon {
            width: 29px;
            height: 29px;
            border-radius: 8px;
        }

        .deals-table.deals-table--modern .table-actions .btn-icon svg {
            width: 14px;
            height: 14px;
        }

        .deals-table.deals-table--modern th {
            padding: 12px 12px;
            letter-spacing: 0.055em;
        }

        .deals-table.deals-table--modern td {
            padding: 13px 12px;
            border-bottom-color: #f1f5f9;
            vertical-align: middle;
        }

        /* Table cell truncation — table-layout:fixed handles column widths */
        .deals-table .deal-company-cell,
        .deals-table .deal-row-store-url {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            display: block;
            max-width: 100%;
        }

        .deals-table .deal-row-store-details {
            overflow: hidden;
            min-width: 0;
        }

        /* Truncate plain text cells (email, phone, location, owner) */
        .deals-table td.cell-truncate {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .deals-table thead {
            background: #f7fafc;
            position: sticky;
            top: 0;
            z-index: 10;
        }

        .deals-table th {
            padding: 10px 10px;
            text-align: left;
            font-size: 11px;
            font-weight: 600;
            color: #718096;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            border-bottom: 2px solid #e2e8f0;
            cursor: pointer;
            user-select: none;
            white-space: nowrap;
        }

        .deals-table th:hover {
            background: #edf2f7;
        }

        .sort-indicator {
            margin-left: 4px;
            color: #cbd5e0;
            font-size: 10px;
        }

        .sort-indicator.active {
            color: #667eea;
        }

        .deals-table td {
            padding: 10px 10px;
            border-bottom: 1px solid #e2e8f0;
            font-size: 13px;
            overflow: hidden;
            color: #4a5568;
            vertical-align: middle;
        }

        .deals-table tbody tr {
            transition: background 0.15s;
        }

        .deals-table tbody tr:hover {
            background: #f7fafc;
        }

        .deals-table tbody tr.selected {
            background: #f7faff;
            border-left: 3px solid #667eea;
        }

        .deals-table tbody tr.selected:hover {
            background: #f0f4ff;
        }

        .deal-id-cell {
            font-weight: 600;
            color: #667eea;
            font-size: 11px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* Default Positions product grid — improved UI/UX */
        .default-positions-table-wrap {
            box-shadow: 0 1px 3px rgba(0,0,0,0.06);
        }
        .default-positions-table th {
            padding: 12px 14px;
            font-size: 11px;
        }
        .default-positions-table td {
            padding: 12px 14px;
            font-size: 13px;
            vertical-align: middle;
        }
        .default-positions-table tbody tr:hover {
            background: #f8fafc;
        }
        .default-positions-table .dp-product-img {
            width: 56px;
            height: 56px;
            object-fit: contain;
            border-radius: 8px;
            border: 1px solid #e2e8f0;
            background: #f8fafc;
        }
        .default-positions-table .dp-product-name {
            font-weight: 600;
            color: #1e293b;
        }
        .default-positions-table .dp-product-sku {
            font-family: ui-monospace, monospace;
            font-size: 12px;
            color: #64748b;
        }
        .default-positions-table .dp-placement-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
        }
        .default-positions-table .dp-placement-tag {
            display: inline-block;
            padding: 2px 8px;
            font-size: 11px;
            background: #e0f2fe;
            color: #0369a1;
            border-radius: 6px;
            white-space: nowrap;
        }
        .default-positions-table td:last-child button {
            white-space: nowrap;
        }

        /* Default Position modal — placement options */
        .default-position-placement-list {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        .default-position-placement-option {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 4px 8px;
            border-radius: 6px;
            cursor: pointer;
            transition: background 0.15s;
            border: 1px solid transparent;
        }
        .default-position-placement-option:hover {
            background: #f1f5f9;
        }
        .default-position-placement-option input[type="radio"] {
            margin: 0;
            accent-color: #3b82f6;
        }
        .default-position-placement-option.dp-placement-set {
            background: #ecfdf5;
            border-color: #a7f3d0;
        }
        .default-position-placement-option.dp-placement-set:hover {
            background: #d1fae5;
        }
        .default-position-placement-option .dp-placement-label {
            flex: 1;
            font-size: 13px;
        }
        .default-position-placement-option .dp-placement-badge {
            font-size: 10px;
            font-weight: 600;
            padding: 2px 6px;
            border-radius: 4px;
            background: #10b981;
            color: white;
        }

        .deal-company-cell {
            font-weight: 600;
            color: #1a202c;
        }

        /* ── Deal status & source chips ─────────────────────────────── */
        .deal-status-badge {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 3px 9px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
            white-space: nowrap;
        }
        .deal-status-badge::before {
            content: '';
            width: 6px;
            height: 6px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        .status-pending {
            background: #fffbeb;
            color: #b45309;
            border: 1px solid #fde68a;
        }
        .status-pending::before { background: #f59e0b; }

        .status-won {
            background: #f0fdf4;
            color: #15803d;
            border: 1px solid #bbf7d0;
        }
        .status-won::before { background: #22c55e; }

        .status-jupiter {
            background: #fffbeb;
            color: #92400e;
            border: 1px solid #f59e0b;
        }
        .status-jupiter::before { background: #f59e0b; }

        .deal-source-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 2px 8px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: 600;
            white-space: nowrap;
            border: 1px solid transparent;
        }
        .deal-source-badge::before {
            content: '';
            width: 5px;
            height: 5px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        .source-hubspot {
            background: #fff4f1;
            color: #c2410c;
            border-color: #fed7aa;
        }
        .source-hubspot::before { background: #f97316; }

        .source-manual {
            background: #eef2ff;
            color: #4338ca;
            border-color: #c7d2fe;
        }
        .source-manual::before { background: #6366f1; }

        .source-ready-store {
            background: #f0fdf4;
            color: #15803d;
            border-color: #bbf7d0;
        }
        .source-ready-store::before { background: #22c55e; }

        .source-store-created {
            background: #ecfdf5;
            color: #065f46;
            border-color: #a7f3d0;
        }
        .source-store-created::before { background: #10b981; }

        /* Customer store approval — row highlight + floating tag on Deal ID (not buried in Source chips) */
        tbody .deal-row.deal-row--approval-changes {
            background: linear-gradient(90deg, rgba(245, 158, 11, 0.14) 0%, rgba(255, 251, 235, 0.65) 12%, #fffbeb 100%);
            box-shadow: inset 4px 0 0 #d97706;
        }
        tbody .deal-row.deal-row--approval-changes:hover {
            background: linear-gradient(90deg, rgba(245, 158, 11, 0.22) 0%, rgba(255, 251, 235, 0.85) 14%, #fff7ed 100%);
        }
        tbody .deal-row.deal-row--approval-approved {
            background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, rgba(236, 253, 245, 0.55) 12%, #f0fdf4 100%);
            box-shadow: inset 4px 0 0 #059669;
        }
        tbody .deal-row.deal-row--approval-approved:hover {
            background: linear-gradient(90deg, rgba(16, 185, 129, 0.14) 0%, rgba(236, 253, 245, 0.75) 14%, #ecfdf5 100%);
        }
        tbody .deal-row.deal-row--approval-rejected {
            background: linear-gradient(90deg, rgba(239, 68, 68, 0.08) 0%, rgba(254, 242, 242, 0.6) 12%, #fff 100%);
            box-shadow: inset 4px 0 0 #dc2626;
        }
        tbody .deal-row.deal-row--approval-awaiting {
            background: #faf5ff;
            box-shadow: inset 3px 0 0 #a78bfa;
        }
        tbody .deal-row.deal-row--approval-launched {
            background: #f8fafc;
            box-shadow: inset 3px 0 0 #94a3b8;
        }

        .deal-id-td {
            min-width: 120px;
        }
        .deal-id-td--has-float {
            padding-right: 76px !important;
        }
        .deal-row-approval-float {
            position: absolute;
            right: 6px;
            top: 50%;
            transform: translateY(-50%);
            z-index: 2;
            font-size: 9px;
            font-weight: 800;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            padding: 5px 8px;
            border-radius: 6px;
            line-height: 1;
            white-space: nowrap;
            pointer-events: auto;
            box-shadow: 0 2px 10px rgba(15, 23, 42, 0.18);
            border: 1px solid rgba(255, 255, 255, 0.6);
        }
        .deal-row-approval-float--changes {
            background: linear-gradient(135deg, #f59e0b, #ea580c);
            color: #fff;
        }
        .deal-row-approval-float--approved {
            background: linear-gradient(135deg, #10b981, #047857);
            color: #fff;
        }
        .deal-row-approval-float--rejected {
            background: linear-gradient(135deg, #ef4444, #b91c1c);
            color: #fff;
        }

        .deal-chips-row {
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
            align-items: center;
        }

        .deal-row-store-info {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .deal-row-store-logo {
            width: 30px;
            height: 30px;
            border-radius: 5px;
            object-fit: contain;
            background: #f7fafc;
            border: 1px solid #e2e8f0;
            flex-shrink: 0;
        }

        .deal-row-store-details {
            display: flex;
            flex-direction: column;
            gap: 2px;
            min-width: 0;
        }

        .deal-row-store-url {
            font-size: 11px;
            color: #667eea;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 180px;
        }

        .deal-row-store-url:hover {
            text-decoration: underline;
        }

        .table-actions {
            display: flex;
            gap: 5px;
            align-items: center;
        }

        .btn-icon {
            width: 32px;
            height: 32px;
            border-radius: 8px;
            border: 1px solid transparent;
            background: #f1f5f9;
            color: #64748b;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
            flex-shrink: 0;
            padding: 0;
        }

        .btn-icon svg {
            width: 15px;
            height: 15px;
            display: block;
            flex-shrink: 0;
        }

        .btn-icon:hover {
            transform: translateY(-1px);
            box-shadow: 0 2px 8px rgba(0,0,0,0.12);
        }

        .btn-icon.edit {
            background: #eff6ff;
            color: #3b82f6;
            border-color: #bfdbfe;
        }
        .btn-icon.edit:hover {
            background: #3b82f6;
            color: #fff;
            border-color: #3b82f6;
            box-shadow: 0 3px 10px rgba(59,130,246,0.35);
        }

        .btn-icon.orders {
            background: #f0fdf4;
            color: #16a34a;
            border-color: #bbf7d0;
        }
        .btn-icon.orders:hover {
            background: #16a34a;
            color: #fff;
            border-color: #16a34a;
            box-shadow: 0 3px 10px rgba(22,163,74,0.35);
        }

        .btn-icon.delete {
            background: #fff1f2;
            color: #f43f5e;
            border-color: #fecdd3;
        }
        .btn-icon.delete:hover {
            background: #f43f5e;
            color: #fff;
            border-color: #f43f5e;
            box-shadow: 0 3px 10px rgba(244,63,94,0.35);
        }

        /* Deal / large modals — nearly full viewport (deal details, add/edit deal, orders, etc.) */
        .modal-content.modal-large {
            width: 95vw !important;
            max-width: 95vw !important;
            height: 95vh !important;
            max-height: 95vh !important;
            min-height: 0;
        }
        
        .modal-content.modal-large .modal-body.modal-scrollable {
            max-height: none;
            min-height: 0;
        }

        .modal-scrollable {
            overflow-y: auto;
            padding-right: 8px;
            flex: 1;
        }

        /* Product Selection Modal Styles */
        .products-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 16px;
            margin-bottom: 24px;
        }

        .product-card {
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            padding: 12px;
            cursor: pointer;
            transition: all 0.2s;
            background: white;
            position: relative;
        }

        .product-card:hover {
            border-color: #667eea;
            box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
        }

        .product-card.selected {
            border-color: #667eea;
            background: #f7faff;
        }

        .product-card.selected::before {
            content: '✓';
            position: absolute;
            top: 8px;
            right: 8px;
            width: 24px;
            height: 24px;
            background: #667eea;
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            font-weight: bold;
            z-index: 20;
        }

        .product-card-category {
            margin-top: 8px;
            padding-top: 8px;
            border-top: 1px solid #e2e8f0;
        }

        .product-card-category-label {
            font-size: 10px;
            color: #718096;
            margin-bottom: 4px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .product-card-category-select {
            width: 100%;
            padding: 5px 6px;
            border: 1px solid #cbd5e0;
            border-radius: 4px;
            font-size: 11px;
            background: white;
            color: #1a202c;
            cursor: pointer;
            transition: border-color 0.2s;
        }

        .product-card-category-select:hover {
            border-color: #667eea;
        }

        .product-card-category-select:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
        }

        .product-card-category-checkboxes {
            max-height: 150px;
            overflow-y: auto;
            border: 1px solid #cbd5e0;
            border-radius: 4px;
            padding: 4px;
            background: white;
        }

        .product-card-category-checkbox-item {
            display: flex;
            align-items: center;
            padding: 4px 6px;
            font-size: 11px;
            cursor: pointer;
            transition: background-color 0.2s;
            border-radius: 3px;
        }

        .product-card-category-checkbox-item:hover {
            background-color: #f7fafc;
        }

        .product-card-category-checkbox-item input[type="checkbox"] {
            margin-right: 6px;
            cursor: pointer;
            width: 14px;
            height: 14px;
            accent-color: #667eea;
        }

        .product-card-category-checkbox-item label {
            cursor: pointer;
            flex: 1;
            color: #1a202c;
            user-select: none;
        }

        .product-card-fundraising {
            margin-top: 8px;
            padding-top: 8px;
            border-top: 1px solid #e2e8f0;
        }

        .product-card-fundraising-label {
            font-size: 10px;
            color: #718096;
            margin-bottom: 4px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .product-card-fundraising-input {
            width: 60px;
            padding: 4px 6px;
            font-size: 12px;
            border: 1px solid #cbd5e0;
            border-radius: 4px;
            background: white;
        }

        .product-image {
            width: 100%;
            height: 150px;
            object-fit: contain;
            background: #f7fafc;
            border-radius: 6px;
            margin-bottom: 8px;
        }

        .product-image-placeholder {
            width: 100%;
            height: 150px;
            background: #f7fafc;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #a0aec0;
            font-size: 12px;
            margin-bottom: 8px;
        }

        .product-name {
            font-size: 13px;
            font-weight: 600;
            color: #1a202c;
            margin-bottom: 4px;
            line-height: 1.4;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .product-sku {
            font-size: 11px;
            color: #718096;
            margin-bottom: 4px;
        }

        .product-price {
            font-size: 14px;
            font-weight: 700;
            color: #667eea;
        }

        .product-price-with-info,
        .price-breakdown-info {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            position: relative;
        }

        .price-breakdown-trigger {
            width: 18px;
            height: 18px;
            min-width: 18px;
            padding: 0;
            border: 1px solid #c7d2fe;
            border-radius: 50%;
            background: #eef2ff;
            color: #4f46e5;
            font-size: 11px;
            line-height: 16px;
            font-weight: 700;
            cursor: help;
        }

        .price-breakdown-trigger:hover,
        .price-breakdown-trigger:focus-visible {
            border-color: #818cf8;
            background: #e0e7ff;
            outline: none;
        }

        .price-breakdown-popover {
            display: none;
            position: absolute;
            left: 50%;
            bottom: calc(100% + 8px);
            transform: translateX(-50%);
            width: 220px;
            padding: 10px;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            background: #ffffff;
            box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
            color: #334155;
            font-size: 11px;
            font-weight: 500;
            line-height: 1.35;
            z-index: 30;
        }

        .price-breakdown-info:hover .price-breakdown-popover,
        .price-breakdown-info:focus-within .price-breakdown-popover {
            display: block;
        }

        .price-breakdown-title,
        .price-breakdown-row,
        .price-breakdown-total {
            display: flex;
            justify-content: space-between;
            gap: 10px;
        }

        .price-breakdown-title {
            margin-bottom: 8px;
            font-size: 11px;
            font-weight: 700;
            color: #0f172a;
        }

        .price-breakdown-row {
            padding: 3px 0;
        }

        .price-breakdown-subrow {
            padding-left: 10px;
            color: #64748b;
            font-size: 10px;
        }

        .price-breakdown-subrow span:first-child::before {
            content: '+ ';
            color: #94a3b8;
        }

        .price-breakdown-row em {
            color: #64748b;
            font-style: normal;
            font-weight: 500;
        }

        .price-breakdown-total {
            margin-top: 6px;
            padding-top: 7px;
            border-top: 1px solid #e2e8f0;
            color: #0f172a;
            font-weight: 700;
        }

        .product-match-reason {
            font-size: 10px;
            color: #a0aec0;
            margin-top: 4px;
            font-style: italic;
        }

        .product-variants {
            margin-top: 8px;
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            gap: 6px;
            align-items: flex-start;
        }

        .variant-swatch {
            width: 24px;
            height: 24px;
            min-width: 24px;
            min-height: 24px;
            max-width: 24px;
            max-height: 24px;
            flex-shrink: 0;
            border-radius: 4px;
            border: 2px solid #e2e8f0;
            cursor: pointer;
            position: relative;
            transition: all 0.2s;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 10px;
            font-weight: 600;
            color: #4a5568;
            background: #f7fafc;
            box-sizing: border-box;
        }

        .variant-swatch:hover {
            border-color: #667eea;
            transform: scale(1.1);
        }

        .variant-swatch.selected {
            border-color: #667eea;
            border-width: 3px;
            box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
        }

        .variant-swatch.selected::after {
            content: '✓';
            position: absolute;
            color: white;
            font-size: 12px;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
        }

        .variant-swatch.color-swatch {
            background-size: cover;
            background-position: center;
            width: 24px;
            height: 24px;
            min-width: 24px;
            min-height: 24px;
            max-width: 24px;
            max-height: 24px;
        }

        .variant-swatch.text-swatch {
            min-width: 32px;
            width: auto;
            height: 24px;
            padding: 0 6px;
            font-size: 9px;
            max-width: none;
        }

        .selected-products-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
            max-height: 200px;
            overflow-y: auto;
        }

        .selected-product-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 12px;
            background: #f7fafc;
            border-radius: 6px;
            border: 1px solid #e2e8f0;
        }

        .selected-product-info {
            flex: 1;
        }

        .selected-product-name {
            font-size: 13px;
            font-weight: 600;
            color: #1a202c;
            margin-bottom: 2px;
        }

        .selected-product-sku {
            font-size: 11px;
            color: #718096;
        }

        .selected-product-category {
            margin-top: 8px;
        }

        .category-select-label {
            font-size: 11px;
            color: #4a5568;
            margin-bottom: 4px;
            font-weight: 600;
        }

        .category-select {
            width: 100%;
            padding: 6px 8px;
            border: 1px solid #e2e8f0;
            border-radius: 4px;
            font-size: 12px;
            background: white;
            color: #1a202c;
            cursor: pointer;
            transition: border-color 0.2s;
        }

        .category-select:hover {
            border-color: #cbd5e0;
        }

        .category-select:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }

        .remove-product-btn {
            padding: 4px 8px;
            background: #fee2e2;
            color: #dc2626;
            border: none;
            border-radius: 4px;
            font-size: 11px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .remove-product-btn:hover {
            background: #fecaca;
        }

        .modal-footer {
            padding: 20px 24px;
            border-top: 1px solid #e2e8f0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: white;
            border-radius: 0 0 16px 16px;
        }

        .modal-scrollable::-webkit-scrollbar {
            width: 8px;
        }

        .modal-scrollable::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 4px;
        }

        .modal-scrollable::-webkit-scrollbar-thumb {
            background: #cbd5e0;
            border-radius: 4px;
        }

        .modal-scrollable::-webkit-scrollbar-thumb:hover {
            background: #a0aec0;
        }


        .deal-details-main {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .details-section {
            background: #fff;
            border-radius: 10px;
            padding: 24px 28px;
            border: 1px solid #e2e8f0;
            position: relative;
            overflow: hidden;
            box-shadow: 0 1px 3px rgba(0,0,0,0.06);
        }
        .details-section::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 4px;
            background: linear-gradient(180deg, #475569 0%, #334155 100%);
            border-radius: 10px 0 0 10px;
        }
        
        /* Logo section: single logo centered; multiple logos use full width */
        #logoSection {
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        #logoSection.logo-section--wide {
            align-items: stretch;
        }

        .details-section-title {
            font-size: 12px;
            font-weight: 700;
            color: #334155;
            margin: -24px -28px 20px -28px;
            padding: 10px 28px 10px 32px;
            background: linear-gradient(90deg, #f1f5f9 0%, #f8fafc 100%);
            border-bottom: 1px solid #cbd5e1;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            display: flex;
            align-items: center;
            gap: 8px;
            border-radius: 10px 10px 0 0;
        }
        .details-section-title::before {
            content: '';
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: #475569;
            flex-shrink: 0;
        }

        /* Checkout custom fields: <details> hides native marker; use explicit chevron */
        .checkout-fields-details > summary.checkout-fields-summary {
            cursor: pointer;
            list-style: none;
            user-select: none;
        }
        .checkout-fields-details > summary.checkout-fields-summary::-webkit-details-marker {
            display: none;
        }
        .checkout-fields-details > summary.checkout-fields-summary::before {
            content: '\25B6';
            font-size: 10px;
            width: 1.1em;
            height: auto;
            border-radius: 0;
            background: transparent;
            color: #475569;
            flex-shrink: 0;
            transition: transform 0.18s ease;
            transform-origin: center;
        }
        .checkout-fields-details[open] > summary.checkout-fields-summary::before {
            transform: rotate(90deg);
        }

        #checkoutFieldsSaveBtn[aria-busy='true'] {
            opacity: 0.9;
            cursor: wait;
        }

        .btn-edit {
            background: #fff;
            color: #475569;
            border: 1px solid #cbd5e0;
            padding: 3px 10px;
            border-radius: 5px;
            font-size: 11px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            white-space: nowrap;
        }
        .btn-edit:hover {
            background: #f1f5f9;
            color: #1e293b;
            border-color: #94a3b8;
        }

        .btn-meta-clear {
            background: none;
            border: 1px solid #e2e8f0;
            color: #94a3b8;
            border-radius: 5px;
            width: 28px;
            height: 28px;
            font-size: 12px;
            cursor: pointer;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.15s;
        }
        .btn-meta-clear:hover {
            background: #fee2e2;
            border-color: #fca5a5;
            color: #dc2626;
        }


        .details-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 16px 20px;
        }
        
        /* Two-column layout for Store Customization section */
        #dealInfoDetails {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 24px 32px;
            align-items: start;
        }
        
        .store-customization-left,
        .store-customization-right {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }
        
        .store-customization-left .detail-item,
        .store-customization-right .detail-item {
            width: 100%;
        }

        .detail-item {
            display: flex;
            flex-direction: column;
            min-width: 0;
            padding: 10px 0;
        }
        
        .detail-item.full-width {
            grid-column: 1 / -1;
        }
        
        .detail-item.half-width {
            grid-column: span 1;
        }

        .detail-label {
            font-size: 11px;
            font-weight: 600;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            margin-bottom: 5px;
        }

        .detail-value {
            font-size: 14px;
            color: #1e293b;
            font-weight: 500;
            word-wrap: break-word;
            overflow-wrap: break-word;
            line-height: 1.5;
        }

        .deal-logo-container {
            margin-bottom: 20px;
            padding: 24px;
            background: #f7fafc;
            border-radius: 8px;
            border: 2px dashed #cbd5e0;
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 200px;
            max-width: 400px;
            width: fit-content;
            margin-left: auto;
            margin-right: auto;
            box-sizing: border-box;
        }

        /* Many logos: use full panel width + responsive columns (reduces vertical scroll) */
        .deal-logo-container.deal-logo-container--multi {
            max-width: none;
            width: 100%;
            margin-left: 0;
            margin-right: 0;
            min-height: 0;
            align-items: flex-start;
            justify-content: flex-start;
        }

        .deal-logo-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
            gap: 14px 16px;
            width: 100%;
            justify-items: center;
        }

        .deal-logo-grid-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            width: 100%;
            max-width: 140px;
            margin: 0 auto;
        }

        .deal-logo-grid-item img {
            width: 72px;
            height: 72px;
            object-fit: contain;
            border-radius: 8px;
            border: 1px solid #e2e8f0;
            background: #f8fafc;
        }

        .deal-logo-grid-item span {
            font-size: 11px;
            color: #64748b;
            line-height: 1.25;
            text-align: center;
            width: 100%;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            word-break: break-word;
        }

        .deal-logo-container img {
            max-width: 100%;
            max-height: 250px;
            width: auto;
            height: auto;
            border-radius: 8px;
            object-fit: contain;
            aspect-ratio: auto;
        }

        /* Keep grid thumbnails fixed size (overrides rule above) */
        .deal-logo-container--multi .deal-logo-grid-item img {
            width: 72px;
            height: 72px;
            max-width: 72px;
            max-height: 72px;
        }

        .deal-logo-placeholder {
            color: #a0aec0;
            font-size: 14px;
            padding: 40px;
        }

        /* Modal: pick existing logo for main BC category image */
        .edit-main-store-logo-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
            gap: 10px;
            max-height: 260px;
            overflow-y: auto;
            padding: 4px 2px 8px 2px;
        }
        .edit-main-store-logo-option {
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            padding: 8px 6px;
            cursor: pointer;
            text-align: center;
            background: #fff;
            font: inherit;
            margin: 0;
            transition: border-color 0.15s, box-shadow 0.15s;
        }
        .edit-main-store-logo-option:hover {
            border-color: #94a3b8;
        }
        .edit-main-store-logo-option.selected {
            border-color: #3b82f6;
            box-shadow: 0 0 0 1px #3b82f6;
        }
        .edit-main-store-logo-option img {
            width: 56px;
            height: 56px;
            object-fit: contain;
            display: block;
            margin: 0 auto;
            border-radius: 6px;
        }
        .edit-main-store-logo-option span {
            font-size: 10px;
            color: #64748b;
            display: block;
            margin-top: 6px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .btn-action {
            padding: 12px 24px;
            border-radius: 8px;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            border: none;
        }

        .btn-action-primary {
            background: #667eea;
            color: white;
        }

        .btn-action-primary:hover {
            background: #5568d3;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
        }

        .btn-action-primary:disabled {
            background: #cbd5e0;
            cursor: not-allowed;
            transform: none;
        }

        /* Users Table */
        .users-table-container {
            overflow-x: auto;
        }

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

        .users-table thead {
            background: #f7fafc;
        }

        .users-table th {
            padding: 12px 16px;
            text-align: left;
            font-size: 12px;
            font-weight: 600;
            color: #718096;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            border-bottom: 2px solid #e2e8f0;
        }

        .users-table td {
            padding: 16px;
            border-bottom: 1px solid #e2e8f0;
            font-size: 14px;
            color: #4a5568;
        }

        .users-table tbody tr:hover {
            background: #f7fafc;
        }

        .badge {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .badge-admin {
            background: #dbeafe;
            color: #1e40af;
        }

        .badge-sales-rep {
            background: #dcfce7;
            color: #166534;
        }

        .badge-active {
            background: #d1fae5;
            color: #065f46;
        }

        .badge-inactive {
            background: #fee2e2;
            color: #991b1b;
        }

        /* Empty States */
        .empty-state {
            text-align: center;
            padding: 60px 20px;
            color: #718096;
        }

        .empty-state-icon {
            font-size: 64px;
            margin-bottom: 16px;
            opacity: 0.5;
        }

        .empty-state h3 {
            font-size: 20px;
            color: #4a5568;
            margin-bottom: 8px;
        }

        .empty-state p {
            font-size: 14px;
            color: #718096;
        }

        /* Modals */
        .modal {
            display: none;
            position: fixed;
            z-index: 2000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(4px);
            overflow-y: auto;
            padding: 20px;
        }

        .modal.active {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* Close modal when clicking backdrop */
        .modal.active::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -1;
        }

        .modal-content {
            background: white;
            border-radius: 14px;
            width: 100%;
            max-width: 1200px;
            max-height: 90vh;
            overflow: hidden;
            box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
            position: relative;
            display: flex;
            flex-direction: column;
            margin: auto;
        }

        /* Edit modals should be smaller */
        #editCompanyModal .modal-content,
        #editUserModal .modal-content {
            max-width: 600px;
        }

        #editCategoryMetaModal .modal-content {
            max-width: 700px;
        }

        /* Add / edit checkout field — wider modal, generous vertical rhythm */
        #checkoutCustomFieldModal .checkout-custom-field-modal-content {
            max-width: min(680px, calc(100vw - 40px));
            width: 100%;
        }
        #checkoutCustomFieldModal .checkout-custom-field-modal-header {
            padding: 20px 28px;
        }
        #checkoutCustomFieldModal .checkout-custom-field-modal-body {
            padding: 28px 32px 32px;
            display: flex;
            flex-direction: column;
            gap: 24px;
            box-sizing: border-box;
        }
        #checkoutCustomFieldModal #checkoutCustomFieldModalError {
            margin-bottom: 0 !important;
        }
        #checkoutCustomFieldModal .checkout-custom-field-modal-field label:not(.checkout-field-required-label) {
            margin-bottom: 8px;
            display: block;
        }
        #checkoutCustomFieldModal .checkout-custom-field-modal-field .form-tip,
        #checkoutCustomFieldModal .checkout-custom-field-modal-field small {
            margin-top: 6px;
        }
        #checkoutCustomFieldModal .checkout-custom-field-modal-field textarea {
            min-height: 108px;
            line-height: 1.5;
            resize: vertical;
        }
        #checkoutCustomFieldModal .checkout-custom-field-modal-field select {
            min-height: 44px;
        }
        #checkoutCustomFieldModal .checkout-field-required-group {
            padding: 14px 16px;
            background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
            border: 1px solid #e2e8f0;
            border-radius: 10px;
            margin: 4px 0;
        }
        #checkoutCustomFieldModal #checkoutFieldOptionsWrap {
            margin-top: 0;
            padding: 18px;
            background: #fafbfc;
            border: 1px solid #e2e8f0;
            border-radius: 10px;
        }
        #checkoutCustomFieldModal #checkoutFieldOptionsWrap > div:first-child {
            margin-bottom: 10px;
        }
        #checkoutCustomFieldModal .checkout-custom-field-modal-actions {
            margin-top: 0 !important;
            padding-top: 22px !important;
            border-top: 1px solid #e2e8f0 !important;
            flex-shrink: 0;
            gap: 12px;
        }

        .detail-item-label-row {
            display: flex;
            align-items: center;
            justify-content: flex-start;
            flex-wrap: wrap;
            gap: 6px 10px;
            margin-bottom: 4px;
        }
        .detail-item-label-row .detail-label {
            margin-bottom: 0;
            flex: 0 1 auto;
        }
        .btn-edit-inline {
            flex-shrink: 0;
            padding: 2px 8px;
            font-size: 12px;
            line-height: 1.3;
            border: 1px solid #cbd5e0;
            background: #fff;
            border-radius: 6px;
            color: #475569;
            cursor: pointer;
            transition: background 0.15s, border-color 0.15s;
        }
        .btn-edit-inline:hover {
            background: #f1f5f9;
            border-color: #94a3b8;
            color: #1e293b;
        }
        
        /* Override for large modals (deal details) - already handled above */

        .modal-header {
            padding: 18px 24px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: sticky;
            top: 0;
            z-index: 10;
            background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
            flex-shrink: 0;
        }

        .deal-details-header-sticky {
            flex-wrap: wrap;
            gap: 12px;
        }

        .deal-details-header-actions {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .modal-header h2 {
            margin: 0;
            color: #fff;
            font-size: 18px;
            font-weight: 700;
            letter-spacing: -0.01em;
        }

        .modal-close {
            background: rgba(255,255,255,0.12);
            border: none;
            font-size: 20px;
            cursor: pointer;
            color: #fff;
            padding: 0;
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: background 0.15s;
            line-height: 1;
            flex-shrink: 0;
        }

        .modal-close:hover {
            background: rgba(255,255,255,0.25);
        }

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

        .modal-body.modal-scrollable {
            max-height: calc(90vh - 120px);
        }
        
        /* Large modals: body fills space below header (flex on .modal-content) */
        .modal-large .modal-body.modal-scrollable {
            max-height: none;
            min-height: 0;
        }

        .modal-actions {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            padding-top: 20px;
            border-top: 1px solid #f1f5f9;
            margin-top: 8px;
            margin-top: 24px;
            border-top: 1px solid #e2e8f0;
        }

        .btn-primary {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            padding: 12px 24px;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
            box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
        }

        .btn-primary:hover {
            background: linear-gradient(135deg, #5568d3 0%, #6a3d8f 100%);
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
        }

        .btn-primary:active {
            transform: translateY(0);
            box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
        }

        .btn-secondary {
            background: white;
            color: #4a5568;
            border: 2px solid #e2e8f0;
            padding: 12px 24px;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .btn-secondary:hover {
            background: #f7fafc;
            border-color: #cbd5e0;
            color: #2d3748;
        }

        .btn-secondary:active {
            background: #edf2f7;
        }

        .form-section {
            margin-bottom: 16px;
            padding: 20px 20px 20px 24px;
            border: 1px solid #e2e8f0;
            background: #fff;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 1px 3px rgba(0,0,0,0.06);
            position: relative;
        }
        .form-section::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 4px;
            background: linear-gradient(180deg, #475569 0%, #334155 100%);
            border-radius: 10px 0 0 10px;
        }
        .form-section:last-of-type {
            margin-bottom: 0;
        }
        .form-section h3 {
            margin: -20px -20px 18px -24px;
            font-size: 12px;
            font-weight: 700;
            color: #334155;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            padding: 10px 20px 10px 28px;
            background: linear-gradient(90deg, #f1f5f9 0%, #f8fafc 100%);
            border-bottom: 1px solid #cbd5e1;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .form-section h3::before {
            content: '';
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: #475569;
            flex-shrink: 0;
        }
        .form-subsection {
            margin-bottom: 24px;
            padding: 16px;
            background: #f8fafc;
            border-radius: 8px;
            border: 1px solid #e2e8f0;
        }
        .form-subsection h4 {
            font-size: 16px;
            font-weight: 600;
            color: #4a5568;
            margin: 0 0 12px 0;
        }

        .form-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 16px;
        }

        .form-group {
            display: flex;
            flex-direction: column;
        }

        /* Checkout field modal — checkbox row (avoid .form-group column stacking checkbox above label) */
        #checkoutCustomFieldModal .checkout-field-required-group label.checkout-field-required-label {
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 10px;
            margin: 0;
            cursor: pointer;
            font-weight: 600;
            font-size: 13px;
            color: #475569;
        }
        #checkoutCustomFieldModal .checkout-field-required-label input[type='checkbox'] {
            width: 18px;
            height: 18px;
            min-width: 18px;
            margin: 0;
            padding: 0;
            flex-shrink: 0;
            border-radius: 4px;
        }

        .form-group.full-width {
            grid-column: 1 / -1;
        }

        .form-tip {
            font-size: 12px;
            color: #718096;
            margin: 4px 0 0 0;
            line-height: 1.4;
        }

        .form-group label {
            margin-bottom: 6px;
            color: #475569;
            font-weight: 600;
            font-size: 13px;
        }

        .form-group input,
        .form-group select,
        .form-group textarea {
            padding: 10px 12px;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            font-size: 14px;
            transition: all 0.2s;
            background: white;
        }

        .form-group input:focus,
        .form-group select:focus,
        .form-group textarea:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }

        /* Tertiary Color Picker Styles */
        .tertiary-color-container {
            display: flex;
            flex-direction: column;
            gap: 12px;
            position: relative; /* Required for absolute positioning of popup */
        }

        .color-swatches-grid {
            display: grid;
            grid-template-columns: repeat(13, 1fr);
            gap: 8px;
            margin-bottom: 12px;
            min-height: 60px; /* Ensure grid has minimum height */
        }
        
        @media (max-width: 1200px) {
            .color-swatches-grid {
                grid-template-columns: repeat(10, 1fr);
            }
        }
        
        @media (max-width: 768px) {
            .color-swatches-grid {
                grid-template-columns: repeat(8, 1fr);
            }
        }

        .color-swatch {
            width: 100%;
            aspect-ratio: 1;
            min-width: 18px;
            min-height: 18px;
            max-width: 24px;
            max-height: 24px;
            border: 1.5px solid #a0aec0;
            border-radius: 3px;
            cursor: pointer;
            transition: all 0.2s;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            margin: 0 auto;
        }

        .color-swatch:hover {
            border-color: #667eea;
            transform: scale(1.05);
        }

        .color-swatch.selected {
            border-color: #667eea;
            border-width: 3px;
            box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
        }

        .color-swatch .remove-icon {
            position: absolute;
            top: -8px;
            right: -8px;
            width: 20px;
            height: 20px;
            background: white;
            border: 2px solid #ef4444;
            border-radius: 50%;
            color: #ef4444;
            font-size: 12px;
            display: none;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 10;
        }

        .color-swatch.selected .remove-icon {
            display: flex;
        }

        .selected-colors-display {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            min-height: 40px;
            padding: 8px;
            border: 1px solid #e2e8f0;
            border-radius: 4px;
            background: #f7fafc;
        }

        .selected-color-chip {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 8px;
            background: white;
            border: 1px solid #cbd5e0;
            border-radius: 4px;
            font-size: 12px;
        }

        .selected-color-chip .color-preview {
            width: 16px;
            height: 16px;
            border-radius: 2px;
            border: 1px solid #a0aec0;
        }

        .btn-custom-color {
            padding: 8px 16px;
            background: #f7fafc;
            border: 1px dashed #cbd5e0;
            border-radius: 4px;
            color: #4a5568;
            cursor: pointer;
            font-size: 14px;
            transition: all 0.2s;
        }

        .btn-custom-color:hover {
            background: #edf2f7;
            border-color: #667eea;
            color: #667eea;
        }

        .color-picker-popup {
            position: absolute;
            top: 100%;
            left: 0;
            margin-top: 8px;
            background: white;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            z-index: 1000;
            padding: 16px;
            min-width: 280px;
            display: none; /* Hidden by default */
        }

        .color-picker-content {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .color-gradient {
            width: 100%;
            height: 150px;
            border: 1px solid #e2e8f0;
            border-radius: 4px;
            cursor: crosshair;
            position: relative;
            overflow: hidden;
        }
        
        .color-gradient::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(to right, white, transparent);
            pointer-events: none;
            z-index: 1;
        }
        
        .color-gradient::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(to bottom, transparent, black);
            pointer-events: none;
            z-index: 2;
        }
        
        .color-gradient .picker-indicator {
            position: absolute;
            width: 12px;
            height: 12px;
            border: 2px solid white;
            border-radius: 50%;
            transform: translate(-50%, -50%);
            pointer-events: none;
            box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
            z-index: 10;
        }

        .color-gradient .picker-indicator {
            position: absolute;
            width: 12px;
            height: 12px;
            border: 2px solid white;
            border-radius: 50%;
            transform: translate(-50%, -50%);
            pointer-events: none;
            box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
        }

        .hue-slider {
            width: 100%;
            height: 20px;
            border: 1px solid #e2e8f0;
            border-radius: 4px;
            cursor: pointer;
            background: linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
            position: relative;
        }
        
        .hue-slider .hue-indicator {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 4px;
            height: 100%;
            background: white;
            border: 1px solid rgba(0, 0, 0, 0.3);
            pointer-events: none;
            z-index: 10;
        }

        .hue-slider .hue-indicator {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 4px;
            height: 100%;
            background: white;
            border: 1px solid rgba(0, 0, 0, 0.3);
            pointer-events: none;
        }

        .color-preview {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .current-color {
            width: 40px;
            height: 40px;
            border: 1px solid #a0aec0;
            border-radius: 4px;
        }

        .color-preview input[type="text"] {
            flex: 1;
            padding: 6px 8px;
            border: 1px solid #e2e8f0;
            border-radius: 4px;
            font-family: monospace;
            font-size: 14px;
        }

        .rgb-inputs {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
        }

        .rgb-inputs input {
            padding: 6px 8px;
            border: 1px solid #e2e8f0;
            border-radius: 4px;
            font-size: 14px;
        }

        .color-picker-actions {
            display: flex;
            gap: 8px;
        }

        .btn-add-color,
        .btn-cancel-color {
            flex: 1;
            padding: 8px 16px;
            border-radius: 4px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-add-color {
            background: #667eea;
            color: white;
            border: none;
        }

        .btn-add-color:hover {
            background: #5568d3;
        }

        .btn-cancel-color {
            background: #f7fafc;
            color: #4a5568;
            border: 1px solid #e2e8f0;
        }

        .btn-cancel-color:hover {
            background: #edf2f7;
        }

        /* Theme Selection Styles */
        .template-selection-container {
            margin-top: 8px;
            max-width: 600px;
            margin-left: auto;
            margin-right: auto;
        }

        .template-thumbnails {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 16px;
            margin-bottom: 12px;
        }

        .template-thumbnail {
            position: relative;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            overflow: hidden;
            cursor: pointer;
            transition: all 0.2s;
            background: white;
        }

        .template-thumbnail:hover {
            border-color: #667eea;
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
            transform: translateY(-2px);
        }

        .template-thumbnail.selected {
            border-color: #667eea;
            border-width: 3px;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
        }

        .template-thumbnail.selected::after {
            content: '✓';
            position: absolute;
            top: 8px;
            right: 8px;
            width: 24px;
            height: 24px;
            background: #667eea;
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            font-weight: bold;
            z-index: 10;
        }

        .template-thumbnail-image {
            position: relative;
            overflow: hidden;
            cursor: pointer;
            height: 100px;
            flex-shrink: 0;
        }

        .template-thumbnail-image img {
            width: 100%;
            height: 100%;
            display: block;
            object-fit: cover;
            object-position: top center;
            transition: transform 0.2s;
        }

        .template-thumbnail-image:hover img {
            transform: scale(1.05);
        }

        .template-preview-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: opacity 0.2s;
            color: white;
            font-size: 14px;
            font-weight: 600;
        }

        .template-thumbnail-image:hover .template-preview-overlay {
            opacity: 1;
        }

        .template-label {
            padding: 8px 12px;
            background: #f7fafc;
            font-size: 13px;
            font-weight: 600;
            color: #1a202c;
            text-align: center;
            border-top: 1px solid #e2e8f0;
        }

        .template-badge {
            padding: 4px 8px;
            background: #667eea;
            color: white;
            font-size: 11px;
            font-weight: 600;
            text-align: center;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        /* Common Droid section */
        .common-droid-section {
            margin-top: 16px;
            padding: 16px;
            background: #f8fafc;
            border-radius: 8px;
            border: 1px solid #e2e8f0;
        }
        .step-badge {
            display: inline-block;
            padding: 4px 10px;
            background: #e2e8f0;
            color: #64748b;
            font-size: 12px;
            font-weight: 600;
            border-radius: 9999px;
            margin-bottom: 8px;
        }
        .common-droid-title {
            font-size: 18px;
            font-weight: 700;
            color: #1a202c;
            margin: 0 0 4px 0;
        }
        .common-droid-subtitle {
            font-size: 13px;
            color: #64748b;
            margin: 0 0 12px 0;
        }
        .common-droid-selected-card {
            max-width: 150px;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            overflow: hidden;
            background: #fff;
            margin-bottom: 12px;
        }
        .common-droid-list-container {
            margin-top: 8px;
        }
        .common-droid-list {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }
        .droid-card {
            width: 100px;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            overflow: hidden;
            cursor: pointer;
            background: #fff;
            transition: all 0.2s;
            position: relative;
        }
        .droid-card:hover {
            border-color: #667eea;
            box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
        }
        .droid-card.selected {
            border-color: #667eea;
            border-width: 3px;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
        }
        .droid-card.selected::after {
            content: '✓';
            position: absolute;
            top: 8px;
            right: 8px;
            width: 24px;
            height: 24px;
            background: #667eea;
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            font-weight: bold;
            z-index: 10;
        }
        .graphic-card.selected {
            border-color: #667eea;
            border-width: 3px;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
            background: #eef2ff;
        }
        .graphic-card.selected::after {
            content: '✓';
            position: absolute;
            top: 4px;
            right: 4px;
            width: 20px;
            height: 20px;
            background: #667eea;
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            font-weight: bold;
            z-index: 10;
        }
        .droid-card canvas {
            width: 100%;
            height: 80px;
            display: block;
            background: #f7fafc;
        }
        .droid-card img {
            width: 100%;
            height: 80px;
            object-fit: contain;
            display: block;
            background: #f7fafc;
        }
        .droid-card .droid-card-name {
            padding: 6px 8px;
            font-size: 11px;
            font-weight: 600;
            color: #1a202c;
            text-align: center;
        }
        .droid-preview-spinner {
            width: 24px;
            height: 24px;
            border: 3px solid #e2e8f0;
            border-top-color: #667eea;
            border-radius: 50%;
            animation: droid-spinner 0.8s linear infinite;
        }
        @keyframes droid-spinner {
            to { transform: rotate(360deg); }
        }
        .common-droid-loading,
        .common-droid-empty {
            font-size: 13px;
            color: #64748b;
            padding: 12px 0;
        }

        /* Theme Preview Modal */
        .template-preview-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.8);
            z-index: 10000;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        .template-preview-modal.active {
            display: flex;
        }

        .template-preview-content {
            position: relative;
            max-width: 90%;
            max-height: 90vh;
            background: white;
            border-radius: 8px;
            overflow: auto;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        }

        .template-preview-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 20px;
            border-bottom: 1px solid #e2e8f0;
            background: #f7fafc;
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .template-preview-title {
            font-size: 18px;
            font-weight: 600;
            color: #1a202c;
        }

        .template-preview-close {
            width: 32px;
            height: 32px;
            border: none;
            background: transparent;
            font-size: 24px;
            color: #718096;
            cursor: pointer;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }

        .template-preview-close:hover {
            background: #e2e8f0;
            color: #1a202c;
        }

        .template-preview-image {
            width: 100%;
            height: auto;
            display: block;
        }

        .form-group textarea {
            resize: vertical;
            min-height: 80px;
        }

        .form-actions {
            display: flex;
            justify-content: flex-end;
            gap: 12px;
            padding-top: 24px;
            border-top: 1px solid #e2e8f0;
            margin-top: 24px;
        }

        .btn-cancel {
            background: #f7fafc;
            color: #4a5568;
            border: 1px solid #e2e8f0;
            padding: 10px 20px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
        }

        .btn-cancel:hover {
            background: #edf2f7;
        }

        .btn-submit {
            background: #667eea;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
        }

        .btn-submit:hover {
            background: #5568d3;
        }

        .btn-submit:disabled {
            background: #cbd5e0;
            cursor: not-allowed;
        }

        /* Loading & Messages */
        .loading {
            display: none;
            text-align: center;
            padding: 40px 20px;
            color: #667eea;
            font-size: 16px;
            font-weight: 500;
        }

        .loading.active {
            display: block;
        }
        
        .loading p {
            margin: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .result-message {
            margin-top: 20px;
            padding: 16px;
            border-radius: 8px;
            display: none;
        }

        .result-message.success {
            background: #d1fae5;
            color: #065f46;
            border: 1px solid #a7f3d0;
            display: block;
        }

        .result-message.error {
            background: #fee2e2;
            color: #991b1b;
            border: 1px solid #fecaca;
            display: block;
        }

        /* Top notification banner (above .modal ~2000 and template preview ~10000) */
        .top-notification {
            position: fixed;
            top: 0;
            left: 260px;
            right: 0;
            z-index: 12000;
            padding: 16px 24px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            display: none;
            align-items: center;
            justify-content: space-between;
            animation: slideDown 0.3s ease-out;
        }

        @media (max-width: 768px) {
            .top-notification {
                left: 0;
            }
        }

        @keyframes slideDown {
            from {
                transform: translateY(-100%);
                opacity: 0;
            }
            to {
                transform: translateY(0);
                opacity: 1;
            }
        }

        .top-notification.show {
            display: flex;
        }

        .top-notification-content {
            flex: 1;
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .top-notification-icon {
            font-size: 24px;
        }

        .top-notification-text {
            flex: 1;
        }

        .top-notification-text h3 {
            margin: 0 0 4px 0;
            font-size: 16px;
            font-weight: 600;
        }

        .top-notification-text p {
            margin: 0;
            font-size: 13px;
            opacity: 0.95;
        }

        .top-notification-close {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            width: 32px;
            height: 32px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 18px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s;
        }

        .top-notification-close:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        /* Customer store approval — in-app attention (polling) */
        .approval-attention-bar {
            flex-shrink: 0;
            width: 100%;
            box-sizing: border-box;
            padding: 12px 18px;
            background: linear-gradient(90deg, #9a3412 0%, #c2410c 40%, #ea580c 100%);
            color: #fff;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            flex-wrap: wrap;
            border-bottom: 2px solid rgba(255, 255, 255, 0.25);
            box-shadow: 0 4px 14px rgba(154, 52, 18, 0.35);
        }

        .approval-attention-bar-text {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            font-size: 14px;
            font-weight: 600;
            line-height: 1.45;
            flex: 1;
            min-width: 200px;
        }

        .approval-attention-icon {
            font-size: 20px;
            flex-shrink: 0;
        }

        .approval-attention-bar-actions {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-shrink: 0;
        }

        .btn-approval-attention-primary {
            padding: 8px 16px;
            border-radius: 8px;
            border: none;
            background: #fff;
            color: #9a3412;
            font-weight: 700;
            font-size: 13px;
            cursor: pointer;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
        }

        .btn-approval-attention-primary:hover {
            background: #fff7ed;
        }

        .btn-approval-attention-dismiss {
            padding: 8px 12px;
            border-radius: 8px;
            border: 1px solid rgba(255, 255, 255, 0.45);
            background: transparent;
            color: #fff;
            font-size: 13px;
            cursor: pointer;
        }

        .btn-approval-attention-dismiss:hover {
            background: rgba(255, 255, 255, 0.12);
        }

        .nav-item-badge {
            margin-left: 6px;
            min-width: 18px;
            height: 18px;
            padding: 0 5px;
            border-radius: 999px;
            background: #dc2626;
            color: #fff;
            font-size: 10px;
            font-weight: 700;
            display: none;
            align-items: center;
            justify-content: center;
            line-height: 1;
        }

        /* Store info and logo wrapper */
        .store-info-logo-wrapper {
            display: grid;
            grid-template-columns: 30% 1fr;
            gap: 20px;
            margin-bottom: 24px;
        }

        @media (max-width: 768px) {
            .store-info-logo-wrapper {
                grid-template-columns: 1fr;
            }
            
            .store-logo-section {
                min-height: 150px;
            }
            
            .store-logo-container img {
                max-height: 120px;
            }
            
            .store-logo-placeholder {
                height: 120px;
            }
        }

        /* Logo section in top layout */
        .store-logo-section {
            background: white;
            border: 2px solid #667eea;
            border-radius: 12px;
            padding: 20px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-height: 200px;
        }

        .store-logo-section h3 {
            margin: 0;
            color: #1a202c;
            font-size: 16px;
            font-weight: 600;
        }

        .store-logo-container {
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            gap: 12px;
        }

        .store-logo-container h3 {
            margin: 0;
            color: #1a202c;
            font-size: 16px;
            font-weight: 600;
            text-align: center;
            width: 100%;
        }

        .store-logo-container img {
            max-width: 100%;
            max-height: 180px;
            object-fit: contain;
            border-radius: 8px;
        }

        .store-logo-placeholder {
            width: 100%;
            height: 180px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #f7fafc;
            border: 2px dashed #cbd5e0;
            border-radius: 8px;
            color: #718096;
            font-size: 14px;
        }

        /* Store info section at top */
        .store-info-top {
            background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
            border: 2px solid #667eea;
            border-radius: 12px;
            padding: 20px;
        }

        .store-info-top-header {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 16px;
        }

        .store-info-top-header h3 {
            margin: 0;
            color: #1a202c;
            font-size: 18px;
        }

        .store-info-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 16px;
        }

        .store-info-item {
            display: flex;
            flex-direction: column;
            gap: 4px;
            min-width: 0; /* Allow flex items to shrink below content size */
        }

        .store-info-item.full-width {
            grid-column: 1 / -1; /* Span all columns */
        }

        .store-info-label {
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: #718096;
            font-weight: 600;
        }

        .store-info-value {
            font-size: 14px;
            color: #1a202c;
            font-weight: 500;
            word-break: break-all; /* Break long URLs */
            overflow-wrap: break-word; /* Additional wrapping support */
            line-height: 1.5;
        }

        .store-info-value a {
            color: #667eea;
            text-decoration: none;
            word-break: break-all;
            overflow-wrap: break-word;
        }

        .store-info-value a:hover {
            text-decoration: underline;
        }

        /* Category products section */
        .category-products-section {
            margin-top: 24px;
        }

        /* Loading state for categories/products */
        .category-products-loading {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 60px 20px;
            background: white;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            min-height: 400px;
        }

        .category-products-loading-spinner {
            width: 48px;
            height: 48px;
            border: 4px solid #e2e8f0;
            border-top-color: #667eea;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-bottom: 16px;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        .category-products-loading-text {
            color: #718096;
            font-size: 14px;
            font-weight: 500;
        }

        .categories-products-layout-wrap {
            position: relative;
            margin-top: 16px;
        }

        /* Two-column layout for categories and products */
        .categories-products-layout {
            display: grid;
            grid-template-columns: 300px 1fr;
            gap: 20px;
            margin-top: 0;
        }

        .category-reorder-busy-overlay {
            position: absolute;
            inset: 0;
            z-index: 80;
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background: rgba(255, 255, 255, 0.78);
            backdrop-filter: blur(3px);
            border-radius: 8px;
            cursor: wait;
            pointer-events: all;
        }

        .category-reorder-busy-inner {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 12px;
            padding: 20px;
            text-align: center;
        }

        .category-reorder-busy-text {
            color: #475569;
            font-size: 14px;
            font-weight: 600;
            max-width: 280px;
            line-height: 1.4;
        }

        /* Category tree sidebar */
        .category-tree-sidebar {
            background: white;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 16px;
            max-height: 600px;
            overflow-y: auto;
        }

        .category-tree-title {
            font-size: 14px;
            font-weight: 600;
            color: #1a202c;
            margin-bottom: 12px;
            padding-bottom: 8px;
            border-bottom: 1px solid #e2e8f0;
        }

        .category-tree-item {
            padding: 8px 12px;
            margin: 4px 0;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 13px;
        }

        .category-tree-item:hover {
            background: #f7fafc;
        }

        .category-tree-item.active {
            background: #667eea;
            color: white;
        }

        .category-tree-item.active .category-tree-count {
            background: rgba(255, 255, 255, 0.2);
            color: white;
        }

        .category-tree-item.main-category {
            font-weight: 600;
            padding-left: 12px;
        }

        .category-tree-item.subcategory {
            font-weight: 400;
            padding-left: 32px;
            font-size: 12px;
        }

        .category-tree-item.category-tree-item--drag-over {
            background: #eef2ff !important;
            outline: 2px dashed #667eea;
            outline-offset: -2px;
        }

        /* Subcategory / product reorder: grip handle (drag indicator) */
        .category-drag-handle,
        .product-reorder-handle {
            flex-shrink: 0;
            width: 14px;
            min-height: 28px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 2px;
            margin-right: 6px;
            padding: 2px 0;
            border-radius: 4px;
            color: #94a3b8;
            cursor: grab;
            line-height: 1;
        }

        .category-drag-handle:hover,
        .product-reorder-handle:hover {
            background: rgba(102, 126, 234, 0.12);
            color: #64748b;
        }

        .category-drag-handle:active,
        .product-reorder-handle:active {
            cursor: grabbing;
        }

        .category-drag-handle .drag-handle-dots,
        .product-reorder-handle .drag-handle-dots {
            display: grid;
            grid-template-columns: 2px 2px;
            gap: 2px;
            pointer-events: none;
        }

        .category-drag-handle .drag-handle-dots span,
        .product-reorder-handle .drag-handle-dots span {
            width: 2px;
            height: 2px;
            border-radius: 50%;
            background: currentColor;
        }

        .product-item-card--reorder-target {
            outline: 2px dashed #667eea !important;
            outline-offset: 2px;
            border-radius: 6px;
        }

        .product-item-card[draggable="true"] {
            cursor: grab;
        }

        .product-item-card[draggable="true"]:active {
            cursor: grabbing;
        }

        .category-tree-icon {
            margin-right: 8px;
            font-size: 14px;
        }

        .category-tree-name {
            flex: 1;
        }

        .category-tree-count {
            background: #e2e8f0;
            color: #4a5568;
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 600;
            min-width: 24px;
            text-align: center;
        }

        /* Products panel */
        .products-panel {
            background: white;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 16px;
            min-height: 400px;
        }

        .products-panel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 16px;
            padding-bottom: 12px;
            border-bottom: 1px solid #e2e8f0;
        }

        .products-panel-title {
            font-size: 16px;
            font-weight: 600;
            color: #1a202c;
        }

        .products-panel-subtitle {
            font-size: 12px;
            color: #718096;
            margin-top: 4px;
        }

        .products-panel-empty {
            text-align: center;
            padding: 60px 20px;
            color: #718096;
        }

        .products-panel-empty-icon {
            font-size: 48px;
            margin-bottom: 12px;
            opacity: 0.5;
        }

        .category-card {
            background: white;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 16px;
            margin-bottom: 16px;
        }

        .category-card-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 12px;
            padding-bottom: 12px;
            border-bottom: 1px solid #e2e8f0;
        }

        .category-card-title {
            font-size: 16px;
            font-weight: 600;
            color: #1a202c;
        }

        .product-list {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 12px;
            margin-top: 12px;
        }

        .product-item-card {
            background: #f7fafc;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            padding: 12px;
            padding-bottom: 44px;
        }

        .product-item-name {
            font-size: 13px;
            font-weight: 600;
            color: #1a202c;
            margin-bottom: 4px;
        }

        .product-item-sku {
            font-size: 11px;
            color: #718096;
            margin-bottom: 8px;
        }

        .variant-list {
            margin-top: 8px;
            padding-top: 8px;
            border-top: 1px solid #e2e8f0;
        }

        .variant-section summary {
            cursor: pointer;
            list-style: none;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 4px 0;
            user-select: none;
        }
        .variant-section summary::-webkit-details-marker { display: none; }
        .variant-section summary::before {
            content: '▶';
            font-size: 10px;
            color: #718096;
            transition: transform 0.2s;
        }
        .variant-section[open] summary::before {
            transform: rotate(90deg);
        }

        .variant-item {
            font-size: 11px;
            color: #4a5568;
            padding: 4px 0;
        }

        .metafield-info {
            margin-top: 12px;
            padding-top: 12px;
            border-top: 1px solid #e2e8f0;
        }

        .metafield-section summary {
            cursor: pointer;
            list-style: none;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 0;
            user-select: none;
        }
        .metafield-section summary::-webkit-details-marker { display: none; }
        .metafield-section summary::before {
            content: '▶';
            font-size: 10px;
            color: #718096;
            transition: transform 0.2s;
        }
        .metafield-section[open] summary::before {
            transform: rotate(90deg);
        }

        .metafield-item {
            font-size: 11px;
            color: #718096;
            margin-top: 4px;
        }

        /* Delete Confirmation */
        .delete-confirm {
            display: none;
            position: fixed;
            z-index: 2001;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(4px);
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        .delete-confirm.active {
            display: flex;
        }

        .delete-confirm-content {
            background: white;
            border-radius: 12px;
            padding: 24px;
            max-width: 400px;
            width: 100%;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        }

        .delete-confirm-content h3 {
            margin: 0 0 12px 0;
            color: #dc2626;
            font-size: 20px;
            font-weight: 700;
        }

        .delete-confirm-content p {
            margin: 0 0 16px 0;
            color: #718096;
            line-height: 1.5;
        }

        .delete-confirm-actions {
            display: flex;
            justify-content: flex-end;
            gap: 12px;
            margin-top: 24px;
        }

        /* Responsive - Medium screens */
        @media (max-width: 1400px) {
            .details-grid {
                grid-template-columns: repeat(3, 1fr);
                gap: 20px;
            }
        }
        
        @media (max-width: 1200px) {
            .details-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 18px;
            }
        }

        /* Hamburger menu - visible on tablet/mobile */
        .sidebar-toggle {
            display: none;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            padding: 0;
            background: #f7fafc;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            cursor: pointer;
            font-size: 20px;
            margin-right: 12px;
        }

        .sidebar-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.4);
            z-index: 999;
            opacity: 0;
            transition: opacity 0.3s;
        }

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

        /* Tablet breakpoint */
        @media (max-width: 1200px) {
            .content-area {
                padding: 24px 20px;
            }

            .top-header {
                padding: 12px 20px;
            }

            .page-title {
                font-size: 20px;
            }

            .header-right {
                flex-wrap: wrap;
                gap: 8px;
            }

            .btn-header {
                padding: 6px 12px;
                font-size: 13px;
            }
        }

        /* Responsive - Tablet and below */
        @media (max-width: 1024px) {
            .sidebar {
                transform: translateX(-100%);
                box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
            }

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

            .sidebar-overlay {
                display: block;
            }

            .sidebar-toggle {
                display: flex;
            }

            .main-content-wrapper {
                margin-left: 0;
            }

            .content-area {
                padding: 20px 16px;
            }

            .top-header {
                padding: 12px 16px;
            }

            .deals-filters {
                padding: 16px;
            }

            .filters-row select,
            .filters-row input[type="date"] {
                min-width: 120px;
            }
        }

        /* Responsive - Small screens */
        @media (max-width: 768px) {
            .content-area {
                padding: 16px 12px;
            }

            .top-header {
                padding: 12px;
                flex-wrap: wrap;
                gap: 12px;
            }

            .header-left {
                flex: 1;
                min-width: 0;
            }

            .page-title {
                font-size: 18px;
            }

            .deals-grid {
                grid-template-columns: 1fr;
            }

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

            .stat-card {
                padding: 12px 14px;
            }
            .stats-grid {
                flex-wrap: wrap;
            }

            .stat-value {
                font-size: 24px;
            }

            .modal-content.modal-large {
                width: 95vw !important;
                max-width: 95vw !important;
            }
            
            .details-grid {
                grid-template-columns: 1fr;
                gap: 16px;
            }
            
            #dealInfoDetails {
                grid-template-columns: 1fr;
                gap: 20px;
            }

            .products-grid {
                grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
                gap: 12px;
            }

            .modal-footer {
                flex-direction: column;
                gap: 12px;
            }

            .modal-footer > div {
                width: 100%;
                flex-direction: column;
            }

            .deal-details-header-sticky {
                flex-direction: column;
                align-items: stretch;
            }

            .deal-details-header-actions {
                width: 100%;
                flex-direction: column;
                gap: 12px;
            }

            .deal-details-header-actions .btn-action {
                width: 100%;
            }

            .deals-table-container {
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                margin: 0 -12px;
                border-radius: 0;
                border-left: none;
                border-right: none;
            }

            .deals-table {
                min-width: 0;
            }

            .filters-row {
                flex-direction: column;
                align-items: stretch;
            }

            .filters-row select,
            .filters-row input[type="date"],
            .filters-row button {
                width: 100%;
                min-width: 0;
            }

            .deals-filters {
                padding: 12px;
            }

            .card-header,
            .card-body {
                padding: 16px;
            }
        }

        /* Extra small screens */
        @media (max-width: 480px) {
            .content-area {
                padding: 12px 8px;
            }

            .top-header {
                padding: 10px;
            }

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

            .sidebar-toggle {
                width: 36px;
                height: 36px;
                font-size: 18px;
            }
        }

/* === Droid Assignment Modal === */
        #droidAssignmentModal .droid-color-select option {
            padding: 8px 12px !important;
        }
        #droidAssignmentModal .droid-color-option:hover {
            background: #f1f5f9 !important;
        }
        #droidAssignmentModal .droid-thumbnail-canvas {
            width: 100% !important;
            height: auto !important;
            aspect-ratio: 2 / 1;
            display: block;
            object-fit: contain;
        }
        #droidAssignmentModal .droid-thumb-spinner {
            pointer-events: none;
        }
        /* Flex-center fabric's .canvas-container within the design wrapper.
           Dynaviewer sizes the canvas-container to the design's own aspect ratio, which
           may differ from the wrapper's aspect ratio. Centering ensures the design is
           always in the middle of the overlay regardless of design shape. */
        #droidModalDesignWrapper {
            align-items: center;
            justify-content: center;
        }
        #droidModalDesignWrapper > .canvas-container {
            position: relative !important;
            flex-shrink: 0;
            left: auto !important;
            top: auto !important;
        }
        #droidModalDesignWrapper > .canvas-container canvas {
            left: 0 !important;
            top: 0 !important;
        }
        .droid-modal-design-overlay.adjust-mode {
            pointer-events: auto !important;
        }
        .droid-modal-design-wrapper.adjust-mode {
            outline: 2px dashed #667eea;
            outline-offset: -2px;
        }
        .droid-resize-handle {
            z-index: 5;
            width: 12px !important;
            height: 12px !important;
            right: -6px !important;
            bottom: -6px !important;
            border-radius: 3px;
        }
        .droid-modal-design-wrapper.adjust-mode .droid-resize-handle {
            display: block !important;
        }
        .droid-modal-position-buttons {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }
        .droid-modal-adjust-btn,
        .droid-modal-make-default-btn {
            padding: 6px 12px;
            font-size: 12px;
            border-radius: 6px;
            cursor: pointer;
            flex: 1;
            min-width: 120px;
        }
        .droid-modal-adjust-btn {
            background: #eef2ff;
            color: #4338ca;
            border: 2px solid #667eea;
            font-weight: 600;
        }
        .droid-modal-adjust-btn:hover {
            background: #e0e7ff;
            border-color: #4f46e5;
            color: #3730a3;
        }
        #droidModalAdjustBtn.adjust-active {
            background: #667eea;
            color: #fff;
            border-color: #667eea;
        }
        .droid-modal-make-default-btn {
            background: #f0fdf4;
            color: #15803d;
            border: 2px solid #22c55e;
            font-weight: 600;
        }
        .droid-modal-make-default-btn:hover:not(:disabled) {
            background: #dcfce7;
            border-color: #16a34a;
            color: #166534;
        }
        .droid-modal-make-default-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            background: #f1f5f9;
            color: #94a3b8;
            border-color: #e2e8f0;
        }

        /* Logo pipeline status badge ---------------------------------------- */
        .logo-status-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 10px;
            border-radius: 6px;
            font-size: 11px;
            font-weight: 600;
            line-height: 1.2;
            max-width: 100%;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .logo-status-badge--ok {
            background: #dcfce7;
            color: #166534;
            border: 1px solid #86efac;
        }
        .logo-status-badge--partial {
            background: #fef3c7;
            color: #92400e;
            border: 1px solid #fcd34d;
        }
        .logo-status-badge--failed {
            background: #fee2e2;
            color: #991b1b;
            border: 1px solid #fca5a5;
        }
        .logo-status-badge--processing {
            background: #dbeafe;
            color: #1e40af;
            border: 1px solid #93c5fd;
        }
        .logo-status-badge .logo-status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            flex-shrink: 0;
            background: currentColor;
        }
        .logo-status-badge--processing .logo-status-dot {
            animation: logoStatusPulse 1s ease-in-out infinite;
        }
        @keyframes logoStatusPulse {
            0%, 100% { opacity: 0.4; }
            50%      { opacity: 1; }
        }
        .logo-status-retry-btn {
            margin-left: 8px;
            padding: 2px 8px;
            font-size: 11px;
            font-weight: 600;
            background: #fff;
            color: inherit;
            border: 1px solid currentColor;
            border-radius: 4px;
            cursor: pointer;
        }
        .droid-logo-upload-spinner {
            width: 14px;
            height: 14px;
            border: 2px solid #cbd5e1;
            border-top-color: #667eea;
            border-radius: 50%;
            display: inline-block;
            flex-shrink: 0;
            animation: spin 0.8s linear infinite;
        }
        .logo-status-retry-btn:hover {
            background: rgba(0,0,0,0.05);
        }

        /* ==================================================================
           Dashboard tab
           ================================================================== */
        .dashboard-root {
            display: flex;
            flex-direction: column;
            gap: 20px;
            padding: 4px 2px 40px;
        }

        /* Filter bar */
        .dashboard-filter-bar {
            display: flex;
            align-items: center;
            gap: 16px;
            flex-wrap: wrap;
            padding: 14px 16px;
            background: #fff;
            border: 1px solid #e2e8f0;
            border-radius: 10px;
            box-shadow: 0 1px 2px rgba(0,0,0,0.03);
        }
        .dashboard-filter-presets {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
        }
        .dash-preset-btn {
            padding: 6px 14px;
            background: #f7fafc;
            border: 1px solid #e2e8f0;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 500;
            color: #4a5568;
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .dash-preset-btn:hover { background: #edf2f7; }
        .dash-preset-btn.active {
            background: #667eea;
            border-color: #667eea;
            color: #fff;
        }
        .dashboard-filter-custom {
            display: flex;
            gap: 10px;
            align-items: center;
        }
        .dashboard-filter-custom label {
            font-size: 12px;
            color: #4a5568;
            display: flex;
            gap: 6px;
            align-items: center;
        }
        .dashboard-filter-custom input[type="date"] {
            padding: 5px 8px;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            font-size: 12px;
        }
        .dashboard-filter-actions {
            margin-left: auto;
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .dashboard-period-label {
            font-size: 12px;
            color: #718096;
            font-weight: 500;
        }

        /* KPI strip */
        .dashboard-kpi-strip {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 12px;
        }
        @media (min-width: 1400px) {
            .dashboard-kpi-strip { grid-template-columns: repeat(9, minmax(0, 1fr)); }
        }
        @media (min-width: 1024px) and (max-width: 1399px) {
            .dashboard-kpi-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
        }
        .dash-kpi-tile {
            background: #fff;
            border: 1px solid #e2e8f0;
            border-radius: 10px;
            padding: 14px 16px;
            box-shadow: 0 1px 2px rgba(0,0,0,0.03);
            display: flex;
            flex-direction: column;
            gap: 4px;
            min-height: 120px;
            position: relative;
        }
        .dash-kpi-title {
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: #718096;
            font-weight: 600;
        }
        .dash-kpi-value {
            font-size: 22px;
            font-weight: 700;
            color: #1a202c;
            line-height: 1.1;
        }
        .dash-kpi-delta {
            font-size: 11px;
            font-weight: 500;
        }
        .dash-kpi-delta-up   { color: #38a169; }
        .dash-kpi-delta-down { color: #e53e3e; }
        .dash-kpi-delta-neutral { color: #a0aec0; }
        .dash-kpi-sub {
            font-size: 10px;
            color: #a0aec0;
            margin-top: 2px;
        }
        .dash-kpi-spark {
            margin-top: auto;
            height: 28px;
        }

        /* Section containers */
        .dashboard-section {
            background: #fff;
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            padding: 18px 20px;
            box-shadow: 0 1px 2px rgba(0,0,0,0.03);
        }
        .dash-section-header {
            display: flex;
            align-items: baseline;
            gap: 12px;
            margin-bottom: 14px;
            flex-wrap: wrap;
        }
        .dash-section-header h3 {
            font-size: 16px;
            font-weight: 600;
            color: #1a202c;
            margin: 0;
        }
        .dash-section-sub {
            font-size: 12px;
            color: #718096;
        }
        .dash-granularity-toggle {
            margin-left: auto;
            display: flex;
            gap: 4px;
        }
        .dash-gran-btn {
            padding: 4px 10px;
            background: #f7fafc;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            font-size: 11px;
            color: #4a5568;
            cursor: pointer;
        }
        .dash-gran-btn.active {
            background: #667eea;
            border-color: #667eea;
            color: #fff;
        }

        /* Layout grids */
        .dash-three-col {
            display: grid;
            grid-template-columns: 1fr;
            gap: 14px;
            background: transparent;
            border: 0;
            box-shadow: none;
            padding: 0;
        }
        @media (min-width: 1024px) {
            .dash-three-col { grid-template-columns: 1.3fr 1fr 1fr; }
        }
        .dash-two-col {
            display: grid;
            grid-template-columns: 1fr;
            gap: 14px;
        }
        @media (min-width: 900px) {
            .dash-two-col { grid-template-columns: 1fr 1fr; }
        }

        /* Cards */
        .dash-card {
            background: #fff;
            border: 1px solid #e2e8f0;
            border-radius: 10px;
            padding: 14px 16px;
            box-shadow: 0 1px 2px rgba(0,0,0,0.03);
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        .dash-card-header {
            display: flex;
            align-items: baseline;
            gap: 10px;
            flex-wrap: wrap;
        }
        .dash-card-header h4 {
            margin: 0;
            font-size: 14px;
            font-weight: 600;
            color: #1a202c;
        }
        .dash-card-sub {
            font-size: 11px;
            color: #a0aec0;
        }
        .dash-chart-wrap {
            position: relative;
            height: 240px;
            width: 100%;
        }

        /* Rep leaderboard */
        .dash-rep-chart-wrap {
            height: 160px;
            margin-bottom: 12px;
            position: relative;
        }
        .dash-table-wrap {
            overflow-x: auto;
        }
        .dash-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 13px;
        }
        .dash-table thead th {
            text-align: left;
            padding: 10px 12px;
            background: #f7fafc;
            border-bottom: 1px solid #e2e8f0;
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.4px;
            color: #718096;
            font-weight: 600;
            white-space: nowrap;
        }
        .dash-table thead th.num { text-align: right; }
        .dash-table thead th .dash-th-sub {
            display: block;
            font-size: 10px;
            font-weight: 500;
            color: #a0aec0;
            text-transform: none;
            letter-spacing: 0;
            margin-top: 2px;
        }
        .dash-table tbody td {
            padding: 10px 12px;
            border-bottom: 1px solid #edf2f7;
            color: #2d3748;
        }
        .dash-table tbody td.num {
            text-align: right;
            font-variant-numeric: tabular-nums;
            white-space: nowrap;
        }
        .dash-table tbody tr {
            cursor: pointer;
            transition: background 0.1s;
        }
        .dash-table tbody tr:hover { background: #f7fafc; }
        .dash-rep-name {
            font-weight: 600;
            color: #1a202c;
        }
        .dash-rep-email {
            font-size: 11px;
            color: #a0aec0;
        }
        .dash-admin-chip {
            display: inline-block;
            padding: 1px 6px;
            background: #faf5ff;
            color: #805ad5;
            border-radius: 10px;
            font-size: 9px;
            text-transform: uppercase;
            letter-spacing: 0.3px;
            font-weight: 600;
            margin-left: 4px;
        }
        .dash-highlight { color: #2d3748; font-weight: 600; }
        .dash-muted { color: #a0aec0; font-size: 11px; }
        .dash-warn { color: #e53e3e; font-weight: 600; }
        .dash-empty {
            text-align: center;
            padding: 24px;
            color: #a0aec0;
            font-size: 13px;
        }
        .dash-loading {
            padding: 30px;
            text-align: center;
            color: #a0aec0;
            font-size: 13px;
        }
        .dash-error {
            padding: 16px;
            background: #fff5f5;
            color: #c53030;
            border: 1px solid #feb2b2;
            border-radius: 8px;
            font-size: 12px;
        }

        /* Rep detail panel */
        .dash-rep-detail {
            margin-top: 14px;
        }
        .dash-rep-detail-card .dash-chart-wrap { height: 260px; }
        .dash-rep-stores-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
            max-height: 280px;
            overflow-y: auto;
            padding-right: 4px;
        }
        .dash-rep-store-row {
            padding: 8px 10px;
            background: #f7fafc;
            border-radius: 6px;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .dash-rep-store-name {
            font-weight: 600;
            font-size: 13px;
            color: #2d3748;
        }
        .dash-rep-store-meta {
            display: flex;
            gap: 10px;
            font-size: 11px;
            color: #718096;
            flex-wrap: wrap;
        }

        /* Funnel */
        .dash-funnel {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }
        .dash-funnel-row {
            display: grid;
            grid-template-columns: 130px 1fr 56px;
            align-items: center;
            gap: 10px;
        }
        .dash-funnel-label {
            font-size: 12px;
            color: #4a5568;
            font-weight: 500;
        }
        .dash-funnel-bar {
            position: relative;
            height: 24px;
            background: #f7fafc;
            border-radius: 4px;
            overflow: hidden;
        }
        .dash-funnel-fill {
            height: 100%;
            background: linear-gradient(90deg, #667eea, #9f7aea);
            border-radius: 4px;
            transition: width 0.3s ease;
        }
        .dash-funnel-count {
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 11px;
            font-weight: 600;
            color: #1a202c;
            mix-blend-mode: difference;
            color: #fff;
        }
        .dash-funnel-conv {
            font-size: 11px;
            color: #718096;
            text-align: right;
        }

        /* Insight panels */
        .dash-insight-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 14px;
        }
        @media (min-width: 768px) {
            .dash-insight-grid { grid-template-columns: 1fr 1fr; }
        }
        @media (min-width: 1280px) {
            .dash-insight-grid { grid-template-columns: 1fr 1fr 1fr 1fr; }
        }
        .dash-insight-card {
            min-height: 220px;
        }
        .dash-insight-body {
            display: flex;
            flex-direction: column;
            gap: 6px;
            font-size: 12px;
            color: #4a5568;
            max-height: 280px;
            overflow-y: auto;
            padding-right: 4px;
        }
        .dash-list-row {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            padding: 8px 10px;
            background: #f7fafc;
            border-radius: 6px;
            gap: 10px;
        }
        .dash-list-row-warn {
            background: #fffaf0;
            border-left: 3px solid #ed8936;
        }
        .dash-list-row-clickable {
            cursor: pointer;
        }
        .dash-list-row-clickable:hover {
            background: #edf2f7;
        }
        .dash-list-row-warn.dash-list-row-clickable:hover {
            background: #fff5e6;
        }
        .dash-list-main {
            flex: 1;
            min-width: 0;
        }
        .dash-list-title {
            font-weight: 600;
            font-size: 12px;
            color: #2d3748;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .dash-list-sub {
            font-size: 11px;
            color: #718096;
            margin-top: 2px;
        }
        .dash-list-right {
            text-align: right;
            white-space: nowrap;
        }
        .dash-list-right-value {
            font-weight: 600;
            font-size: 12px;
            color: #2d3748;
        }
        .dash-list-right-sub {
            font-size: 10px;
            color: #a0aec0;
        }

        /* Insight mini-stats */
        .dash-stat-big {
            font-size: 22px;
            font-weight: 700;
            color: #1a202c;
            display: flex;
            align-items: baseline;
            gap: 8px;
        }
        .dash-stat-big.dash-stat-ok   { color: #38a169; }
        .dash-stat-big.dash-stat-warn { color: #ed8936; }
        .dash-stat-big.dash-stat-bad  { color: #e53e3e; }
        .dash-stat-sub {
            font-size: 12px;
            font-weight: 400;
            color: #a0aec0;
        }
        .dash-stat-row {
            display: flex;
            justify-content: space-between;
            font-size: 12px;
            padding: 4px 0;
            color: #4a5568;
        }
        .dash-warn-msg {
            margin-top: 8px;
            padding: 6px 8px;
            background: #fff5f5;
            color: #c53030;
            border-radius: 4px;
            font-size: 11px;
        }
        .dash-bar-stacked {
            display: flex;
            height: 8px;
            border-radius: 4px;
            overflow: hidden;
            background: #edf2f7;
            margin: 6px 0;
        }
        .dash-bar-good { background: #48bb78; }
        .dash-bar-low  { background: #ecc94b; }
        .dash-bar-none { background: #f56565; }

        .dash-ghosted-header {
            margin-top: 10px;
            font-size: 11px;
            font-weight: 600;
            color: #718096;
            text-transform: uppercase;
            letter-spacing: 0.4px;
        }
        .dash-ghosted-list {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .dash-ghosted-row {
            display: grid;
            grid-template-columns: 1fr 1.2fr auto;
            gap: 8px;
            font-size: 11px;
            padding: 4px 0;
            border-bottom: 1px dashed #edf2f7;
        }
        .dash-ghosted-co { font-weight: 600; color: #2d3748; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .dash-ghosted-email { color: #718096; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .dash-ghosted-age { color: #a0aec0; }

        /* ==================================================================
           Orders tab (global order dashboard)
           ================================================================== */
        .orders-dash-root {
            display: flex;
            flex-direction: column;
            gap: 10px;
            padding: 2px 2px 24px;
        }
        .orders-dash-hero {
            position: relative;
            overflow: hidden;
            border-radius: 10px;
            padding: 12px 16px;
            background: linear-gradient(120deg, #1e1b4b 0%, #312e81 40%, #5b21b6 100%);
            color: #fff;
            box-shadow: 0 6px 18px rgba(79, 70, 229, 0.22);
        }
        .orders-dash-hero::after {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.07) 50%, transparent 60%);
            background-size: 200% 100%;
            animation: ordersDashShimmer 8s ease-in-out infinite;
            pointer-events: none;
        }
        @keyframes ordersDashShimmer {
            0%, 100% { background-position: 100% 0; }
            50% { background-position: -100% 0; }
        }
        .orders-dash-hero-copy { position: relative; z-index: 1; max-width: 640px; }
        .orders-dash-hero-title {
            margin: 0 0 4px;
            font-size: 16px;
            font-weight: 700;
            letter-spacing: -0.02em;
        }
        .orders-dash-hero-sub {
            margin: 0;
            font-size: 12px;
            line-height: 1.35;
            opacity: 0.88;
        }
        .orders-dash-hero-accent {
            position: absolute;
            right: -48px;
            top: -48px;
            width: 120px;
            height: 120px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(250,204,21,0.35) 0%, transparent 70%);
            z-index: 0;
        }
        .orders-dash-toolbar {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 8px;
            padding: 8px 10px;
            background: #fff;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
        }
        .orders-dash-toolbar-right {
            margin-left: auto;
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .orders-dash-check {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
            color: #4a5568;
            cursor: pointer;
            user-select: none;
        }
        .orders-dash-period-hint {
            font-size: 12px;
            color: #718096;
            padding: 0 4px;
            min-height: 16px;
        }
        .orders-dash-bento {
            display: grid;
            grid-template-columns: minmax(360px, 420px) minmax(520px, 1fr) minmax(180px, 220px);
            align-items: stretch;
            gap: 8px;
        }
        .orders-dash-stat-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 6px;
            min-width: 0;
            align-content: stretch;
        }
        .orders-dash-summary-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 6px;
            min-width: 0;
        }
        .orders-dash-summary-item {
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            min-width: 0;
            min-height: 42px;
            padding: 6px 10px;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            background: #fff;
            box-shadow: 0 1px 2px rgba(0,0,0,0.03);
        }
        .orders-dash-summary-item span {
            font-size: 10px;
            font-weight: 700;
            color: #64748b;
            line-height: 1.15;
            min-width: 0;
        }
        .orders-dash-summary-item strong {
            font-size: 13px;
            color: #111827;
            line-height: 1.2;
            white-space: nowrap;
            flex-shrink: 0;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        @media (max-width: 1320px) {
            .orders-dash-bento {
                grid-template-columns: minmax(320px, 380px) minmax(420px, 1fr);
            }
            .orders-dash-chart-card {
                grid-column: 1 / -1;
                max-width: none;
            }
            .orders-dash-chart-canvas {
                height: 88px;
                flex-basis: 88px;
            }
        }
        @media (max-width: 980px) {
            .orders-dash-bento {
                grid-template-columns: 1fr;
            }
            .orders-dash-summary-grid {
                grid-template-columns: repeat(4, minmax(96px, 1fr));
            }
        }
        @media (max-width: 720px) {
            .orders-dash-summary-grid {
                grid-template-columns: repeat(2, minmax(110px, 1fr));
            }
        }
        .orders-dash-kpi {
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            min-width: 0;
            background: #fff;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 6px 10px;
            min-height: 42px;
            box-shadow: 0 1px 2px rgba(0,0,0,0.03);
        }
        .orders-dash-kpi--accent {
            border-color: rgba(99,102,241,0.35);
            background: linear-gradient(165deg, #faf5ff 0%, #fff 60%);
        }
        .orders-dash-kpi-label {
            display: block;
            font-size: 10px;
            text-transform: none;
            letter-spacing: 0;
            color: #64748b;
            font-weight: 600;
            margin-bottom: 0;
            line-height: 1.2;
            flex: 1;
            min-width: 0;
        }
        .orders-dash-kpi-value {
            font-size: 14px;
            font-weight: 700;
            color: #1a202c;
            white-space: nowrap;
            flex-shrink: 0;
            line-height: 1.2;
        }
        .orders-dash-chart-card {
            min-width: 0;
            background: #fff;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 6px 8px 4px;
            box-shadow: 0 1px 2px rgba(0,0,0,0.03);
            display: flex;
            flex-direction: column;
        }
        .orders-dash-chart-head { margin-bottom: 2px; }
        .orders-dash-chart-title {
            font-size: 11px;
            font-weight: 700;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }
        .orders-dash-chart-sub {
            display: none;
        }
        .orders-dash-chart-body {
            flex: 1;
            min-height: 0;
            display: flex;
            flex-direction: column;
        }
        .orders-dash-table-card .card-header {
            padding: 14px 18px;
        }
        .orders-dash-table-card .card-title {
            font-size: 17px;
        }
        .orders-dash-table-card .card-body {
            padding: 12px 18px 18px;
        }

        .orders-dash-chart-canvas {
            position: relative;
            height: 72px;
            flex: 0 0 72px;
        }
        .orders-dash-table-header {
            align-items: flex-start;
            flex-wrap: wrap;
            gap: 8px;
            padding-bottom: 10px;
        }
        .orders-dash-table-desc {
            margin: 4px 0 0;
            font-size: 12px;
            color: #718096;
            max-width: 520px;
            line-height: 1.35;
        }
        .orders-dash-table-controls {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            align-items: center;
            margin-left: auto;
        }
        .orders-dash-search {
            min-width: 220px;
            padding: 8px 12px;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            font-size: 13px;
        }
        .orders-dash-filters-row {
            display: flex;
            flex-wrap: wrap;
            align-items: flex-end;
            gap: 10px 14px;
            margin-bottom: 14px;
            padding: 10px 12px;
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
        }
        .orders-dash-filter {
            display: flex;
            flex-direction: column;
            gap: 4px;
            min-width: 140px;
        }
        .orders-dash-filter--rep {
            flex: 1 1 200px;
            max-width: 320px;
        }
        .orders-dash-filter-lbl {
            font-size: 10px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: #64748b;
        }
        .orders-dash-filter-input,
        .orders-dash-filter-select {
            padding: 7px 10px;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            font-size: 13px;
            background: #fff;
        }
        .orders-dash-clear-filters {
            padding: 7px 12px !important;
            font-size: 12px !important;
            align-self: flex-end;
            margin-left: auto;
        }
        .orders-dash-store-summary {
            flex: 1 1 100%;
            margin-top: 2px;
            padding: 10px 12px;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            background: #fff;
        }
        .orders-dash-store-summary-title {
            margin-bottom: 8px;
            font-size: 12px;
            font-weight: 700;
            color: #1f2937;
        }
        .orders-dash-store-summary-grid {
            display: grid;
            grid-template-columns: repeat(7, minmax(84px, 1fr));
            gap: 6px;
        }
        .orders-dash-store-summary-item {
            min-width: 0;
            padding: 6px 8px;
            border: 1px solid #edf2f7;
            border-radius: 7px;
            background: #f8fafc;
        }
        .orders-dash-store-summary-item span {
            display: block;
            font-size: 10px;
            font-weight: 700;
            color: #64748b;
            line-height: 1.15;
        }
        .orders-dash-store-summary-item strong {
            display: block;
            margin-top: 2px;
            font-size: 13px;
            color: #111827;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        @media (max-width: 1180px) {
            .orders-dash-store-summary-grid {
                grid-template-columns: repeat(4, minmax(96px, 1fr));
            }
        }
        @media (max-width: 720px) {
            .orders-dash-store-summary-grid {
                grid-template-columns: repeat(2, minmax(110px, 1fr));
            }
        }
        .orders-dash-select {
            padding: 8px 10px;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            font-size: 13px;
            background: #fff;
        }
        .orders-dash-loading {
            text-align: center;
            padding: 28px;
            color: #718096;
        }
        .orders-dash-error {
            margin: 12px 0;
            padding: 10px 12px;
            background: #fff5f5;
            border: 1px solid #feb2b2;
            border-radius: 8px;
            color: #c53030;
            font-size: 13px;
        }
        .orders-dash-table-wrap {
            overflow-x: auto;
            border-radius: 8px;
            border: 1px solid #edf2f7;
        }
        .orders-dash-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 13px;
        }
        .orders-dash-table thead th {
            text-align: left;
            padding: 10px 12px;
            background: #f8fafc;
            color: #64748b;
            font-weight: 600;
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            border-bottom: 1px solid #e2e8f0;
        }
        .orders-dash-table thead th.num { text-align: right; }
        .orders-dash-row {
            border-bottom: 1px solid #f1f5f9;
            transition: background .12s ease;
        }
        .orders-dash-row:hover { background: #fafbfc; }
        .orders-dash-row[data-status*="Incomplete"],
        .orders-dash-row[data-status*="incomplete"] {
            border-left: 3px solid #cbd5e1;
        }
        .orders-dash-row:not([data-status*="Incomplete"]):not([data-status*="incomplete"]) {
            border-left: 3px solid transparent;
        }
        .orders-dash-row td {
            padding: 12px;
            vertical-align: top;
        }
        .orders-dash-row td.num { text-align: right; }
        .orders-bc { font-weight: 700; color: #1e293b; }
        .orders-bc-link { color: #3730a3; text-decoration: none; }
        .orders-bc-link:hover { text-decoration: underline; }
        .orders-co-name { font-weight: 600; color: #1a202c; }
        .orders-link-sub { display: inline-block; margin-top: 4px; font-size: 11px; color: #6366f1; text-decoration: none; font-weight: 500; }
        .orders-link-sub:hover { text-decoration: underline; }
        .orders-deal-btn {
            font-family: ui-monospace, monospace;
            font-size: 12px;
            padding: 4px 8px;
            border-radius: 6px;
            border: 1px solid #e2e8f0;
            background: #f8fafc;
            cursor: pointer;
            color: #4338ca;
            font-weight: 600;
        }
        .orders-deal-btn:hover {
            background: #eef2ff;
            border-color: #c7d2fe;
        }
        .orders-total { font-weight: 600; color: #0f172a; }
        .orders-st {
            display: inline-block;
            padding: 3px 10px;
            border-radius: 999px;
            font-size: 11px;
            font-weight: 600;
        }
        .orders-st--ok { background: #dcfce7; color: #166534; }
        .orders-st--warn { background: #fef3c7; color: #92400e; }
        .orders-st--bad { background: #fee2e2; color: #991b1b; }
        .orders-st--blue { background: #dbeafe; color: #1d4ed8; }
        .orders-st--muted { background: #f1f5f9; color: #64748b; }
        .orders-st--neutral { background: #e0f2fe; color: #0369a1; }
        .orders-sync-main { font-weight: 600; color: #334155; }
        .orders-sync-sub { font-size: 11px; color: #94a3b8; margin-top: 2px; }
        .orders-rep { font-size: 12px; color: #475569; }
        .orders-link { color: #6366f1; font-weight: 600; text-decoration: none; font-size: 13px; }
        .orders-link:hover { text-decoration: underline; }
        .orders-muted { color: #94a3b8; font-size: 12px; }
        .orders-export-btn {
            border: 1px solid #c7d2fe;
            background: #eef2ff;
            color: #3730a3;
            border-radius: 6px;
            padding: 5px 9px;
            font-size: 11px;
            font-weight: 700;
            cursor: pointer;
            white-space: nowrap;
        }
        .orders-export-btn:hover { background: #e0e7ff; }
        .orders-export-btn:disabled { opacity: .65; cursor: wait; }
        .orders-dash-empty {
            text-align: center;
            padding: 48px 20px;
            color: #718096;
        }
        .orders-dash-empty-icon { font-size: 42px; margin-bottom: 8px; }
        .orders-dash-pager {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 12px;
            margin-top: 16px;
            flex-wrap: wrap;
        }
        .orders-dash-pager-info {
            margin-right: auto;
            font-size: 13px;
            color: #64748b;
        }

