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

    :root {
        --bg-primary: #f8fafc;
        --bg-secondary: #ffffff;
        --bg-tertiary: #f1f5f9;
        --text-primary: #334155;
        --text-secondary: #64748b;
        --text-muted: #94a3b8;
        --border-color: #e2e8f0;
        --border-hover: #cbd5e1;
        --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
        --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
        --brand-color: #0891b2;
        --brand-hover: #2563eb;
        --success-color: #00d084;
        --warning-color: #fbbf24;
        --error-color: #ef4444;
        --blue-color: #3b82f6;
        --accent-color: #3b82f6;
        --accent-dark: #2563eb;
        --accent-rgb: 59, 130, 246;
        --danger-color: #ef4444;
        --danger-light: #fee2e2;
    }

    [data-theme="dark"] {
        --bg-primary: #1a1a1a;
        --bg-secondary: #2d2d2d;
        --bg-tertiary: #0d0d0d;
        --text-primary: #ffffff;
        --text-secondary: #e1e1e1;
        --text-muted: #8a8a8a;
        --border-color: #404040;
        --border-hover: #595959;
        --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
        --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
        --brand-color: #0891b2;
        --brand-hover: #2563eb;
        --success-color: #00d084;
        --warning-color: #fbbf24;
        --error-color: #ff6b6b;
        --blue-color: #3b82f6;
        --accent-color: #3b82f6;
        --accent-dark: #2563eb;
        --accent-rgb: 59, 130, 246;
        --danger-color: #ef4444;
        --danger-light: #fee2e2;
    }

    /* Force all sidebar elements to dark theme */
    [data-theme="dark"] .sidebar,
    [data-theme="dark"] .sidebar *,
    [data-theme="dark"] .menu-section,
    [data-theme="dark"] .menu-section-header,
    [data-theme="dark"] .section-content,
    [data-theme="dark"] .menu-group {
        background: #0d0d0d !important;
    }

    [data-theme="dark"] .menu-item {
        background: #0d0d0d !important;
    }

    [data-theme="dark"] .menu-item:hover {
        background: #2d2d2d !important;
    }

    [data-theme="dark"] .menu-item:hover *,
    [data-theme="dark"] .menu-item:hover .menu-item-text,
    [data-theme="dark"] .menu-item:hover span,
    [data-theme="dark"] .menu-item:hover div {
        background: transparent !important;
    }

    [data-theme="dark"] .menu-item span,
    [data-theme="dark"] .menu-item .menu-item-text,
    [data-theme="dark"] .menu-item div {
        background: transparent !important;
    }

    /* Theme toggle switch dark mode styling */
    [data-theme="dark"] #themeToggle + span {
        background-color: #404040 !important;
    }

    [data-theme="dark"] #themeToggle:checked + span {
        background-color: #006d6a !important;
    }

    [data-theme="dark"] #themeToggle + span + span {
        background-color: #ffffff !important;
    }

    [data-theme="dark"] .menu-section-header:hover {
        background: #1a1a1a !important;
    }

    [data-theme="dark"] .menu-item.active {
        background: rgba(0, 109, 106, 0.15) !important;
        color: #006d6a !important;
    }

    [data-theme="dark"] .menu-item.active * {
        background: transparent !important;
        color: #006d6a !important;
    }
    
    /* Dark Mode - Navigation Text Colors */
    [data-theme="dark"] .sidebar,
    [data-theme="dark"] .sidebar-nav,
    [data-theme="dark"] .menu-section-header,
    [data-theme="dark"] .menu-item,
    [data-theme="dark"] .menu-item-text {
        color: var(--text-primary) !important;
    }
    
    /* Dark Mode - Menu Section Headers Hover */
    [data-theme="dark"] .menu-section-header:hover {
        background: #1a1a1a !important;
        color: var(--text-secondary) !important;
    }
    
    /* Dark Mode - Section Chevrons */
    [data-theme="dark"] .section-chevron {
        color: var(--text-muted) !important;
    }
    
    /* Dark Mode - Bottom User Bar */
    [data-theme="dark"] .sidebar div[style*="background: var(--bg-tertiary)"] {
        background: var(--bg-tertiary) !important;
        border-top: 1px solid var(--border-color) !important;
    }
    
    [data-theme="dark"] #user-email-display {
        color: var(--text-muted) !important;
    }
    
    [data-theme="dark"] button[onclick="window.logoutUser()"] {
        color: var(--text-muted) !important;
        background: transparent !important;
    }

    /* User Configuration Styles */
    .user-profile-section {
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .profile-photo-section h3,
    .profile-name-section h3 {
        margin: 0 0 12px 0;
        font-size: 14px;
        font-weight: 600;
        color: var(--text-primary);
    }

    .profile-photo-container {
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .profile-photo-preview {
        width: 80px;
        height: 80px;
        border-radius: 50%;
        border: 2px solid var(--border-color);
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--bg-secondary);
        overflow: hidden;
        position: relative;
    }

    .profile-photo-preview img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
    }

    .profile-initials {
        font-size: 28px;
        font-weight: 600;
        color: var(--text-muted);
        user-select: none;
    }

    .profile-photo-controls {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

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

    .profile-actions {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .save-status {
        font-size: 12px;
        font-weight: 500;
    }

    .save-status.success {
        color: var(--success-color);
    }

    .save-status.error {
        color: var(--danger-color);
    }

    /* User Display Styles */
    .user-display {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .user-avatar {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        overflow: hidden;
        background: #3b82f6;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .user-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .user-avatar-initials {
        font-size: 12px;
        font-weight: 600;
        color: white;
        user-select: none;
    }

    .user-name {
        font-size: 11px;
        color: var(--text-muted);
        font-weight: 500;
    }

    /* Dark Mode - Login Screen */
    [data-theme="dark"] #auth-section {
        background: var(--bg-primary) !important;
        color: var(--text-primary) !important;
    }
    
    [data-theme="dark"] #auth-section > div {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
    }
    
    [data-theme="dark"] #auth-section h2 {
        color: var(--text-primary) !important;
    }
    
    [data-theme="dark"] #auth-section #login-tab,
    [data-theme="dark"] #auth-section #register-tab {
        border: none !important;
        background: rgb(67, 67, 67);
        color: white !important;
    }
    
    [data-theme="dark"] #auth-section input[type="email"],
    [data-theme="dark"] #auth-section input[type="password"] {
        background: rgb(67, 67, 67) !important;
        color: white !important;
        border: 1px solid #696969 !important;
    }
    
    [data-theme="dark"] #auth-section input[type="email"]:focus,
    [data-theme="dark"] #auth-section input[type="password"]:focus {
        border: 1px solid #9ca3af !important;
        outline: none !important;
    }
    
    [data-theme="dark"] #auth-section input::placeholder {
        color: #9ca3af !important;
    }
    
    [data-theme="dark"] #auth-section button[onclick*="loginUser"],
    [data-theme="dark"] #auth-section button[onclick*="registerUser"] {
        background: rgb(102, 102, 102) !important;
        color: white !important;
        transition: background 0.2s ease !important;
    }
    
    [data-theme="dark"] #auth-section button[onclick*="loginUser"]:hover,
    [data-theme="dark"] #auth-section button[onclick*="registerUser"]:hover {
        background: rgb(120, 120, 120) !important;
    }

    /* Order Progress Bar */
    .order-progress-container {
        background: var(--bg-secondary);
        padding: 25px;
        border-radius: 8px;
        margin-bottom: 30px;
    }

    .order-progress-header {
        font-size: 12px;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 20px;
    }

    .order-progress-linear {
        display: flex;
        align-items: center;
        position: relative;
        margin-bottom: 10px;
    }

    .order-progress-step {
        flex: 1;
        text-align: center;
        position: relative;
        z-index: 2;
        display: flex;
        flex-direction: column;
        align-items: center;
        min-height: 100px; /* Ensure consistent height */
    }

    .order-step-label {
        font-size: 11px;
        font-weight: 500;
        line-height: 1.2;
        margin-top: 8px;
        color: var(--text-muted);
    }

    /* Progress Line */
    .order-progress-line {
        position: absolute;
        top: 18px;
        left: calc(7.14% + 18px);
        right: calc(7.14% + 18px);
        height: 3px;
        background: var(--border-color);
        border-radius: 1.5px;
        z-index: 1;
    }

    .order-progress-fill {
        height: 100%;
        background: #10b981;
        width: 0%;
        border-radius: 1.5px;
        transition: width 0.5s ease;
    }

    /* Step Indicators */
    .order-step-indicator {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 13px;
        font-weight: 600;
        position: relative;
        transition: all 0.2s ease;
        cursor: pointer;
        flex-shrink: 0;
    }

    .order-step-indicator:hover {
        transform: scale(1.05);
    }

    .order-step-indicator.completed {
        background: #10b981;
        color: white;
        border: 2px solid #10b981;
    }

    .order-step-indicator.current {
        background: var(--bg-primary);
        color: #3b82f6;
        border: 3px solid #3b82f6;
        animation: pulseRing 2s infinite;
    }

    .order-step-indicator.current:hover {
        transform: scale(1.05);
        animation: pulseRing 2s infinite;
    }

    .order-step-indicator.pending {
        background: var(--bg-primary);
        color: var(--text-muted);
        border: 2px solid var(--border-color);
    }

    /* Step Labels */
    .order-step-label.completed { 
        color: #10b981; 
        font-weight: 600; 
    }
    
    .order-step-label.current { 
        color: #3b82f6; 
        font-weight: 700; 
    }

    .order-progress-step:hover .order-step-label {
        color: var(--text-primary);
        font-weight: 600;
    }

    /* Pulse Animation */
    @keyframes pulseRing {
        0% {
            box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
        }
        50% {
            box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.1);
        }
        100% {
            box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
        }
    }

    /* Step Timestamps */
    .order-step-timestamp {
        font-size: 10px;
        color: var(--text-muted);
        margin-top: 4px;
        line-height: 1.2;
        white-space: nowrap;
        display: none;
        position: absolute;
        top: 70px; /* Position below the label */
        left: 50%;
        transform: translateX(-50%);
        width: 80px;
    }

    /* Show timestamps for completed and current steps */
    .order-progress-step:has(.order-step-label.completed) .order-step-timestamp,
    .order-progress-step:has(.order-step-label.current) .order-step-timestamp {
        display: block;
    }

    /* Fallback for browsers that don't support :has() */
    .order-step-timestamp.show {
        display: block !important;
    }

    /* Rejected State Styles */
    .order-step-indicator.rejected {
        background: #ef4444;
        color: white;
        border: 2px solid #ef4444;
    }

    .order-step-label.rejected {
        color: #ef4444;
        font-weight: 600;
    }

    .order-progress-step:has(.order-step-label.rejected) .order-step-timestamp {
        color: #ef4444;
        display: block;
    }

    /* Dark Mode - Keywords Section */
    [data-theme="dark"] #keywords .products-header {
        background: transparent;
        border-color: var(--border-color);
    }
    [data-theme="dark"] #keywords .products-header h2 {
        color: var(--text-primary);
    }
    
    /* Dark Mode - Keywords Table */
    [data-theme="dark"] #keywords .table-container {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
    }
    [data-theme="dark"] #keywords .data-table {
        background: var(--bg-secondary);
    }
    [data-theme="dark"] #keywords .data-table thead {
        background: var(--bg-tertiary);
    }
    [data-theme="dark"] #keywords .data-table thead th {
        background: var(--bg-tertiary);
        color: var(--text-primary);
        border-bottom: 1px solid var(--border-color);
    }
    [data-theme="dark"] #keywords .data-table tbody tr {
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border-color);
    }
    [data-theme="dark"] #keywords .data-table tbody tr:hover {
        background: var(--bg-secondary);
    }
    [data-theme="dark"] #keywords .data-table tbody td {
        color: var(--text-primary);
        border-bottom: 1px solid var(--border-color);
    }
    
    /* Keyword Conflicts Location Expansion */
    .expand-locations {
        color: var(--link-color) !important;
        cursor: pointer !important;
        text-decoration: underline !important;
        font-weight: 500;
    }
    .expand-locations:hover {
        text-decoration: none !important;
        opacity: 0.8;
    }
    [data-theme="dark"] .expand-locations {
        color: #60a5fa !important;
    }
    [data-theme="dark"] .expand-locations:hover {
        color: #93c5fd !important;
    }
    

    /* Going Dark Transition */
    .going-dark-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: #000000;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1000000;
        opacity: 0;
        transition: opacity 0.8s ease;
    }

    .going-dark-overlay.show {
        opacity: 1;
    }

    .going-dark-text {
        font-size: 100px;
        font-weight: 700;
        color: #ffffff;
        text-align: left;
        line-height: 1.1;
        opacity: 0;
        transform: translateY(20px);
        transition: all 1s ease;
    }

    .going-dark-text.show {
        opacity: 1;
        transform: translateY(0);
    }

    body {
        background-color: var(--bg-primary);
        color: var(--text-primary);
        transition: background-color 0.3s ease, color 0.3s ease;
    }
    
    /* Login/Auth Styling */
    .auth-tabs {
        display: flex;
        margin-bottom: 1rem;
    }
    .auth-tab {
        flex: 1;
        padding: 0.5rem;
        background: #f3f4f6;
        color: #374151;
        border: none;
        cursor: pointer;
        border: 1px solid #d1d5db;
    }
    .auth-tab:first-child {
        border-radius: 4px 0 0 4px;
    }
    .auth-tab:last-child {
        border-radius: 0 4px 4px 0;
    }
    .auth-tab.active {
        background: #3b82f6;
        color: white;
    }
    .auth-tab:hover:not(.active) {
        background: #e5e7eb;
    }
    
    .auth-input {
        width: 100%;
        padding: 0.75rem;
        margin-bottom: 1rem;
        border: 1px solid #d1d5db;
        border-radius: 4px;
        background: white;
        color: #374151;
        font-size: 14px;
    }
    .auth-input:focus {
        outline: none;
        border-color: #3b82f6;
        box-shadow: 0 0 0 1px #3b82f6;
    }
    
    .auth-button {
        width: 100%;
        padding: 0.75rem;
        background: #3b82f6;
        color: white;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-size: 14px;
        font-weight: 500;
    }
    .auth-button:hover {
        background: #2563eb;
    }
    
    /* Dark Mode Auth Styling */
    [data-theme="dark"] .auth-tab {
        background: rgb(67, 67, 67) !important;
        color: white !important;
        border-color: #4b5563 !important;
    }
    [data-theme="dark"] .auth-tab.active {
        background: rgb(102, 102, 102) !important;
        color: white !important;
    }
    [data-theme="dark"] .auth-tab:hover:not(.active) {
        background: #4b5563 !important;
    }
    
    [data-theme="dark"] .auth-input {
        background: rgb(67, 67, 67);
        color: white;
        border-color: #696969;
    }
    [data-theme="dark"] .auth-input:focus {
        border-color: #93c5fd;
        box-shadow: 0 0 0 1px #93c5fd;
    }
    
    [data-theme="dark"] .auth-button {
        background: rgb(102, 102, 102);
    }
    [data-theme="dark"] .auth-button:hover {
        background: rgba(102, 102, 102, 0.8);
    }

    [data-theme="dark"] .sidebar-header {
        background: #0d0d0d !important;
    }

    /* Digital Assets Category Badges */
    .category-badge {
        background: #dcfce7;
        color: #166534;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
        white-space: nowrap;
        display: inline-block;
        letter-spacing: normal;
    }
    .category-badge.pdfs {
        background: #fef2f2;
        color: #dc2626;
    }
    .category-badge.images {
        background: #dcfce7;
        color: #166534;
    }
    .category-badge.brochures {
        background: #f3e8ff;
        color: #7c3aed;
    }
    .category-badge.templates {
        background: #fef3c7;
        color: #d97706;
    }

    /* Light mode - ensure no borders on category badges */
    .category-badge.pdfs,
    .category-badge.images,
    .category-badge.brochures,
    .category-badge.templates {
        border: none;
    }
    [data-theme="dark"] .category-badge.pdfs {
        background: #7f1d1d !important;
        color: #fecaca !important;
        border: 1px solid #dc2626;
    }
    [data-theme="dark"] .category-badge.images {
        background: #14532d !important;
        color: #86efac !important;
        border: 1px solid #16a34a;
    }
    [data-theme="dark"] .category-badge.brochures {
        background: #581c87 !important;
        color: #c4b5fd !important;
        border: 1px solid #a855f7;
    }
    [data-theme="dark"] .category-badge.templates {
        background: #451a03 !important;
        color: #fdba74 !important;
        border: 1px solid #d97706;
    }

    /* Asset status badges */
    .status-badge.new {
        background: #10b981;
        color: white;
        font-size: 10px;
        padding: 2px 6px;
        border-radius: 3px;
        font-weight: 600;
        margin-left: 8px;
    }
    .status-badge.updated {
        background: #f59e0b;
        color: white;
        font-size: 10px;
        padding: 2px 6px;
        border-radius: 3px;
        font-weight: 600;
        margin-left: 8px;
    }

    /* Format badges */
    .format-badge {
        background: #f1f5f9;
        color: #475569;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
        white-space: nowrap;
        display: inline-block;
        border: 1px solid #e2e8f0;
    }

    [data-theme="dark"] .format-badge {
        background: #334155 !important;
        color: #cbd5e1 !important;
        border: 1px solid #475569;
    }

    /* Assets table specific column widths - remove fixed widths */
    #assetsTable .col-name { 
        min-width: auto !important; 
        width: auto;
    }
    #assetsTable .col-category { 
        min-width: auto !important; 
        width: auto; 
    }
    #assetsTable .col-format { 
        min-width: auto !important; 
        width: auto; 
    }
    #assetsTable .col-version { 
        min-width: auto !important; 
        width: auto; 
    }
    #assetsTable .col-date { 
        min-width: auto !important; 
        width: auto; 
    }
    #assetsTable .col-user { 
        min-width: auto !important; 
        width: auto; 
    }
    #assetsTable .col-size { 
        min-width: auto !important; 
        width: auto; 
    }
    #assetsTable .col-actions {
        width: 120px; /* Keep actions column fixed for buttons */
    }
    #assetsTable .col-version { 
        min-width: auto !important; 
        width: auto; 
    }
    #assetsTable .col-date { 
        min-width: auto !important; 
        width: auto; 
    }
    #assetsTable .col-user { 
        min-width: auto !important; 
        width: auto; 
    }
    #assetsTable .col-size { 
        min-width: auto !important; 
        width: auto; 
    }
    #assetsTable .col-actions {
        width: 120px; /* Keep actions column fixed for buttons */
    }

    /* Edit modal dark mode styling */
    [data-theme="dark"] #assetEditModal .product-modal {
        background: var(--bg-primary) !important;
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] #assetEditModal .product-modal-header {
        background: var(--bg-secondary) !important;
        border-bottom: 1px solid var(--border-color);
    }

    [data-theme="dark"] #assetEditModal .product-modal-header h3 {
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #assetEditModal .product-modal-body {
        background: var(--bg-secondary) !important;
    }

    [data-theme="dark"] #assetEditModal .modal-form-group label {
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #assetEditModal .modal-form-group input,
    [data-theme="dark"] #assetEditModal .modal-form-group select,
    [data-theme="dark"] #assetEditModal .modal-form-group textarea {
        background: var(--bg-primary) !important;
        border: 1px solid var(--border-color) !important;
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #assetEditModal .modal-form-group input:focus,
    [data-theme="dark"] #assetEditModal .modal-form-group select:focus,
    [data-theme="dark"] #assetEditModal .modal-form-group textarea:focus {
        border-color: #3b82f6 !important;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    }

    [data-theme="dark"] #assetEditModal .product-modal-footer {
        background: var(--bg-secondary) !important;
        border-top: 1px solid var(--border-color);
    }

    [data-theme="dark"] #assetEditModal .modal-close-btn {
        color: var(--text-primary) !important;
        background: transparent !important;
        border: none !important;
    }

    [data-theme="dark"] #assetEditModal .modal-close-btn:hover {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }

    /* Edit modal current file info dark mode - remove border and padding */
    [data-theme="dark"] #assetEditModal .modal-form-group div {
        background: var(--bg-secondary) !important;
        color: var(--text-muted) !important;
        border: none !important;
        padding: 0 !important;
    }

    /* Asset Upload Modal Styles */
    .file-upload-area {
        border: 2px dashed #d1d5db;
        border-radius: 8px;
        padding: 32px;
        text-align: center;
        cursor: pointer;
        transition: all 0.2s ease;
        background: #f9fafb;
    }
    .file-upload-area:hover {
        border-color: #3b82f6;
        background: #f0f9ff;
    }
    .file-upload-area.drag-over {
        border-color: #3b82f6;
        background: #eff6ff;
    }
    [data-theme="dark"] .file-upload-area {
        background: var(--bg-secondary);
        border-color: #4b5563;
        color: var(--text-primary);
    }
    [data-theme="dark"] .file-upload-area:hover {
        border-color: #60a5fa;
        background: var(--bg-tertiary);
    }

    /* Version History Timeline */
    .version-timeline {
        position: relative;
        padding-left: 32px;
    }
    .version-timeline::before {
        content: '';
        position: absolute;
        left: 12px;
        top: 0;
        bottom: 0;
        width: 2px;
        background: #e5e7eb;
    }
    [data-theme="dark"] .version-timeline::before {
        background: #4b5563;
    }
    .version-item {
        position: relative;
        background: white;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 16px;
        margin-bottom: 16px;
    }
    .version-item::before {
        content: '';
        position: absolute;
        left: -28px;
        top: 20px;
        width: 12px;
        height: 12px;
        background: #3b82f6;
        border: 2px solid white;
        border-radius: 50%;
    }
    .version-item.current::before {
        background: #10b981;
    }
    [data-theme="dark"] .version-item {
        background: var(--bg-secondary);
        border-color: var(--border-color);
        color: var(--text-primary);
    }
    [data-theme="dark"] .version-item::before {
        border-color: var(--bg-secondary);
    }

    /* Digital Assets Table Dark Mode */
    [data-theme="dark"] #assetsTable {
        background: var(--bg-primary);
        border-color: var(--border-color);
    }
    [data-theme="dark"] #assetsTable thead {
        background: var(--bg-secondary);
    }
    [data-theme="dark"] #assetsTable th {
        background: var(--bg-tertiary);
        color: var(--text-primary);
        border-color: var(--border-color);
        border-bottom: 2px solid var(--border-color);
    }
    [data-theme="dark"] #assetsTable th:hover {
        background: var(--bg-primary);
    }
    [data-theme="dark"] #assetsTable tbody tr {
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border-color);
    }
    [data-theme="dark"] #assetsTable tbody tr:hover {
        background: var(--bg-secondary);
    }
    [data-theme="dark"] #assetsTable tbody td {
        color: var(--text-primary);
        border-bottom: 1px solid var(--border-color);
    }
    /* Digital Assets Table Container */
    #digital-assets .table-container {
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        background: white;
    }
    
    [data-theme="dark"] #digital-assets .table-container {
        background: var(--bg-primary);
        border-color: var(--border-color);
    }
    [data-theme="dark"] #assetsTable th.col-actions {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
        border-left: 1px solid var(--border-color);
    }
    [data-theme="dark"] #assetsTable .col-actions {
        background: var(--bg-secondary);
        border-left: 1px solid var(--border-color);
    }
    
    /* Assets Table Button Styling - match warehouse transfers and report analyzer */
    #digital-assets .data-table .btn {
        padding: 6px 8px !important;
        min-height: auto !important;
    }
    
    #digital-assets .data-table .btn.secondary {
        width: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f8fafc;
        color: #374151;
        border: 1px solid #e2e8f0;
    }
    
    #digital-assets .data-table .btn.secondary:hover {
        background: #f1f5f9;
        border-color: #cbd5e1;
    }
    
    
    /* Dark Mode - Assets Table Buttons */
    [data-theme="dark"] #digital-assets .btn.secondary {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
        padding: 6px 8px !important;
        min-height: auto !important;
        width: 42px;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    [data-theme="dark"] #digital-assets .btn.secondary:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }
    
    
    /* Assets Table Sort Indicators - disable global ::after arrows and use span content */
    #assetsTable th.sort-asc::after,
    #assetsTable th.sort-desc::after {
        content: none !important;
    }
    
    #assetsTable .sort-indicator.active {
        opacity: 1;
        color: var(--text-muted);
    }
    
    #assetsTable .sort-indicator {
        opacity: 0.5;
        transition: all 0.2s ease;
    }
    
    /* Digital Assets Section Dark Mode Styling */
    [data-theme="dark"] #digital-assets .products-header h2 {
        color: var(--text-primary);
    }
    
    [data-theme="dark"] #digital-assets .search-box input {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }
    
    [data-theme="dark"] #digital-assets .search-box input:focus {
        border-color: var(--border-hover);
        outline: none;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
    }
    
    [data-theme="dark"] #digital-assets .search-box input::placeholder {
        color: var(--text-muted);
    }
    
    [data-theme="dark"] #digital-assets select {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }
    
    [data-theme="dark"] #digital-assets select:focus {
        border-color: var(--border-hover);
        outline: none;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
    }
    
    [data-theme="dark"] #digital-assets .btn {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }
    
    [data-theme="dark"] #digital-assets .btn:hover {
        background: var(--bg-tertiary);
        border-color: var(--border-hover);
    }
    
    /* Fix Upload Asset button text wrapping */
    #digital-assets .btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* Dark Mode - Asset Upload Modal */
    [data-theme="dark"] #assetUploadModal .product-modal {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    
    [data-theme="dark"] #assetUploadModal .product-modal-header {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    
    [data-theme="dark"] #assetUploadModal .product-modal-body {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
    }
    
    [data-theme="dark"] #assetUploadModal .modal-close-btn {
        color: var(--text-primary) !important;
        background: transparent !important;
        background-color: transparent !important;
        border: none !important;
    }
    
    [data-theme="dark"] #assetUploadModal .modal-close-btn:hover {
        background: var(--bg-tertiary) !important;
        background-color: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }
    
    [data-theme="dark"] #assetUploadModal label {
        color: var(--text-primary) !important;
    }
    
    [data-theme="dark"] #assetUploadModal input {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    
    [data-theme="dark"] #assetUploadModal select {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    
    [data-theme="dark"] #assetUploadModal textarea {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    
    [data-theme="dark"] #assetUploadModal input::placeholder,
    [data-theme="dark"] #assetUploadModal textarea::placeholder {
        color: var(--text-muted) !important;
    }
    
    /* Dark Mode - File Upload Selected File Info */
    [data-theme="dark"] #selectedFileInfo {
        background: var(--bg-primary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    
    [data-theme="dark"] #selectedFileInfo #fileName,
    [data-theme="dark"] #selectedFileInfo #fileSize {
        color: var(--text-primary) !important;
    }
    
    /* Dark Mode - Asset History Modal */
    [data-theme="dark"] #assetHistoryModal .product-modal {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    
    [data-theme="dark"] #assetHistoryModal .product-modal-header {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    
    [data-theme="dark"] #assetHistoryModal .product-modal-body {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
    }
    
    [data-theme="dark"] #assetHistoryModal .modal-close-btn {
        color: var(--text-primary) !important;
        background: transparent !important;
        background-color: transparent !important;
        border: none !important;
    }
    
    [data-theme="dark"] #assetHistoryModal .modal-close-btn:hover {
        background: var(--bg-tertiary) !important;
        background-color: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }
    
    /* Asset History Modal Download Button Styling - match actions column exactly, only target buttons in modal body */
    #assetHistoryModal .product-modal-body .btn.secondary {
        width: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f8fafc;
        color: #374151;
        border: 1px solid #e2e8f0;
        padding: 6px 8px !important;
        min-height: auto !important;
    }
    
    #assetHistoryModal .product-modal-body .btn.secondary:hover {
        background: #f1f5f9;
        border-color: #cbd5e1;
    }
    
    [data-theme="dark"] #assetHistoryModal .product-modal-body .btn.secondary {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
        padding: 6px 8px !important;
        min-height: auto !important;
        width: 42px;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    [data-theme="dark"] #assetHistoryModal .product-modal-body .btn.secondary:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }
    
    /* Assets Table - Remove fixed column widths to allow natural content fitting */
    #assetsTable .col-name,
    #assetsTable .col-version,
    #assetsTable .col-date,
    #assetsTable .col-user,
    #assetsTable .col-size {
        width: auto !important;
        white-space: nowrap;
    }
    
    /* Add vertical spacing between modal form sections */
    .modal-form-group + .modal-form-group {
        padding-top: 20px;
    }

    [data-theme="dark"] .sidebar-header * {
        background: transparent !important;
    }

    .card, .chart-card, .stat-card {
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
        color: var(--text-primary) !important;
    }

    .card {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        box-shadow: var(--shadow-sm);
        color: var(--text-primary);
    }

    .nav-btn {
        background: var(--bg-secondary);
        border: 2px solid var(--border-color);
        color: var(--text-primary);
    }

    .nav-btn:hover {
        border-color: var(--blue-color);
        background: var(--bg-tertiary);
    }

    .nav-btn.active {
        background: var(--blue-color);
        color: white;
        border-color: var(--blue-color);
    }

    .header {
        background: var(--bg-secondary);
        color: var(--text-primary);
        box-shadow: var(--shadow-sm);
    }

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

    .btn:hover {
        background: var(--brand-hover);
    }

    body {
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        background-color: #f8fafc;
        color: #334155;
    }

    .container {
        max-width: 1400px;
        margin: 0 auto;
        padding: 20px;
        background-color: var(--bg-primary);
        min-height: 100vh;
    }

    .header {
        background: #f8fafc;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        margin-bottom: 20px;
    }

    .header h1 {
        color: #1e293b;
        margin-bottom: 8px;
    }

    .header p {
        color: #64748b;
    }

    .nav {
        display: flex;
        gap: 10px;
        margin-bottom: 20px;
    }

    .nav-btn {
        padding: 10px 20px;
        background: white;
        border: 2px solid #e2e8f0;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s;
        font-size: 14px;
    }

    .nav-btn:hover {
        border-color: #3b82f6;
        background: #eff6ff;
    }

    .nav-btn.active {
        background: #3b82f6;
        color: white;
        border-color: #3b82f6;
    }

    .section.active {
        display: block;
    }

    .card {
        background: white;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        margin-bottom: 20px;
    }

    .btn {
        padding: 10px 20px;
        background: #3b82f6;
        color: white;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        font-size: 14px;
        margin-right: 0px;
    }

    .btn:hover {
        background: #2563eb;
    }

    .btn.secondary {
        background: #6b7280;
    }

    .btn.danger {
        background: #ef4444;
    }

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

    .form-group {
        margin-bottom: 15px;
    }

    label {
        display: block;
        margin-bottom: 5px;
        font-weight: 500;
    }

    input, select, textarea {
        width: 100%;
        padding: 8px 12px;
        border: 2px solid #e2e8f0;
        border-radius: 6px;
        font-size: 14px;
    }

    input:focus, select:focus, textarea:focus {
        outline: none;
        border-color: #3b82f6;
    }

    /* Dark mode input styling */
    [data-theme="dark"] input,
    [data-theme="dark"] select,
    [data-theme="dark"] textarea {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] input:focus,
    [data-theme="dark"] select:focus,
    [data-theme="dark"] textarea:focus {
        border-color: #3b82f6 !important;
        outline: none !important;
    }

    [data-theme="dark"] input::placeholder,
    [data-theme="dark"] textarea::placeholder {
        color: var(--text-muted) !important;
    }

    /* Dark mode label styling */
    [data-theme="dark"] label {
        color: var(--text-primary) !important;
    }

    /* Drag and drop styles */
    .category-section {
        margin-bottom: 20px;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        padding: 15px;
        background: white;
    }

    .category-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 15px;
        cursor: pointer;
        padding: 5px;
        border-radius: 4px;
        transition: background-color 0.2s;
    }

    .category-header:hover {
        background-color: #f8fafc;
    }

    .level1-section {
        margin-bottom: 15px;
        margin-left: 20px;
        border-left: 3px solid #e2e8f0;
        padding-left: 15px;
    }

    .level1-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px;
        cursor: pointer;
        padding: 3px;
        border-radius: 4px;
    }

    .level1-header:hover {
        background-color: #f1f5f9;
    }

    .level2-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 12px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 4px;
        margin-bottom: 5px;
        cursor: grab;
        user-select: none;
    }

    .level2-item:active {
        cursor: grabbing;
    }

    .level2-item.dragging {
        opacity: 0.5;
    }

    .drag-handle {
        color: #9ca3af;
        margin-right: 10px;
        cursor: grab;
        font-size: 12px;
    }

    .drag-handle:hover {
        color: #6b7280;
    }

    .collapse-icon {
        margin-right: 10px;
        font-size: 12px;
        transition: transform 0.3s ease;
    }

    .category-content {
        transition: all 0.3s ease;
        overflow: hidden;
    }

    .category-content.collapsed {
        max-height: 0;
        margin-bottom: 0;
        padding-top: 0;
    }

    .level2-list {
        margin-left: 20px;
        transition: all 0.3s ease;
        overflow: hidden;
    }

    .level2-list.collapsed {
        max-height: 0;
        margin-bottom: 0;
    }

    /* Keyword Analyzer Styles */
    .upload-zone {
        background: white;
        border: 2px dashed #cbd5e1;
        border-radius: 12px;
        padding: 40px 20px;
        text-align: center;
        margin-bottom: 20px;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
        position: relative;
        overflow: hidden;
    }

    .upload-zone:hover {
        border-color: #3b82f6;
        box-shadow: 0 10px 15px rgba(59, 130, 246, 0.1);
        transform: translateY(-2px);
    }

    .upload-zone.dragover {
        border-color: #10b981;
        background: #f0fdf4;
        box-shadow: 0 10px 15px rgba(16, 185, 129, 0.1);
    }


    .upload-zone input[type="file"] {
        position: absolute;
        width: 100%;
        height: 100%;
        opacity: 0;
        cursor: pointer;
    }

        .upload-icon-svg {
        width: 48px;
        height: 48px;
        stroke: #64748b;
        fill: none;
        stroke-width: 1.5;
        margin-bottom: 16px;
        display: block;
        margin-left: auto;
        margin-right: auto;
    }

    .upload-zone h3 {
        color: #1e293b;
        font-size: 20px;
        font-weight: 600;
        margin-bottom: 8px;
    }

    .upload-zone p {
        color: #64748b;
        font-size: 14px;
        margin-bottom: 12px;
    }

    .upload-zone small {
        color: #94a3b8;
        font-size: 12px;
    }

    .upload-zone:hover .upload-icon-svg {
        stroke: #3b82f6;
    }

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

    .setting-group {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .setting-group label {
        font-size: 14px;
        font-weight: 500;
        color: #374151;
    }

    .keyword-file-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        margin-bottom: 8px;
    }

    .file-info {
        display: flex;
        flex-direction: column;
    }

    .file-name {
        font-weight: 500;
        color: #1e293b;
    }

    .file-details {
        font-size: 12px;
        color: #64748b;
    }

    .file-status {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .processing-spinner {
        display: inline-block;
        width: 16px;
        height: 16px;
        border: 2px solid #e2e8f0;
        border-radius: 50%;
        border-top-color: #3b82f6;
        animation: spin 1s ease-in-out infinite;
    }

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

    .keyword-checkbox {
        margin-right: 8px;
    }

    /* Tooltip styles */
    .opportunity-score {
        position: relative;
        cursor: help;
        display: inline-block;
    }

    .opportunity-tooltip {
        visibility: hidden;
        width: 280px;
        background-color: #1f2937;
        color: white;
        text-align: left;
        border-radius: 6px;
        padding: 10px;
        position: absolute;
        z-index: 9999;
        top: 125%; /* Change from bottom: 125% to top: 125% */
        left: 50%;
        margin-left: -140px;
        opacity: 0;
        transition: opacity 0.3s;
        font-size: 11px;
        line-height: 1.3;
    }

    .opportunity-tooltip::after {
        content: "";
        position: absolute;
        bottom: 100%; /* Change from top: 100% to bottom: 100% */
        left: 50%;
        margin-left: -5px;
        border-width: 5px;
        border-style: solid;
        border-color: transparent transparent #1f2937 transparent; /* Flip arrow direction */
    }

    .opportunity-score:hover .opportunity-tooltip {
        visibility: visible;
        opacity: 1;
    }

    .sort-indicator {
        font-size: 10px;
        opacity: 0.5;
    }

    .sort-indicator.active {
        opacity: 1;
    }

    #keywordTable thead {
        position: sticky;
        top: 0;
        background: #f8fafc;
        z-index: 100;
    }

    #keywordTable th {
        font-size: 14px;
        font-weight: 600;
        padding: 12px 8px;
        background: #f8fafc;
        border-bottom: 2px solid #e2e8f0;
        cursor: pointer;
        user-select: none;
    }

    #keywordTable th:hover {
        background: #f1f5f9;
    }

    /* Ensure first and last headers get the rounded corners */
    #keywordTable th:first-child {
        border-top-left-radius: 8px;
    }

    #keywordTable th:last-child {
        border-top-right-radius: 8px;
    }

    #keywordTable td {
        font-size: 14px;
        padding: 12px 8px;
        border-bottom: 1px solid #e2e8f0;
    }

    #keywordTableContainer {
        overflow-x: auto;
        background: white;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        max-height: 70vh;
        overflow-y: auto;
}

    /* Dashboard styles */
    .stats {
        display: flex;
        gap: 20px;
        margin-bottom: 20px;
        flex-wrap: wrap;
    }

    .stat {
        background: var(--bg-secondary);
        padding: 20px;
        border-radius: 8px;
        text-align: center;
        flex: 1;
        min-width: 150px;
        box-shadow: var(--shadow-sm);
        border: 1px solid var(--border-color);
    }

    .stat-card {
        background-color: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 20px;
        transition: all 0.2s ease;
    }

    .stat-card:hover {
        border-color: var(--border-hover);
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
    }

    .chart-card {
        background-color: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 24px;
    }

    .stat-number {
        font-size: 32px;
        font-weight: bold;
        color: #1e293b;
        margin-bottom: 5px;
    }

    .stat-label {
        font-size: 14px;
        color: #64748b;
        text-transform: capitalize;
    }

    textarea {
        resize: vertical;
        height: 120px;
        font-family: inherit;
    }

    .alert {
        padding: 12px;
        border-radius: 6px;
        margin-bottom: 15px;
    }

    .alert.warning {
        background: #fef3c7;
        color: #92400e;
        border: 1px solid #fde047;
    }

    .uniqueness-score {
        font-weight: bold;
        padding: 8px 12px;
        border-radius: 4px;
        font-size: 14px;
    }

    .score-excellent { 
        background: #dcfce7; 
        color: #166534; 
    }

    .score-good { 
        background: #fef3c7; 
        color: #92400e; 
    }

    .score-poor { 
        background: #fecaca; 
        color: #991b1b; 
    }

    /* Keyword analyzer styles */
    .keyword-tag-display {
        display: inline-block;
        background: #eff6ff;
        color: #1d4ed8;
        padding: 6px 12px;
        border: 1px solid #3b82f6;
        border-radius: 16px;
        font-size: 12px;
        margin: 3px;
        font-weight: 500;
    }

    .keyword-group {
        border: 2px solid #e2e8f0;
        border-radius: 8px;
        padding: 15px;
        margin-bottom: 15px;
        background: #fafafa;
    }

    .keyword-group.product {
        border-color: #3b82f6;
        background: #eff6ff;
    }

    .keyword-group.collection {
        border-color: #10b981;
        background: #ecfdf5;
    }

    .keyword-tag-display.used {
        background: #f3f4f6 !important;
        color: #9ca3af !important;
        border-color: #d1d5db !important;
        cursor: default !important;
    }

    .keyword-tag-display.available {
        background: #eff6ff;
        color: #1d4ed8;
        border-color: #3b82f6;
        cursor: pointer;
    }

    .btn.small {
        padding: 4px 6px;
        font-size: 11px;
        min-width: auto;
    }

    .btn-warning {
        background: #f59e0b;
        color: white;
        border: 1px solid #d97706;
    }

    .btn-warning:hover {
        background: #d97706;
    }

    /* SEO Analyzer Styles */
    .seo-sidebar {
        background: #f8fafc;
        border: 2px solid #e2e8f0;
        border-radius: 8px;
        padding: 20px;
        position: sticky;
        top: 20px;
        height: fit-content;
    }

    .seo-score-circle {
        width: 80px;
        height: 80px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        font-weight: bold;
        margin: 0 auto 15px;
        color: white;
    }

    .seo-score-poor { background: #ef4444; }
    .seo-score-fair { background: #f59e0b; }
    .seo-score-good { background: #10b981; }

    .seo-check {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 8px;
        font-size: 13px;
    }

    .seo-check-icon {
        width: 16px;
        height: 16px;
        min-width: 16px;  /* Prevent compression */
        min-height: 16px; /* Prevent compression */
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 10px;
        font-weight: bold;
        flex-shrink: 0;  /* Prevent shrinking */
    }

    .seo-check-good { background: #10b981; }
    .seo-check-fair { background: #f59e0b; }
    .seo-check-poor { background: #ef4444; }

    .seo-section {
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 1px solid #e2e8f0;
    }

    .seo-section:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }

    .seo-section h4 {
        margin-bottom: 10px;
        font-size: 14px;
        color: #374151;
    }

    .slug-preview {
        background: #f3f4f6;
        padding: 8px;
        border-radius: 4px;
        font-family: monospace;
        font-size: 12px;
        color: #6b7280;
        margin-top: 5px;
    }

    .content-uniqueness {
        background: #fffbeb;
        border: 1px solid #f59e0b;
        padding: 10px;
        border-radius: 4px;
        font-size: 12px;
    }

    .char-counter {
        font-size: 11px;
        color: #6b7280;
        text-align: right;
        margin-top: 2px;
    }

    .form-grid {
        display: grid;
        grid-template-columns: 1fr 320px;
        gap: 30px;
    }

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

    /* Fix modal width to match parent */
    #createProductModal .card {
        max-width: none !important;
        margin: 0 !important;
    }

    /* Products Table Styles */
    .products-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        flex-wrap: wrap;
        gap: 15px;
    }

    .products-controls {
        display: flex;
        gap: 15px;
        align-items: center;
        flex-wrap: wrap;
    }

    .search-box {
        position: relative;
    }

    .search-box input {
        padding: 8px 12px 8px 35px;
        border: 2px solid #e2e8f0;
        border-radius: 6px;
        width: 250px;
        font-size: 14px;
    }

    .search-box::before {
        content: "🔍";
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        color: #9ca3af;
    }

    .filter-dropdown select {
        padding: 8px 12px;
        border: 2px solid #e2e8f0;
        border-radius: 6px;
        font-size: 14px;
        background: var(--bg-secondary);
        color: var(--text-primary);
        cursor: pointer;
        min-width: 150px;
    }

    .filter-dropdown select:focus {
        border-color: var(--accent-color);
        outline: none;
        box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
    }

    [data-theme="dark"] .filter-dropdown select {
        border-color: var(--border-color);
        background: var(--bg-secondary);
    }

    [data-theme="dark"] .filter-dropdown select:focus {
        border-color: var(--accent-color);
    }

    .bulk-actions {
        display: flex;
        gap: 10px;
        align-items: center;
    }

    .bulk-actions select {
        padding: 8px 12px;
        border: 2px solid #e2e8f0;
        border-radius: 6px;
        background: white;
    }

    .financial-status-dropdown {
        padding: 4px 6px;
        border: 1px solid #d1d5db;
        border-radius: 4px;
        font-size: 12px;
        background: white;
        cursor: pointer;
        width: 105px;
    }

    /* Column Specific Styles */
    .col-checkbox {
        width: 50px !important;
        min-width: 50px !important;
        text-align: center !important;
        padding: 12px 8px !important;
    }

    /* Override any specific column padding issues */
    .col-checkbox,
    .col-name,
    .col-category,
    .col-keywords,
    .col-volume,
    .col-avg-opportunity,
    .col-avg-difficulty,
    .col-seo,
    .col-conflicts,
    .col-status,
    .col-dates,
    .col-actions {
        padding: 12px 8px !important;
    }

    .col-name {
        min-width: 200px;
        max-width: 250px;
    }

    .col-category {
        width: 150px;
    }

    .col-keywords {
        min-width: 300px;
        max-width: 400px;
    }

    .col-seo {
        width: 80px;
        text-align: center;
    }

    .col-conflicts {
        width: 100px;
        text-align: center;
    }

    .col-status {
        width: 100px;
        text-align: center;
    }

    /* Financial Status column in invoices needs more width for saved message */
    #invoices .col-status[data-sort="financialStatus"] {
        width: 180px;
        min-width: 180px;
    }

    /* Transfer column width for invoices table */
    #invoices .col-transfer {
        width: 110px;
        min-width: 110px;
        text-align: center;
        font-size: 13px;
        color: var(--text-secondary);
    }

    /* Factory column width for invoices table */
    #invoices .col-factory {
        width: 90px;
        min-width: 90px;
        text-align: center;
    }

    /* Factory column width for orders table */
    #orders .col-factory {
        width: 90px;
        min-width: 90px;
        text-align: center;
    }

    .col-dates {
        width: 120px;
        font-size: 12px;
    }

    .col-actions {
        width: 120px;
        text-align: center;
    }

    .col-volume {
        width: 100px;
        text-align: center;
    }

    .col-avg-opportunity {
        width: 120px;
        text-align: center;
    }

    .col-avg-difficulty {
        width: 120px;
        text-align: center;
    }

    /* NEW: Metric indicators */
    .metric-value {
        font-weight: 600;
        font-size: 13px;
    }

    .volume-high { color: #10b981; }
    .volume-medium { color: #f59e0b; }
    .volume-low { color: #6b7280; }

    .opportunity-high { color: #10b981; }
    .opportunity-medium { color: #f59e0b; }
    .opportunity-low { color: #ef4444; }

    .difficulty-low { color: #10b981; }
    .difficulty-medium { color: #f59e0b; }
    .difficulty-high { color: #ef4444; }

    /* SEO Score Indicators */
    .seo-score-mini {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
        font-size: 11px;
        color: white;
    }

    .seo-score-poor { background: #ef4444; }
    .seo-score-fair { background: #f59e0b; }
    .seo-score-good { background: #10b981; }

    /* Keyword Tags in Table */
    .keyword-tags-table {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        max-height: none;
        overflow: visible;
    }

    .keyword-tag-table {
        background: #eff6ff;
        color: #1d4ed8;
        padding: 2px 6px;
        border-radius: 12px;
        font-size: 11px;
        border: 1px solid #bfdbfe;
        white-space: nowrap;
    }

    .keyword-tag.conflict {
        background: #fef2f2;
        color: #dc2626;
        border-color: #fecaca;
    }

    .keyword-more {
        color: #6b7280;
        font-size: 11px;
        font-style: italic;
        align-self: center;
    }

    /* Conflict Indicators */
    .conflict-indicator {
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
    }

    .conflict-none {
        background: #dcfce7;
        color: #166534;
    }

    .conflict-warning {
        background: #fef3c7;
        color: #d97706;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
        white-space: nowrap;
        display: inline-block;
        letter-spacing: normal;
    }

    .conflict-error {
        background: #fef2f2;
        color: #dc2626;
    }

    /* Table SEO Score Pills (matching conflict pill style) */
    .seo-score-table {
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
        color: white;
        display: inline-block;
        min-width: 32px;
        text-align: center;
    }

    .seo-score-table.seo-score-poor { background: #ef4444; }
    .seo-score-table.seo-score-fair { background: #f59e0b; }
    .seo-score-table.seo-score-good { background: #10b981; }

    /* Pagination */
    .pagination-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        background: #f8fafc;
        border-top: 1px solid #e2e8f0;
    }

    .pagination-info {
        color: #6b7280;
        font-size: 14px;
    }

    .pagination-controls {
        display: flex;
        gap: 10px;
        align-items: center;
    }

    .page-btn {
        padding: 6px 12px;
        border: 1px solid #d1d5db;
        background: white;
        border-radius: 4px;
        cursor: pointer;
        font-size: 13px;
    }

    .page-btn:hover {
        background: #f3f4f6;
    }

    .page-btn.active {
        background: #3b82f6;
        color: white;
        border-color: #3b82f6;
    }

    .page-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }
    .pagination-btn {
        padding: 6px 12px;
        border: 1px solid #d1d5db;
        background: white;
        border-radius: 4px;
        cursor: pointer;
        font-size: 13px;
        margin: 0 4px;
    }
    .pagination-btn:hover {
        background: #f3f4f6;
    }
    .pagination-btn.active {
        background: #3b82f6;
        color: white;
        border-color: #3b82f6;
    }
    .pagination-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    .per-page-selector {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 14px;
    }

    .per-page-selector select {
        padding: 4px 8px;
        border: 1px solid #d1d5db;
        border-radius: 4px;
        background: white;
    }

    /* Modal Styles - Almost Full Screen */
    .product-modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1000;
        padding: 40px;
    }

    .product-modal {
        background: white;
        border-radius: 12px;
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }

    .product-modal-header {
        padding: 20px 30px;
        border-bottom: 1px solid #e2e8f0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #f8fafc;
    }

    .product-modal-body {
        flex: 1;
        overflow: auto;
        padding: 30px;
    }

    .modal-close-btn {
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        color: #6b7280;
        padding: 5px;
        border-radius: 4px;
    }

    .modal-close-btn:hover {
        background: #f3f4f6;
        color: #374151;
    }

    .opportunity-poor { 
        color: #6b7280; 
    }
    
    .opportunity-fair { 
        color: #ef4444; 
    }
    
    .opportunity-good { 
        color: #f59e0b; 
    }
    
    .opportunity-very-good { 
        color: #22c55e; 
    }
    
    .opportunity-excellent { 
        color: #10b981; 
    }
    
    .opportunity-exceptional { 
        color: #059669; 
    }

    .opportunity-unicorn { 
        color: #7c3aed; 
    }

    @media (max-width: 900px) {
        .products-header {
            flex-direction: column;
            align-items: stretch;
        }
        
        .products-controls {
            justify-content: space-between;
        }
    }

    @media (max-width: 600px) {
        .product-modal-overlay {
            padding: 10px;
        }
    }

    /* Force Actions Column to Always Be Visible */
    .col-actions {
        width: 120px !important;
        min-width: 120px !important;
        text-align: center !important;
        display: table-cell !important; /* Force display even on narrow screens */
        position: sticky;
        right: 0;
        background: white;
        border-left: 1px solid #e2e8f0;
        z-index: 5;
    }

    /* Ensure buttons in actions column are properly sized */
    .col-actions .btn.small {
        padding: 4px 6px !important;
        font-size: 11px !important;
        min-width: auto !important;
        margin: 0 2px !important;
    }

    /* Make sure the actions div doesn't get compressed */
    .col-actions > div {
        display: flex !important;
        gap: 5px !important;
        justify-content: center !important;
        min-width: 100px;
    }

    /* Override any responsive hiding for actions column specifically */
    @media (max-width: 600px) {
        .col-actions {
            display: table-cell !important; /* Override any hiding */
            width: 100px !important;
            min-width: 100px !important;
        }
        
        /* Make buttons even smaller on mobile but keep them visible */
        .col-actions .btn.small {
            padding: 3px 5px !important;
            font-size: 10px !important;
        }
    }

    .keyword-tag {
        display: inline-block;
        background: #eff6ff;
        color: #1d4ed8;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 11px;
        margin: 0px;
        border: 1px solid #bfdbfe;
    }

    .product-card {
        cursor: pointer;
        padding: 15px;
        border: 2px solid #e2e8f0;
        border-radius: 6px;
        margin-bottom: 10px;
        background: white;
        transition: all 0.2s;
    }

    .product-card:hover {
        border-color: #94a3b8;
        background: #f8fafc;
    }

    .product-card.selected {
        background: #eff6ff;
        border-color: #3b82f6;
    }

    .product-card.recent {
        border-left: 4px solid #10b981;
    }
    
    /* Keyword Difficulty Score Styles */
    .difficulty-score {
        position: relative;
        cursor: help;
        display: inline-block;
    }

    .difficulty-tooltip {
        visibility: hidden;
        width: 280px;
        background-color: #1f2937;
        color: white;
        text-align: left;
        border-radius: 6px;
        padding: 10px;
        position: absolute;
        z-index: 9999;
        top: 125%;
        left: 50%;
        margin-left: -140px;
        opacity: 0;
        transition: opacity 0.3s;
        font-size: 11px;
        line-height: 1.3;
    }

    .difficulty-tooltip::after {
        content: "";
        position: absolute;
        bottom: 100%;
        left: 50%;
        margin-left: -5px;
        border-width: 5px;
        border-style: solid;
        border-color: transparent transparent #1f2937 transparent;
    }

    .difficulty-score:hover .difficulty-tooltip {
        visibility: visible;
        opacity: 1;
    }

    /* Override heavy font weight for difficulty scores */
    .difficulty-score .metric-value {
        font-weight: normal !important;
    }

    .difficulty-tooltip {
        font-weight: normal;
    }

    /* Enhanced Keyword Management Styles */
    .keyword-tooltip {
        opacity: 0 !important;
        transition: opacity 0.2s;
    }

    .group:hover .keyword-tooltip {
        opacity: 1 !important;
    }

    #primaryKeyword:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        outline: none;
    }

    #secondaryKeywordInput:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        outline: none;
    }

    .secondary-keyword-tag {
        display: inline-flex;
        align-items: center;
        padding: 6px 12px;
        border-radius: 16px;
        font-size: 12px;
        margin: 3px;
        position: relative;
        cursor: default;
        background: #ecfdf5;
        color: #10b981;
        border: 1px solid #a7f3d0;
    }

    .secondary-keyword-tag button {
        background: none;
        border: none;
        margin-left: 8px;
        cursor: pointer;
        font-size: 14px;
        line-height: 1;
        color: #ef4444;
    }

    /* Collection-specific keyword strategy analysis */
    #collectionKeywordStrategyAnalysis {
        background: #f8fafc;
        padding: 15px;
        border-radius: 6px;
        border-left: 4px solid #10b981; /* Green theme */
    }

    /* Collection modal responsive */
    @media (max-width: 1000px) {
        .form-grid {
            grid-template-columns: 1fr;
        }
        
        .seo-sidebar {
            order: -1; /* Move SEO sidebar to top on mobile */
            margin-bottom: 20px;
        }
    }
    
    /* Conflict tooltip styles for keyword analyzer */
    .conflict-tooltip-container:hover .conflict-tooltip {
        visibility: visible !important;
        opacity: 1 !important;
    }

    .conflict-tooltip::after {
        content: "";
        position: absolute;
        bottom: 100%;
        left: 50%;
        margin-left: -5px;
        border-width: 5px;
        border-style: solid;
        border-color: transparent transparent #1f2937 transparent;
    }

    /* Collections Table Styles - Mirror Products Table */
    .collections-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        gap: 20px;
    }

    .collections-controls {
        display: flex;
        gap: 15px;
        align-items: center;
    }

    /* Green-themed keyword tags for collections */
    .collection-keyword-tag {
        display: inline-block;
        background: #ecfdf5;
        color: #10b981;
        padding: 2px 6px;
        border-radius: 12px;
        font-size: 11px;
        margin: 0px;
        border: 1px solid #a7f3d0;
    }

    .collection-keyword-tag.conflict {
        background: #fef2f2;
        color: #ef4444;
        border-color: #fecaca;
    }

    /* Collection modal specific styles */
    #collectionKeywordTags .keyword-tag {
        background: #ecfdf5;
        color: #10b981;
        border-color: #a7f3d0;
    }

    /* Collection form elements */
    .collection-form-group {
        margin-bottom: 20px;
    }

    .collection-form-group label {
        display: block;
        margin-bottom: 6px;
        font-weight: 500;
        color: #374151;
    }

    /* Green accents for collection buttons */
    .btn.collection-primary {
        background: #10b981;
        color: white;
        border: 1px solid #059669;
    }

    .btn.collection-primary:hover {
        background: #059669;
        border-color: #047857;
    }

    @media (max-width: 900px) {
        .collections-header {
            flex-direction: column;
            align-items: stretch;
        }
        
        .collections-controls {
            justify-content: space-between;
        }
    }

    /* Green theme for collection SEO indicators */
    .collection-seo-good {
        background: #10b981;
    }

    .collection-seo-fair {
        background: #f59e0b;
    }

    .collection-seo-poor {
        background: #ef4444;
    }

    /* Pages Modal Footer */
    .product-modal-footer {
        padding: 30px;
        display: flex;
        justify-content: flex-start;
        gap: 15px;
        position: sticky;
        bottom: 0;
        background: white;
        border-top: 1px solid #e2e8f0;
        margin-top: auto;
    }
    
    /* Dark mode footer styling */
    [data-theme="dark"] .product-modal-footer {
        background: var(--bg-secondary) !important;
        border-top: 1px solid var(--border-color) !important;
    }

    /* Purple-themed keyword tags for pages */
    .page-keyword-tag {
        display: inline-block;
        background: #f3e8ff;
        color: #7c3aed;
        padding: 2px 6px;
        border-radius: 12px;
        font-size: 11px;
        margin: 0px;
        border: 1px solid #c4b5fd;
    }

    .keyword-tag-table.conflict,
    .page-keyword-tag.conflict,
    .collection-keyword-tag.conflict {
        background: #fef2f2 !important;
        color: #ef4444 !important;
        border-color: #fecaca !important;
    }

    /* Page modal keyword tags */
    #pageKeywordTags .keyword-tag {
        background: #f3e8ff;
        color: #7c3aed;
        border-color: #c4b5fd;
    }

    /* Ensure conflict indicators don't wrap */
    .conflict-indicator {
        white-space: nowrap !important;
        display: inline-block;
    }

    /* Report Analyzer - Reuse existing keyword analyzer styles */
    #reportTable th:nth-child(1), #reportTable td:nth-child(1) { 
        width: 300px; 
        max-width: 300px; 
        text-align: left;
    }

    /* Report Analyzer - Fix column alignment */
    #reportTable th:nth-child(3), #reportTable td:nth-child(3) { text-align: center; } /* Avg Opp */
    #reportTable th:nth-child(4), #reportTable td:nth-child(4) { text-align: center; } /* Avg Diff */
    #reportTable th:nth-child(5), #reportTable td:nth-child(5) { text-align: center; } /* High Opp */
    #reportTable th:nth-child(7), #reportTable td:nth-child(7) { text-align: center; } /* Upload Date */

    #reportTable th.sortable.sort-asc,
    #reportTable th.sortable.sort-desc {
        background: #f1f5f9;
    }

    #reportTable .sort-indicator {
        font-size: 10px;
        opacity: 0.5;
    }

    #reportTable .sort-indicator.active {
        opacity: 1;
        color: #3b82f6;
    }

    /* Keyword Analyzer Header Styles */
    .keyword-analyzer-header .search-box input:focus {
        outline: none;
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

    .keyword-analyzer-header select:focus {
        outline: none;
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

    .keyword-analyzer-header .btn:hover {
        background: #4b5563 !important;
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .keyword-analyzer-header select:hover,
    .keyword-analyzer-header input:hover {
        border-color: #9ca3af;
    }

    /* Shopify Tags Styles */
    .shopify-tags-section {
        background: #f8fafc;
        padding: 20px;
        border-radius: 8px;
        margin-bottom: 20px;
        border-left: 4px solid #6b7280;
    }

    .shopify-tags-section h4 {
        margin: 0 0 15px 0;
        color: #374151;
        font-size: 16px;
        font-weight: 600;
    }

    .shopify-tags-container {
        min-height: 50px;
        border: 2px dashed #e2e8f0;
        border-radius: 6px;
        padding: 10px;
        margin-bottom: 10px;
        background: #fafafa;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: flex-start;
    }

    .shopify-tag {
        display: inline-flex;
        align-items: center;
        background-color: #f3f4f6;
        color: #4b5563;
        border: 1px solid #6b7280;
        padding: 6px 12px;
        border-radius: 16px;
        font-size: 12px;
        margin: 3px;
        position: relative;
        cursor: default;
    }

    .shopify-tag span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .shopify-tag button {
        background: none;
        border: none;
        margin-left: 8px;
        cursor: pointer;
        font-size: 14px;
        line-height: 1;
        color: #6b7280;
    }

    .shopify-tag button:hover {
        color: #374151;
        background-color: rgba(107, 114, 128, 0.1);
    }

    .shopify-tags-help {
        font-size: 12px;
        color: #6b7280;
        margin-top: 4px;
    }

    .tags-empty-state {
        color: #9ca3af;
        font-style: italic;
    }

    .tag-suggestion {
        display: inline-block;
        background: #f3f4f6;
        color: #4b5563;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 12px;
        margin-right: 8px;
        margin-bottom: 4px;
        cursor: pointer;
        border: 1px solid #6b7280;
    }

    .tag-suggestion:hover {
        background: #e5e7eb;
    }

    .shopify-tags-section .form-group {
        margin-bottom: 0 !important;
    }

    /* Fix Pages modal button spacing */
    #pageForm .form-group:last-of-type {
        margin-bottom: 0 !important;
    }

    /* Tab-based bulk actions */
    .bulk-tab-container {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .bulk-tab-headers {
        display: flex;
        gap: 2px;
        background: #f1f5f9;
        padding: 4px;
        border-radius: 8px;
        width: fit-content;
    }

    .bulk-tab-header {
        padding: 8px 16px;
        background: transparent;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        font-size: 14px;
        font-weight: 500;
        color: #64748b;
        transition: all 0.2s;
    }

    .bulk-tab-header.active {
        background: white;
        color: #1e293b;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

    .bulk-tab-content {
        display: none;
    }

    .bulk-tab-content.active {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }

    /* Color-coded buttons */
    .btn-product {
        background: #3b82f6; /* Blue for products */
    }

    .btn-product:hover {
        background: #2563eb;
    }

    .btn-product.secondary {
        background: #64748b; /* Darker blue-grey for secondary product actions */
        border: 1px solid #3b82f6;
    }

    .btn-product.secondary:hover {
        background: #475569;
    }

    .btn-collection {
        background: #10b981; /* Green for collections */
    }

    .btn-collection:hover {
        background: #059669;
    }

    .btn-collection.secondary {
        background: #64748b; /* Darker green-grey for secondary collection actions */
        border: 1px solid #10b981;
    }

    .btn-collection.secondary:hover {
        background: #475569;
    }

    /* Help Scout Saved Replies Table Styles */
    #saved-replies .data-table {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        overflow: hidden;
        box-shadow: var(--shadow-sm);
    }

    #saved-replies .data-table th {
        background: var(--bg-tertiary);
        border-bottom: 2px solid var(--border-color);
        color: var(--text-primary);
        font-weight: 600;
        padding: 12px 8px;
        text-align: left;
        cursor: pointer;
        user-select: none;
        transition: background-color 0.2s ease;
    }

    #saved-replies .data-table th:hover {
        background: var(--border-hover);
    }

    #saved-replies .data-table th.sortable:hover {
        background: var(--bg-primary);
    }

    #saved-replies .data-table td {
        padding: 12px 8px;
        border-bottom: 1px solid var(--border-color);
        color: var(--text-primary);
        vertical-align: top;
    }

    #saved-replies .data-table tbody tr:hover {
        background: var(--bg-tertiary);
    }

    /* Column widths for saved replies table */
    #saved-replies .col-name {
        width: 35%;
        min-width: 300px;
    }

    #saved-replies .col-inboxes {
        width: 25%;
        min-width: 200px;
    }

    #saved-replies .col-version {
        width: 10%;
        min-width: 80px;
        text-align: left;
    }

    #saved-replies .col-updated {
        width: 15%;
        min-width: 100px;
        text-align: left;
    }

    #saved-replies .col-actions {
        width: 15%;
        min-width: 180px;
        text-align: center;
        position: sticky;
        right: 0;
        background: var(--bg-secondary);
        border-left: 1px solid var(--border-color);
        z-index: 5;
    }

    /* Inbox tags styling */
    #saved-replies .inbox-tag {
        background: #e0e7ff !important;
        color: #3730a3 !important;
        border: 1px solid #bfdbfe;
        transition: all 0.2s ease;
    }

    #saved-replies .inbox-tag:hover {
        background: #c7d2fe !important;
        transform: translateY(-1px);
    }

    /* Dark mode overrides for saved replies */
    /* Add border around saved replies table container (matching other sections) */
    #saved-replies .table-container {
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    
    /* Ensure table rows don't inherit container border-radius */
    #saved-replies .data-table {
        border-radius: 0;
    }
    
    #saved-replies .data-table tbody tr {
        border-radius: 0 !important;
    }
    
    #saved-replies .data-table tbody tr:hover {
        border-radius: 0 !important;
    }
    
    [data-theme="dark"] #saved-replies .data-table {
        background: var(--bg-secondary) !important;
        border-color: var(--border-color) !important;
    }
    
    [data-theme="dark"] #saved-replies .table-container {
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 8px !important;
    }

    [data-theme="dark"] #saved-replies .data-table th {
        background: var(--bg-tertiary);
        color: var(--text-primary);
        border-bottom-color: var(--border-color);
    }

    [data-theme="dark"] #saved-replies .data-table th:hover {
        background: var(--border-hover);
    }

    [data-theme="dark"] #saved-replies .data-table th.sortable:hover {
        background: var(--bg-primary);
    }

    [data-theme="dark"] #saved-replies .data-table td {
        color: var(--text-primary);
        border-bottom-color: var(--border-color);
    }

    [data-theme="dark"] #saved-replies .data-table tbody tr:hover {
        background: var(--bg-tertiary);
    }

    [data-theme="dark"] #saved-replies .col-actions {
        background: var(--bg-secondary) !important;
        border-left-color: var(--border-color);
    }

    /* Fix Actions column header in dark mode */
    [data-theme="dark"] #saved-replies .data-table th.col-actions {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }

    /* Dark mode inbox tags - keep their blue theme but adjust for readability */
    [data-theme="dark"] #saved-replies .inbox-tag {
        background: #1e3a8a !important;
        color: #bfdbfe !important;
        border-color: #3730a3;
    }

    [data-theme="dark"] #saved-replies .inbox-tag:hover {
        background: #1e40af !important;
    }

    /* Sort indicators styling */
    #saved-replies .sort-indicator {
        font-size: 10px;
        opacity: 0.5;
        margin-left: 5px;
        transition: all 0.2s ease;
    }

    #saved-replies .sort-indicator.active {
        opacity: 1;
        color: var(--accent-color);
    }

    #saved-replies th.sortable.sort-asc,
    #saved-replies th.sortable.sort-desc {
        background: var(--bg-primary);
    }

    [data-theme="dark"] #saved-replies th.sortable.sort-asc,
    [data-theme="dark"] #saved-replies th.sortable.sort-desc {
        background: var(--bg-primary);
    }

    /* Search bar styling */
    #saved-replies #savedReplySearch {
        border: 2px solid var(--border-color) !important;
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        transition: border-color 0.2s ease;
    }

    #saved-replies #savedReplySearch:focus {
        border-color: var(--accent-color) !important;
        outline: none;
    }

    #saved-replies #savedReplySearch::placeholder {
        color: var(--text-muted);
    }

    /* Dark Mode - Create New Reply Button (match warehouse transfers styling) */
    [data-theme="dark"] #saved-replies .btn {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #saved-replies .btn:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }

    /* Keep secondary and danger buttons with their specific styling */
    [data-theme="dark"] #saved-replies .btn.secondary {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #saved-replies .btn.secondary:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }

    [data-theme="dark"] #saved-replies .btn.danger {
        background: var(--danger-color) !important;
        color: white !important;
        border: 1px solid var(--danger-color) !important;
    }

    [data-theme="dark"] #saved-replies .btn.danger:hover {
        background: #dc2626 !important;
        border-color: #dc2626 !important;
    }

    /* Action buttons styling - match digital assets */
    #saved-replies .data-table .btn.secondary {
        width: 42px;
        height: 34px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        background: #f8fafc;
        color: #374151;
        border: 1px solid #d1d5db;
    }
    
    #saved-replies .data-table .btn.secondary:hover {
        background: #f1f5f9;
        border-color: #cbd5e1;
    }
    /* Fix title color in dark mode */
    [data-theme="dark"] #saved-replies h2 {
        color: var(--text-primary) !important;
    }
    /* Dark Mode - Edit Saved Reply Modal */
    [data-theme="dark"] #savedReplyModal {
        background: rgba(0,0,0,0.7) !important;
    }
    [data-theme="dark"] #savedReplyModal > div {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #savedReplyModal h3 {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #savedReplyModal label {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #savedReplyModal input {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #savedReplyModal select {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #savedReplyModal textarea {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    /* Primary button (Save Reply) - keep default blue styling */
    [data-theme="dark"] #savedReplyModal .btn:not(.secondary) {
        background: #3b82f6 !important;
        color: white !important;
        border: 1px solid #3b82f6 !important;
    }
    [data-theme="dark"] #savedReplyModal .btn:not(.secondary):hover {
        background: #2563eb !important;
        border-color: #2563eb !important;
    }
    /* × Close button styling - match other modal close buttons */
    [data-theme="dark"] #savedReplyModal button[onclick="closeSavedReplyModal()"] {
        background: none !important;
        color: var(--text-primary) !important;
        border: none !important;
        padding: 5px !important;
        border-radius: 4px !important;
    }
    [data-theme="dark"] #savedReplyModal button[onclick="closeSavedReplyModal()"]:hover {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }
    /* Header and footer border styling - tone down borders */
    [data-theme="dark"] #savedReplyModal div[style*="border-bottom: 1px solid #e2e8f0"] {
        border-bottom: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #savedReplyModal div[style*="border-top: 1px solid #e2e8f0"] {
        border-top: 1px solid #404040 !important; /* Much more subtle grey */
    }
    /* Tone down target mailboxes borders to match subtle footer border */
    [data-theme="dark"] #savedReplyModal label[style*="border: 1px solid #e2e8f0"] {
        border: 1px solid #404040 !important; /* Much more subtle grey */
    }
    /* Cancel button - grey background with same padding and border-radius as Save Reply button */
    [data-theme="dark"] #savedReplyModal .btn.secondary {
        background: #6b7280 !important;
        padding: 10px 20px !important;
        border-radius: 6px !important;
    }
    [data-theme="dark"] #savedReplyModal .btn.secondary:hover {
        background: #4b5563 !important;
    }
    /* Dark Mode - Version History Modal */
    [data-theme="dark"] #versionHistoryModal {
        background: rgba(0,0,0,0.7) !important;
    }
    [data-theme="dark"] #versionHistoryModal > div {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #versionHistoryModal h3 {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #versionHistoryModal button {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #versionHistoryModal button:hover {
        background: var(--bg-quaternary) !important;
        border-color: var(--border-hover) !important;
    }
    [data-theme="dark"] #versionHistoryModal .btn.secondary {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #versionHistoryModal .btn.secondary:hover {
        background: var(--bg-quaternary) !important;
        border-color: var(--border-hover) !important;
    }
    [data-theme="dark"] #versionHistoryModal .btn.danger {
        background: var(--danger-color) !important;
        color: white !important;
        border: 1px solid var(--danger-color) !important;
    }
    [data-theme="dark"] #versionHistoryModal .btn.danger:hover {
        background: #dc2626 !important;
        border-color: #dc2626 !important;
    }
    /* × Close button styling - match other modal close buttons */
    [data-theme="dark"] #versionHistoryModal button[onclick="closeVersionHistoryModal()"] {
        background: none !important;
        color: var(--text-primary) !important;
        border: none !important;
        padding: 5px !important;
        border-radius: 4px !important;
    }
    [data-theme="dark"] #versionHistoryModal button[onclick="closeVersionHistoryModal()"]:hover {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }
    /* Close button - grey background with same padding and border-radius as other buttons (exclude action buttons) */
    [data-theme="dark"] #versionHistoryModal .btn.secondary:not(#savedReplyVersionContent .btn.secondary) {
        background: #6b7280 !important;
        padding: 10px 20px !important;
        border-radius: 6px !important;
    }
    [data-theme="dark"] #versionHistoryModal .btn.secondary:not(#savedReplyVersionContent .btn.secondary):hover {
        background: #4b5563 !important;
    }
    /* Header and footer border styling */
    [data-theme="dark"] #versionHistoryModal div[style*="border-bottom: 1px solid #e2e8f0"] {
        border-bottom: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #versionHistoryModal div[style*="border-top: 1px solid #e2e8f0"] {
        border-top: 1px solid var(--border-color) !important;
    }
    /* Version history content styling */
    [data-theme="dark"] #versionHistoryModal #versionHistoryContent div[style*="border: 1px solid #e2e8f0"] {
        border: 1px solid var(--border-color) !important;
        background: var(--bg-tertiary) !important;
    }
    [data-theme="dark"] #versionHistoryModal #versionHistoryContent div[style*="background: #f0f9ff"] {
        background: var(--bg-quaternary) !important;
        border-color: #404040 !important; /* Much more subtle grey instead of blue */
    }
    [data-theme="dark"] #versionHistoryModal #versionHistoryContent strong {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #versionHistoryModal #versionHistoryContent div[style*="color: #64748b"] {
        color: var(--text-muted) !important;
    }
    [data-theme="dark"] #versionHistoryModal #versionHistoryContent div[style*="background: #f8fafc"] {
        background: var(--bg-quaternary) !important;
        border-left: 3px solid var(--brand-primary) !important;
    }
    [data-theme="dark"] #versionHistoryModal #versionHistoryContent div[style*="color: #1e293b"] {
        color: var(--text-primary) !important;
    }
    /* Light Mode - Saved Reply Version History Modal Action Buttons */
    #versionHistoryModal .product-modal-body .btn.secondary {
        width: 42px !important;
        height: 32px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #f8fafc !important;
        color: #374151 !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 6px !important;
        padding: 6px 8px !important;
        min-height: auto !important;
        font-size: 14px !important;
    }
    
    #versionHistoryModal .product-modal-body .btn.secondary:hover {
        background: #f1f5f9 !important;
        border-color: #cbd5e1 !important;
        color: #374151 !important;
    }
    
    /* Dark Mode - Saved Reply Version History Modal Action Buttons */
    [data-theme="dark"] #versionHistoryModal .product-modal-body .btn.secondary {
        width: 42px !important;
        height: 32px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 6px !important;
        padding: 6px 8px !important;
        min-height: auto !important;
        font-size: 14px !important;
    }
    
    [data-theme="dark"] #versionHistoryModal .product-modal-body .btn.secondary:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
        color: var(--text-primary) !important;
    }
    /* Delete button specific styling for × character */
    #versionHistoryModal #savedReplyVersionContent .btn.secondary:last-child {
        font-size: 18px;
        font-weight: bold;
    }
    
    /* Dark Mode - Saved Reply Version History Modal */
    [data-theme="dark"] #versionHistoryModal .product-modal {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #versionHistoryModal .product-modal-header {
        background: var(--bg-secondary) !important;
        border-bottom: 1px solid var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #versionHistoryModal .product-modal-header h3 {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #versionHistoryModal .product-modal-body {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #versionHistoryModal .product-modal-footer {
        background: var(--bg-secondary) !important;
        border-top: 1px solid var(--border-color) !important;
    }
    
    /* Dark Mode - Edit Product Modal */
    [data-theme="dark"] #productModalOverlay .product-modal {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #productModalOverlay .product-modal-header {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #productModalOverlay .product-modal-body {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #productModalOverlay .modal-close-btn {
        color: var(--text-primary) !important;
        background: transparent !important;
        border: none !important;
    }
    [data-theme="dark"] #productModalOverlay .modal-close-btn:hover {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }
    /* Form elements in product modal */
    [data-theme="dark"] #productModalOverlay input,
    [data-theme="dark"] #productModalOverlay select,
    [data-theme="dark"] #productModalOverlay textarea {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #productModalOverlay input:focus,
    [data-theme="dark"] #productModalOverlay select:focus,
    [data-theme="dark"] #productModalOverlay textarea:focus {
        border-color: var(--brand-primary) !important;
        outline: none !important;
    }
    /* Labels and text */
    [data-theme="dark"] #productModalOverlay label {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #productModalOverlay .slug-preview {
        color: var(--text-muted) !important;
        background: transparent !important;
        padding: 0 !important;
        border: 0 !important;
    }
    [data-theme="dark"] #productModalOverlay .char-counter,
    [data-theme="dark"] #productModalOverlay .form-help {
        color: var(--text-muted) !important;
        background: transparent !important;
        padding: 0 !important;
        border: 0 !important;
    }
    /* Buttons in product modal */
    [data-theme="dark"] #productModalOverlay .btn:not(.secondary) {
        background: #3b82f6 !important;
        color: white !important;
        border: 1px solid #3b82f6 !important;
    }
    [data-theme="dark"] #productModalOverlay .btn:not(.secondary):hover {
        background: #2563eb !important;
        border-color: #2563eb !important;
    }
    [data-theme="dark"] #productModalOverlay .btn.secondary {
        background: #6b7280 !important;
        color: white !important;
        border: 1px solid #6b7280 !important;
    }
    [data-theme="dark"] #productModalOverlay .btn.secondary:hover {
        background: #4b5563 !important;
        border-color: #4b5563 !important;
    }
    /* Shopify Tags section */
    [data-theme="dark"] #productModalOverlay .shopify-tags-section {
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 8px !important;
        padding: 16px !important;
    }
    [data-theme="dark"] #productModalOverlay .shopify-tags-section h4 {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #productModalOverlay .shopify-tags-container {
        background: var(--bg-tertiary) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 6px !important;
        padding: 12px !important;
        min-height: 40px !important;
    }
    [data-theme="dark"] #productModalOverlay .tags-empty-state {
        color: var(--text-muted) !important;
    }
    [data-theme="dark"] #productModalOverlay .shopify-tag {
        background: var(--bg-quaternary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #productModalOverlay .shopify-tag button {
        color: var(--text-muted) !important;
        background: transparent !important;
        border: none !important;
    }
    [data-theme="dark"] #productModalOverlay .shopify-tag button:hover {
        color: var(--text-primary) !important;
        background: var(--bg-tertiary) !important;
        border-radius: 3px !important;
    }
    [data-theme="dark"] #productModalOverlay .shopify-tags-help {
        color: var(--text-muted) !important;
        background: transparent !important;
        padding: 0 !important;
        border: 0 !important;
    }
    [data-theme="dark"] #productModalOverlay .tag-suggestion {
        background: var(--bg-quaternary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #productModalOverlay .tag-suggestion:hover {
        background: var(--brand-primary) !important;
        color: white !important;
        border-color: var(--brand-primary) !important;
    }
    /* Fix Target Keywords Strategy heading */
    [data-theme="dark"] #productModalOverlay h3 {
        color: var(--text-primary) !important;
    }
    /* Secondary Keywords section */
    [data-theme="dark"] #productModalOverlay .keywords-section,
    [data-theme="dark"] #productModalOverlay .secondary-keywords-section {
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #productModalOverlay .secondary-keywords-container {
        background: var(--bg-tertiary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #productModalOverlay .keyword-tag {
        background: var(--bg-quaternary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #productModalOverlay .keyword-tag button {
        color: var(--text-muted) !important;
        background: transparent !important;
    }
    [data-theme="dark"] #productModalOverlay .keyword-tag button:hover {
        color: var(--text-primary) !important;
        background: var(--bg-tertiary) !important;
    }
    [data-theme="dark"] #productModalOverlay .keywords-empty-state {
        color: var(--text-muted) !important;
    }
    /* Shopify theme preview section */
    [data-theme="dark"] #productModalOverlay .theme-preview-section,
    [data-theme="dark"] #productModalOverlay .seo-sidebar {
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #productModalOverlay .theme-preview-section h4,
    [data-theme="dark"] #productModalOverlay .seo-sidebar h4 {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #productModalOverlay .preview-container {
        background: var(--bg-tertiary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #productModalOverlay .preview-content {
        background: var(--bg-quaternary) !important;
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #productModalOverlay .seo-score-item {
        background: var(--bg-tertiary) !important;
        border: 1px solid var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    /* Fix Secondary Keywords section with inline styles */
    [data-theme="dark"] #productModalOverlay #secondaryKeywordTags {
        background: var(--bg-tertiary) !important;
        border: 2px dashed var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #productModalOverlay #secondaryKeywordTags div {
        color: var(--text-muted) !important;
    }
    /* Secondary keyword tags - Blue for no conflicts (match Design Approved) */
    [data-theme="dark"] #productModalOverlay .secondary-keyword-tag {
        background: #1e3a8a !important;
        color: #93c5fd !important;
        border: 1px solid #3b82f6 !important;
    }
    [data-theme="dark"] #productModalOverlay .secondary-keyword-tag span {
        color: #93c5fd !important;
    }
    /* Used keyword state - Orange */
    [data-theme="dark"] #productModalOverlay .secondary-keyword-tag[style*="#fef3c7"] {
        background: #451a03 !important;
        color: #fdba74 !important;
        border: 1px solid #92400e !important;
    }
    [data-theme="dark"] #productModalOverlay .secondary-keyword-tag[style*="#fef3c7"] span {
        color: #fdba74 !important;
    }
    [data-theme="dark"] #productModalOverlay .secondary-keyword-tag[style*="#fef3c7"] button {
        color: #fdba74 !important;
    }
    /* Conflict keyword state - Red */
    [data-theme="dark"] #productModalOverlay .secondary-keyword-tag[style*="#fef2f2"] {
        background: #7f1d1d !important;
        color: #fca5a5 !important;
        border: 1px solid #ef4444 !important;
    }
    [data-theme="dark"] #productModalOverlay .secondary-keyword-tag[style*="#fef2f2"] span {
        color: #fca5a5 !important;
    }
    [data-theme="dark"] #productModalOverlay .secondary-keyword-tag[style*="#fef2f2"] button {
        color: #fca5a5 !important;
    }
    /* Keyword tag buttons - match text colors */
    [data-theme="dark"] #productModalOverlay .secondary-keyword-tag button {
        background: transparent !important;
        border: none !important;
        color: #93c5fd !important;
    }
    /* Keyword tooltips */
    [data-theme="dark"] #productModalOverlay .keyword-tooltip {
        background: #1f2937 !important;
        color: white !important;
    }
    /* Fix Shopify Theme Preview Settings section */
    [data-theme="dark"] #productModalOverlay .theme-assets-section {
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #productModalOverlay .theme-assets-header {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #productModalOverlay .theme-assets-title {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #productModalOverlay .theme-assets-content {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #productModalOverlay .theme-assets-description {
        color: var(--text-muted) !important;
        background: transparent !important;
        border: 0 !important;
        padding: 16px 0 0 0 !important;
    }
    [data-theme="dark"] #productModalOverlay .asset-group {
        background: transparent !important;
        border: 0 !important;
        padding: 0 !important;
    }
    [data-theme="dark"] #productModalOverlay .asset-group-title,
    [data-theme="dark"] #productModalOverlay .asset-group-title strong {
        color: white !important;
    }
    [data-theme="dark"] #productModalOverlay .collapse-arrow {
        color: var(--text-primary) !important;
    }
    /* Asset field delete buttons (crosses) - target more broadly */
    [data-theme="dark"] #productModalOverlay .asset-fields button {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #productModalOverlay .asset-fields button:hover {
        background: var(--bg-quaternary) !important;
        border-color: var(--border-hover) !important;
    }
    /* SEO Score Section */
    [data-theme="dark"] #productModalOverlay .seo-sidebar {
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
    }
    /* Don't override seo-score-circle background - it needs to keep its color coding */
    /* Fix "8 factors analyzed" text color */
    [data-theme="dark"] #productModalOverlay .seo-sidebar div[style*="color: #6b7280"] {
        color: #9ca3af !important;
    }
    [data-theme="dark"] #productModalOverlay .collapsible-section {
        background: var(--bg-tertiary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #productModalOverlay .collapsible-header {
        background: var(--bg-quaternary) !important;
        color: var(--text-primary) !important;
        border-bottom: 1px solid var(--border-color) !important;
        border-radius: 8px 8px 0 0 !important;
    }
    [data-theme="dark"] #productModalOverlay .collapsible-content {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }
    /* Don't override mini-score backgrounds - they need to keep their color coding */
    [data-theme="dark"] #productModalOverlay .help-icon {
        background: var(--bg-quaternary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #productModalOverlay .tooltip {
        background: var(--bg-primary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #productModalOverlay .expand-icon {
        color: var(--text-primary) !important;
    }
    /* SEO checks inside collapsible content */
    [data-theme="dark"] #productModalOverlay .seo-check-item,
    [data-theme="dark"] #productModalOverlay .check-item {
        background: var(--bg-quaternary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }    .btn-page {
        background: #7c3aed; /* Purple for pages */
    }

    .btn-page:hover {
        background: #6d28d9;
    }

    .btn-page.secondary {
        background: #64748b; /* Darker purple-grey for secondary page actions */
        border: 1px solid #7c3aed;
    }

    .btn-page.secondary:hover {
        background: #475569;
    }

    .btn-ai {
        background: linear-gradient(135deg, #f59e0b 0%, #ef4444 50%, #8b5cf6 100%); /* Gradient for AI */
        position: relative;
        overflow: hidden;
    }

    .btn-ai:hover {
        background: linear-gradient(135deg, #d97706 0%, #dc2626 50%, #7c3aed 100%);
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }

    .btn-ai::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
        transform: rotate(45deg);
        transition: all 0.6s;
        opacity: 0;
    }

    .btn-ai:hover::before {
        animation: shimmer 1.5s infinite;
        opacity: 1;
    }

    @keyframes shimmer {
        0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
        100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
    }

    #bulkActionsSection h4 {
        margin-bottom: 10px;
    }

    /* Add padding below the description paragraph */
    .card p {
        margin-bottom: 20px; /* Increase from default to add more space */
    }

    /* Or target it more specifically if you only want this specific paragraph */
    #keyword-analyzer-v2 .card > p {
        margin-bottom: 20px;
    }

    .sync-status {
        font-weight: bold;
        padding: 2px 6px;
        border-radius: 3px;
        font-size: 12px;
    }

    /* Enhanced SEO Sidebar Styles */
    .collapsible-section {
        border: 1px solid #e5e7eb;
        border-radius: 6px;
        margin-bottom: 8px;
        overflow: visible; /* Changed from hidden to visible */
    }

    .collapsible-header {
        border-radius: 8px;
        background: #f9fafb;
        padding: 10px 12px;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 13px;
        font-weight: 500;
        position: relative;
        overflow: visible;
    }

    .collapsible-header:hover {
        background: #f3f4f6;
    }

    .collapsible-content {
        padding: 8px 12px;
        border-radius: 0 0 8px 8px;
        background: white;
        display: none;
    }

    .collapsible-content.expanded {
        display: block;
    }

    .expand-icon {
        transition: transform 0.2s;
    }

    .expand-icon svg {
        transition: transform 0.2s ease;
    }

    .expand-icon.rotated {
        transform: rotate(90deg);
    }

    .mini-score {
        background: #e5e7eb;
        color: #374151;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 11px;
        font-weight: bold;
        min-width: 24px;
        text-align: center;
    }

    .mini-score.good { background: #10b981; color: white; }
    .mini-score.fair { background: #f59e0b; color: white; }
    .mini-score.poor { background: #ef4444; color: white; }

    .market-analysis-section {
        border-top: 1px solid #e5e7eb;
        margin: 10px 0;
        padding-top: 8px;
    }

    .subsection-label {
        font-size: 10px;
        font-weight: 600;
        color: #6b7280;
        margin-bottom: 6px;
        text-transform: uppercase;
    }

    .seo-check-info { 
        background: #3b82f6; 
    }

    .help-icon {
        width: 16px;
        height: 16px;
        background: #6b7280;
        color: white;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        font-weight: bold;
        cursor: help;
        margin-left: 6px;
        position: relative;
        z-index: 1000;
    }

    .tooltip {
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        background: #1f2937;
        color: white;
        padding: 10px 12px;
        border-radius: 6px;
        font-size: 11px;
        line-height: 1.4;
        white-space: normal;
        max-width: 280px;
        min-width: 200px;
        z-index: 10000;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s, visibility 0.2s;
        margin-bottom: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        pointer-events: none;
    }

    .tooltip {
        font-weight: normal !important;
    }

    .tooltip strong {
        font-weight: bold !important;
    }

    .tooltip br + • {
        font-weight: normal !important;
    }

    /* More specific targeting for the bullet point text */
    .help-icon .tooltip {
        font-weight: 100;
    }

    .help-icon .tooltip strong {
        font-weight: bold;
    }

    .help-icon:hover .tooltip {
        opacity: 1;
        visibility: visible;
    }

    /* Menu Management Styles */
    .menu-selector {
        display: flex;
        gap: 15px;
        align-items: center;
        margin-bottom: 20px;
        padding: 15px;
        background: #f8fafc;
        border-radius: 8px;
        flex-wrap: wrap;
    }

    .menu-type-badge {
        background: #3b82f6;
        color: white;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 11px;
        font-weight: 600;
    }

    .menu-item {
        display: flex;
        align-items: center;
        padding: 12px 24px;
        color: #4b5563;
        text-decoration: none;
        font-size: 14px;
        font-weight: 400;
        border-left: 3px solid transparent;
        border: none !important; /* Remove grey border */
        border-radius: 0 !important; /* Remove border radius */
        margin: 0 !important; /* Remove extra margins */
        transition: all 0.2s ease;
        cursor: pointer;
        position: relative;
        background: transparent;
    }

    .menu-item:hover {
        background: #f3f4f6;
        color: #1f2937;
        border-left: 3px solid #e5e7eb !important; /* Grey left border on hover */
        border-top: none !important;
        border-right: none !important;
        border-bottom: none !important;
        box-shadow: none !important;
    }

    .menu-item-left {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .menu-item-info {
        display: flex;
        flex-direction: column;
    }

    .menu-item-title {
        font-weight: 500;
        color: #1e293b;
        margin-bottom: 2px;
    }

    .menu-item-meta {
        font-size: 12px;
        color: #64748b;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .link-type-badge {
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
    }

    .link-type-product { background: #dbeafe; color: #1e40af; }
    .link-type-collection { background: #dcfce7; color: #166534; }
    .link-type-page { background: #f3e8ff; color: #7c3aed; }
    .link-type-external { background: #e5e7eb; color: #374151; }
    .link-type-blogpost { background: #ecfeff; color: #0891b2; }
    .link-type-blog { background: #f3e8ff; color: #7c3aed; }

    .menu-item-actions {
        display: flex;
        gap: 5px;
        opacity: 0;
        transition: opacity 0.2s;
    }

    .menu-item:hover .menu-item-actions {
        opacity: 1;
    }

    .menu-nest-level-1 {
        margin-left: 30px;
        border-left: 2px solid #e2e8f0;
        padding-left: 15px;
    }

    .menu-nest-level-2 {
        margin-left: 60px;
        border-left: 2px solid #e2e8f0;
        padding-left: 15px;
    }

    .menu-empty-state {
        text-align: center;
        padding: 40px;
        color: #6b7280;
        background: #f9fafb;
        border: 2px dashed #d1d5db;
        border-radius: 8px;
    }

    .menu-stats {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
        margin-bottom: 20px;
    }

    .menu-stat {
        background: white;
        padding: 12px;
        border-radius: 6px;
        border: 1px solid #e2e8f0;
        text-align: center;
    }

    .menu-stat-number {
        font-size: 18px;
        font-weight: 600;
        color: #1e293b;
    }

    .menu-stat-label {
        font-size: 11px;
        color: #64748b;
        text-transform: uppercase;
    }

    /* Expand/Collapse Styles */
    .collapse-icon {
        margin-right: 10px;
        font-size: 12px;
        transition: transform 0.3s ease;
        cursor: pointer;
        color: #6b7280;
        width: 16px;
        display: inline-block;
        text-align: center;
    }

    .collapse-icon:hover {
        color: #374151;
    }

    .menu-children-container {
        transition: all 0.3s ease;
        overflow: hidden;
    }

    .menu-children-container.collapsed {
        max-height: 0;
        opacity: 0;
        margin: 0;
    }

    .menu-item-wrapper {
        position: relative;
    }

    /* Improve drag & drop styling */
    .menu-item-wrapper.sortable-ghost {
        opacity: 0.5;
    }

    .menu-item-wrapper.sortable-chosen {
        background: #f0f9ff;
    }

    /* Teal-themed keyword tags for blog posts */
    .blogpost-keyword-tag {
        display: inline-block;
        background: #ecfeff;
        color: #0891b2;
        padding: 2px 6px;
        border-radius: 12px;
        font-size: 11px;
        margin: 0px;
        border: 1px solid #67e8f9;
    }

    .blogpost-keyword-tag.conflict {
        background: #fef2f2 !important;
        color: #ef4444 !important;
        border-color: #fecaca !important;
    }

    /* Blog post modal keyword tags */
    #blogPostKeywordTags .keyword-tag {
        background: #ecfeff;
        color: #0891b2;
        border: 1px solid #67e8f9;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 11px;
        margin: 2px;
        display: inline-block;
    }

    #blogPostKeywordTags .keyword-tag.primary {
        background: #0891b2;
        color: white;
        border-color: #0e7490;
    }

    #blogPostKeywordTags .keyword-tag.secondary {
        background: #ecfeff;
        color: #0891b2;
        border-color: #67e8f9;
    }
    
    /* Blog post form elements */
    .blogpost-form-group {
        margin-bottom: 20px;
    }

    .blogpost-form-group label {
        display: block;
        margin-bottom: 6px;
        font-weight: 500;
        color: #374151;
    }

    /* Teal accents for blog post buttons */
    .btn.blogpost-primary {
        background: #0891b2;
        color: white;
        border: 1px solid #0e7490;
    }

    .btn.blogpost-primary:hover {
        background: #0e7490;
    }

    .tags-input-container {
        display: flex;
        gap: 8px;
        margin-bottom: 8px;
    }

    .tags-input-container input {
        flex: 1;
    }

    .tags-display {
        min-height: 50px;
        border: 2px dashed #e2e8f0;
        border-radius: 6px;
        padding: 10px;
        margin-bottom: 10px;
        background: #fafafa;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: flex-start;
    }

    .form-help {
        font-size: 12px;
        color: #6b7280;
        margin-top: 4px;
    }

    .secondary-keyword-tag.blogpost-secondary {
        background: #ecfeff;
        color: #0891b2;
        border: 1px solid #67e8f9;
        padding: 6px 10px;
        border-radius: 15px;
        display: inline-flex;
        align-items: center;
        margin: 3px;
        font-size: 12px;
        position: relative;
    }

    /* Universal rules for selected rows */
    .data-table tr.selected {
        background: #eff6ff !important;
    }

    .data-table tr.selected:hover {
        background: #dbeafe !important;
    }

    .menu-action-btn {
        padding: 13px 20px !important;
    }

    /* Blog post button styles */
    .btn-blogpost {
        background: #0891b2 !important;
        color: white !important;
        border: 1px solid #0e7490 !important;
    }

     .btn-blogpost:hover {
        background: #0e7490 !important;
    }

    .btn-blogpost.secondary {
        background: #6b7280 !important;  /* Same grey as other secondary buttons */
        color: white !important;         /* White text like other secondary buttons */
        border: 1px solid #0891b2 !important;  /* Only the outline is teal */
    }

    .btn-blogpost.secondary:hover {
        background: #4b5563 !important;  /* Darker grey on hover like other secondary buttons */
        border: 1px solid #0891b2 !important;  /* Keep teal outline on hover */
    }

    /* New CSS for opportunity squares */
    .opportunity-score-new {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-weight: normal;
        color: #374151;
    }

    .opportunity-square {
        width: 12px;
        height: 12px;
        border-radius: 2px;
        flex-shrink: 0;
    }

    .opportunity-square.poor { background-color: #6b7280; }
    .opportunity-square.fair { background-color: #ef4444; }
    .opportunity-square.good { background-color: #f59e0b; }
    .opportunity-square.very-good { background-color: #22c55e; }
    .opportunity-square.excellent { background-color: #10b981; }
    .opportunity-square.exceptional { background-color: #059669; }
    .opportunity-square.unicorn { background-color: #7c3aed; }

    /* Sort indicators for all tables */
    .sort-indicator {
        font-size: 10px;
        opacity: 0.5;
    }

    .sort-indicator.active {
        opacity: 1;
        color: #6b7280;
    }

    /* Theme Asset Configuration Styles */
    .theme-assets-section {
        background: #f8fafc;
        border-radius: 8px;
        border-left: 4px solid #3b82f6;
        margin-bottom: 20px;
        overflow: hidden;
    }

    .theme-assets-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 15px 20px;
        cursor: pointer;
        user-select: none;
        transition: background-color 0.2s;
    }

    .theme-assets-header:hover {
        background: #f1f5f9;
    }

    .theme-assets-title {
        color: #1f2937;
        font-weight: 600;
        font-size: 16px;
        margin: 0;
    }

    .collapse-arrow {
        font-size: 12px;
        color: #6b7280;
        transition: transform 0.2s;
    }

    .theme-assets-section.expanded .collapse-arrow {
        transform: rotate(90deg);
    }

    .theme-assets-content {
        padding: 0 20px 20px 20px;
        display: none;
    }

    .theme-assets-section.expanded .theme-assets-content {
        display: block;
    }

    .theme-assets-description {
        font-size: 13px;
        color: #6b7280;
        margin-bottom: 20px;
    }

    .asset-group {
        margin-bottom: 20px;
    }

    .asset-group:last-child {
        margin-bottom: 0;
    }

    .asset-group-title {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 10px;
    }

    .asset-group-title strong {
        font-size: 14px;
        color: #374151;
    }

    .asset-fields input {
        width: 100%;
        padding: 10px 12px;
        border: 2px solid #e2e8f0;
        border-radius: 6px;
        margin-bottom: 8px;
        font-size: 13px;
    }

    .add-field-btn {
        font-size: 12px;
        color: #3b82f6;
        background: none;
        border: none;
        cursor: pointer;
        text-decoration: underline;
    }

    .add-field-btn:hover {
        color: #2563eb;
    }

    /* Simple Working Quill Styles */
    .ql-toolbar.ql-snow {
        border: 2px solid #e2e8f0 !important;
        border-bottom: 1px solid #e2e8f0 !important;
        border-radius: 6px 6px 0 0 !important;
        background: #f8fafc !important;
    }

    .ql-container.ql-snow {
        border: 2px solid #e2e8f0 !important;
        border-top: none !important;
        border-radius: 0 0 6px 6px !important;
        background: white !important;
        height: 300px !important;
    }

    /* Hide TinyMCE branding */
    .tox .tox-statusbar__branding {
        display: none !important;
    }

    .tox-statusbar__branding {
        display: none !important;
    }

    /* New Sidebar Layout Styles */
    .mockup-container {
        display: flex;
        min-height: 100vh;
    }

    .sidebar {
        width: 300px;
        background: var(--bg-tertiary);
        border-right: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
        overflow-y: auto;
        position: fixed;
        height: 100vh;
        top: 0;
        left: 0;
        display: flex;
        flex-direction: column;
        color: var(--text-primary);
    }

    .sidebar-nav {
        flex: 1;
        overflow-y: auto;
    }

    .content-wrapper {
        flex: 1;
        margin-left: 300px;
        min-height: 100vh;
        background: var(--bg-primary);
        overflow: hidden;
        border-left: 1px solid var(--border-color);
    }

    .sidebar-header {
        padding: 24px 24px 16px;
        border-bottom: 1px solid var(--border-color);
        background: var(--bg-tertiary);
        color: var(--text-primary);
        text-align: left;
    }

    .sidebar-header h1 {
        font-size: 19px; /* Same size as before */
        font-weight: 700; /* Same weight as before */
        color: var(--text-primary);
        letter-spacing: -0.025em;
        margin: 0; /* Remove default margins */
    }

    .menu-section {
        margin-bottom: 0;
        transition: margin-bottom 0.3s ease;
    }

    .menu-section.collapsed {
        margin-bottom: 0;
    }

    .dashboard-section {
        margin-bottom: 0;
    }

    .menu-section-header {
        padding: 16px 24px 8px;
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        color: var(--text-muted);
        background: var(--bg-tertiary);
        border-bottom: 1px solid var(--border-color);
        position: sticky;
        top: 0;
        z-index: 10;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        transition: all 0.2s ease;
    }

    .menu-section, .menu-group, .section-content {
        background: var(--bg-tertiary);
    }

    .menu-section-header:hover {
        background: var(--bg-secondary);
        color: var(--text-secondary);
    }

    .menu-section-header:hover {
        background: #f3f4f6;
        color: #4b5563;
    }

    .section-chevron {
        font-size: 10px;
        transition: transform 0.3s ease;
        color: #9ca3af;
    }

    .section-chevron::before {
        content: "▼";
    }

    .section-chevron.collapsed::before {
        content: "▶";
    }

    .section-content {
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        padding: 0;
        max-height: 400px; /* Add this line */
    }

    .section-content.collapsed {
        max-height: 0;
        overflow: hidden;
    }

    .menu-group {
        padding: 0;
    }

    .menu-item {
        display: flex;
        align-items: center;
        padding: 12px 24px;
        color: var(--text-secondary);
        text-decoration: none;
        font-size: 14px;
        font-weight: 400;
        border-left: 3px solid transparent;
        border-top: none;
        border-right: none;
        border-bottom: none;
        border-radius: 0;
        margin: 0;
        transition: all 0.2s ease;
        cursor: pointer;
        position: relative;
        background: var(--bg-secondary);
        box-shadow: none;
    }

    .menu-item:hover {
        background: var(--bg-tertiary);
        color: var(--text-primary);
        border-left-color: var(--border-hover);
    }

    .menu-item.active {
        background: #edf4f3; /* New teal background */
        color: #006d6a; /* Teal text color to match */
        border-left: 3px solid #006d6a !important; /* New teal left border */
        font-weight: 500;
        border-top: none !important;
        border-right: none !important;
        border-bottom: none !important;
        border-radius: 0 !important;
    }

    .menu-item-text {
        flex: 1;
    }

    .section {
        display: none;
        padding: 24px;
        margin: 24px;
        background: #ffffff;
        border-radius: 12px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    }

    .sidebar .menu-item {
        box-shadow: none !important;
        border-radius: 0 !important;
        margin-bottom: 0 !important;
    }

    .dashboard-content {
        background: transparent !important;
        padding: 20px !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        margin: 0 !important;
    }

    /* Fix Navigation Menu Builder styling */
    #menus .menu-item {
        background: white !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 6px !important;
        padding: 12px !important;
        margin-bottom: 8px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        cursor: grab !important;
        transition: all 0.2s !important;
        border-left: 1px solid #e2e8f0 !important; /* Override sidebar border-left */
    }

    #menus .menu-item:hover {
        border-color: #3b82f6 !important;
        box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1) !important;
        background: white !important;
    }

    #menus .menu-item-actions {
        display: flex !important;
        gap: 5px !important;
        opacity: 0 !important;
        transition: opacity 0.2s !important;
    }

    #menus .menu-item:hover .menu-item-actions {
        opacity: 1 !important;
    }

    #menus .menu-item-left {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
    }

    #menus .menu-item-info {
        display: flex !important;
        flex-direction: column !important;
    }

    #menus .menu-item-title {
        font-weight: 500 !important;
        color: #1e293b !important;
        margin-bottom: 2px !important;
    }

    #menus .menu-item-meta {
        font-size: 12px !important;
        color: #64748b !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }


    #keyword-analyzer-v2 .card {
        margin-bottom: 24px;
    }

    #keyword-analyzer-v2 .table-container {
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

    /* Enhanced SEO v5.1 Styles */
    .keyword-warning {
        background: #fef3c7;
        border-left: 3px solid #f59e0b;
        padding: 6px 8px;
        margin: 4px 0;
        border-radius: 3px;
        font-size: 11px;
    }

    .guide-title {
        font-weight: 600;
        margin-bottom: 12px;
        display: block;
    }

    .guide-step {
        display: flex;
        align-items: flex-start;
        margin-top: 4px;
        margin-bottom: 8px;
        font-size: 11px;
        line-height: 1.4;
    }

    .step-number {
        background: #3b82f6;
        color: white;
        border-radius: 50%;
        width: 14px;
        height: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        font-weight: bold;
        margin-right: 4px;
        flex-shrink: 0;
    }

    .seo-summary {
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        padding: 12px;
        margin-bottom: 16px;
    }

    .summary-stats {
        display: flex;
        gap: 16px;
        margin-bottom: 8px;
    }

    .stat-item {
        font-size: 12px;
        color: #374151;
    }

    .priority-actions {
        font-size: 11px;
        color: #6b7280;
    }

    .action-item {
        margin: 2px 0;
        padding-left: 8px;
    }

    .action-link {
        color: #3b82f6;
        cursor: pointer;
        text-decoration: underline;
        margin-left: 4px;
        font-size: 11px;
    }

    .action-link:hover {
        color: #1d4ed8;
        text-decoration: none;
    }

    .expandable-content {
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 4px;
        padding: 12px;
        margin-top: 8px;
        font-size: 11px;
        display: none;
    }

    .expandable-content.show {
        display: block;
    }

    .close-link {
        float: right;
        color: #6b7280;
        cursor: pointer;
        font-size: 16px;
        font-weight: bold;
        margin-left: 10px;
        line-height: 1;
        margin-top: -4px;
    }

    .close-link:hover {
        color: #374151;
    }

    .keyword-location {
        background: #fef3c7;
        border-left: 3px solid #f59e0b;
        padding: 6px 8px;
        margin: 4px 0;
        border-radius: 3px;
        font-size: 11px;
    }

    .keyword-suggestion {
        color: #059669;
        font-weight: 500;
        margin-left: 10px;
    }

    .complex-sentence {
        background: #fef3c7;
        border-left: 3px solid #f59e0b;
        padding: 8px;
        margin: 4px 0;
        border-radius: 3px;
        font-size: 11px;
    }

    .suggestion-text {
        color: #059669;
        font-style: italic;
        margin-top: 4px;
        font-size: 10px;
    }

    .header-good {
        background: #dcfce7;
        border-left: 3px solid #10b981;
        padding: 4px 8px;
        margin: 4px 0;
        border-radius: 3px;
        font-size: 11px;
    }

    .header-suggestion {
        background: #fef3c7;
        border-left: 3px solid #f59e0b;
        padding: 4px 8px;
        margin: 4px 0;
        border-radius: 3px;
        font-size: 11px;
    }

    .missing-alt-item {
        background: #fee2e2;
        border-left: 3px solid #ef4444;
        padding: 8px;
        margin: 4px 0;
        border-radius: 3px;
        font-size: 11px;
    }

    .guide-title {
        font-weight: 600;
        margin-bottom: 12px;
        display: block;
    }

    .guide-step {
        display: flex;
        align-items: flex-start;
        margin-top: 4px;
        margin-bottom: 8px;
        font-size: 11px;
        line-height: 1.4;
    }

    .step-number {
        background: #3b82f6;
        color: white;
        border-radius: 50%;
        width: 14px;
        height: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        font-weight: bold;
        margin-right: 4px;
        flex-shrink: 0;
    }

    /* Make table containers fill available height */
    .table-container {
        height: calc(100vh - 200px);
        overflow-y: auto;
        overflow-x: auto;
        max-width: 100%;
    }

    /* Navigation Menus Header - Match other sections */
    .menus-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        flex-wrap: wrap;
        gap: 15px;
        padding-bottom: 20px;
        border-bottom: 1px solid #e2e8f0;
    }

    .menus-controls {
        display: flex;
        gap: 20px;
        align-items: center;
        flex-wrap: wrap;
    }

    .menu-action-buttons {
        display: flex;
        gap: 10px;
        align-items: center;
    }

    .menus-controls select {
        padding: 8px 12px;
        border: 2px solid #e2e8f0;
        border-radius: 6px;
        background: white;
        min-width: 150px;
    }

    #auth-section {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        background: #f8fafc !important;
        z-index: 99999 !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    #auth-section > div {
        background: white !important;
        padding: 2rem !important;
        border-radius: 8px !important;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
        max-width: 400px !important;
        width: 100% !important;
        margin: 0 !important;
        position: relative !important;
    }

    /* ===== UNIVERSAL TABLE SYSTEM - PRODUCTS TEST ===== */
    
    /* Base Table Container - Products test */
    .table-container {
        background: white;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        height: calc(100vh - 200px);
        overflow-y: auto;
        overflow-x: auto !important;
        max-width: 100% !important;
        position: relative;
    }

    /* Base Table - Products test */
    .data-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 14px;
        min-width: 1000px;
    }

    /* Cost Management Table - Let columns size naturally based on content */
    #costsTable {
        table-layout: auto;
        width: 100%;
    }

    /* Cost Management Table - Center align and sticky actions column */
    #costsTable td:nth-child(13) {
        text-align: center !important;
        vertical-align: middle !important;
        position: sticky;
        right: 0;
        background: white;
        border-left: 1px solid #e2e8f0;
        z-index: 5;
    }

    /* Cost Management Table - PO# column no wrap */
    #costsTable td:nth-child(2) {
        white-space: nowrap !important;
    }

    /* Cost Management Table - Customer column no wrap */
    #costsTable td:nth-child(4) {
        white-space: nowrap !important;
    }

    /* Cost Management Table - Date column no wrap */
    #costsTable td:nth-child(5) {
        white-space: nowrap !important;
    }

    /* Table Headers */
    .data-table thead {
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .data-table th {
        background: #f8fafc;
        padding: 12px 8px;
        text-align: left;
        font-weight: 600;
        color: #374151;
        border-bottom: 2px solid #e2e8f0;
        cursor: pointer;
        user-select: none;
        white-space: nowrap;
        position: sticky;
        top: 0;
        font-size: inherit !important; /* FIX: Ensure all headers have same font size */
    }

    .data-table th:hover {
        background: #f1f5f9;
    }

    /* Table Body */
    .data-table td {
        padding: 12px 8px;
        border-bottom: 1px solid #e2e8f0;
        vertical-align: top;
    }

    .data-table tr:hover {
        background: #f8fafc;
    }

    .data-table tr.selected {
        background: #eff6ff !important;
    }

    .data-table tr.selected:hover {
        background: #dbeafe !important;
    }

    /* Sticky Actions Column */
    .data-table .col-actions {
        width: 120px !important;
        min-width: 120px !important;
        text-align: center !important;
        position: sticky;
        right: 0;
        background: white;
        border-left: 1px solid #e2e8f0;
        z-index: 5;
    }

    .data-table th.col-actions {
        position: sticky;
        right: 0;
        background: #f8fafc !important;
        border-left: 1px solid #e2e8f0;
        z-index: 15;
    }

    /* Sorting Indicators - DISABLED because HTML already has sort indicators */
    /* This was adding duplicate arrows on top of HTML <span class="sort-indicator"> elements */
    /*.data-table th.sortable:not(#keywordConflictsTable th)::after {
        content: " ⇅";
        opacity: 0.5;
        font-size: 10px;
        color: var(--text-muted);
    }*/

    /* DISABLED - using HTML sort indicators instead */
    /*.data-table th.sort-asc::after {
        content: " ▲";
        opacity: 1;
        color: var(--text-muted);
    }

    .data-table th.sort-desc::after {
        content: " ▼";
        opacity: 1;
        color: var(--text-muted);
    }*/

    /* Column Specific Styles */
    .data-table .col-checkbox {
        width: 50px !important;
        min-width: 50px !important;
        text-align: center !important;
    }

    .data-table .col-name { min-width: 200px; }
    .data-table .col-category { min-width: 120px; }
    .data-table .col-keywords { min-width: 180px; }
    .data-table .col-volume { min-width: 100px; text-align: center; }
    .data-table .col-avg-opportunity { min-width: 100px; text-align: center; }
    .data-table .col-avg-difficulty { min-width: 100px; text-align: center; }
    .data-table .col-conflicts { min-width: 140px; text-align: center; white-space: nowrap; }
    .data-table .col-dates { 
        min-width: 120px; 
        text-align: left !important;
        font-size: 12px;
    }
    .data-table .col-tags { min-width: 150px; }
    .data-table .col-usage { min-width: 120px; text-align: center; }
    

    /* Products keyword tags - Blue theme */
    .keyword-tag-products {
        display: inline-block;
        background: #eff6ff;
        color: #1d4ed8;
        padding: 2px 6px;
        border-radius: 12px;
        font-size: 11px;
        margin: 0px;
        border: 1px solid #bfdbfe;
        white-space: nowrap;
    }

    .keyword-tag-products.conflict {
        background: #fef2f2 !important;
        color: #ef4444 !important;
        border-color: #fecaca !important;
    }

    /* Collections keyword tags - Green theme */
    .keyword-tag-collections {
        display: inline-block;
        background: #ecfdf5;
        color: #10b981; 
        padding: 2px 6px;
        border-radius: 12px;      
        font-size: 11px;          
        margin: 0px;              
        border: 1px solid #a7f3d0;
        white-space: nowrap;
    }

    .keyword-tag-collections.conflict {
        background: #fef2f2 !important;
        color: #ef4444 !important;
        border-color: #fecaca !important;
    }

    /* Pages keyword tags - Purple theme */
    .keyword-tag-pages {
        display: inline-block;
        background: #f3e8ff;
        color: #7c3aed;
        padding: 2px 6px;
        border-radius: 12px;      
        font-size: 11px;          
        margin: 0px;              
        border: 1px solid #c4b5fd;
        white-space: nowrap;
    }

    .keyword-tag-pages.conflict {
        background: #fef2f2 !important;
        color: #ef4444 !important;
        border-color: #fecaca !important;
    }

    /* Blog Posts keyword tags - Teal theme (exact copy of original) */
    .keyword-tag-blogposts {
        display: inline-block;
        background: #ecfeff;      /* EXACT: Original teal background */
        color: #0891b2;           /* EXACT: Original teal text */
        padding: 2px 6px;         /* EXACT: Same as other tables */
        border-radius: 12px;      
        font-size: 11px;          
        margin: 0px;              
        border: 1px solid #67e8f9; /* EXACT: Original teal border */
        white-space: nowrap;
    }

    .keyword-tag-blogposts.conflict {
        background: #fef2f2 !important;
        color: #ef4444 !important;
        border-color: #fecaca !important;
    }

    /* Keyword Analyzer keyword tags - Blue theme (same as products) */
    .keyword-tag-analyzer {
        display: inline-block;
        background: #eff6ff;
        color: #1d4ed8;
        padding: 2px 6px;
        border-radius: 12px;
        font-size: 11px;
        margin: 0px;
        border: 1px solid #bfdbfe;
        white-space: nowrap;
    }

    .keyword-tag-analyzer.conflict {
        background: #fef2f2 !important;
        color: #ef4444 !important;
        border-color: #fecaca !important;
    }

    /* CONFLICT TOOLTIP STYLES - Add this to your universal table CSS */
    .conflict-indicator-tooltip {
        position: fixed !important;
        background-color: #1f2937 !important;
        color: white !important;
        padding: 10px !important;
        border-radius: 6px !important;
        font-size: 11px !important;
        line-height: 1.3 !important;
        z-index: 999999 !important;
        max-width: 280px !important;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
        border: 1px solid #374151 !important;
        opacity: 1;
        transition: opacity 0.3s ease !important;
        display: block !important;
        visibility: visible !important;
        pointer-events: none !important;
    }

    /* Arrow styles for conflict tooltips */
    .conflict-tooltip-arrow {
        position: absolute !important;
        width: 0 !important;
        height: 0 !important;
        border-left: 5px solid transparent !important;
        border-right: 5px solid transparent !important;
    }

    .conflict-tooltip-arrow.arrow-up {
        border-bottom: 5px solid #1f2937 !important;
        top: -5px !important;
    }

    .conflict-tooltip-arrow.arrow-down {
        border-top: 5px solid #1f2937 !important;
        bottom: -5px !important;
    }

    /* Conflict indicator styles */
    .conflict-indicator {
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
        white-space: nowrap !important;
        display: inline-block;
    }

    .conflict-none {
        background: #dcfce7;
        color: #166534;
    }

    .conflict-warning {
        background: #fef3c7;
        color: #92400e;
        cursor: help;
    }

    .conflict-error {
        background: #fef2f2;
        color: #dc2626;
        cursor: help;
    }

    /* Dark Mode - Loading Overlays */
    [data-theme="dark"] .loading-overlay {
        background: rgba(26, 26, 26, 0.9) !important;
    }
    
    [data-theme="dark"] .loading-text {
        color: var(--text-primary) !important;
    }
    
    [data-theme="dark"] .loading-subtext {
        color: var(--text-muted) !important;
    }

    /* Loading Overlay */
    .loading-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(255, 255, 255, 0.8);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10;
    }

    .loading-spinner {
        width: 40px;
        height: 40px;
        border: 4px solid #e2e8f0;
        border-top: 4px solid #3b82f6;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }

    @keyframes fadeOut {
        from { opacity: 1; }
        to { opacity: 0; }
    }

    /* Enhanced Loading Text */
    .loading-text {
        color: #6b7280;
        font-size: 14px;
        font-weight: 500;
        text-align: center;
        margin-top: 12px;
    }

    .loading-subtext {
        color: #9ca3af;
        font-size: 12px;
        margin-top: 4px;
        text-align: center;
        max-width: 300px;
    }

    /* Update your existing .loading-overlay to support flex-column */
    .loading-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(255, 255, 255, 0.8);
        display: flex;
        flex-direction: column; /* Add this line */
        align-items: center;
        justify-content: center;
        z-index: 10;
    }

    /* Button Loading State - New */
    .btn.loading {
        color: transparent;
        pointer-events: none;
    }

    .btn.loading::after {
        content: '';
        position: absolute;
        width: 16px;
        height: 16px;
        top: 50%;
        left: 50%;
        margin-left: -8px;
        margin-top: -8px;
        border: 2px solid #ffffff40;
        border-top: 2px solid #ffffff;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

    /* Toast Notifications - New */
    .toast {
        position: fixed;
        top: 20px;
        right: 20px;
        background: #10b981;
        color: white;
        padding: 12px 20px;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        z-index: 999999;  /* ← Much higher z-index */
        animation: slideIn 0.3s ease-out;
        max-width: 400px;
    }

    .toast.error { background: #ef4444; }
    .toast.warning { background: #f59e0b; }

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

    /* Dark Mode - Dashboard Loading */
    [data-theme="dark"] .dashboard-loading-overlay {
        background: rgba(0, 0, 0, 0.95) !important;
    }
    
    [data-theme="dark"] .dashboard-loading-title {
        color: white !important;
    }
    
    [data-theme="dark"] .dashboard-loading-subtitle {
        color: white !important;
    }
    
    [data-theme="dark"] .loading-step {
        color: white !important;
    }

    /* Dashboard Loading States */
    .dashboard-loading-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(255, 255, 255, 0.95);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        z-index: 999999 !important; /* Force highest z-index */
        backdrop-filter: blur(2px);
    }

    .dashboard-loading-content {
        text-align: center;
        max-width: 400px;
    }

    .dashboard-loading-spinner {
        width: 60px;
        height: 60px;
        border: 4px solid #e2e8f0;
        border-top: 4px solid #3b82f6;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        margin: 0 auto 20px;
    }

    .dashboard-loading-title {
        font-size: 24px;
        font-weight: 600;
        color: #1f2937;
        margin-bottom: 8px;
    }

    .dashboard-loading-subtitle {
        font-size: 16px;
        color: #6b7280;
        margin-bottom: 20px;
    }

    .dashboard-loading-progress {
        width: 100%;
        max-width: 300px;
        background: #e2e8f0;
        border-radius: 8px;
        height: 8px;
        overflow: hidden;
        margin: 0 auto;
    }

    .dashboard-loading-bar {
        background: #3b82f6;
        height: 100%;
        width: 0%;
        transition: width 0.3s ease;
        border-radius: 8px;
    }

    .loading-steps {
        margin-top: 20px;
        text-align: left;
    }

    .loading-step {
        display: flex;
        align-items: center;
        padding: 4px 0;
        font-size: 14px;
        color: #6b7280;
    }

    .loading-step.active {
        color: #3b82f6;
        font-weight: 500;
    }

    .loading-step.completed {
        color: #10b981;
    }

    .loading-step-icon {
        width: 16px;
        height: 16px;
        margin-right: 8px;
        border-radius: 50%;
        border: 2px solid #e2e8f0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
    }

    .loading-step.active .loading-step-icon {
        border-color: #3b82f6;
        background: #3b82f6;
        color: white;
    }

    .loading-step.completed .loading-step-icon {
        border-color: #10b981;
        background: #10b981;
        color: white;
    }

    /* Content Modules Modal Styles */
    .modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1000;
    }

    .modal {
        background: white;
        border-radius: 8px;
        width: 95%;
        max-width: 1100px;
        max-height: 95vh;
        min-height: 80vh;
        overflow: hidden;
        box-shadow: 0 20px 25px rgba(0,0,0,0.3);
        display: flex;
        flex-direction: column;
    }

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

    .modal-header {
        padding: 20px 30px;
        border-bottom: 1px solid #e2e8f0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #f8fafc;
    }

    .btn.secondary {
        background: #6b7280;
        color: white;
    }

    .btn.secondary:hover {
        background: #4b5563;
    }

    /* Content Module Visual Styles */
    .content-module {
        border: 2px dashed #10b981;
        background: #f0fdf4;
        border-radius: 6px;
        margin: 10px 0;
        position: relative;
        padding: 15px;
        padding-top: 35px;
    }

    .content-module .module-tag {
        position: absolute;
        top: -1px;
        left: -1px;
        background: #10b981;
        color: white;
        padding: 4px 8px;
        font-size: 11px;
        font-weight: 600;
        border-radius: 4px 0 4px 0;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    /* Table module tags styling */
    .module-tag {
        background: #e5e7eb;
        color: #6b7280;
        padding: 2px 6px;
        border-radius: 10px;
        font-size: 11px;
        margin-right: 4px;
        display: inline-block;
    }

    /* Fix TinyMCE dialog z-index conflicts */
    .tox-dialog-wrap {
        z-index: 999999 !important;
    }

    .tox-dialog {
        z-index: 1000000 !important;
    }

    .tox-tinymce-aux {
        z-index: 999998 !important;
    }

    /* Ensure TinyMCE dialogs appear above everything */
    .tox-silver-sink {
        z-index: 999997 !important;
    }

    /* Fix custom modal z-index conflicts */
    #modulePickerOverlay {
        z-index: 1000001 !important;
    }

    .modal-overlay {
        z-index: 1000001 !important;
    }

    /* CodeMirror modal z-index */
    #codeEditorOverlay {
        z-index: 1000001 !important;
    }

    /* Any other modal overlays */
    [id*="modal"], [id*="Modal"], [id*="overlay"], [id*="Overlay"] {
        z-index: 1000001 !important;
    }

    /* Fix CodeMirror modal z-index */
    #codeEditorOverlay {
        z-index: 1000001 !important;
    }

    /* CodeMirror components */
    .CodeMirror {
        z-index: 1000002 !important;
        position: relative !important;
    }

    #saveCode, #cancelCode {
        z-index: 1000003 !important;
        position: relative !important;
    }

    /* Any modal that contains CodeMirror */
    div:has(.CodeMirror) {
        z-index: 1000001 !important;
    }

    button[onclick="window.logoutUser()"]:hover {
        background: #e2e8f0 !important;
        color: #475569 !important;
    }

    .stats-tooltip {
        top: 100% !important;
        bottom: auto !important;
        margin-top: 8px !important;
        margin-bottom: 0 !important;
    }

    .stats-tooltip::after {
        content: '' !important;
        position: absolute !important;
        top: auto !important;
        bottom: 100% !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        border: 5px solid transparent !important;
        border-top-color: transparent !important;
        border-bottom-color: #1f2937 !important;
    }

    .modal-tabs {
        display: flex;
        border-bottom: 1px solid #e2e8f0;
        margin-bottom: 20px;
    }

    .modal-tab {
        padding: 12px 20px;
        background: none;
        border: none;
        cursor: pointer;
        font-weight: 500;
        color: #6b7280;
        border-bottom: 1px solid transparent;
        transition: all 0.2s;
    }

    .modal-tab.active {
        color: #3b82f6;
        border-bottom: 2px solid #3b82f6;
    }

    .modal-tab:hover {
        color: #374151;
    }

    .tab-content {
        display: none;
    }

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

    /* Factory Badges */
    .factory-badge {
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
    }

    .factory-m-shef { background: #dcfce7; color: #166534; }
    .factory-p-shef { background: #fef3c7; color: #d97706; }
    .factory-k-laho { background: #dbeafe; color: #1e40af; }
    .factory-k-derb { background: #f3e8ff; color: #7c3aed; }

    .order-expansion {
        background: #f8fafc !important;
    }

    .mixed-status-container {
        display: flex;
        align-items: center;
    }

    /* Narrow Order Table Columns - match header padding with other tables */
    #ordersTable th {
        padding: 12px 8px !important; /* Match standard table header padding */
        white-space: nowrap;
        font-size: 13px;
    }

    #ordersTable td {
        padding: 8px 6px !important; /* Keep cells compact for narrow layout */
        white-space: nowrap;
        font-size: 13px;
    }

    #ordersTable th.col-name {
        width: auto !important;
        min-width: 80px;
    }

    /* Specific column widths */
    #ordersTable th:nth-child(1) { width: 100px; } /* Order # */
    #ordersTable th:nth-child(2) { width: 120px; } /* PO # */
    #ordersTable th:nth-child(3) { width: 90px; }  /* Factory */
    #ordersTable th:nth-child(4) { width: 120px; } /* Customer */
    #ordersTable th:nth-child(5) { width: 80px; }  /* Date */
    #ordersTable th:nth-child(6) { width: 60px; }  /* Items */
    #ordersTable th:nth-child(7) { width: 90px; }  /* Payment */
    #ordersTable th:nth-child(8) { width: 90px; }  /* Fulfillment */
    #ordersTable th:nth-child(9) { width: 90px; }  /* Delivery */
    #ordersTable th:nth-child(10) { width: 120px; } /* Internal */
    #ordersTable th:nth-child(11) { width: 80px; }  /* Total */
    #ordersTable th:nth-child(12) { width: 90px; }  /* Actions */

    /* Factory badges */
    .factory-mshef, .factory-m-shef {
        background: #dcfce7;
        color: #166534;
    }

    .factory-klaho, .factory-k-laho {
        background: #dbeafe;
        color: #1e40af;
    }

    .factory-pshef, .factory-p-shef {
        background: #fde68a;
        color: #92400e;
    }

    #transfersTable th, #transfersTable td {
        padding: 8px 6px !important;
    }

    /* ===== CONSOLIDATED STATUS BADGE SYSTEM ===== */
    /* This replaces ALL the scattered status CSS you just deleted */

    /* Draft statuses (orange) */
    .status-product-draft,
    .status-collection-draft,
    .status-page-draft,
    .status-blogpost-draft {
        background: #fef3c7;
        color: #d97706;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
        white-space: nowrap;
        display: inline-block;
        letter-spacing: normal;
    }

    /* Published statuses (green) */
    .status-product-published,
    .status-collection-published,
    .status-page-published,
    .status-blogpost-published {
        background: #dcfce7;
        color: #166534;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
        white-space: nowrap;
        display: inline-block;
        letter-spacing: normal;
    }
    /* Visible statuses (green) - for pages and blog posts */
    .status-page-visible,
    .status-blogpost-visible {
        background: #dcfce7;
        color: #166534;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
        white-space: nowrap;
        display: inline-block;
        letter-spacing: normal;
    }
    /* Hidden statuses (red) - for pages and blog posts */
    .status-page-hidden,
    .status-blogpost-hidden {
        background: #fef2f2;
        color: #dc2626;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
        white-space: nowrap;
        display: inline-block;
        letter-spacing: normal;
    }

    /* Unlinked statuses (grey) */
    .status-product-unlinked,
    .status-collection-unlinked,
    .status-page-unlinked,
    .status-blogpost-unlinked {
        background: #f3f4f6;
        color: #6b7280;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
        white-space: nowrap;
        display: inline-block;
        letter-spacing: normal;
    }

    /* Production status (blue) */
    .status-production {
        background: #dbeafe;
        color: #1e40af;
        border: 1px solid #3b82f6;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
        white-space: nowrap;
        display: inline-block;
        letter-spacing: normal;
    }

    /* Mixed status (purple) */
    .status-mixed {
        background: #f3e8ff;
        color: #7c3aed;
        border: 1px solid #a855f7;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
        white-space: nowrap;
        display: inline-block;
        letter-spacing: normal;
    }

    /* Keyword status pills */
    .status-used-pill {
        background: #fef2f2;
        color: #dc2626;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
        cursor: help;
    }

    .status-available-pill {
        background: #dcfce7;
        color: #166534;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
    }

    /* Error/rejected statuses (red) */
    .status-product-rejected,
    .status-collection-rejected,
    .status-page-rejected,
    .status-blogpost-rejected {
        background: #fef2f2;
        color: #dc2626;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
        white-space: nowrap;
        display: inline-block;
        letter-spacing: normal;
    }

    /* Approved statuses (blue) */
    .status-product-approved,
    .status-collection-approved,
    .status-page-approved,
    .status-blogpost-approved {
        background: #dbeafe;
        color: #1e40af;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
        white-space: nowrap;
        display: inline-block;
        letter-spacing: normal;
    }

    /* ===== DARK MODE OVERRIDES ===== */
    [data-theme="dark"] .status-product-draft,
    [data-theme="dark"] .status-collection-draft,
    [data-theme="dark"] .status-page-draft,
    [data-theme="dark"] .status-blogpost-draft {
        background: #451a03 !important;
        color: #fdba74 !important;
        border: 1px solid #92400e;
    }

    [data-theme="dark"] .status-product-published,
    [data-theme="dark"] .status-collection-published,
    [data-theme="dark"] .status-page-published,
    [data-theme="dark"] .status-blogpost-published {
        background: #14532d !important;
        color: #86efac !important;
        border: 1px solid #16a34a;
    }
    [data-theme="dark"] .status-page-visible,
    [data-theme="dark"] .status-blogpost-visible {
        background: rgba(0, 208, 132, 0.2) !important;
        color: var(--success-color) !important;
        border: 1px solid var(--success-color);
    }
    [data-theme="dark"] .status-page-hidden,
    [data-theme="dark"] .status-blogpost-hidden {
        background: #7f1d1d !important;
        color: #fca5a5 !important;
        border: 1px solid #ef4444;
    }

    [data-theme="dark"] .status-product-unlinked,
    [data-theme="dark"] .status-collection-unlinked,
    [data-theme="dark"] .status-page-unlinked,
    [data-theme="dark"] .status-blogpost-unlinked {
        background: #374151 !important;
        color: #d1d5db !important;
        border: 1px solid #6b7280;
    }

    [data-theme="dark"] .status-production {
        background: #1e3a8a !important;
        color: #93c5fd !important;
        border: 1px solid #3b82f6;
    }

    [data-theme="dark"] .status-mixed {
        background: #581c87 !important;
        color: #c4b5fd !important;
        border: 1px solid #a855f7;
    }

    [data-theme="dark"] .status-used-pill {
        background: #7f1d1d !important;
        color: #fca5a5 !important;
        border: 1px solid #dc2626;
    }

    [data-theme="dark"] .status-available-pill {
        background: #14532d !important;
        color: #86efac !important;
        border: 1px solid #16a34a;
    }

    [data-theme="dark"] .status-product-rejected,
    [data-theme="dark"] .status-collection-rejected,
    [data-theme="dark"] .status-page-rejected,
    [data-theme="dark"] .status-blogpost-rejected {
        background: #7f1d1d !important;
        color: #fca5a5 !important;
        border: 1px solid #dc2626;
    }

    /* Dark mode for approved statuses */
    [data-theme="dark"] .status-product-approved,
    [data-theme="dark"] .status-collection-approved,
    [data-theme="dark"] .status-page-approved,
    [data-theme="dark"] .status-blogpost-approved {
        background: #1e3a8a !important;
        color: #93c5fd !important;
        border: 1px solid #3b82f6;
    }

    /* Cost Management Styles */
    .checklist-container {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 24px;
    }

    .checklist {
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 20px;
    }

    .checklist-item {
        display: flex;
        align-items: flex-start;
        padding: 15px;
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        margin-bottom: 10px;
        cursor: pointer;
        transition: all 0.2s;
    }

    .checklist-item:hover {
        border-color: #3b82f6;
        background: #eff6ff;
    }

    .checkbox {
        width: 18px;
        height: 18px;
        border: 1px solid #d1d5db;
        border-radius: 4px;
        margin-right: 12px;
        position: relative;
        cursor: pointer;
        flex-shrink: 0;
        margin-top: 2px;
    }

    .checkbox.checked {
        background: #10b981;
        border-color: #10b981;
    }

    .checkbox.checked::after {
        content: '✓';
        position: absolute;
        top: -1px;
        left: 3px;
        color: white;
        font-size: 12px;
        font-weight: bold;
    }

    .checklist-content {
        flex: 1;
        min-width: 0;
    }

    .checklist-title {
        font-weight: 500;
        margin-bottom: 4px;
        display: flex;
        align-items: center;
        color: #1e293b;
    }

    .checklist-subtitle {
        font-size: 14px;
        color: #64748b;
        line-height: 1.4;
    }

    .expand-icon {
        margin-left: 8px;
        transition: transform 0.2s;
        font-size: 12px;
        color: #6b7280;
    }

    .expand-icon.expanded {
        transform: rotate(90deg);
    }

    .item-details {
        margin-top: 12px;
        padding: 15px;
        background: #eff6ff;
        border: 1px solid #bfdbfe;
        border-radius: 6px;
        font-size: 14px;
        line-height: 1.5;
        display: none;
    }

    .item-details.expanded {
        display: block;
    }

    .checklist-input {
        padding: 8px 12px;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        width: 90px;
        text-align: right;
        margin-left: auto;
        margin-right: 8px;
        font-size: 14px;
    }

    .checklist-input:focus {
        outline: none;
        border-color: #3b82f6;
    }

    .checklist-input:disabled {
        background: #f8fafc;
        color: #10b981;
        font-weight: 600;
        cursor: default;
    }

    .override-container {
        display: flex;
        align-items: center;
        margin-left: auto;
        gap: 8px;
    }

    .override-btn {
        background: none;
        border: 1px solid #d1d5db;
        border-radius: 4px;
        padding: 4px 8px;
        font-size: 11px;
        cursor: pointer;
        color: #6b7280;
        transition: all 0.2s;
    }

    .override-btn:hover {
        background: #f3f4f6;
        border-color: #9ca3af;
    }

    .override-btn.overridden {
        background: #fef3c7;
        border-color: #f59e0b;
        color: #92400e;
    }

    .summary-panel {
        background: transparent;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 20px;
        height: fit-content;
        position: sticky;
        top: 20px;
    }

    .summary-title {
        margin: 0 0 20px 0;
        font-weight: 600;
        color: #1e293b;
        font-size: 16px;
    }

    .progress-circle {
        width: 80px;
        height: 80px;
        border-radius: 50%;
        background: conic-gradient(#3b82f6 0deg 216deg, #e5e7eb 216deg 360deg);
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto 16px;
        position: relative;
    }

    .progress-circle::before {
        content: '';
        width: 60px;
        height: 60px;
        border-radius: 50%;
        background: white;
        position: absolute;
    }

    .progress-text {
        position: relative;
        font-weight: 600;
        color: #3b82f6;
        font-size: 16px;
    }

    .progress-label {
        text-align: center;
        color: #64748b;
        margin-bottom: 24px;
        font-size: 14px;
    }

    .summary-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px solid #e2e8f0;
        font-size: 14px;
    }

    .summary-item:last-child {
        border-bottom: none;
    }

    .summary-total {
        font-weight: 600;
        font-size: 16px;
        padding-top: 10px;
        padding-bottom: 10px;
        border-top: 2px solid #3b82f6;
        margin-bottom: 20px; /* Add space after Total Cost */
    }

    /* Revenue section spacing - add margin to Revenue (Inc Tax) item */
    .summary-item:has(#summary-revenue-inc-tax) {
        margin-top: 20px;
    }

    /* Fallback approach for browsers that don't support :has() */
    .summary-total + .summary-item {
        margin-top: 20px;
    }

    /* Remove border from Miscellaneous Costs (last cost item before Total Cost) to avoid double borders */
    .summary-item:has(#summary-miscellaneous) {
        border-bottom: none;
    }

    /* Remove any unnecessary margin from Total Cost */
    .summary-total {
        margin-top: 0;
    }

    .summary-item:nth-last-child(n+3):has(+ .summary-total) {
        border-bottom: none;
    }

    /* Simpler approach - target the 7th summary-item (Miscellaneous Costs) */
    .summary-item:nth-child(7) {
        border-bottom: none;
    }

    /* Remove any extra borders from Revenue (Ex Tax) item to avoid double borders */
    .summary-item[style*="border-bottom: 1px solid #e5e7eb"] {
        border-bottom: none !important;
        padding-bottom: 10px;
    }

    /* Make profit and margin items bigger and more prominent */
    .profit-positive,
    .profit-negative {
        font-weight: 600;
        font-size: 16px;
    }

    .profit-positive {
        color: #10b981;
    }

    .profit-negative {
        color: #ef4444;
    }

    .auto-badge {
        background: #dcfce7;
        color: #166534;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
        margin-left: 8px;
    }

    .missing-badge {
        background: #fee2e2;
        color: #991b1b;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
        margin-left: 8px;
    }

    .optional-badge {
        background: #f3f4f6;
        color: #6b7280;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
        margin-left: 8px;
    }

    /* Cost Status Badges */
    .cost-status-incomplete {
        background: #fef2f2;
        color: #dc2626;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
        white-space: nowrap;
    }

    .cost-status-complete {
        background: #dcfce7;
        color: #166534;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
        white-space: nowrap;
    }

    .cost-status-partial {
        background: #fef3c7;
        color: #d97706;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
        white-space: nowrap;
    }

    /* Missing Items Tooltip */
    .missing-items-container {
        position: relative;
        cursor: help;
        display: inline-block;
    }

    .missing-items-tooltip {
        visibility: hidden;
        width: 200px;
        background-color: #1f2937;
        color: white;
        text-align: left;
        border-radius: 6px;
        padding: 10px;
        position: absolute;
        z-index: 9999;
        top: 125%;
        left: 50%;
        margin-left: -100px;
        opacity: 0;
        transition: opacity 0.3s;
        font-size: 11px;
        line-height: 1.3;
    }

    .missing-items-tooltip::after {
        content: "";
        position: absolute;
        bottom: 100%;
        left: 50%;
        margin-left: -5px;
        border-width: 5px;
        border-style: solid;
        border-color: transparent transparent #1f2937 transparent;
    }

    .missing-items-container:hover .missing-items-tooltip {
        visibility: visible;
        opacity: 1;
    }

    /* PO Tooltip */
    .po-container {
        position: relative;
        cursor: help;
        display: inline-block;
    }

    .po-tooltip {
        visibility: hidden;
        width: 150px;
        background-color: #1f2937;
        color: white;
        text-align: left;
        border-radius: 6px;
        padding: 10px;
        position: absolute;
        z-index: 9999;
        top: 125%;
        left: 50%;
        margin-left: -75px;
        opacity: 0;
        transition: opacity 0.3s;
        font-size: 11px;
        line-height: 1.3;
    }

    .po-tooltip::after {
        content: "";
        position: absolute;
        bottom: 100%;
        left: 50%;
        margin-left: -5px;
        border-width: 5px;
        border-style: solid;
        border-color: transparent transparent #1f2937 transparent;
    }

    .po-container:hover .po-tooltip {
        visibility: visible;
        opacity: 1;
    }

    /* Factory Tooltip for Costs section */
    #costs .factory-container {
        position: relative;
        cursor: help;
        display: inline-block;
    }

    #costs .factory-tooltip {
        visibility: hidden;
        width: auto;
        min-width: 120px;
        background-color: #1f2937;
        color: white;
        text-align: left;
        border-radius: 6px;
        padding: 10px;
        position: absolute;
        z-index: 9999;
        top: 125%;
        left: 50%;
        transform: translateX(-50%);
        opacity: 0;
        transition: opacity 0.3s;
        font-size: 12px;
        white-space: nowrap;
    }

    #costs .factory-tooltip::after {
        content: "";
        position: absolute;
        bottom: 100%;
        left: 50%;
        margin-left: -5px;
        border-width: 5px;
        border-style: solid;
        border-color: transparent transparent #1f2937 transparent;
    }

    #costs .factory-container:hover .factory-tooltip {
        visibility: visible;
        opacity: 1;
    }

    /* Dark Mode - Cost Management Section */
    [data-theme="dark"] #costs {
        background: var(--bg-primary);
        color: var(--text-primary);
    }

    [data-theme="dark"] #costs .section {
        background: var(--bg-primary);
    }

    /* Dark Mode - Cost Management Header and Controls */
    [data-theme="dark"] #costs .products-header h2 {
        color: var(--text-primary);
    }

    [data-theme="dark"] #costs .search-box input {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] #costs .search-box input:focus {
        border-color: var(--border-hover);
        outline: none;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
    }

    [data-theme="dark"] #costs .search-box input::placeholder {
        color: var(--text-muted);
    }

    [data-theme="dark"] #costs select {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] #costs select:focus {
        border-color: var(--border-hover);
        outline: none;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
    }

    /* Dark Mode - Cost Management Stats Cards */
    [data-theme="dark"] #costs div[style*="display: grid"] > div[style*="background: white"] {
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
        box-shadow: var(--shadow-sm) !important;
    }

    [data-theme="dark"] #costs div[style*="display: grid"] > div[style*="background: white"] > div:first-child {
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #costs div[style*="display: grid"] > div[style*="background: white"] > div:last-child {
        color: var(--text-muted) !important;
    }

    /* Dark Mode - Cost Management Table */
    [data-theme="dark"] #costs .table-container {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
    }

    [data-theme="dark"] #costs .data-table {
        background: var(--bg-secondary);
        color: var(--text-primary);
    }

    [data-theme="dark"] #costs .data-table th {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border-bottom: 2px solid var(--border-color) !important;
    }

    [data-theme="dark"] #costs .data-table th:hover {
        background: var(--bg-primary) !important;
    }

    [data-theme="dark"] #costs .data-table td {
        border-bottom: 1px solid var(--border-color) !important;
        color: var(--text-primary);
    }

    [data-theme="dark"] #costs .data-table tr:hover {
        background: var(--bg-tertiary) !important;
    }

    /* Light Mode - Cost Management Table Row Left Borders */
    #costs .data-table tr[style*="background: #fef2f2"] {
        border-left: 4px solid #ef4444 !important;
    }

    #costs .data-table tr[style*="background: #f0fdf4"] {
        border-left: 4px solid #10b981 !important;
    }

    /* Dark Mode - Cost Management Table Row Backgrounds */
    [data-theme="dark"] #costs .data-table tr[style*="background: #fef2f2"] {
        background: rgba(239, 68, 68, 0.2) !important;
        border-left: 4px solid var(--error-color) !important;
    }

    [data-theme="dark"] #costs .data-table tr[style*="background: #f0fdf4"] {
        background: rgba(0, 208, 132, 0.1) !important;
        border-left: 4px solid #10b981 !important;
    }

    /* Dark Mode - Cost Status Badges */
    [data-theme="dark"] #costs .cost-status-incomplete {
        background: rgba(239, 68, 68, 0.2) !important;
        color: var(--error-color) !important;
        border: 1px solid var(--error-color);
    }

    [data-theme="dark"] #costs .cost-status-complete {
        background: rgba(0, 208, 132, 0.2) !important;
        color: var(--success-color) !important;
        border: 1px solid var(--success-color);
    }

    [data-theme="dark"] #costs .cost-status-partial {
        background: rgba(251, 191, 36, 0.2) !important;
        color: var(--warning-color) !important;
        border: 1px solid var(--warning-color);
    }

    /* Dark Mode - Cost Management Buttons */
    [data-theme="dark"] #costs .btn {
        background: var(--brand-color) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--brand-color);
    }

    [data-theme="dark"] #costs .btn:hover {
        background: var(--brand-hover) !important;
        border-color: var(--brand-hover);
    }

    /* Light Mode - Cost Management Action Buttons */
    #costs .data-table .btn.secondary {
        width: 42px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 6px 8px !important;
        min-height: auto !important;
        background: #f8fafc;
        color: #374151;
        border: 1px solid #d1d5db;
    }
    
    #costs .data-table .btn.secondary:hover {
        background: #f1f5f9;
        border-color: #cbd5e1;
    }
    
    #costs .data-table .btn.secondary svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

    /* Dark Mode - Cost Management Action Buttons */
    [data-theme="dark"] #costs .data-table .btn.secondary {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
        width: 42px !important;
        height: 32px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 6px 8px !important;
        min-height: auto !important;
    }

    [data-theme="dark"] #costs .data-table .btn.secondary:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }

    /* Dark Mode - Missing Items Tooltip */
    [data-theme="dark"] #costs .missing-items-tooltip {
        background-color: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] #costs .missing-items-tooltip::after {
        border-color: transparent transparent var(--bg-tertiary) transparent !important;
    }

    /* Dark Mode - PO Badges and Tooltip */
    [data-theme="dark"] #costs .po-badge {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] #costs .po-tooltip {
        background-color: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] #costs .po-tooltip::after {
        border-color: transparent transparent var(--bg-tertiary) transparent !important;
    }

    /* Dark Mode - Factory tooltips for costs section */
    [data-theme="dark"] #costs .factory-tooltip {
        background-color: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] #costs .factory-tooltip::after {
        border-color: transparent transparent var(--bg-tertiary) transparent !important;
    }

    /* Dark Mode - Factory badges for costs section */
    [data-theme="dark"] #costs .factory-badge {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color);
    }

    /* Override text-transform for Multiple badge in factory containers in costs section */
    #costs .factory-container .factory-badge {
        text-transform: none !important;
    }

    /* Financial Status Badges */
    .financial-status-badge {
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
        white-space: nowrap;
        display: inline-block;
    }

    /* Not invoiced - EXACT Awaiting Design styles */
    .financial-status-badge.status-not-invoiced {
        background: #fef3c7;
        color: #d97706;
    }

    /* Invoiced - EXACT Awaiting Approval styles */
    .financial-status-badge.status-invoiced {
        background: #dbeafe;
        color: #1e40af;
    }

    /* Paid - Green */
    .financial-status-badge.status-paid {
        background: #dcfce7;
        color: #166534;
    }

    /* Mixed - Gray */
    .financial-status-badge.status-mixed {
        background: #e5e7eb;
        color: #374151;
    }

    /* Financial Status Tooltip */
    .financial-status-container {
        position: relative;
        cursor: help;
        display: inline-block;
    }

    .financial-status-tooltip {
        visibility: hidden;
        width: auto;
        min-width: 180px;
        background-color: #1f2937;
        color: white;
        text-align: left;
        border-radius: 6px;
        padding: 10px;
        position: absolute;
        z-index: 9999;
        top: 125%;
        left: 50%;
        transform: translateX(-50%);
        opacity: 0;
        transition: opacity 0.3s;
        font-size: 12px;
        white-space: nowrap;
    }

    .financial-status-tooltip::after {
        content: "";
        position: absolute;
        bottom: 100%;
        left: 50%;
        margin-left: -5px;
        border-width: 5px;
        border-style: solid;
        border-color: transparent transparent #1f2937 transparent;
    }

    .financial-status-container:hover .financial-status-tooltip {
        visibility: visible;
        opacity: 1;
    }

    /* Dark Mode - Financial Status Badges */
    [data-theme="dark"] .financial-status-badge.status-not-invoiced {
        background: #451a03 !important;
        color: #fdba74 !important;
        border: 1px solid #92400e;
    }

    [data-theme="dark"] .financial-status-badge.status-invoiced {
        background: #1e3a8a !important;
        color: #93c5fd !important;
        border: 1px solid #3b82f6;
    }

    [data-theme="dark"] .financial-status-badge.status-paid {
        background: #14532d !important;
        color: #86efac !important;
        border: 1px solid #16a34a;
    }

    [data-theme="dark"] .financial-status-badge.status-mixed {
        background: var(--bg-tertiary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }

    /* Dark Mode - Financial Status Tooltip */
    [data-theme="dark"] .financial-status-tooltip {
        background-color: var(--bg-tertiary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] .financial-status-tooltip::after {
        border-color: transparent transparent var(--bg-tertiary) transparent;
    }

    /* Dark Mode - Invoices Section */
    [data-theme="dark"] #invoices {
        background: var(--bg-primary);
        color: var(--text-primary);
    }

    [data-theme="dark"] #invoices .products-header {
        background: transparent;
        border-color: var(--border-color);
    }

    [data-theme="dark"] #invoices .products-header h2 {
        color: var(--text-primary);
    }

    /* Match cost management search box styling exactly */
    #invoices .search-box input {
        border: 2px solid #e2e8f0;
    }

    [data-theme="dark"] #invoices .search-box input {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] #invoices .search-box input:focus {
        border-color: var(--border-hover);
        outline: none;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
    }

    [data-theme="dark"] #invoices .search-box select {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] #invoices .search-box select:focus {
        border-color: var(--border-hover);
        outline: none;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
    }

    [data-theme="dark"] #invoices .search-box input::placeholder {
        color: var(--text-muted);
    }

    [data-theme="dark"] #invoices .table-container {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }

    [data-theme="dark"] #invoices .data-table {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }

    /* Add border around invoices table container (matching cost management) */
    #invoices .table-container {
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

    /* Invoices table and pagination styling for cohesive appearance */
    #invoices .table-container + .pagination-container {
        border: 1px solid var(--border-color);
        border-top: none;
        border-radius: 0 0 8px 8px;
        background: var(--bg-secondary);
        padding: 12px 16px;
        margin-top: 0;
    }

    /* Remove bottom radius from table container when pagination follows */
    #invoices .table-container:has(+ .pagination-container) {
        border-radius: 8px 8px 0 0;
    }

    /* Add hairline border to invoices table headers (matching cost management) */
    #invoices .data-table th {
        border-bottom: 2px solid var(--border-color);
    }

    [data-theme="dark"] #invoices .data-table th {
        background: var(--bg-tertiary);
        color: var(--text-primary);
        border-color: var(--border-color);
        border-bottom: 2px solid var(--border-color);
    }

    [data-theme="dark"] #invoices .data-table th.col-actions {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }

    [data-theme="dark"] #invoices .data-table td {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border-color: var(--border-color);
    }

    [data-theme="dark"] #invoices .data-table tbody tr:hover {
        background: var(--bg-tertiary);
    }

    /* Dark Mode - Invoice PO Badges and Tooltips */
    [data-theme="dark"] #invoices .po-badge {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] #invoices .po-tooltip {
        background-color: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] #invoices .po-tooltip::after {
        border-color: transparent transparent var(--bg-tertiary) transparent !important;
    }

    /* Dark Mode - Invoice Status Badges */
    [data-theme="dark"] #invoices .status-badge {
        border: 1px solid var(--border-color);
    }

    /* Dark Mode - Invoices Specific Status Overrides (higher specificity) */
    [data-theme="dark"] #invoices .status-badge.status-production {
        background: #1e3a8a !important;
        color: #93c5fd !important;
        border: 1px solid #3b82f6 !important;
    }

    [data-theme="dark"] #invoices .status-badge.status-mixed {
        background: #581c87 !important;
        color: #c4b5fd !important;
        border: 1px solid #a855f7 !important;
    }

    /* Dark Mode - Invoice Bulk Actions */
    [data-theme="dark"] #invoices .bulk-actions select {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] #invoices .bulk-actions select:focus {
        border-color: var(--border-hover);
        outline: none;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
    }

    /* Dark Mode - Financial Status Dropdown */
    [data-theme="dark"] #invoices .financial-status-dropdown {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] #invoices .financial-status-dropdown:focus {
        border-color: var(--border-hover);
        outline: none;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
    }

    /* Prevent Apply button text from wrapping */
    #invoices .btn.secondary {
        white-space: nowrap;
    }

    [data-theme="dark"] #invoices .btn.secondary {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] #invoices .btn.secondary:hover {
        background: var(--bg-tertiary);
        border-color: var(--border-hover);
    }

    /* Dark Mode - Invoice Upload Buttons */
    [data-theme="dark"] #invoices .upload-btn {
        background: var(--bg-tertiary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] #invoices .upload-btn:hover {
        background: var(--bg-primary);
    }

    [data-theme="dark"] #invoices .delete-btn {
        background: #ef4444;
        color: white;
    }

    [data-theme="dark"] #invoices .delete-btn:hover {
        background: #dc2626;
    }


    /* Change Factory Modal - Target each field individually by ID */
    #changeFactoryOrderNumber,
    #changeFactoryCurrentFactory, 
    #changeFactoryNewFactory,
    #changeFactoryConfirm {
        width: 350px !important;
        height: 42px !important;
        padding: 0 12px !important;
        margin: 0 !important;
        border: 1px solid #d1d5db !important;
        border-radius: 6px !important;
        font-size: 14px !important;
        line-height: 42px !important;
        box-sizing: border-box !important;
        display: block !important;
        font-family: inherit !important;
        -webkit-appearance: none !important;
        -moz-appearance: none !important;
        appearance: none !important;
        background: white !important;
        color: #374151 !important;
        vertical-align: middle !important;
    }

    #changeFactoryOrderNumber,
    #changeFactoryCurrentFactory {
        background: #f3f4f6 !important;
        color: #6b7280 !important;
    }

    #changeFactoryConfirm {
        text-transform: uppercase !important;
    }

    /* Dark Mode - Change Factory Assignment Modal */
    [data-theme="dark"] #changeFactoryModal .product-modal {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #changeFactoryModal .product-modal-header {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border-bottom: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #changeFactoryModal .product-modal-body {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #changeFactoryModal table {
        background: var(--bg-secondary) !important;
    }

    [data-theme="dark"] #changeFactoryModal td {
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #changeFactoryModal label {
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #changeFactoryModal input {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #changeFactoryModal select {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #changeFactoryModal .modal-close-btn {
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #changeFactoryModal .modal-close-btn:hover {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }

    /* Dark Mode - Change Factory Modal Warning Box */
    [data-theme="dark"] #changeFactoryModal .product-modal-body div[style*="#fef2f2"] {
        background: #7f1d1d !important;
        border: 1px solid #dc2626 !important;
        color: #fecaca !important;
    }

    [data-theme="dark"] #changeFactoryModal .product-modal-body div[style*="#fef2f2"] strong {
        color: #fecaca !important;
    }

    /* Dark Mode - Edit PO Modal */
    [data-theme="dark"] #editPOModal .product-modal {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #editPOModal .product-modal-header {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border-bottom: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #editPOModal .product-modal-body {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #editPOModal table {
        background: var(--bg-secondary) !important;
    }

    [data-theme="dark"] #editPOModal td {
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #editPOModal label {
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #editPOModal input {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #editPOModal span {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #editPOModal .modal-close-btn {
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #editPOModal .modal-close-btn:hover {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }

    /* Dark Mode - Delete PO Modal */
    [data-theme="dark"] #deletePOModal .product-modal {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #deletePOModal .product-modal-header {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border-bottom: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #deletePOModal .product-modal-body {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #deletePOModal table {
        background: var(--bg-secondary) !important;
    }

    [data-theme="dark"] #deletePOModal td {
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #deletePOModal label {
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #deletePOModal input {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #deletePOModal .modal-close-btn {
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #deletePOModal .modal-close-btn:hover {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }

    /* Dark Mode - Delete PO Modal Warning Box */
    [data-theme="dark"] #deletePOModal .product-modal-body div[style*="#fef2f2"] {
        background: #7f1d1d !important;
        border: 1px solid #dc2626 !important;
        color: #fecaca !important;
    }

    [data-theme="dark"] #deletePOModal .product-modal-body div[style*="#fef2f2"] strong {
        color: #fecaca !important;
    }

    /* Dark Mode - Invoices Factory Badges */
    [data-theme="dark"] #invoices .factory-badge {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color);
    }

    /* Dark mode - Invoices table and pagination styling for cohesive appearance */
    [data-theme="dark"] #invoices .table-container + .pagination-container {
        border: 1px solid var(--border-color);
        border-top: none;
        border-radius: 0 0 8px 8px;
        background: var(--bg-secondary);
    }

    /* Dark mode - Remove bottom radius from table container when pagination follows */
    [data-theme="dark"] #invoices .table-container:has(+ .pagination-container) {
        border-radius: 8px 8px 0 0;
    }

    /* Dark mode - Invoices pagination styling (matching orders) */
    [data-theme="dark"] #invoices .per-page-selector select {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }
    [data-theme="dark"] #invoices .per-page-selector label {
        color: var(--text-primary);
    }
    [data-theme="dark"] #invoices .pagination-btn {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }
    [data-theme="dark"] #invoices .pagination-btn:hover {
        background: var(--bg-tertiary);
        border-color: var(--border-hover);
    }
    [data-theme="dark"] #invoices .pagination-btn.active {
        background: #000000;
        color: var(--text-primary);
        border-color: #000000;
    }
    [data-theme="dark"] #invoices .pagination-btn:disabled {
        background: var(--bg-primary);
        color: var(--text-muted);
        border-color: var(--border-color);
    }

    /* Costs table and pagination styling for cohesive appearance */
    #costs .table-container + .pagination-container {
        border: 1px solid var(--border-color);
        border-top: none;
        border-radius: 0 0 8px 8px;
        background: var(--bg-secondary);
        padding: 12px 16px;
        margin-top: 0;
    }

    /* Remove bottom radius from table container when pagination follows */
    #costs .table-container:has(+ .pagination-container) {
        border-radius: 8px 8px 0 0;
    }

    /* Dark mode - Costs table and pagination styling for cohesive appearance */
    [data-theme="dark"] #costs .table-container + .pagination-container {
        border: 1px solid var(--border-color);
        border-top: none;
        border-radius: 0 0 8px 8px;
        background: var(--bg-secondary);
    }

    /* Dark mode - Remove bottom radius from table container when pagination follows */
    [data-theme="dark"] #costs .table-container:has(+ .pagination-container) {
        border-radius: 8px 8px 0 0;
    }

    /* Dark mode - Costs pagination controls styling (matching orders and invoices) */
    [data-theme="dark"] #costs .per-page-selector select {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }
    [data-theme="dark"] #costs .per-page-selector label {
        color: var(--text-primary);
    }
    [data-theme="dark"] #costs .pagination-btn {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }
    [data-theme="dark"] #costs .pagination-btn:hover {
        background: var(--bg-tertiary);
        border-color: var(--border-hover);
    }
    [data-theme="dark"] #costs .pagination-btn.active {
        background: #000000;
        color: var(--text-primary);
        border-color: #000000;
    }
    [data-theme="dark"] #costs .pagination-btn:disabled {
        background: var(--bg-primary);
        color: var(--text-muted);
        border-color: var(--border-color);
    }


    /* Add border around orders table container (matching cost management and invoices) */
    #orders .table-container {
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

    /* Orders table and pagination styling for cohesive appearance */
    #orders .table-container + .pagination-container {
        border: 1px solid var(--border-color);
        border-top: none;
        border-radius: 0 0 8px 8px;
        background: var(--bg-secondary);
        padding: 12px 16px;
        margin-top: 0;
    }

    /* Remove bottom radius from table container when pagination follows */
    #orders .table-container:has(+ .pagination-container) {
        border-radius: 8px 8px 0 0;
    }

    /* Add hairline border to orders table headers (matching cost management and invoices) */
    #orders .data-table th {
        border-bottom: 2px solid var(--border-color);
    }

    /* Add border around warehouse transfers table container (matching other sections) */
    #warehouse-transfers .table-container {
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

    /* Add hairline border to warehouse transfers table headers (matching other sections) */
    #warehouse-transfers .data-table th {
        border-bottom: 2px solid var(--border-color);
        padding: 12px 8px !important;
    }

    /* Light Mode - Orders Status Badges (no borders to match other sections) */
    #orders .status-badge.status-production {
        border: none !important;
    }

    #orders .status-badge.status-mixed {
        border: none !important;
    }

    #invoices .status-badge.status-mixed {
        border: none !important;
    }

    #costs .status-badge.status-mixed {
        border: none !important;
    }

    /* Dark Mode - Orders Section */
    [data-theme="dark"] #orders {
        background: var(--bg-primary);
        color: var(--text-primary);
    }

    [data-theme="dark"] #orders .section {
        background: var(--bg-primary);
    }

    /* Dark Mode - Orders Header and Controls */
    [data-theme="dark"] #orders .products-header {
        background: transparent;
        border-color: var(--border-color);
    }

    [data-theme="dark"] #orders .products-header h2 {
        color: var(--text-primary);
    }

    [data-theme="dark"] #orders .search-box input {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] #orders .search-box input:focus {
        border-color: var(--border-hover);
        outline: none;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
    }

    [data-theme="dark"] #orders .search-box input::placeholder {
        color: var(--text-muted);
    }

    [data-theme="dark"] #orders .bulk-actions select {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] #orders .bulk-actions select:focus {
        border-color: var(--border-hover);
        outline: none;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
    }

    /* Dark Mode - Orders Table */
    [data-theme="dark"] #orders .table-container {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
    }

    /* Dark mode - Orders table and pagination styling for cohesive appearance */
    [data-theme="dark"] #orders .table-container + .pagination-container {
        border: 1px solid var(--border-color);
        border-top: none;
        border-radius: 0 0 8px 8px;
        background: var(--bg-secondary);
    }

    /* Dark mode - Remove bottom radius from table container when pagination follows */
    [data-theme="dark"] #orders .table-container:has(+ .pagination-container) {
        border-radius: 8px 8px 0 0;
    }

    [data-theme="dark"] #orders .data-table {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border-color: var(--border-color);
    }

    [data-theme="dark"] #orders .data-table th {
        background: var(--bg-tertiary);
        color: var(--text-primary);
        border-color: var(--border-color);
        border-bottom: 2px solid var(--border-color);
    }

    [data-theme="dark"] #orders .data-table th:hover {
        background: var(--bg-primary);
    }

    [data-theme="dark"] #orders .data-table th.col-actions {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }

    [data-theme="dark"] #orders .data-table td {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border-bottom: 1px solid var(--border-color);
    }

    [data-theme="dark"] #orders .data-table tr:hover {
        background: var(--bg-tertiary) !important;
    }

    /* Dark Mode - Orders Table Sticky Actions Column */
    [data-theme="dark"] #orders .data-table .col-actions {
        background: var(--bg-secondary);
        border-left: 1px solid var(--border-color);
    }

    /* Dark Mode - Cost Management Table Sticky Actions Column */
    [data-theme="dark"] #cost-management .data-table .col-actions {
        background: var(--bg-secondary);
        border-left: 1px solid var(--border-color);
    }

    [data-theme="dark"] #cost-management .data-table th.col-actions {
        background: var(--bg-tertiary) !important;
        border-left: 1px solid var(--border-color);
    }

    /* Dark Mode - Cost Management Table Sticky Actions Body Cells */
    [data-theme="dark"] #costsTable td:nth-child(13) {
        background: var(--bg-secondary) !important;
        border-left: 1px solid var(--border-color) !important;
    }

    /* Dark Mode - Orders Expanded Content */
    [data-theme="dark"] #orders .expansion-content {
        background: var(--bg-tertiary) !important;
        border-left: 3px solid #3b82f6 !important;
    }

    [data-theme="dark"] #orders .expansion-content .line-item {
        border-bottom: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #orders .expansion-content .item-name {
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #orders .expansion-content .item-details {
        color: var(--text-muted) !important;
    }

    /* Dark Mode - Orders Factory Badges and Status Badges in Expansion */
    [data-theme="dark"] #orders .expansion-content .factory-badge {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] #orders .expansion-content span[style*="background: #e5e7eb"] {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] #orders .expansion-content span[style*="background: #dbeafe"] {
        background: #1e3a8a !important;
        color: #93c5fd !important;
        border: 1px solid #3b82f6;
    }

    /* Dark Mode - Orders Status Badges */
    [data-theme="dark"] #orders .status-badge {
        border: 1px solid var(--border-color);
    }

    /* Dark Mode - Orders Specific Status Overrides (higher specificity) */
    [data-theme="dark"] #orders .status-badge.status-production {
        background: #1e3a8a !important;
        color: #93c5fd !important;
        border: 1px solid #3b82f6 !important;
    }

    [data-theme="dark"] #orders .status-badge.status-mixed {
        background: #581c87 !important;
        color: #c4b5fd !important;
        border: 1px solid #a855f7 !important;
    }

    [data-theme="dark"] #costs .status-badge.status-mixed {
        background: #581c87 !important;
        color: #c4b5fd !important;
        border: 1px solid #a855f7 !important;
    }

    /* Dark Mode - Create Transfer Modal */
    [data-theme="dark"] #createTransferModalOverlay .product-modal {
        background: var(--bg-primary);
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] #createTransferModalOverlay .product-modal-header {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }

    [data-theme="dark"] #createTransferModalOverlay .modal-title {
        color: var(--text-primary);
    }

    [data-theme="dark"] #createTransferModalOverlay .modal-close-btn {
        color: var(--text-primary);
    }

    [data-theme="dark"] #createTransferModalOverlay .product-modal-body {
        background: var(--bg-primary);
    }

    /* Transfer Info Grid Cards */
    [data-theme="dark"] #createTransferModalOverlay div[style*="background: #f8fafc"] {
        background: var(--bg-tertiary) !important;
    }

    [data-theme="dark"] #createTransferModalOverlay div[style*="color: #6b7280"] {
        color: var(--text-muted) !important;
    }

    [data-theme="dark"] #createTransferModalOverlay div[style*="color: #1f2937"] {
        color: var(--text-primary) !important;
    }

    /* Modal Headers */
    [data-theme="dark"] #createTransferModalOverlay h4 {
        color: var(--text-primary) !important;
    }

    /* Form Labels */
    [data-theme="dark"] #createTransferModalOverlay label {
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #createTransferModalOverlay div[style*="color: #374151"] {
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #createTransferModalOverlay input {
        background: none !important;
        border-color: var(--border-color) !important;
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #createTransferModalOverlay select {
        background: var(--bg-primary) !important;
        border-color: var(--border-color) !important;
        color: var(--text-primary) !important;
    }

    /* Cards */
    [data-theme="dark"] #createTransferModalOverlay div[style*="background: white"] {
        background: transparent !important;
        border-color: var(--border-color) !important;
    }

    [data-theme="dark"] #createTransferModalOverlay div[style*="border-bottom: 1px solid #e2e8f0"] {
        border-color: var(--border-color) !important;
    }

    /* Selected Orders Summary */
    [data-theme="dark"] #createTransferModalOverlay div[style*="background: #f0f9ff"] {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-color) !important;
    }

    /* Modal Footer */
    [data-theme="dark"] #createTransferModalOverlay div[style*="border-top: 1px solid #e2e8f0"] {
        border-color: var(--border-color) !important;
        background: var(--bg-secondary);
    }

    /* PO Selection Cards */
    [data-theme="dark"] #createTransferModalOverlay .po-card {
        background: var(--bg-secondary) !important;
        border-color: var(--border-color) !important;
    }

    /* PO Card Hover - softer hover effect for dark mode */
    [data-theme="dark"] #createTransferModalOverlay .po-card:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }

    /* PO Number Pills */
    [data-theme="dark"] #createTransferModalOverlay .po-card span[style*="background: #e5e7eb"] {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color);
    }

    /* Order Numbers */
    [data-theme="dark"] #createTransferModalOverlay .po-card span[style*="color: #1f2937"] {
        color: var(--text-primary) !important;
    }

    /* Customer Names */
    [data-theme="dark"] #createTransferModalOverlay .po-card span[style*="color: #6b7280"] {
        color: var(--text-muted) !important;
    }

    /* Selected PO Cards */
    [data-theme="dark"] #createTransferModalOverlay .po-card.selected {
        background: rgba(59, 130, 246, 0.2) !important;
        border-color: #3b82f6 !important;
    }

    /* PO Pills in Selected Orders Summary */
    [data-theme="dark"] #createTransferModalOverlay #selectedOrdersSummary div[style*="background: #e5e7eb"] {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #createTransferModalOverlay #selectedOrdersSummary div[style*="color: #374151"] {
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #createTransferModalOverlay #selectedOrdersSummary button[style*="color: #374151"] {
        color: var(--text-primary) !important;
    }

    /* Modal Close Button Hover */
    [data-theme="dark"] #createTransferModalOverlay .modal-close-btn:hover {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }

    /* Dark Mode - Order Details Modal */
    [data-theme="dark"] #orderModalOverlay .product-modal {
        background: var(--bg-primary);
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] #orderModalOverlay .product-modal-header {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }

    [data-theme="dark"] #orderModalOverlay .modal-close-btn {
        color: var(--text-primary);
    }

    [data-theme="dark"] #orderModalOverlay .modal-close-btn:hover {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #orderModalOverlay .product-modal-body {
        background: var(--bg-primary);
    }

    /* Modal Tabs */
    [data-theme="dark"] #orderModalOverlay .modal-tabs {
        border-color: var(--border-color) !important;
    }

    [data-theme="dark"] #orderModalOverlay .modal-tab {
        background: transparent;
        color: var(--text-primary);
        border-bottom: 0px;
    }

    [data-theme="dark"] #orderModalOverlay .modal-tab:hover {
        color: #d1d5db;
    }

    [data-theme="dark"] #orderModalOverlay .modal-tab.active {
        background: transparent;
        border-bottom: 2px solid #3b82f6;
        color: #3b82f6;
    }

    /* Order Details Tab - Info Cards */
    [data-theme="dark"] #orderModalOverlay div[style*="background: #f9fafb"] {
        background: var(--bg-tertiary) !important;
    }

    [data-theme="dark"] #orderModalOverlay label[style*="color: #6b7280"] {
        color: var(--text-muted) !important;
    }

    [data-theme="dark"] #orderModalOverlay div[style*="color: #059669"] {
        color: #10b981 !important;
    }

    /* Order Details Tab - Content Cards (Order Items & Changelog) */
    [data-theme="dark"] #orderModalOverlay div[style*="background: white"] {
        background: transparent !important;
        border-color: var(--border-color) !important;
    }

    [data-theme="dark"] #orderModalOverlay div[style*="border-bottom: 1px solid #e2e8f0"] {
        border-color: var(--border-color) !important;
    }

    [data-theme="dark"] #orderModalOverlay h4 {
        color: var(--text-primary) !important;
    }

    /* Fix text visibility issues */
    [data-theme="dark"] #orderModalOverlay #orderModalTitle {
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #orderModalOverlay #orderNumber,
    [data-theme="dark"] #orderModalOverlay #orderCustomer,
    [data-theme="dark"] #orderModalOverlay #orderDate,
    [data-theme="dark"] #orderModalOverlay #orderTotal,
    [data-theme="dark"] #orderModalOverlay #orderTags,
    [data-theme="dark"] #orderModalOverlay #orderPaymentStatus,
    [data-theme="dark"] #orderModalOverlay #orderFulfilmentStatus,
    [data-theme="dark"] #orderModalOverlay #orderDeliveryStatus,
    [data-theme="dark"] #orderModalOverlay #orderInternalStatus {
        color: var(--text-primary) !important;
    }

    /* Order Items and Changelog content */
    [data-theme="dark"] #orderModalOverlay #orderLineItems,
    [data-theme="dark"] #orderModalOverlay #changelogEntries {
        color: var(--text-primary) !important;
    }

    /* All text content in the modal - DISABLED TO PRESERVE COLORED TEXT */
    /*
    [data-theme="dark"] #orderModalOverlay div,
    [data-theme="dark"] #orderModalOverlay span,
    [data-theme="dark"] #orderModalOverlay p {
        color: var(--text-primary);
    }
    */

    /* Override for muted text that should stay muted */
    [data-theme="dark"] #orderModalOverlay .checklist-subtitle,
    [data-theme="dark"] #orderModalOverlay .detail-content,
    [data-theme="dark"] #orderModalOverlay label[style*="color: #6b7280"] {
        color: var(--text-muted) !important;
    }

    /* Approved Designs Section */
    [data-theme="dark"] #orderModalOverlay #approvedDesignsContainer {
        color: var(--text-primary);
    }

    /* File download area - make transparent instead of white/light backgrounds */
    [data-theme="dark"] #orderModalOverlay #approvedDesignsContainer div[style*="background: white"],
    [data-theme="dark"] #orderModalOverlay #approvedDesignsContainer div[style*="background:#ffffff"],
    [data-theme="dark"] #orderModalOverlay #approvedDesignsContainer div[style*="background-color: white"],
    [data-theme="dark"] #orderModalOverlay #approvedDesignsContainer div[style*="background-color:#ffffff"],
    [data-theme="dark"] #orderModalOverlay #approvedDesignsContainer div[style*="background: #fafafa"],
    [data-theme="dark"] #orderModalOverlay #approvedDesignsContainer div[style*="background:#fafafa"] {
        background: transparent !important;
        border-color: var(--border-color) !important;
    }

    /* Approval timestamp badge */
    [data-theme="dark"] #orderModalOverlay .approval-badge,
    [data-theme="dark"] #orderModalOverlay span[style*="background: #10b981"],
    [data-theme="dark"] #orderModalOverlay span[style*="background:#10b981"] {
        background: #059669 !important;
        color: #d1fae5 !important;
        border: 1px solid #10b981;
    }

    /* Product details text in Approved Designs */
    [data-theme="dark"] #orderModalOverlay #approvedDesignsContainer strong {
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #orderModalOverlay #approvedDesignsContainer div[style*="color: #6b7280"],
    [data-theme="dark"] #orderModalOverlay #approvedDesignsContainer div[style*="color:#6b7280"],
    [data-theme="dark"] #orderModalOverlay #approvedDesignsContainer span[style*="color: #6b7280"],
    [data-theme="dark"] #orderModalOverlay #approvedDesignsContainer span[style*="color:#6b7280"] {
        color: var(--text-muted) !important;
    }

    [data-theme="dark"] #orderModalOverlay #approvedDesignsContainer div[style*="color: #1f2937"],
    [data-theme="dark"] #orderModalOverlay #approvedDesignsContainer div[style*="color:#1f2937"],
    [data-theme="dark"] #orderModalOverlay #approvedDesignsContainer span[style*="color: #1f2937"],
    [data-theme="dark"] #orderModalOverlay #approvedDesignsContainer span[style*="color:#1f2937"] {
        color: var(--text-primary) !important;
    }

    /* Download links and file names in Approved Designs */
    [data-theme="dark"] #orderModalOverlay #approvedDesignsContainer a {
        color: #3b82f6 !important;
    }

    [data-theme="dark"] #orderModalOverlay #approvedDesignsContainer a:hover {
        color: #2563eb !important;
    }

    /* All text content in Approved Designs section */
    [data-theme="dark"] #orderModalOverlay #approvedDesignsContainer * {
        color: var(--text-primary) !important;
    }

    /* Factory & Shipping Tab - Dark Mode */
    [data-theme="dark"] #order-factory-tab h3,
    [data-theme="dark"] #order-factory-tab h4 {
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #order-factory-tab p,
    [data-theme="dark"] #order-factory-tab li {
        color: var(--text-muted) !important;
    }

    /* Factory cards - make them dark */
    [data-theme="dark"] #order-factory-tab div[style*="background: white"] {
        background: var(--bg-secondary) !important;
        border-color: var(--border-color) !important;
    }

    /* Factory card headers */
    [data-theme="dark"] #order-factory-tab h4[style*="color: #1f2937"] {
        color: var(--text-primary) !important;
    }

    /* Factory card descriptions */
    [data-theme="dark"] #order-factory-tab p[style*="color: #6b7280"] {
        color: var(--text-muted) !important;
    }

    /* PO Numbers */
    [data-theme="dark"] #order-factory-tab div[style*="color: #1f2937"] {
        color: var(--text-primary) !important;
    }

    /* Instructions box */
    [data-theme="dark"] #order-factory-tab div[style*="background: #f0f9ff"] {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-color) !important;
    }

    [data-theme="dark"] #order-factory-tab h4[style*="color: #1e40af"] {
        color: #3b82f6 !important;
    }

    [data-theme="dark"] #order-factory-tab ul[style*="color: #1e40af"] {
        color: var(--text-muted) !important;
    }

    /* Order Items section - primary content should be white */
    [data-theme="dark"] #orderModalOverlay #orderLineItems {
        color: var(--text-primary);
    }

    /* Order Items - Product titles and prices stay primary white */
    [data-theme="dark"] #orderModalOverlay #orderLineItems div[style*="color: #1f2937"] {
        color: var(--text-primary) !important;
    }

    /* Order Items - SKUs, "each" text, and secondary info should be muted grey */
    [data-theme="dark"] #orderModalOverlay #orderLineItems div[style*="color: #6b7280"] {
        color: var(--text-muted) !important;
    }

    /* Order Items - No items message */
    [data-theme="dark"] #orderModalOverlay #orderLineItems div[style*="padding: 15px; color: #6b7280"] {
        color: var(--text-muted) !important;
    }

    /* Order Items - Individual line item containers should have proper background */
    [data-theme="dark"] #orderModalOverlay #orderLineItems div[style*="background: white"] {
        background: var(--bg-secondary) !important;
        border-color: var(--border-color) !important;
    }

    /* Order Changelog section - with proper text hierarchy */
    [data-theme="dark"] #orderModalOverlay #changelogEntries {
        color: var(--text-primary);
    }

    /* Changelog entry main text (action description) - primary color #374151 -> white */
    [data-theme="dark"] #orderModalOverlay #changelogEntries div[style*="color: #374151"] {
        color: var(--text-primary) !important;
    }

    /* Changelog secondary text (user and timestamp) - muted color #6b7280 -> muted grey */
    [data-theme="dark"] #orderModalOverlay #changelogEntries div[style*="color: #6b7280"] {
        color: var(--text-muted) !important;
    }

    /* Changelog borders - replace bright white #f3f4f6 with proper dark border */
    [data-theme="dark"] #orderModalOverlay #changelogEntries div[style*="border-bottom: 1px solid #f3f4f6"] {
        border-bottom: 1px solid var(--border-color) !important;
    }

    /* No changes message */
    [data-theme="dark"] #orderModalOverlay #changelogEntries p[style*="color: #6b7280"] {
        color: var(--text-muted) !important;
    }

    /* Order Items - Customisation option tags (Shape: Cube, Unit: cm, Length A: 137, etc.) */
    [data-theme="dark"] #orderModalOverlay #orderLineItems div[style*="background: #f3f4f6"] {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }

    /* Order Items - Status divider area (bright white background and border) */
    [data-theme="dark"] #orderModalOverlay #orderLineItems div[style*="background: #f9fafb"] {
        background: var(--bg-secondary) !important;
        border-color: var(--border-color) !important;
    }

    /* Order Items - Status dropdown styling to match invoice section */
    [data-theme="dark"] #orderModalOverlay #orderLineItems select[style*="border: 1px solid #d1d5db"] {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #orderModalOverlay #orderLineItems select[style*="border: 1px solid #d1d5db"]:focus {
        border-color: var(--border-hover) !important;
        outline: none !important;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3) !important;
    }

    /* Order Items - Internal Status label should be white, not muted grey */
    [data-theme="dark"] #orderModalOverlay #orderLineItems span[style*="color: #6b7280; font-weight: 600"] {
        color: var(--text-primary) !important;
    }

    /* Order Items - PO-number badges (grey background) */
    [data-theme="dark"] #orderModalOverlay #orderLineItems .factory-badge[style*="background: #e5e7eb"] {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color);
    }

    /* Order Items - Factory code badges (blue background) */
    [data-theme="dark"] #orderModalOverlay #orderLineItems .factory-badge[style*="background: #dbeafe"] {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color);
    }

    /* Order Items - Edit/change buttons within badges should match badge text color */
    [data-theme="dark"] #orderModalOverlay #orderLineItems .factory-badge button {
        color: var(--text-primary) !important;
    }

    /* Add PO Number button - black background with white plus icon */
    [data-theme="dark"] #orderModalOverlay button[onclick*="showAddPOModal"] {
        background: #000000 !important;
        color: white !important;
    }

    /* Custom Product text - change from purple to grey in dark mode */
    [data-theme="dark"] #orderModalOverlay span[style*="color: #7c3aed"] {
        color: var(--text-muted) !important;
    }

    /* Order Details - Tags section styling (keep blue like light mode) */
    [data-theme="dark"] #orderModalOverlay #orderTags span[style*="background: #dbeafe"] {
        background: #1e3a8a !important;
        color: #93c5fd !important;
        border: 1px solid #3b82f6;
    }

    /* Order Details - Approved date/time pill (match Paid tag green styling, no tick icon) */
    [data-theme="dark"] #orderModalOverlay span[style*="background: #dcfce7; color: #166534"] {
        background: #14532d !important;
        color: #86efac !important;
        border: 1px solid #16a34a;
    }

    /* Approved Designs - File name should be white in dark mode */
    [data-theme="dark"] #orderModalOverlay #approvedDesignsContainer div[style*="color: #374151"] {
        color: var(--text-primary) !important;
    }

    /* Override download links to stay blue */
    [data-theme="dark"] #orderModalOverlay #approvedDesignsContainer a * {
        color: #3b82f6 !important;
    }

    /* Approved date pill should override the blue link rule and use proper green color */
    [data-theme="dark"] #orderModalOverlay #approvedDesignsContainer span[style*="background: #dcfce7; color: #166534"] {
        background: #14532d !important;
        color: #86efac !important;
        border: 1px solid #16a34a !important;
    }

    /* Customer Attached Images - Fix white divider border */
    [data-theme="dark"] #orderModalOverlay #orderLineItems div[style*="border-top: 1px solid #e5e7eb"] {
        border-top: 1px solid var(--border-color) !important;
    }

    /* Customer Attached Images - Label text should be white */
    [data-theme="dark"] #orderModalOverlay #orderLineItems h6[style*="color: #374151"] {
        color: var(--text-primary) !important;
    }

    /* Order Modal - Save/Cancel buttons divider should use grey border */
    [data-theme="dark"] #orderModalOverlay div[style*="border-top: 1px solid #e2e8f0"] {
        border-top: 1px solid var(--border-color) !important;
    }

    /* Cost Management Tab in Order Modal */
    [data-theme="dark"] #orderModalOverlay .checklist-container {
        background: transparent;
    }

    [data-theme="dark"] #orderModalOverlay .checklist {
        background: transparent;
        border-color: var(--border-color);
    }

    [data-theme="dark"] #orderModalOverlay .checklist-item {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }

    [data-theme="dark"] #orderModalOverlay .checklist-item:hover {
        background: var(--bg-tertiary);
        border-color: var(--border-hover);
    }

    [data-theme="dark"] #orderModalOverlay .checklist-title {
        color: var(--text-primary);
    }

    [data-theme="dark"] #orderModalOverlay .checklist-subtitle {
        color: var(--text-muted);
    }

    [data-theme="dark"] #orderModalOverlay .item-details {
        background: transparent;
        border-color: var(--border-color);
    }

    /* Fix yellow highlighted calculation sections - make readable in dark mode */
    [data-theme="dark"] #orderModalOverlay .calculation-highlight {
        background: #451a03;
        color: #fed7aa;
        border: 1px solid #f59e0b;
    }

    /* Fix any other yellow highlighted elements in calculations */
    [data-theme="dark"] #orderModalOverlay span[style*="background: #fef3c7"] {
        background: #451a03 !important;
        color: #fed7aa !important;
    }

    /* Fix disabled input fields - should have dark background even when disabled */
    [data-theme="dark"] #orderModalOverlay .checklist-input:disabled {
        background: var(--bg-primary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }

    /* Override inline styles for disabled inputs */
    [data-theme="dark"] #orderModalOverlay input[style*="background: #f8fafc"] {
        background: var(--bg-primary) !important;
        color: var(--text-primary) !important;
    }

    /* Override inline styles for enabled inputs (when override button is clicked) */
    [data-theme="dark"] #orderModalOverlay input[style*="background: #fff"],
    [data-theme="dark"] #orderModalOverlay input[style*="background: white"],
    [data-theme="dark"] #orderModalOverlay input[style*="background:#fff"],
    [data-theme="dark"] #orderModalOverlay input[style*="background:white"],
    [data-theme="dark"] #orderModalOverlay input[style*="background: rgb(255, 255, 255)"] {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }

    /* Ensure ALL enabled checklist inputs are dark, regardless of how they got enabled */
    [data-theme="dark"] #orderModalOverlay .checklist-input:not(:disabled) {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }

    /* Tax amount input field in cost summary */
    [data-theme="dark"] #orderModalOverlay #vatOverrideInput {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }

    /* ALL auto-badge elements get green styling by default */
    [data-theme="dark"] #orderModalOverlay .auto-badge {
        background: #14532d !important;
        color: #86efac !important;
        border: 1px solid #16a34a !important;
    }

    [data-theme="dark"] #orderModalOverlay .missing-badge {
        background: #7f1d1d !important;
        color: #fecaca !important;
        border: 1px solid #dc2626 !important;
    }

    [data-theme="dark"] #orderModalOverlay .optional-badge {
        background: var(--bg-tertiary) !important;
        color: var(--text-muted) !important;
        border: 1px solid var(--border-color) !important;
    }

    /* Target badges with inline styles that override class styling */
    /* AUTO badges - green styling */
    [data-theme="dark"] #orderModalOverlay span[style*="background: #dcfce7; color: #166534"] {
        background: #14532d !important;
        color: #86efac !important;
        border: 1px solid #16a34a !important;
    }


    [data-theme="dark"] #orderModalOverlay span[style*="background: #fee2e2; color: #991b1b"] {
        background: #7f1d1d !important;
        color: #fecaca !important;
        border: 1px solid #dc2626 !important;
    }

    [data-theme="dark"] #orderModalOverlay span[style*="background: #f3f4f6; color: #6b7280"] {
        background: var(--bg-tertiary) !important;
        color: var(--text-muted) !important;
        border: 1px solid var(--border-color) !important;
    }


    [data-theme="dark"] #orderModalOverlay .checkbox {
        border-color: var(--border-color);
        background: var(--bg-primary);
    }

    [data-theme="dark"] #orderModalOverlay .checkbox.checked {
        background: #10b981;
        border-color: #10b981;
    }

    [data-theme="dark"] #orderModalOverlay .detail-label {
        color: var(--text-primary);
    }

    [data-theme="dark"] #orderModalOverlay .detail-content {
        color: var(--text-muted);
    }

    [data-theme="dark"] #orderModalOverlay .checklist-input {
        background: var(--bg-primary);
        color: var(--text-primary);
        border-color: var(--border-color);
    }

    [data-theme="dark"] #orderModalOverlay .override-btn {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border-color: var(--border-color);
    }

    [data-theme="dark"] #orderModalOverlay .override-btn:hover {
        background: var(--bg-tertiary);
        border-color: var(--border-hover);
    }

    [data-theme="dark"] #orderModalOverlay .override-btn.overridden {
        background: #451a03;
        color: #fed7aa;
        border-color: #f59e0b;
    }

    [data-theme="dark"] #orderModalOverlay .summary-panel {
        background: transparent;
        border-color: var(--border-color);
    }

    [data-theme="dark"] #orderModalOverlay .summary-row {
        border-color: var(--border-color);
        color: var(--text-primary);
    }

    [data-theme="dark"] #orderModalOverlay .summary-total {
        background: transparent;
        color: var(--text-primary);
    }



    [data-theme="dark"] #orderModalOverlay .summary-title {
        color: var(--text-primary);
    }


    [data-theme="dark"] #orderModalOverlay .summary-item {
        border-color: var(--border-color);
    }

    /* Specific Revenue (Ex Tax) border fix */
    [data-theme="dark"] #orderModalOverlay .summary-item[style*="border-bottom: 1px solid #e5e7eb"] {
        border-bottom: 1px solid var(--border-color) !important;
    }

    /* Retain profit/margin colors in dark mode - green for positive, red for negative */
    [data-theme="dark"] #orderModalOverlay .profit-positive span {
        color: #22c55e !important;
    }

    [data-theme="dark"] #orderModalOverlay .profit-negative span {
        color: #ef4444 !important;
    }

    /* MANUAL badges - MUST override any other auto-badge rules - highest specificity */
    [data-theme="dark"] #orderModalOverlay span.auto-badge[style*="background: #fef3c7"] {
        background: #451a03 !important;
        color: #fed7aa !important;
        border: 1px solid #f59e0b !important;
    }
    
    [data-theme="dark"] #orderModalOverlay .auto-badge[style*="color: #d97706"] {
        background: #451a03 !important;
        color: #fed7aa !important;
        border: 1px solid #f59e0b !important;
    }


    /* NUCLEAR OPTION - Target badges that say MANUAL directly */
    [data-theme="dark"] #orderModalOverlay .auto-badge:contains("MANUAL") {
        background: #451a03 !important;
        color: #fed7aa !important;
        border: 1px solid #f59e0b !important;
    }
    
    /* Also try targeting by inline style that JavaScript sets */
    [data-theme="dark"] #orderModalOverlay .auto-badge[style*="background: rgb(254, 243, 199)"] {
        background: #451a03 !important;
        color: #fed7aa !important;
        border: 1px solid #f59e0b !important;
    }

    /* Dark Mode - Orders PO Badges and Tooltip */
    [data-theme="dark"] #orders .po-badge {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] #orders .po-tooltip {
        background-color: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] #orders .po-tooltip::after {
        border-color: transparent transparent var(--bg-tertiary) transparent !important;
    }

    /* Factory tooltip for orders table */
    #orders .factory-container {
        position: relative;
        cursor: help;
        display: inline-block;
    }

    #orders .factory-tooltip {
        visibility: hidden;
        width: 150px;
        background-color: #1f2937;
        color: white;
        text-align: left;
        border-radius: 6px;
        padding: 10px;
        position: absolute;
        z-index: 9999;
        top: 125%;
        left: 50%;
        margin-left: -75px;
        opacity: 0;
        transition: opacity 0.3s;
        font-size: 12px;
        white-space: nowrap;
    }

    #orders .factory-tooltip::after {
        content: "";
        position: absolute;
        bottom: 100%;
        left: 50%;
        margin-left: -5px;
        border-width: 5px;
        border-style: solid;
        border-color: transparent transparent #1f2937 transparent;
    }

    #orders .factory-container:hover .factory-tooltip {
        visibility: visible;
        opacity: 1;
    }

    [data-theme="dark"] #orders .factory-tooltip {
        background-color: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] #orders .factory-tooltip::after {
        border-color: transparent transparent var(--bg-tertiary) transparent !important;
    }

    /* Dark mode factory badges for orders table (matching invoices) */
    [data-theme="dark"] #orders .factory-badge {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color);
    }

    /* Override text-transform for Multiple badge in factory containers */
    #orders .factory-container .factory-badge {
        text-transform: none !important;
    }

    /* Light mode ONLY - ensure K-DERB factory styling in orders table */
    body:not([data-theme="dark"]) #orders span.factory-badge.factory-kderb {
        background: #f3e8ff !important;
        color: #7c3aed !important;
    }

    /* Dark Mode - Orders Buttons */
    [data-theme="dark"] #orders .btn {
        background: var(--brand-color);
        color: var(--text-primary);
        border: 1px solid var(--brand-color);
    }

    [data-theme="dark"] #orders .btn:hover {
        background: var(--brand-hover);
        border-color: var(--brand-hover);
    }

    /* Dark Mode - Orders Action Buttons */
    [data-theme="dark"] #orders .data-table .btn.secondary {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
        width: 42px !important;
        height: 32px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 6px 8px !important;
        min-height: auto !important;
    }

    [data-theme="dark"] #orders .data-table .btn.secondary:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }

    /* Dark Mode - Orders Loading Overlay */
    [data-theme="dark"] #orders .loading-overlay {
        background: rgba(17, 24, 39, 0.8);
    }

    /* Dark Mode - Orders Pagination */
    [data-theme="dark"] #orders .pagination-container {
        background: var(--bg-secondary) !important;
        border-top: 1px solid var(--border-color);
    }

    [data-theme="dark"] #orders .pagination-info {
        color: var(--text-primary);
    }

    [data-theme="dark"] #orders .pagination-container .btn {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] #orders .pagination-container .btn:hover {
        background: var(--bg-tertiary);
        border-color: var(--border-hover);
    }

    [data-theme="dark"] #orders .pagination-container .btn:disabled {
        background: var(--bg-primary);
        color: var(--text-muted);
        border-color: var(--border-color);
        opacity: 0.5;
    }

    /* Dark Mode - Orders Per-Page Selector Dropdown (match All Statuses styling) */
    [data-theme="dark"] #orders .per-page-selector select {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] #orders .per-page-selector select:focus {
        border-color: var(--border-hover);
        outline: none;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
    }

    [data-theme="dark"] #orders .per-page-selector label {
        color: var(--text-primary);
    }
    [data-theme="dark"] #orders .pagination-btn {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }
    [data-theme="dark"] #orders .pagination-btn:hover {
        background: var(--bg-tertiary);
        border-color: var(--border-hover);
    }
    [data-theme="dark"] #orders .pagination-btn.active {
        background: #000000;
        color: var(--text-primary);
        border-color: #000000;
    }
    [data-theme="dark"] #orders .pagination-btn:disabled {
        background: var(--bg-primary);
        color: var(--text-muted);
        border-color: var(--border-color);
        opacity: 0.5;
    }
    /* Dark Mode - Products Pagination */
    [data-theme="dark"] #products .pagination-container {
        background: var(--bg-secondary) !important;
        border-top: 1px solid var(--border-color);
    }
    [data-theme="dark"] #products .pagination-info {
        color: var(--text-primary);
    }
    [data-theme="dark"] #products .pagination-container .btn {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }
    [data-theme="dark"] #products .pagination-container .btn:hover {
        background: var(--bg-tertiary);
        border-color: var(--border-hover);
    }
    [data-theme="dark"] #products .pagination-container .btn:disabled {
        background: var(--bg-primary);
        color: var(--text-muted);
        border-color: var(--border-color);
        opacity: 0.5;
    }
    [data-theme="dark"] #products .per-page-selector select {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }
    [data-theme="dark"] #products .per-page-selector select:focus {
        border-color: var(--border-hover);
        outline: none;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
    }
    [data-theme="dark"] #products .per-page-selector label {
        color: var(--text-primary);
    }
    [data-theme="dark"] #products .page-btn {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }
    [data-theme="dark"] #products .page-btn:hover {
        background: var(--bg-tertiary);
        border-color: var(--border-hover);
    }
    [data-theme="dark"] #products .page-btn.active {
        background: #000000;
        color: var(--text-primary);
        border-color: #000000;
    }
    [data-theme="dark"] #products .page-btn:disabled {
        background: var(--bg-primary);
        color: var(--text-muted);
        border-color: var(--border-color);
        opacity: 0.5;
    }
    
    /* Dark Mode - Collections Section */
    [data-theme="dark"] #collections {
        background: var(--bg-primary);
        color: var(--text-primary);
    }
    [data-theme="dark"] #collections .section {
        background: var(--bg-primary);
    }
    /* Dark Mode - Collections Header and Controls */
    [data-theme="dark"] #collections .collections-header {
        background: transparent;
        border-color: var(--border-color);
    }
    [data-theme="dark"] #collections .collections-header h2 {
        color: var(--text-primary);
    }
    /* Dark Mode - Collections Controls */
    [data-theme="dark"] #collections .collections-controls {
        background: transparent;
    }
    [data-theme="dark"] #collections .search-box input {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 2px solid var(--border-color);
        border-radius: 6px;
    }
    [data-theme="dark"] #collections .search-box input:focus {
        border-color: var(--brand-color);
        outline: none;
    }
    [data-theme="dark"] #collections .search-box input::placeholder {
        color: var(--text-muted) !important;
    }
    [data-theme="dark"] #collections .collections-controls .search-box input::placeholder {
        color: var(--text-muted) !important;
    }
    [data-theme="dark"] #collections .bulk-actions select {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 2px solid var(--border-color);
    }
    [data-theme="dark"] #collections .bulk-actions select:focus {
        border-color: var(--border-hover);
        outline: none;
    }
    [data-theme="dark"] #collections .btn {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #collections .btn:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }
    /* Dark Mode - Collections Table */
    [data-theme="dark"] #collections .table-container {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
    }

    /* Collections table and pagination styling for cohesive appearance */
    #collections .table-container + .pagination-container {
        border: 1px solid var(--border-color);
        border-top: none;
        border-radius: 0 0 8px 8px;
        background: var(--bg-secondary);
        padding: 12px 16px;
        margin-top: 0;
    }

    /* Remove bottom radius from table container when pagination follows */
    #collections .table-container:has(+ .pagination-container) {
        border-radius: 8px 8px 0 0;
    }

    /* Dark mode - Collections table and pagination styling for cohesive appearance */
    [data-theme="dark"] #collections .table-container + .pagination-container {
        border: 1px solid var(--border-color);
        border-top: none;
        border-radius: 0 0 8px 8px;
        background: var(--bg-secondary);
    }

    /* Dark mode - Remove bottom radius from table container when pagination follows */
    [data-theme="dark"] #collections .table-container:has(+ .pagination-container) {
        border-radius: 8px 8px 0 0;
    }
    [data-theme="dark"] #collections .data-table {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border-color: var(--border-color);
    }
    [data-theme="dark"] #collections .data-table th {
        background: var(--bg-tertiary);
        color: var(--text-primary);
        border-color: var(--border-color);
        border-bottom: 2px solid var(--border-color);
    }
    [data-theme="dark"] #collections .data-table th:hover {
        background: var(--bg-primary);
    }
    [data-theme="dark"] #collections .data-table th.col-actions {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
        border-left: 1px solid var(--border-color);
    }
    [data-theme="dark"] #collections .data-table .col-actions {
        background: var(--bg-secondary);
        border-left: 1px solid var(--border-color);
    }
    [data-theme="dark"] #collections .data-table td {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border-bottom: 1px solid var(--border-color);
    }
    [data-theme="dark"] #collections .data-table tbody tr:hover {
        background: var(--bg-tertiary) !important;
    }
    [data-theme="dark"] #collections .data-table tbody tr:hover td {
        background: var(--bg-tertiary) !important;
    }
    [data-theme="dark"] #collections .data-table tbody tr:hover .col-keywords {
        background: transparent !important;
    }
    [data-theme="dark"] #collections .data-table tbody tr:hover .col-keywords .keyword-tags-table {
        background: transparent !important;
    }
    [data-theme="dark"] #collections .data-table tbody tr:hover .col-keywords .keyword-tag {
        background: var(--bg-tertiary) !important;
    }
    [data-theme="dark"] #collections .data-table tbody tr:hover .col-keywords .keyword-tag-collections {
        background: #064e3b !important;
    }
    [data-theme="dark"] #collections .data-table tbody tr:hover .col-keywords .keyword-tag-collections.conflict {
        background: #7f1d1d !important;
    }
    /* Dark Mode - Collections Keywords Column */
    [data-theme="dark"] #collections .col-keywords {
        color: var(--text-primary);
    }
    [data-theme="dark"] #collections .keyword-tags-container {
        background: transparent;
    }
    [data-theme="dark"] #collections .keyword-tag {
        background: var(--bg-tertiary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }
    [data-theme="dark"] #collections .keyword-tag-collections {
        background: #064e3b !important;
        color: #6ee7b7 !important;
        border-color: #10b981 !important;
    }
    [data-theme="dark"] #collections .keyword-tag-collections.conflict {
        background: #7f1d1d !important;
        color: #fca5a5 !important;
        border-color: #ef4444 !important;
    }
    /* Dark Mode - Collections Volume Column */
    [data-theme="dark"] #collections .col-volume .metric-value {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #collections .col-volume div {
        color: var(--text-primary) !important;
    }
    /* Dark Mode - Collections Avg Opportunity Column */
    [data-theme="dark"] #collections .col-avg-opportunity {
        color: var(--text-primary);
    }
    [data-theme="dark"] #collections .opportunity-score {
        color: var(--text-primary);
    }
    [data-theme="dark"] #collections .opportunity-score-new {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #collections .opportunity-tooltip {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
    }
    /* Opportunity squares maintain their original colors as they're semantic */
    /* Dark Mode - Collections Avg Difficulty Column */
    [data-theme="dark"] #collections .col-avg-difficulty {
        color: var(--text-primary);
    }
    [data-theme="dark"] #collections .difficulty-score {
        color: var(--text-primary);
    }
    [data-theme="dark"] #collections .difficulty-score > span:first-child {
        color: var(--text-primary) !important;
    }
    /* Keep difficulty color dots semantic - don't override their colors */
    [data-theme="dark"] #collections .difficulty-tooltip {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
    }
    /* Dark Mode - Collections SEO Column */
    [data-theme="dark"] #collections .col-seo {
        color: var(--text-primary);
    }
    [data-theme="dark"] #collections .seo-score-table {
        color: var(--text-primary);
    }
    /* Dark Mode - Collections Conflicts Column */
    [data-theme="dark"] #collections .col-conflicts {
        color: var(--text-primary);
    }
    [data-theme="dark"] #collections .conflict-indicator {
        color: var(--text-primary);
    }
    [data-theme="dark"] #collections .conflict-none {
        background: rgba(0, 208, 132, 0.2) !important;
        color: var(--success-color) !important;
        border: 1px solid var(--success-color);
    }
    [data-theme="dark"] #collections .conflict-warning {
        background: #7f1d1d !important;
        color: #fca5a5 !important;
        border: 1px solid #ef4444 !important;
    }
    [data-theme="dark"] #collections .conflict-error {
        background: #7f1d1d !important;
        color: #fca5a5 !important;
        border: 1px solid #ef4444 !important;
    }
    [data-theme="dark"] #collections .conflict-indicator-tooltip {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    /* Light Mode - Collections Action Buttons */
    #collections .data-table .btn.secondary {
        width: 42px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 6px 8px !important;
        min-height: auto !important;
        background: #f8fafc;
        color: #374151;
        border: 1px solid #d1d5db;
    }
    
    #collections .data-table .btn.secondary:hover {
        background: #f1f5f9;
        border-color: #cbd5e1;
    }
    
    #collections .data-table .btn.secondary svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }
    /* Dark Mode - Collections Action Buttons */
    [data-theme="dark"] #collections .data-table .btn.secondary {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
        width: 42px !important;
        height: 32px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 6px 8px !important;
        min-height: auto !important;
    }
    
    [data-theme="dark"] #collections .data-table .btn.secondary:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }
    /* Dark Mode - Collections Pagination */
    [data-theme="dark"] #collections .pagination-container {
        background: var(--bg-secondary) !important;
        border-top: 1px solid var(--border-color);
    }
    [data-theme="dark"] #collections .pagination-info {
        color: var(--text-primary);
    }
    [data-theme="dark"] #collections .pagination-container .btn {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }
    [data-theme="dark"] #collections .pagination-container .btn:hover {
        background: var(--bg-tertiary);
        border-color: var(--border-hover);
    }
    [data-theme="dark"] #collections .pagination-container .btn:disabled {
        background: var(--bg-primary);
        color: var(--text-muted);
        border-color: var(--border-color);
        opacity: 0.5;
    }
    [data-theme="dark"] #collections .per-page-selector select {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }
    [data-theme="dark"] #collections .per-page-selector select:focus {
        border-color: var(--border-hover);
        outline: none;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
    }
    [data-theme="dark"] #collections .per-page-selector label {
        color: var(--text-primary);
    }
    [data-theme="dark"] #collections .page-btn {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }
    [data-theme="dark"] #collections .page-btn:hover {
        background: var(--bg-tertiary);
        border-color: var(--border-hover);
    }
    [data-theme="dark"] #collections .page-btn.active {
        background: #000000;
        color: var(--text-primary);
        border-color: #000000;
    }
    [data-theme="dark"] #collections .page-btn:disabled {
        background: var(--bg-primary);
        color: var(--text-muted);
        border-color: var(--border-color);
        opacity: 0.5;
    }
    
    /* Dark Mode - Pages Section */
    [data-theme="dark"] #pages {
        background: var(--bg-primary);
        color: var(--text-primary);
    }
    [data-theme="dark"] #pages .section {
        background: var(--bg-primary);
    }
    /* Dark Mode - Pages Header and Controls */
    [data-theme="dark"] #pages .products-header {
        background: transparent;
        border-color: var(--border-color);
    }
    [data-theme="dark"] #pages .products-header h2 {
        color: var(--text-primary);
    }
    /* Dark Mode - Pages Controls */
    [data-theme="dark"] #pages .products-controls {
        background: transparent;
    }
    [data-theme="dark"] #pages .search-box input {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 2px solid var(--border-color);
        border-radius: 6px;
    }
    [data-theme="dark"] #pages .search-box input:focus {
        border-color: var(--brand-color);
        outline: none;
    }
    [data-theme="dark"] #pages .search-box input::placeholder {
        color: var(--text-muted) !important;
    }
    [data-theme="dark"] #pages .products-controls .search-box input::placeholder {
        color: var(--text-muted) !important;
    }
    [data-theme="dark"] #pages .bulk-actions select {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 2px solid var(--border-color);
    }
    [data-theme="dark"] #pages .bulk-actions select:focus {
        border-color: var(--border-hover);
        outline: none;
    }
    [data-theme="dark"] #pages .btn {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #pages .btn:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }
    /* Dark Mode - Pages Table */
    [data-theme="dark"] #pages .table-container {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
    }

    /* Pages table and pagination styling for cohesive appearance */
    #pages .table-container + .pagination-container {
        border: 1px solid var(--border-color);
        border-top: none;
        border-radius: 0 0 8px 8px;
        background: var(--bg-secondary);
        padding: 12px 16px;
        margin-top: 0;
    }

    /* Remove bottom radius from table container when pagination follows */
    #pages .table-container:has(+ .pagination-container) {
        border-radius: 8px 8px 0 0;
    }

    /* Dark mode - Pages table and pagination styling for cohesive appearance */
    [data-theme="dark"] #pages .table-container + .pagination-container {
        border: 1px solid var(--border-color);
        border-top: none;
        border-radius: 0 0 8px 8px;
        background: var(--bg-secondary);
    }

    /* Dark mode - Remove bottom radius from table container when pagination follows */
    [data-theme="dark"] #pages .table-container:has(+ .pagination-container) {
        border-radius: 8px 8px 0 0;
    }
    [data-theme="dark"] #pages .data-table {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border-color: var(--border-color);
    }
    [data-theme="dark"] #pages .data-table th {
        background: var(--bg-tertiary);
        color: var(--text-primary);
        border-color: var(--border-color);
        border-bottom: 2px solid var(--border-color);
    }
    [data-theme="dark"] #pages .data-table th:hover {
        background: var(--bg-primary);
    }
    [data-theme="dark"] #pages .data-table th.col-actions {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
        border-left: 1px solid var(--border-color);
    }
    [data-theme="dark"] #pages .data-table .col-actions {
        background: var(--bg-secondary);
        border-left: 1px solid var(--border-color);
    }
    [data-theme="dark"] #pages .data-table td {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border-bottom: 1px solid var(--border-color);
    }
    [data-theme="dark"] #pages .data-table tbody tr:hover {
        background: var(--bg-tertiary) !important;
    }
    [data-theme="dark"] #pages .data-table tbody tr:hover td {
        background: var(--bg-tertiary) !important;
    }
    [data-theme="dark"] #pages .data-table tbody tr:hover .col-keywords {
        background: transparent !important;
    }
    [data-theme="dark"] #pages .data-table tbody tr:hover .col-keywords .keyword-tags-table {
        background: transparent !important;
    }
    [data-theme="dark"] #pages .data-table tbody tr:hover .col-keywords .keyword-tag {
        background: var(--bg-tertiary) !important;
    }
    [data-theme="dark"] #pages .data-table tbody tr:hover .col-keywords .keyword-tag-pages {
        background: #581c87 !important;
    }
    [data-theme="dark"] #pages .data-table tbody tr:hover .col-keywords .keyword-tag-pages.conflict {
        background: #7f1d1d !important;
    }
    /* Dark Mode - Pages Keywords Column */
    [data-theme="dark"] #pages .col-keywords {
        color: var(--text-primary);
    }
    [data-theme="dark"] #pages .keyword-tags-container {
        background: transparent;
    }
    [data-theme="dark"] #pages .keyword-tag {
        background: var(--bg-tertiary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }
    [data-theme="dark"] #pages .keyword-tag-pages {
        background: #581c87 !important;
        color: #c4b5fd !important;
        border-color: #7c3aed !important;
    }
    [data-theme="dark"] #pages .keyword-tag-pages.conflict {
        background: #7f1d1d !important;
        color: #fca5a5 !important;
        border-color: #ef4444 !important;
    }
    /* Dark Mode - Pages Volume Column */
    [data-theme="dark"] #pages .col-volume .metric-value {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #pages .col-volume div {
        color: var(--text-primary) !important;
    }
    /* Dark Mode - Pages Avg Opportunity Column */
    [data-theme="dark"] #pages .col-avg-opportunity {
        color: var(--text-primary);
    }
    [data-theme="dark"] #pages .opportunity-score {
        color: var(--text-primary);
    }
    [data-theme="dark"] #pages .opportunity-score-new {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #pages .opportunity-tooltip {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
    }
    /* Opportunity squares maintain their original colors as they're semantic */
    /* Dark Mode - Pages Avg Difficulty Column */
    [data-theme="dark"] #pages .col-avg-difficulty {
        color: var(--text-primary);
    }
    [data-theme="dark"] #pages .difficulty-score {
        color: var(--text-primary);
    }
    [data-theme="dark"] #pages .difficulty-score > span:first-child {
        color: var(--text-primary) !important;
    }
    /* Keep difficulty color dots semantic - don't override their colors */
    [data-theme="dark"] #pages .difficulty-tooltip {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
    }
    /* Dark Mode - Pages SEO Column */
    [data-theme="dark"] #pages .col-seo {
        color: var(--text-primary);
    }
    [data-theme="dark"] #pages .seo-score-table {
        color: var(--text-primary);
    }
    /* Dark Mode - Pages Conflicts Column */
    [data-theme="dark"] #pages .col-conflicts {
        color: var(--text-primary);
    }
    [data-theme="dark"] #pages .conflict-indicator {
        color: var(--text-primary);
    }
    [data-theme="dark"] #pages .conflict-none {
        background: rgba(0, 208, 132, 0.2) !important;
        color: var(--success-color) !important;
        border: 1px solid var(--success-color);
    }
    [data-theme="dark"] #pages .conflict-warning {
        background: #7f1d1d !important;
        color: #fca5a5 !important;
        border: 1px solid #ef4444 !important;
    }
    [data-theme="dark"] #pages .conflict-error {
        background: #7f1d1d !important;
        color: #fca5a5 !important;
        border: 1px solid #ef4444 !important;
    }
    [data-theme="dark"] #pages .conflict-indicator-tooltip {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    /* Light Mode - Pages Action Buttons */
    #pages .data-table .btn.secondary {
        width: 42px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 6px 8px !important;
        min-height: auto !important;
        background: #f8fafc;
        color: #374151;
        border: 1px solid #d1d5db;
    }
    
    #pages .data-table .btn.secondary:hover {
        background: #f1f5f9;
        border-color: #cbd5e1;
    }
    
    #pages .data-table .btn.secondary svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }
    /* Dark Mode - Pages Action Buttons */
    [data-theme="dark"] #pages .data-table .btn.secondary {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
        width: 42px !important;
        height: 32px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 6px 8px !important;
        min-height: auto !important;
    }
    
    [data-theme="dark"] #pages .data-table .btn.secondary:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }
    /* Dark Mode - Pages Pagination */
    [data-theme="dark"] #pages .pagination-container {
        background: var(--bg-secondary) !important;
        border-top: 1px solid var(--border-color);
    }
    [data-theme="dark"] #pages .pagination-info {
        color: var(--text-primary);
    }
    [data-theme="dark"] #pages .pagination-container .btn {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }
    [data-theme="dark"] #pages .pagination-container .btn:hover {
        background: var(--bg-tertiary);
        border-color: var(--border-hover);
    }
    [data-theme="dark"] #pages .pagination-container .btn:disabled {
        background: var(--bg-primary);
        color: var(--text-muted);
        border-color: var(--border-color);
        opacity: 0.5;
    }
    [data-theme="dark"] #pages .per-page-selector select {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }
    [data-theme="dark"] #pages .per-page-selector select:focus {
        border-color: var(--border-hover);
        outline: none;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
    }
    [data-theme="dark"] #pages .per-page-selector label {
        color: var(--text-primary);
    }
    [data-theme="dark"] #pages .page-btn {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }
    [data-theme="dark"] #pages .page-btn:hover {
        background: var(--bg-tertiary);
        border-color: var(--border-hover);
    }
    [data-theme="dark"] #pages .page-btn.active {
        background: #000000;
        color: var(--text-primary);
        border-color: #000000;
    }
    [data-theme="dark"] #pages .page-btn:disabled {
        background: var(--bg-primary);
        color: var(--text-muted);
        border-color: var(--border-color);
        opacity: 0.5;
    }
    
    /* Dark Mode - Blog Posts Section */
    [data-theme="dark"] #blogposts {
        background: var(--bg-primary);
        color: var(--text-primary);
    }
    [data-theme="dark"] #blogposts .section {
        background: var(--bg-primary);
    }
    /* Dark Mode - Blog Posts Header and Controls */
    [data-theme="dark"] #blogposts .products-header {
        background: transparent;
        border-color: var(--border-color);
    }
    [data-theme="dark"] #blogposts .products-header h2 {
        color: var(--text-primary);
    }
    /* Dark Mode - Blog Posts Controls */
    [data-theme="dark"] #blogposts .products-controls {
        background: transparent;
    }
    [data-theme="dark"] #blogposts .search-box input {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 2px solid var(--border-color);
        border-radius: 6px;
    }
    [data-theme="dark"] #blogposts .search-box input:focus {
        border-color: var(--brand-color);
        outline: none;
    }
    [data-theme="dark"] #blogposts .search-box input::placeholder {
        color: var(--text-muted) !important;
    }
    [data-theme="dark"] #blogposts .products-controls .search-box input::placeholder {
        color: var(--text-muted) !important;
    }
    [data-theme="dark"] #blogposts .bulk-actions select {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 2px solid var(--border-color);
    }
    [data-theme="dark"] #blogposts .bulk-actions select:focus {
        border-color: var(--border-hover);
        outline: none;
    }
    [data-theme="dark"] #blogposts .btn {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #blogposts .btn:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }
    /* Dark Mode - Blog Posts Table */
    [data-theme="dark"] #blogposts .table-container {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
    }

    /* Blog posts table and pagination styling for cohesive appearance */
    #blogposts .table-container + .pagination-container {
        border: 1px solid var(--border-color);
        border-top: none;
        border-radius: 0 0 8px 8px;
        background: var(--bg-secondary);
        padding: 12px 16px;
        margin-top: 0;
    }

    /* Remove bottom radius from table container when pagination follows */
    #blogposts .table-container:has(+ .pagination-container) {
        border-radius: 8px 8px 0 0;
    }

    /* Dark mode - Blog posts table and pagination styling for cohesive appearance */
    [data-theme="dark"] #blogposts .table-container + .pagination-container {
        border: 1px solid var(--border-color);
        border-top: none;
        border-radius: 0 0 8px 8px;
        background: var(--bg-secondary);
    }

    /* Dark mode - Remove bottom radius from table container when pagination follows */
    [data-theme="dark"] #blogposts .table-container:has(+ .pagination-container) {
        border-radius: 8px 8px 0 0;
    }
    [data-theme="dark"] #blogposts .data-table {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border-color: var(--border-color);
    }
    [data-theme="dark"] #blogposts .data-table th {
        background: var(--bg-tertiary);
        color: var(--text-primary);
        border-color: var(--border-color);
        border-bottom: 2px solid var(--border-color);
    }
    [data-theme="dark"] #blogposts .data-table th:hover {
        background: var(--bg-primary);
    }
    [data-theme="dark"] #blogposts .data-table th.col-actions {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
        border-left: 1px solid var(--border-color);
    }
    [data-theme="dark"] #blogposts .data-table .col-actions {
        background: var(--bg-secondary);
        border-left: 1px solid var(--border-color);
    }
    [data-theme="dark"] #blogposts .data-table td {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border-bottom: 1px solid var(--border-color);
    }
    [data-theme="dark"] #blogposts .data-table tbody tr:hover {
        background: var(--bg-tertiary) !important;
    }
    [data-theme="dark"] #blogposts .data-table tbody tr:hover td {
        background: var(--bg-tertiary) !important;
    }
    [data-theme="dark"] #blogposts .data-table tbody tr:hover .col-keywords {
        background: transparent !important;
    }
    [data-theme="dark"] #blogposts .data-table tbody tr:hover .col-keywords .keyword-tags-table {
        background: transparent !important;
    }
    [data-theme="dark"] #blogposts .data-table tbody tr:hover .col-keywords .keyword-tag {
        background: var(--bg-tertiary) !important;
    }
    [data-theme="dark"] #blogposts .data-table tbody tr:hover .col-keywords .keyword-tag-blogposts {
        background: #0f3f3c !important;
    }
    [data-theme="dark"] #blogposts .data-table tbody tr:hover .col-keywords .keyword-tag-blogposts.conflict {
        background: #7f1d1d !important;
    }
    /* Dark Mode - Blog Posts Keywords Column */
    [data-theme="dark"] #blogposts .col-keywords {
        color: var(--text-primary);
    }
    [data-theme="dark"] #blogposts .keyword-tags-container {
        background: transparent;
    }
    [data-theme="dark"] #blogposts .keyword-tag {
        background: var(--bg-tertiary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }
    [data-theme="dark"] #blogposts .keyword-tag-blogposts {
        background: #0f3f3c !important;
        color: #7dd3fc !important;
        border-color: #0891b2 !important;
    }
    [data-theme="dark"] #blogposts .keyword-tag-blogposts.conflict {
        background: #7f1d1d !important;
        color: #fca5a5 !important;
        border-color: #ef4444 !important;
    }
    /* Dark Mode - Blog Posts Volume Column */
    [data-theme="dark"] #blogposts .col-volume .metric-value {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #blogposts .col-volume div {
        color: var(--text-primary) !important;
    }
    /* Dark Mode - Blog Posts Avg Opportunity Column */
    [data-theme="dark"] #blogposts .col-avg-opportunity {
        color: var(--text-primary);
    }
    [data-theme="dark"] #blogposts .opportunity-score {
        color: var(--text-primary);
    }
    [data-theme="dark"] #blogposts .opportunity-score-new {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #blogposts .opportunity-tooltip {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
    }
    /* Opportunity squares maintain their original colors as they're semantic */
    /* Dark Mode - Blog Posts Avg Difficulty Column */
    [data-theme="dark"] #blogposts .col-avg-difficulty {
        color: var(--text-primary);
    }
    [data-theme="dark"] #blogposts .difficulty-score {
        color: var(--text-primary);
    }
    [data-theme="dark"] #blogposts .difficulty-score > span:first-child {
        color: var(--text-primary) !important;
    }
    /* Keep difficulty color dots semantic - don't override their colors */
    [data-theme="dark"] #blogposts .difficulty-tooltip {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
    }
    /* Dark Mode - Blog Posts SEO Column */
    [data-theme="dark"] #blogposts .col-seo {
        color: var(--text-primary);
    }
    [data-theme="dark"] #blogposts .seo-score-table {
        color: var(--text-primary);
    }
    /* Dark Mode - Blog Posts Conflicts Column */
    [data-theme="dark"] #blogposts .col-conflicts {
        color: var(--text-primary);
    }
    [data-theme="dark"] #blogposts .conflict-indicator {
        color: var(--text-primary);
    }
    [data-theme="dark"] #blogposts .conflict-none {
        background: rgba(0, 208, 132, 0.2) !important;
        color: var(--success-color) !important;
        border: 1px solid var(--success-color);
    }
    [data-theme="dark"] #blogposts .conflict-warning {
        background: #7f1d1d !important;
        color: #fca5a5 !important;
        border: 1px solid #ef4444 !important;
    }
    [data-theme="dark"] #blogposts .conflict-error {
        background: #7f1d1d !important;
        color: #fca5a5 !important;
        border: 1px solid #ef4444 !important;
    }
    [data-theme="dark"] #blogposts .conflict-indicator-tooltip {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    /* Light Mode - Blog Posts Action Buttons */
    #blogposts .data-table .btn.secondary {
        width: 42px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 6px 8px !important;
        min-height: auto !important;
        background: #f8fafc;
        color: #374151;
        border: 1px solid #d1d5db;
    }
    
    #blogposts .data-table .btn.secondary:hover {
        background: #f1f5f9;
        border-color: #cbd5e1;
    }
    
    #blogposts .data-table .btn.secondary svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }
    /* Dark Mode - Blog Posts Action Buttons */
    [data-theme="dark"] #blogposts .data-table .btn.secondary {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
        width: 42px !important;
        height: 32px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 6px 8px !important;
        min-height: auto !important;
    }
    
    [data-theme="dark"] #blogposts .data-table .btn.secondary:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }
    /* Dark Mode - Blog Posts Pagination */
    [data-theme="dark"] #blogposts .pagination-container {
        background: var(--bg-secondary) !important;
        border-top: 1px solid var(--border-color);
    }
    [data-theme="dark"] #blogposts .pagination-info {
        color: var(--text-primary);
    }
    [data-theme="dark"] #blogposts .pagination-container .btn {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }
    [data-theme="dark"] #blogposts .pagination-container .btn:hover {
        background: var(--bg-tertiary);
        border-color: var(--border-hover);
    }
    [data-theme="dark"] #blogposts .pagination-container .btn:disabled {
        background: var(--bg-primary);
        color: var(--text-muted);
        border-color: var(--border-color);
        opacity: 0.5;
    }
    [data-theme="dark"] #blogposts .per-page-selector select {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }
    [data-theme="dark"] #blogposts .per-page-selector select:focus {
        border-color: var(--border-hover);
        outline: none;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
    }
    [data-theme="dark"] #blogposts .per-page-selector label {
        color: var(--text-primary);
    }
    [data-theme="dark"] #blogposts .page-btn {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }
    [data-theme="dark"] #blogposts .page-btn:hover {
        background: var(--bg-tertiary);
        border-color: var(--border-hover);
    }
    [data-theme="dark"] #blogposts .page-btn.active {
        background: #000000;
        color: var(--text-primary);
        border-color: #000000;
    }
    [data-theme="dark"] #blogposts .page-btn:disabled {
        background: var(--bg-primary);
        color: var(--text-muted);
        border-color: var(--border-color);
        opacity: 0.5;
    }
    
    /* Dark Mode - Navigation Menus Section */
    [data-theme="dark"] #menus {
        background: var(--bg-primary);
        color: var(--text-primary);
    }
    [data-theme="dark"] #menus .section {
        background: var(--bg-primary);
    }
    /* Dark Mode - Menus Header and Controls */
    [data-theme="dark"] #menus .menus-header {
        background: transparent;
        border-color: var(--border-color);
    }
    [data-theme="dark"] #menus .menus-header h2 {
        color: var(--text-primary);
    }
    [data-theme="dark"] #menus .menus-controls {
        background: transparent;
    }
    [data-theme="dark"] #menus .menus-controls label {
        color: var(--text-primary);
    }
    [data-theme="dark"] #menus .menus-controls select {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 2px solid var(--border-color);
    }
    [data-theme="dark"] #menus .menus-controls select:focus {
        border-color: var(--border-hover);
        outline: none;
    }
    [data-theme="dark"] #menus .menu-action-buttons .btn {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #menus .menu-action-buttons .btn:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }
    /* Exception - Keep Shopify sync button with original gradient */
    [data-theme="dark"] #menus button[data-menu-shopify-sync="true"] {
        background: linear-gradient(135deg, #64943e 0%, #95bf47 100%) !important;
        color: white !important;
        border: none !important;
        padding: 12px 20px !important;
        border-radius: 6px !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        display: flex !important;
        align-items: center !important;
    }
    [data-theme="dark"] #menus button[data-menu-shopify-sync="true"]:hover {
        background: linear-gradient(135deg, #527a33 0%, #7da43b 100%) !important;
    }
    /* Dark Mode - Menu Builder */
    [data-theme="dark"] #menus #menuBuilder {
        background: transparent;
        border: none;
        border-radius: 0;
    }
    [data-theme="dark"] #menus .menu-empty-state {
        background: var(--bg-secondary);
        color: var(--text-primary);
    }
    [data-theme="dark"] #menus .menu-empty-state h3 {
        color: var(--text-primary);
    }
    [data-theme="dark"] #menus .menu-empty-state p {
        color: var(--text-muted);
    }
    /* Dark Mode - Menu Items */
    [data-theme="dark"] #menus .menu-item {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #menus .menu-item:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }
    [data-theme="dark"] #menus .menu-item-title {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #menus .menu-item-meta {
        color: var(--text-muted) !important;
    }
    [data-theme="dark"] #menus .menu-item-actions button {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #menus .menu-item-actions button:hover {
        background: var(--bg-primary) !important;
        border-color: var(--border-hover) !important;
    }
    [data-theme="dark"] #menus .drag-handle {
        color: var(--text-muted) !important;
    }
    [data-theme="dark"] #menus .collapse-icon {
        color: var(--text-muted) !important;
    }
    
    /* Dark Mode - Link Type Badges (Pills) */
    [data-theme="dark"] #menus .link-type-product {
        background: #1e3a8a !important;
        color: #93c5fd !important;
        border: 1px solid #3b82f6 !important;
    }
    [data-theme="dark"] #menus .link-type-collection {
        background: #064e3b !important;
        color: #6ee7b7 !important;
        border: 1px solid #10b981 !important;
    }
    [data-theme="dark"] #menus .link-type-page {
        background: #581c87 !important;
        color: #c4b5fd !important;
        border: 1px solid #7c3aed !important;
    }
    [data-theme="dark"] #menus .link-type-blogpost {
        background: #0f3f3c !important;
        color: #7dd3fc !important;
        border: 1px solid #0891b2 !important;
    }
    [data-theme="dark"] #menus .link-type-blog {
        background: #581c87 !important;
        color: #c4b5fd !important;
        border: 1px solid #7c3aed !important;
    }
    [data-theme="dark"] #menus .link-type-external {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    
    /* Dark Mode - Menu Items Container */
    [data-theme="dark"] #menus #menuItemsContainer {
        background: transparent !important;
    }
    
    /* Dark Mode - Menu Items Container Buttons */
    [data-theme="dark"] #menus #menuItemsContainer .btn {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #menus #menuItemsContainer .btn:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }
    [data-theme="dark"] #menus #menuItemsContainer .btn.secondary {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #menus #menuItemsContainer .btn.secondary:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }
    
    /* Dark Mode - New Menu Modal */
    [data-theme="dark"] #newMenuModalOverlay .product-modal {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #newMenuModalOverlay .product-modal-header {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #newMenuModalOverlay .product-modal-body {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #newMenuModalOverlay label {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #newMenuModalOverlay input {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #newMenuModalOverlay .product-modal-header .modal-close-btn {
        color: var(--text-primary) !important;
        background: transparent !important;
        background-color: transparent !important;
        border: none !important;
    }
    [data-theme="dark"] #newMenuModalOverlay .product-modal-header .modal-close-btn:hover {
        background: var(--bg-tertiary) !important;
        background-color: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }
    /* Dark Mode - Menu Settings Modal */
    [data-theme="dark"] #menuSettingsModalOverlay .product-modal {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #menuSettingsModalOverlay .product-modal-header {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #menuSettingsModalOverlay .product-modal-body {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #menuSettingsModalOverlay label {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #menuSettingsModalOverlay input {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #menuSettingsModalOverlay .product-modal-header .modal-close-btn {
        color: var(--text-primary) !important;
        background: transparent !important;
        background-color: transparent !important;
        border: none !important;
    }
    [data-theme="dark"] #menuSettingsModalOverlay .product-modal-header .modal-close-btn:hover {
        background: var(--bg-tertiary) !important;
        background-color: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }
    
    /* Dark Mode - Add Menu Item Modal */
    [data-theme="dark"] #menuItemModalOverlay .product-modal {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #menuItemModalOverlay .product-modal-header {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #menuItemModalOverlay .product-modal-body {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #menuItemModalOverlay label {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #menuItemModalOverlay input,
    [data-theme="dark"] #menuItemModalOverlay select {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #menuItemModalOverlay .product-modal-header .modal-close-btn {
        color: var(--text-primary) !important;
        background: transparent !important;
        background-color: transparent !important;
        border: none !important;
    }
    [data-theme="dark"] #menuItemModalOverlay .product-modal-header .modal-close-btn:hover {
        background: var(--bg-tertiary) !important;
        background-color: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }

    /* Dark Mode - Content Modules Section */
    [data-theme="dark"] #content-modules {
        background: var(--bg-primary);
        color: var(--text-primary);
    }

    [data-theme="dark"] #content-modules .section {
        background: var(--bg-primary);
    }

    [data-theme="dark"] #content-modules h2 {
        color: var(--text-primary);
    }

    /* Content Modules - Search input and filter dropdown */
    [data-theme="dark"] #content-modules .search-box input {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 2px solid var(--border-color);
        border-radius: 6px;
    }

    [data-theme="dark"] #content-modules .search-box input:focus {
        border-color: var(--brand-color);
        outline: none;
    }

    [data-theme="dark"] #content-modules #moduleTagFilter {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #content-modules #moduleTagFilter:focus {
        border-color: var(--border-hover) !important;
        outline: none !important;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3) !important;
    }

    [data-theme="dark"] #content-modules #moduleSearch::placeholder {
        color: var(--text-muted) !important;
    }

    /* Content Modules - Search magnifying glass icon */
    [data-theme="dark"] #content-modules .search-box::before {
        color: var(--text-muted) !important;
    }

    /* Content Modules - Buttons */
    [data-theme="dark"] #content-modules .btn {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #content-modules .btn:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }

    /* Dark Mode - Content Modules Action Buttons */
    [data-theme="dark"] #content-modules .data-table .btn.secondary {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
        width: 42px !important;
        height: 32px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 6px 8px !important;
        min-height: auto !important;
    }

    [data-theme="dark"] #content-modules .data-table .btn.secondary:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }

    /* Content Modules - Table - Force override all conflicting styles */
    [data-theme="dark"] #content-modules .data-table,
    [data-theme="dark"] #content-modules #contentModulesTable,
    [data-theme="dark"] #contentModulesTable {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }
    
    [data-theme="dark"] #content-modules .data-table th,
    [data-theme="dark"] #content-modules #contentModulesTable th,
    [data-theme="dark"] #contentModulesTable th {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
        border-bottom: 2px solid var(--border-color) !important;
    }
    
    [data-theme="dark"] #content-modules .data-table th:hover,
    [data-theme="dark"] #content-modules #contentModulesTable th:hover,
    [data-theme="dark"] #contentModulesTable th:hover {
        background: var(--bg-primary) !important;
    }
    
    [data-theme="dark"] #content-modules .data-table th.col-actions,
    [data-theme="dark"] #content-modules #contentModulesTable th.col-actions,
    [data-theme="dark"] #contentModulesTable th.col-actions {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
        border-left: 1px solid var(--border-color) !important;
    }
    
    [data-theme="dark"] #content-modules .data-table .col-actions,
    [data-theme="dark"] #content-modules #contentModulesTable .col-actions,
    [data-theme="dark"] #contentModulesTable .col-actions {
        background: var(--bg-secondary) !important;
        border-left: 1px solid var(--border-color) !important;
    }
    
    [data-theme="dark"] #content-modules .data-table td,
    [data-theme="dark"] #content-modules #contentModulesTable td,
    [data-theme="dark"] #contentModulesTable td {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    
    [data-theme="dark"] #content-modules .data-table tbody tr:hover,
    [data-theme="dark"] #content-modules #contentModulesTable tbody tr:hover,
    [data-theme="dark"] #contentModulesTable tbody tr:hover {
        background: var(--bg-tertiary) !important;
    }
    
    [data-theme="dark"] #content-modules .data-table tbody tr:hover td,
    [data-theme="dark"] #content-modules #contentModulesTable tbody tr:hover td,
    [data-theme="dark"] #contentModulesTable tbody tr:hover td {
        background: var(--bg-tertiary) !important;
    }

    /* Content Modules - Module tags */
    [data-theme="dark"] #content-modules .module-tag {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    /* Content Modules - Table tags (override inline styles) */
    [data-theme="dark"] #content-modules span[style*="background: #e5e7eb"] {
        background: #1e40af !important;
        color: #93c5fd !important;
        border: 1px solid #3b82f6;
    }

    /* Content Modules Modal - Dark Mode */
    [data-theme="dark"] #moduleModal .product-modal {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #moduleModal .product-modal-header {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border-bottom: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #moduleModal .product-modal-body {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
    }

    /* Content Modules Modal - Close button (light mode) */
    #moduleModal .product-modal-header button[onclick="hideModuleModal()"] {
        background: none !important;
        border: none !important;
        font-size: 24px !important;
        cursor: pointer !important;
        color: #6b7280 !important;
        padding: 5px !important;
        border-radius: 4px !important;
    }
    
    #moduleModal .product-modal-header button[onclick="hideModuleModal()"]:hover {
        background: #f3f4f6 !important;
        color: #374151 !important;
    }
    
    /* Content Modules Modal - Close button (dark mode) */
    [data-theme="dark"] #moduleModal .product-modal-header button[onclick="hideModuleModal()"] {
        color: var(--text-primary) !important;
        background: transparent !important;
        background-color: transparent !important;
        border: none !important;
    }

    [data-theme="dark"] #moduleModal .product-modal-header button[onclick="hideModuleModal()"]:hover {
        background: var(--bg-tertiary) !important;
        background-color: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }

    /* Content Modules Modal - Form inputs */
    [data-theme="dark"] #moduleModal input,
    [data-theme="dark"] #moduleModal textarea,
    [data-theme="dark"] #moduleModal select {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #moduleModal input:focus,
    [data-theme="dark"] #moduleModal textarea:focus,
    [data-theme="dark"] #moduleModal select:focus {
        border-color: var(--border-hover) !important;
        outline: none !important;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3) !important;
    }

    [data-theme="dark"] #moduleModal input::placeholder,
    [data-theme="dark"] #moduleModal textarea::placeholder {
        color: var(--text-muted) !important;
    }

    /* Content Modules Modal - Labels */
    [data-theme="dark"] #moduleModal label {
        color: var(--text-primary) !important;
    }

    /* Content Modules Modal - Buttons */
    [data-theme="dark"] #moduleModal .btn {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #moduleModal .btn:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }

    [data-theme="dark"] #moduleModal .btn.secondary {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #moduleModal .btn.secondary:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }

    /* Dark Mode - Refresh Orders Button (match Apply button styling from invoices) */
    [data-theme="dark"] #orders button[onclick="loadShopifyOrders()"] {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #orders button[onclick="loadShopifyOrders()"]:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }

    /* Dark Mode - Refresh Orders Button */
    [data-theme="dark"] #orders button[onclick="refreshData()"] {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #orders button[onclick="refreshData()"]:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }

    /* Dark Mode - Create Transfer Button (match refresh/apply button styling) */
    [data-theme="dark"] #warehouse-transfers .products-controls .btn {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #warehouse-transfers .products-controls .btn:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }

    /* Reduce button padding for icon-only buttons in cost management */
    #costs .data-table .btn {
        padding: 6px 8px !important;
        min-height: auto !important;
    }

    /* Light Mode - Orders Action Buttons */
    #orders .data-table .btn.secondary {
        width: 42px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 6px 8px !important;
        min-height: auto !important;
        background: #f8fafc;
        color: #374151;
        border: 1px solid #d1d5db;
    }
    
    #orders .data-table .btn.secondary:hover {
        background: #f1f5f9;
        border-color: #cbd5e1;
    }
    
    #orders .data-table .btn.secondary svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

    /* General button padding for all buttons in orders */
    #orders .data-table .btn {
        padding: 6px 8px !important;
        min-height: auto !important;
    }

    /* Reduce button padding for icon-only buttons in warehouse transfers (match other sections) */
    #warehouse-transfers .data-table .btn {
        padding: 6px 8px !important;
        min-height: auto !important;
    }

    /* Dark Mode - Warehouse Transfers Section */
    [data-theme="dark"] #warehouse-transfers {
        background: var(--bg-primary);
        color: var(--text-primary);
    }

    [data-theme="dark"] #warehouse-transfers .section {
        background: var(--bg-primary);
    }

    /* Dark Mode - Warehouse Transfers Header and Controls */
    [data-theme="dark"] #warehouse-transfers .products-header {
        background: transparent;
        border-color: var(--border-color);
    }

    [data-theme="dark"] #warehouse-transfers .products-header h2 {
        color: var(--text-primary);
    }

    /* Dark Mode - Warehouse Transfers Table */
    [data-theme="dark"] #warehouse-transfers .table-container {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
    }

    [data-theme="dark"] #warehouse-transfers .data-table {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border-color: var(--border-color);
    }

    [data-theme="dark"] #warehouse-transfers .data-table th {
        background: var(--bg-tertiary);
        color: var(--text-primary);
        border-color: var(--border-color);
        border-bottom: 2px solid var(--border-color);
    }

    [data-theme="dark"] #warehouse-transfers .data-table th:hover {
        background: var(--bg-primary);
    }

    [data-theme="dark"] #warehouse-transfers .data-table th.col-actions {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }

    /* Remove bright white border from warehouse transfers actions column */
    #warehouse-transfers .data-table .col-actions {
        border-left: none !important;
    }

    [data-theme="dark"] #warehouse-transfers .data-table .col-actions {
        background: var(--bg-secondary);
        border-left: none !important;
    }

    [data-theme="dark"] #warehouse-transfers .data-table td {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border-bottom: 1px solid var(--border-color);
    }

    [data-theme="dark"] #warehouse-transfers .data-table tr:hover {
        background: var(--bg-tertiary) !important;
    }

    /* Dark Mode - Warehouse Transfers Empty State */
    [data-theme="dark"] #warehouse-transfers .data-table td[colspan] {
        color: var(--text-muted) !important;
    }

    /* Dark Mode - Warehouse Transfers Buttons */
    [data-theme="dark"] #warehouse-transfers .btn {
        background: var(--brand-color);
        color: var(--text-primary);
        border: 1px solid var(--brand-color);
    }

    [data-theme="dark"] #warehouse-transfers .btn:hover {
        background: var(--brand-hover);
        border-color: var(--brand-hover);
    }

    /* Dark Mode - Warehouse Transfers Action Buttons */
    [data-theme="dark"] #warehouse-transfers .data-table .btn.secondary {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
        width: 42px !important;
        height: 32px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 6px 8px !important;
        min-height: auto !important;
    }

    [data-theme="dark"] #warehouse-transfers .data-table .btn.secondary:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }

    /* Match cost management button padding for warehouse transfers */
    #warehouse-transfers .data-table .btn {
        padding: 6px 8px !important;
        min-height: auto !important;
    }
    
    /* Modern Settings Design */
    .settings-container {
        max-width: 1000px;
        margin: 0 auto;
    }

    .settings-header {
        text-align: center;
        margin-bottom: 32px;
        padding: 32px;
        background: white;
        border-radius: 16px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        border: 1px solid #e2e8f0;
    }

    .settings-header h1 {
        font-size: 32px;
        color: #1f2937;
        margin-bottom: 8px;
        background: linear-gradient(135deg, #3b82f6, #1d4ed8);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .settings-header p {
        color: #6b7280;
        font-size: 16px;
    }

    .settings-sections {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .settings-section {
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        overflow: hidden;
        transition: all 0.3s ease;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        margin-bottom: 24px;
    }

    .settings-section:hover {
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        border-color: #3b82f6;
    }

    .settings-section-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 24px 28px;
        cursor: pointer;
        background: #fafbfc;
        border-bottom: 1px solid #e2e8f0;
        transition: all 0.2s ease;
        user-select: none;
    }

    .settings-section-header:hover {
        background: #f1f5f9;
    }

    .settings-section-header.active {
        background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
        border-bottom-color: #3b82f6;
    }

    .section-title-area {
        display: flex;
        align-items: center;
        gap: 16px;
        flex: 1;
    }

    .section-icon {
        width: 48px;
        height: 48px;
        background: linear-gradient(135deg, #3b82f6, #1d4ed8);
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 16px;
        font-weight: bold;
        box-shadow: 0 4px 8px rgba(59, 130, 246, 0.2);
    }

    .section-title-text h3 {
        font-size: 20px;
        font-weight: 600;
        color: #1f2937;
        margin-bottom: 4px;
    }

    .section-subtitle {
        color: #6b7280;
        font-size: 14px;
        line-height: 1.4;
    }

    .section-meta {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .section-badge {
        font-size: 11px;
        padding: 6px 12px;
        border-radius: 12px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .section-badge.system {
        background: #dcfce7;
        color: #166534;
    }

    .section-badge.costs {
        background: #fef3c7;
        color: #92400e;
    }

    .section-badge.standard {
        background: #e0e7ff;
        color: #3730a3;
    }

    .section-badge.changelog {
        background: #f3e8ff;
        color: #6b21a8;
    }

    .section-count {
        background: #f3f4f6;
        color: #6b7280;
        font-size: 12px;
        padding: 6px 10px;
        border-radius: 12px;
        font-weight: 500;
    }

    .settings-section .section-chevron {
        font-size: 16px;
        color: #6b7280;
        transition: transform 0.3s ease;
        margin-left: 8px;
    }

    .settings-section .section-chevron.expanded {
        transform: rotate(180deg);
    }

    .settings-section-content {
        padding: 0;
        background: white;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease, padding 0.3s ease;
    }

    .settings-section.expanded .settings-section-content {
        max-height: 1200px;
        padding: 32px;
        display: block !important;
    }

    /* System Actions Styles */
    .system-actions-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
        margin-bottom: 28px;
    }

    .action-card {
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
        border: 2px solid #e2e8f0;
        border-radius: 12px;
        padding: 24px;
        cursor: pointer;
        transition: all 0.3s ease;
        text-align: center;
        position: relative;
        overflow: hidden;
    }

    .action-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, #3b82f6, #1d4ed8);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .action-card:hover::before {
        transform: translateX(0);
    }

    .action-card:hover {
        border-color: #3b82f6;
        transform: translateY(-4px);
        box-shadow: 0 12px 28px rgba(59, 130, 246, 0.15);
    }

    .action-card.primary {
        background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
        color: white;
        border-color: #1d4ed8;
    }

    .action-card h4 {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 8px;
    }

    .action-card p {
        font-size: 14px;
        opacity: 0.8;
    }

    /* Cost Management Styles */
    .cost-overview {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
        margin-bottom: 32px;
        padding: 24px;
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
        border-radius: 12px;
        border: 1px solid #e2e8f0;
    }

    .cost-stat {
        text-align: center;
    }

    .cost-stat-value {
        font-size: 24px;
        font-weight: 700;
        color: #1f2937;
        margin-bottom: 4px;
    }

    .cost-stat-label {
        font-size: 12px;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .cost-categories {
        display: grid;
        gap: 24px;
    }

    .cost-category {
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        overflow: hidden;
    }

    .cost-category-header {
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
        padding: 20px 24px;
        border-bottom: 1px solid #e2e8f0;
    }

    .cost-category-title {
        font-size: 18px;
        font-weight: 600;
        color: #1f2937;
        margin-bottom: 4px;
    }

    .cost-category-subtitle {
        font-size: 14px;
        color: #6b7280;
    }

    .cost-category-content {
        padding: 24px;
    }

    .material-item {
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        margin-bottom: 16px;
        overflow: hidden;
        transition: all 0.2s ease;
    }

    .material-item:hover {
        border-color: #3b82f6;
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
    }

    .material-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        background: #fafbfc;
        border-bottom: 1px solid #e2e8f0;
    }

    .material-name {
        font-size: 16px;
        font-weight: 500;
        color: #1f2937;
    }

    .material-rate {
        font-size: 18px;
        font-weight: 600;
        color: #3b82f6;
    }

    .period-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        border-bottom: none;
        transition: background 0.2s ease;
    }

    .period-item:hover {
        background: #f8fafc;
    }

    .period-item:last-child {
        border-bottom: none;
    }

    .period-details {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .period-rate {
        font-size: 16px;
        font-weight: 600;
        color: #1f2937;
    }

    .period-dates {
        font-size: 13px;
        color: #6b7280;
    }

    .period-actions {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .status-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 6px 12px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .status-active {
        background: #dcfce7;
        color: #166534;
        border: 1px solid #22c55e;
    }

    .status-indicator {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: currentColor;
    }

    .btn-edit {
        background: #f3f4f6;
        color: #374151;
        border: 1px solid #d1d5db;
        padding: 6px 12px;
        border-radius: 6px;
        font-size: 12px;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .btn-edit:hover {
        background: #e5e7eb;
        border-color: #9ca3af;
    }

    .add-period-section {
        padding: 16px 20px;
        background: #fafbfc;
        border-top: 1px solid #e2e8f0;
        text-align: center;
    }

    .btn-add {
        background: #3b82f6;
        color: white;
        border: none;
        padding: 10px 20px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .btn-add:hover {
        background: #2563eb;
        transform: translateY(-1px);
    }

    .maintenance-info {
        background: #fef7e7;
        border: 1px solid #f59e0b;
        border-radius: 8px;
        padding: 20px;
        margin-top: 24px;
    }

    .maintenance-info h4 {
        color: #92400e;
        margin-bottom: 12px;
        font-size: 16px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .maintenance-info ul {
        color: #78350f;
        font-size: 14px;
        line-height: 1.6;
        margin-left: 20px;
    }

    .maintenance-info li {
        margin-bottom: 4px;
    }

    .maintenance-info li strong {
        color: #92400e;
    }

    /* Standard Products Styles */
    .standard-products-manager {
        margin-bottom: 20px;
    }

    .standard-products-input {
        display: flex;
        gap: 10px;
        margin-bottom: 15px;
    }

    .standard-products-input input {
        flex: 1;
        padding: 8px 12px;
        border: 2px solid #e2e8f0;
        border-radius: 6px;
    }

    .standard-products-list {
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        padding: 10px;
        min-height: 100px;
        background: #f9fafb;
    }

    .standard-product-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        background: var(--bg-primary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        margin-bottom: 8px;
        transition: all 0.2s ease;
    }

    .standard-product-item:hover {
        border-color: var(--accent-color);
        box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.1);
    }

    .sku-info {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .sku-code {
        font-weight: 600;
        font-size: 14px;
        color: var(--text-primary);
        font-family: 'JetBrains Mono', monospace;
    }

    .sku-label {
        font-size: 12px;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .remove-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        background: none;
        border: 1px solid transparent;
        border-radius: 6px;
        cursor: pointer;
        color: var(--text-secondary);
        transition: all 0.2s ease;
    }

    .remove-btn:hover {
        background: var(--danger-light);
        border-color: var(--danger-color);
        color: var(--danger-color);
    }

    /* Changelog Styles */
    .changelog-container {
        max-height: 600px;
        overflow-y: auto;
        margin-top: 15px;
    }

    .changelog-entry {
        margin-bottom: 24px;
        padding: 16px;
        background: #f8fafc;
        border-left: 4px solid #006d6a;
        border-radius: 6px;
    }

    .changelog-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
    }

    .changelog-header h4 {
        margin: 0;
        color: #006d6a;
        font-size: 16px;
        font-weight: 600;
    }

    .changelog-date {
        margin-bottom: 8px;
    }

    .changelog-date small {
        color: #6b7280;
        font-size: 12px;
    }

    .changelog-content ul {
        margin: 0;
        padding-left: 16px;
        color: #4b5563;
        font-size: 14px;
        line-height: 1.5;
    }

    .changelog-content li {
        margin-bottom: 4px;
    }

    @media (max-width: 768px) {
        .cost-overview {
            grid-template-columns: 1fr;
        }

        .system-actions-grid {
            grid-template-columns: 1fr;
        }
    }

    /* Dark Mode - Modern Settings Design */
    [data-theme="dark"] .settings-header {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }

    [data-theme="dark"] .settings-header h1 {
        color: var(--text-primary);
    }

    [data-theme="dark"] .settings-header p {
        color: var(--text-muted);
    }

    [data-theme="dark"] .settings-section {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }

    [data-theme="dark"] .settings-section:hover {
        border-color: var(--brand-color);
    }

    [data-theme="dark"] .settings-section-header {
        background: var(--bg-primary);
        border-color: var(--border-color);
    }

    [data-theme="dark"] .settings-section-header:hover {
        background: var(--bg-tertiary);
    }

    [data-theme="dark"] .settings-section-header.active {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
        border-bottom-color: var(--brand-color);
    }

    [data-theme="dark"] .section-title-text h3 {
        color: var(--text-primary);
    }

    [data-theme="dark"] .section-subtitle {
        color: var(--text-muted);
    }

    [data-theme="dark"] .section-count {
        background: var(--bg-tertiary);
        color: var(--text-muted);
    }

    [data-theme="dark"] .menu-section .section-chevron {
        color: var(--text-muted);
    }

    [data-theme="dark"] .settings-section .section-chevron {
        color: var(--text-secondary);
    }

    [data-theme="dark"] .settings-section-content {
        background: var(--bg-secondary);
    }

    [data-theme="dark"] .settings-section h2 {
        color: var(--text-primary);
    }

    [data-theme="dark"] .settings-section p {
        color: var(--text-secondary);
    }

    [data-theme="dark"] .settings-section h3 {
        color: var(--text-primary);
    }

    [data-theme="dark"] .settings-section h4 {
        color: var(--text-primary);
    }

    [data-theme="dark"] .stat-label {
        color: var(--text-secondary);
    }

    [data-theme="dark"] .stat-value {
        color: var(--text-primary);
    }

    [data-theme="dark"] .expand-icon {
        color: var(--text-secondary);
    }

    /* Dark mode for SEO expandable content areas */
    [data-theme="dark"] .action-link {
        color: #60a5fa !important;
    }

    [data-theme="dark"] .action-link:hover {
        color: #93c5fd !important;
    }

    [data-theme="dark"] .expandable-content {
        background: var(--bg-secondary) !important;
        border: 1px solid #374151 !important;
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] .close-link {
        color: #9ca3af !important;
    }

    [data-theme="dark"] .close-link:hover {
        color: #d1d5db !important;
    }

    [data-theme="dark"] .keyword-location {
        background: #451a03 !important;
        border-left: 3px solid #92400e !important;
        color: #fdba74 !important;
    }

    [data-theme="dark"] .keyword-suggestion {
        color: #34d399 !important;
    }

    [data-theme="dark"] .complex-sentence {
        background: #451a03 !important;
        border-left: 3px solid #92400e !important;
        color: #fdba74 !important;
    }

    [data-theme="dark"] .suggestion-text {
        color: #34d399 !important;
    }

    [data-theme="dark"] .header-good {
        background: #064e3b !important;
        border-left: 3px solid #059669 !important;
        color: #6ee7b7 !important;
    }

    [data-theme="dark"] .header-suggestion {
        background: #451a03 !important;
        border-left: 3px solid #92400e !important;
        color: #fdba74 !important;
    }

    [data-theme="dark"] .missing-alt-item {
        background: #450a0a !important;
        border-left: 3px solid #dc2626 !important;
        color: #fca5a5 !important;
    }

    [data-theme="dark"] .guide-title {
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] .guide-step {
        color: var(--text-secondary) !important;
    }

    [data-theme="dark"] .step-number {
        background: #1e40af !important;
        color: #dbeafe !important;
    }

    /* SEO status message styles */
    .seo-status-good {
        background: #dcfce7;
        padding: 8px;
        margin: 8px 0;
        border-radius: 4px;
        border-left: 3px solid #10b981;
    }

    .seo-status-warning {
        background: #fef3c7;
        padding: 8px;
        margin: 8px 0;
        border-radius: 4px;
        border-left: 3px solid #f59e0b;
    }

    .seo-status-critical {
        background: #fef3c7;
        padding: 8px;
        margin: 8px 0;
        border-radius: 4px;
        border-left: 3px solid #f59e0b;
    }

    [data-theme="dark"] .seo-status-good {
        background: #064e3b !important;
        border-left: 3px solid #059669 !important;
        color: #6ee7b7 !important;
    }

    [data-theme="dark"] .seo-status-warning {
        background: #451a03 !important;
        border-left: 3px solid #92400e !important;
        color: #fdba74 !important;
    }

    [data-theme="dark"] .seo-status-critical {
        background: #451a03 !important;
        border-left: 3px solid #92400e !important;
        color: #fdba74 !important;
    }

    .seo-status-info {
        background: #f8fafc;
        padding: 8px;
        margin: 8px 0;
        border-radius: 4px;
        border-left: 3px solid #6b7280;
    }

    [data-theme="dark"] .seo-status-info {
        background: var(--bg-secondary) !important;
        border-left: 3px solid #6b7280 !important;
        color: var(--text-secondary) !important;
    }

    /* Content duplicate styles */
    .duplicate-exact {
        margin: 4px 0;
        padding: 6px 8px;
        border-radius: 3px;
        background: #fef2f2;
        border-left: 3px solid #ef4444;
        color: #991b1b;
    }

    .duplicate-similar {
        margin: 4px 0;
        padding: 6px 8px;
        border-radius: 3px;
        background: #fef3c7;
        border-left: 3px solid #f59e0b;
        color: #92400e;
    }

    .duplicate-type {
        font-size: 12px;
        color: #6b7280;
    }

    [data-theme="dark"] .duplicate-exact {
        background: #450a0a !important;
        border-left: 3px solid #dc2626 !important;
        color: #fca5a5 !important;
    }

    [data-theme="dark"] .duplicate-similar {
        background: #451a03 !important;
        border-left: 3px solid #92400e !important;
        color: #fdba74 !important;
    }

    [data-theme="dark"] .duplicate-type {
        color: #9ca3af !important;
    }

    [data-theme="dark"] .section {
        background: var(--bg-primary);
    }

    /* Insert Content Module modal styles */
    .module-picker-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10000;
    }

    .module-picker-modal {
        background: white;
        border-radius: 8px;
        width: 90%;
        max-width: 800px;
        max-height: 80vh;
        overflow: hidden;
    }

    .module-picker-header {
        background: #f9fafb;
        padding: 20px;
        border-bottom: 1px solid #e5e7eb;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .module-picker-header h3 {
        margin: 0;
    }

    .module-picker-close {
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
    }

    .module-picker-content {
        padding: 20px;
        max-height: 400px;
        overflow-y: auto;
    }

    .module-picker-search {
        width: 100%;
        padding: 10px;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        margin-bottom: 15px;
    }

    .module-item {
        border: 1px solid #e5e7eb;
        border-radius: 6px;
        padding: 15px;
        margin-bottom: 10px;
        cursor: pointer;
        transition: all 0.2s;
    }

    .module-item:hover {
        border-color: #3b82f6;
        background: #f8fafc;
    }

    .module-item-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 8px;
    }

    .module-item-name {
        font-weight: 600;
        color: #1f2937;
        margin-bottom: 4px;
    }

    .module-tags {
        display: flex;
        gap: 4px;
        flex-wrap: wrap;
    }

    .module-tag {
        background: #e5e7eb;
        color: #6b7280;
        padding: 2px 6px;
        border-radius: 10px;
        font-size: 10px;
    }

    .module-usage-count {
        background: #fef3c7;
        color: #92400e;
        padding: 2px 6px;
        border-radius: 10px;
        font-size: 10px;
    }

    .module-description {
        color: #6b7280;
        font-size: 13px;
        border-top: 1px solid #f3f4f6;
        padding-top: 8px;
    }

    /* Dark mode for Insert Content Module modal */
    [data-theme="dark"] .module-picker-modal {
        background: var(--bg-primary) !important;
    }

    [data-theme="dark"] .module-picker-header {
        background: var(--bg-secondary) !important;
        border-bottom: 1px solid #374151 !important;
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] .module-picker-close {
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] .module-picker-search {
        background: var(--bg-secondary) !important;
        border: 1px solid #4b5563 !important;
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] .module-picker-search::placeholder {
        color: var(--text-secondary) !important;
    }

    [data-theme="dark"] .module-item {
        border: 1px solid #4b5563 !important;
        background: var(--bg-secondary) !important;
    }

    [data-theme="dark"] .module-item:hover {
        border-color: #3b82f6 !important;
        background: #374151 !important;
    }

    [data-theme="dark"] .module-item-name {
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] .module-tag {
        background: #4b5563 !important;
        color: #9ca3af !important;
    }

    [data-theme="dark"] .module-usage-count {
        background: #451a03 !important;
        color: #fdba74 !important;
    }

    [data-theme="dark"] .module-description {
        color: var(--text-secondary) !important;
        border-top: 1px solid #4b5563 !important;
    }

    /* Collections Modal Dark Mode */
    [data-theme="dark"] #collectionModalOverlay .product-modal {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #collectionModalOverlay .product-modal-header {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #collectionModalOverlay .product-modal-body {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #collectionModalOverlay .modal-close-btn {
        color: var(--text-primary) !important;
        background: transparent !important;
        border: none !important;
    }
    [data-theme="dark"] #collectionModalOverlay .modal-close-btn:hover {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }
    /* Form elements in collection modal */
    [data-theme="dark"] #collectionModalOverlay input,
    [data-theme="dark"] #collectionModalOverlay select,
    [data-theme="dark"] #collectionModalOverlay textarea {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #collectionModalOverlay input:focus,
    [data-theme="dark"] #collectionModalOverlay select:focus,
    [data-theme="dark"] #collectionModalOverlay textarea:focus {
        border-color: var(--brand-primary) !important;
        outline: none !important;
    }
    /* Labels and text */
    [data-theme="dark"] #collectionModalOverlay label {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #collectionModalOverlay .slug-preview {
        color: var(--text-muted) !important;
        background: transparent !important;
        padding: 0 !important;
        border: 0 !important;
    }
    [data-theme="dark"] #collectionModalOverlay .char-counter,
    [data-theme="dark"] #collectionModalOverlay .form-help {
        color: var(--text-muted) !important;
        background: transparent !important;
        padding: 0 !important;
        border: 0 !important;
    }
    /* Buttons in collection modal */
    [data-theme="dark"] #collectionModalOverlay .btn:not(.secondary) {
        background: #3b82f6 !important;
        color: white !important;
        border: 1px solid #3b82f6 !important;
    }
    [data-theme="dark"] #collectionModalOverlay .btn:not(.secondary):hover {
        background: #2563eb !important;
        border-color: #2563eb !important;
    }
    [data-theme="dark"] #collectionModalOverlay .btn.secondary {
        background: #6b7280 !important;
        color: white !important;
        border: 1px solid #6b7280 !important;
    }
    [data-theme="dark"] #collectionModalOverlay .btn.secondary:hover {
        background: #4b5563 !important;
        border-color: #4b5563 !important;
    }
    /* Fix Target Keywords Strategy heading */
    [data-theme="dark"] #collectionModalOverlay h3 {
        color: var(--text-primary) !important;
    }
    /* Secondary Keywords section */
    [data-theme="dark"] #collectionModalOverlay .keywords-section,
    [data-theme="dark"] #collectionModalOverlay .secondary-keywords-section {
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #collectionModalOverlay .secondary-keywords-container {
        background: var(--bg-tertiary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #collectionModalOverlay .keyword-tag {
        background: var(--bg-quaternary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #collectionModalOverlay .keyword-tag button {
        color: var(--text-muted) !important;
        background: transparent !important;
    }
    [data-theme="dark"] #collectionModalOverlay .keyword-tag button:hover {
        color: var(--text-primary) !important;
        background: var(--bg-tertiary) !important;
    }
    [data-theme="dark"] #collectionModalOverlay .keywords-empty-state {
        color: var(--text-muted) !important;
    }
    /* SEO sidebar */
    [data-theme="dark"] #collectionModalOverlay .seo-sidebar {
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #collectionModalOverlay .seo-sidebar h4 {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #collectionModalOverlay .seo-score-item {
        background: var(--bg-tertiary) !important;
        border: 1px solid var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    /* Fix Secondary Keywords section with inline styles */
    [data-theme="dark"] #collectionModalOverlay #collectionSecondaryKeywordTags {
        background: var(--bg-tertiary) !important;
        border: 2px dashed var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #collectionModalOverlay #collectionSecondaryKeywordTags div {
        color: var(--text-muted) !important;
    }
    /* Collection secondary keyword tags - GREEN for collections (instead of blue) */
    [data-theme="dark"] #collectionModalOverlay .collection-keyword-tag {
        background: #064e3b !important;
        color: #6ee7b7 !important;
        border: 1px solid #10b981 !important;
    }
    [data-theme="dark"] #collectionModalOverlay .collection-keyword-tag span {
        color: #6ee7b7 !important;
    }
    [data-theme="dark"] #collectionModalOverlay .collection-keyword-tag button {
        background: transparent !important;
        border: none !important;
        color: #6ee7b7 !important;
    }
    /* Collection conflict keyword states - ORANGE for used, RED for conflict */
    [data-theme="dark"] #collectionModalOverlay .collection-keyword-tag[style*="#fef3c7"] {
        background: #451a03 !important;
        color: #fdba74 !important;
        border: 1px solid #92400e !important;
    }
    [data-theme="dark"] #collectionModalOverlay .collection-keyword-tag[style*="#fef3c7"] span {
        color: #fdba74 !important;
    }
    [data-theme="dark"] #collectionModalOverlay .collection-keyword-tag[style*="#fef3c7"] button {
        color: #fdba74 !important;
    }
    [data-theme="dark"] #collectionModalOverlay .collection-keyword-tag[style*="#fef2f2"] {
        background: #7f1d1d !important;
        color: #fca5a5 !important;
        border: 1px solid #ef4444 !important;
    }
    [data-theme="dark"] #collectionModalOverlay .collection-keyword-tag[style*="#fef2f2"] span {
        color: #fca5a5 !important;
    }
    [data-theme="dark"] #collectionModalOverlay .collection-keyword-tag[style*="#fef2f2"] button {
        color: #fca5a5 !important;
    }

    /* Collections Theme Assets - Copy exact working styles from products modal */
    [data-theme="dark"] #collectionModalOverlay .theme-assets-section {
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #collectionModalOverlay .theme-assets-header {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #collectionModalOverlay .theme-assets-title {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #collectionModalOverlay .theme-assets-content {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #collectionModalOverlay .theme-assets-description {
        color: var(--text-muted) !important;
        background: transparent !important;
        border: 0 !important;
        padding: 16px 0 0 0 !important;
    }
    [data-theme="dark"] #collectionModalOverlay .asset-group-title strong {
        color: white !important;
    }

    /* Collections SEO Sidebar - Copy all styling from products modal */
    [data-theme="dark"] #collectionModalOverlay .seo-sidebar {
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #collectionModalOverlay .seo-sidebar h4 {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #collectionModalOverlay .seo-sidebar div[style*="color: #6b7280"] {
        color: #9ca3af !important;
    }
    [data-theme="dark"] #collectionModalOverlay .seo-score-item {
        background: var(--bg-tertiary) !important;
        border: 1px solid var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #collectionModalOverlay .collapsible-section {
        background: var(--bg-tertiary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #collectionModalOverlay .collapsible-header {
        background: var(--bg-quaternary) !important;
        color: var(--text-primary) !important;
        border-bottom: 1px solid var(--border-color) !important;
        border-radius: 8px 8px 0 0 !important;
    }
    [data-theme="dark"] #collectionModalOverlay .collapsible-content {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #collectionModalOverlay .expand-icon {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #collectionModalOverlay .seo-check-item,
    [data-theme="dark"] #collectionModalOverlay .check-item {
        background: var(--bg-quaternary) !important;
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #collectionModalOverlay .help-icon {
        background: var(--bg-quaternary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #collectionModalOverlay .tooltip {
        background: var(--bg-primary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #collectionModalOverlay .keyword-tooltip {
        background: #1f2937 !important;
        color: white !important;
    }

    /* Pages Modal Dark Mode - Complete styling */
    [data-theme="dark"] #pageModalOverlay .product-modal {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #pageModalOverlay .product-modal-header {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #pageModalOverlay .product-modal-body {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #pageModalOverlay .modal-close-btn {
        color: var(--text-primary) !important;
        background: transparent !important;
        border: none !important;
    }
    [data-theme="dark"] #pageModalOverlay .modal-close-btn:hover {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }
    /* Form elements */
    [data-theme="dark"] #pageModalOverlay input,
    [data-theme="dark"] #pageModalOverlay select,
    [data-theme="dark"] #pageModalOverlay textarea {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #pageModalOverlay input:focus,
    [data-theme="dark"] #pageModalOverlay select:focus,
    [data-theme="dark"] #pageModalOverlay textarea:focus {
        border-color: var(--brand-primary) !important;
        outline: none !important;
    }
    [data-theme="dark"] #pageModalOverlay label {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #pageModalOverlay .slug-preview {
        color: var(--text-muted) !important;
        background: transparent !important;
        padding: 0 !important;
        border: 0 !important;
    }
    [data-theme="dark"] #pageModalOverlay .char-counter,
    [data-theme="dark"] #pageModalOverlay .form-help {
        color: var(--text-muted) !important;
        background: transparent !important;
        padding: 0 !important;
        border: 0 !important;
    }
    /* Buttons */
    [data-theme="dark"] #pageModalOverlay .btn:not(.secondary) {
        background: #3b82f6 !important;
        color: white !important;
        border: 1px solid #3b82f6 !important;
    }
    [data-theme="dark"] #pageModalOverlay .btn:not(.secondary):hover {
        background: #2563eb !important;
        border-color: #2563eb !important;
    }
    [data-theme="dark"] #pageModalOverlay .btn.secondary {
        background: #6b7280 !important;
        color: white !important;
        border: 1px solid #6b7280 !important;
    }
    [data-theme="dark"] #pageModalOverlay .btn.secondary:hover {
        background: #4b5563 !important;
        border-color: #4b5563 !important;
    }
    [data-theme="dark"] #pageModalOverlay h3 {
        color: var(--text-primary) !important;
    }
    /* Secondary Keywords section */
    [data-theme="dark"] #pageModalOverlay .keywords-section,
    [data-theme="dark"] #pageModalOverlay .secondary-keywords-section {
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #pageModalOverlay .secondary-keywords-container {
        background: var(--bg-tertiary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #pageModalOverlay #pageSecondaryKeywordTags {
        background: var(--bg-tertiary) !important;
        border: 2px dashed var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #pageModalOverlay #pageSecondaryKeywordTags div {
        color: var(--text-muted) !important;
    }
    /* Pages secondary keyword tags - PURPLE theme (from pages table) */
    [data-theme="dark"] #pageModalOverlay .secondary-keyword-tag {
        background: #581c87 !important;
        color: #c4b5fd !important;
        border: 1px solid #7c3aed !important;
    }
    [data-theme="dark"] #pageModalOverlay .secondary-keyword-tag span {
        color: #c4b5fd !important;
    }
    [data-theme="dark"] #pageModalOverlay .secondary-keyword-tag button {
        background: transparent !important;
        border: none !important;
        color: #c4b5fd !important;
    }
    /* Pages used keywords - ORANGE */
    [data-theme="dark"] #pageModalOverlay .secondary-keyword-tag[style*="#fef3c7"] {
        background: #451a03 !important;
        color: #fdba74 !important;
        border: 1px solid #92400e !important;
    }
    [data-theme="dark"] #pageModalOverlay .secondary-keyword-tag[style*="#fef3c7"] span {
        color: #fdba74 !important;
    }
    [data-theme="dark"] #pageModalOverlay .secondary-keyword-tag[style*="#fef3c7"] button {
        color: #fdba74 !important;
    }
    /* Pages conflict keywords - RED */
    [data-theme="dark"] #pageModalOverlay .secondary-keyword-tag[style*="#fef2f2"] {
        background: #7f1d1d !important;
        color: #fca5a5 !important;
        border: 1px solid #ef4444 !important;
    }
    [data-theme="dark"] #pageModalOverlay .secondary-keyword-tag[style*="#fef2f2"] span {
        color: #fca5a5 !important;
    }
    [data-theme="dark"] #pageModalOverlay .secondary-keyword-tag[style*="#fef2f2"] button {
        color: #fca5a5 !important;
    }

    /* Pages SEO Sidebar - Copy from collections/products modal */
    [data-theme="dark"] #pageModalOverlay .seo-sidebar {
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #pageModalOverlay .seo-sidebar h4 {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #pageModalOverlay .seo-sidebar div[style*="color: #6b7280"] {
        color: #9ca3af !important;
    }
    [data-theme="dark"] #pageModalOverlay .seo-score-item {
        background: var(--bg-tertiary) !important;
        border: 1px solid var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #pageModalOverlay .collapsible-section {
        background: var(--bg-tertiary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #pageModalOverlay .collapsible-header {
        background: var(--bg-quaternary) !important;
        color: var(--text-primary) !important;
        border-bottom: 1px solid var(--border-color) !important;
        border-radius: 8px 8px 0 0 !important;
    }
    [data-theme="dark"] #pageModalOverlay .collapsible-content {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #pageModalOverlay .expand-icon {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #pageModalOverlay .seo-check-item,
    [data-theme="dark"] #pageModalOverlay .check-item {
        background: var(--bg-quaternary) !important;
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #pageModalOverlay .help-icon {
        background: var(--bg-quaternary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #pageModalOverlay .tooltip {
        background: var(--bg-primary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #pageModalOverlay .keyword-tooltip {
        background: #1f2937 !important;
        color: white !important;
    }

    /* Pages Shopify Theme Preview Settings - Copy from collections modal */
    [data-theme="dark"] #pageModalOverlay .theme-assets-section {
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #pageModalOverlay .theme-assets-header {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #pageModalOverlay .theme-assets-title {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #pageModalOverlay .theme-assets-content {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #pageModalOverlay .theme-assets-description {
        color: var(--text-muted) !important;
        background: transparent !important;
        border: 0 !important;
        padding: 16px 0 0 0 !important;
    }
    [data-theme="dark"] #pageModalOverlay .asset-group-title strong {
        color: white !important;
    }

    /* Blog Posts Modal Dark Mode - Complete styling */
    [data-theme="dark"] #blogPostModalOverlay .product-modal {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .product-modal-header {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .product-modal-body {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .modal-close-btn {
        color: var(--text-primary) !important;
        background: transparent !important;
        border: none !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .modal-close-btn:hover {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }
    /* Form elements */
    [data-theme="dark"] #blogPostModalOverlay input,
    [data-theme="dark"] #blogPostModalOverlay select,
    [data-theme="dark"] #blogPostModalOverlay textarea {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #blogPostModalOverlay input:focus,
    [data-theme="dark"] #blogPostModalOverlay select:focus,
    [data-theme="dark"] #blogPostModalOverlay textarea:focus {
        border-color: var(--brand-primary) !important;
        outline: none !important;
    }
    [data-theme="dark"] #blogPostModalOverlay label {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .slug-preview {
        color: var(--text-muted) !important;
        background: transparent !important;
        padding: 0 !important;
        border: 0 !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .char-counter,
    [data-theme="dark"] #blogPostModalOverlay .form-help {
        color: var(--text-muted) !important;
        background: transparent !important;
        padding: 0 !important;
        border: 0 !important;
    }
    /* Buttons */
    [data-theme="dark"] #blogPostModalOverlay .btn:not(.secondary) {
        background: #3b82f6 !important;
        color: white !important;
        border: 1px solid #3b82f6 !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .btn:not(.secondary):hover {
        background: #2563eb !important;
        border-color: #2563eb !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .btn.secondary {
        background: #6b7280 !important;
        color: white !important;
        border: 1px solid #6b7280 !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .btn.secondary:hover {
        background: #4b5563 !important;
        border-color: #4b5563 !important;
    }
    [data-theme="dark"] #blogPostModalOverlay h3 {
        color: var(--text-primary) !important;
    }
    /* Secondary Keywords section */
    [data-theme="dark"] #blogPostModalOverlay .keywords-section,
    [data-theme="dark"] #blogPostModalOverlay .secondary-keywords-section {
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .secondary-keywords-container {
        background: var(--bg-tertiary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #blogPostModalOverlay #blogPostSecondaryKeywordTags {
        background: var(--bg-tertiary) !important;
        border: 2px dashed var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #blogPostModalOverlay #blogPostSecondaryKeywordTags div {
        color: var(--text-muted) !important;
    }
    /* Blog posts secondary keyword tags - LIGHT BLUE theme (from blog posts table) */
    [data-theme="dark"] #blogPostModalOverlay .secondary-keyword-tag {
        background: #0f3f3c !important;
        color: #7dd3fc !important;
        border: 1px solid #0891b2 !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .secondary-keyword-tag span {
        color: #7dd3fc !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .secondary-keyword-tag button {
        background: transparent !important;
        border: none !important;
        color: #7dd3fc !important;
    }
    /* Blog posts used keywords - ORANGE */
    [data-theme="dark"] #blogPostModalOverlay .secondary-keyword-tag[style*="#fef3c7"] {
        background: #451a03 !important;
        color: #fdba74 !important;
        border: 1px solid #92400e !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .secondary-keyword-tag[style*="#fef3c7"] span {
        color: #fdba74 !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .secondary-keyword-tag[style*="#fef3c7"] button {
        color: #fdba74 !important;
    }
    /* Blog posts conflict keywords - RED */
    [data-theme="dark"] #blogPostModalOverlay .secondary-keyword-tag[style*="#fef2f2"] {
        background: #7f1d1d !important;
        color: #fca5a5 !important;
        border: 1px solid #ef4444 !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .secondary-keyword-tag[style*="#fef2f2"] span {
        color: #fca5a5 !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .secondary-keyword-tag[style*="#fef2f2"] button {
        color: #fca5a5 !important;
    }

    /* Blog Posts SEO Sidebar */
    [data-theme="dark"] #blogPostModalOverlay .seo-sidebar {
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .seo-sidebar h4 {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .seo-sidebar div[style*="color: #6b7280"] {
        color: #9ca3af !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .seo-score-item {
        background: var(--bg-tertiary) !important;
        border: 1px solid var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .collapsible-section {
        background: var(--bg-tertiary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .collapsible-header {
        background: var(--bg-quaternary) !important;
        color: var(--text-primary) !important;
        border-bottom: 1px solid var(--border-color) !important;
        border-radius: 8px 8px 0 0 !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .collapsible-content {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .expand-icon {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .seo-check-item,
    [data-theme="dark"] #blogPostModalOverlay .check-item {
        background: var(--bg-quaternary) !important;
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .help-icon {
        background: var(--bg-quaternary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .tooltip {
        background: var(--bg-primary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .keyword-tooltip {
        background: #1f2937 !important;
        color: white !important;
    }

    /* Blog Posts Shopify Theme Preview Settings */
    [data-theme="dark"] #blogPostModalOverlay .theme-assets-section {
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .theme-assets-header {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .theme-assets-title {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .theme-assets-content {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .theme-assets-description {
        color: var(--text-muted) !important;
        background: transparent !important;
        border: 0 !important;
        padding: 16px 0 0 0 !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .asset-group-title strong {
        color: white !important;
    }
    
    /* Shopify Tags section */
    [data-theme="dark"] #blogPostModalOverlay .shopify-tags-section {
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 8px !important;
        padding: 16px !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .shopify-tags-section h4 {
        color: var(--text-primary) !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .shopify-tags-container {
        background: var(--bg-tertiary) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 6px !important;
        padding: 12px !important;
        min-height: 40px !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .tags-empty-state {
        color: var(--text-muted) !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .shopify-tag {
        background: var(--bg-quaternary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .shopify-tag button {
        color: var(--text-muted) !important;
        background: transparent !important;
        border: none !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .shopify-tag button:hover {
        color: var(--text-primary) !important;
        background: var(--bg-tertiary) !important;
        border-radius: 3px !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .shopify-tags-help {
        color: var(--text-muted) !important;
        background: transparent !important;
        padding: 0 !important;
        border: 0 !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .tag-suggestion {
        background: var(--bg-quaternary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    [data-theme="dark"] #blogPostModalOverlay .tag-suggestion:hover {
        background: var(--brand-primary) !important;
        color: white !important;
        border-color: var(--brand-primary) !important;
    }

    /* Section Header Styles */
    .section-header {
        margin-bottom: 24px;
    }

    .section-header h1 {
        font-size: 28px;
        font-weight: 600;
        color: var(--text-primary);
        margin: 0;
        line-height: 1.2;
    }

    [data-theme="dark"] .section-header h1 {
        color: var(--text-primary);
    }

    /* Action Button Styles */
    .action-btn {
        padding: 8px;
        margin-top: 0px;
        border: 1px solid var(--border-color);
        border-radius: 6px;
        background: var(--bg-secondary);
        color: var(--text-primary);
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 32px;
        height: 32px;
    }

    .action-btn:hover {
        background: var(--bg-primary);
        border-color: var(--accent-color);
        transform: translateY(-1px);
    }

    .action-btn:active {
        transform: translateY(0);
    }

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

    .action-btn.primary:hover {
        background: var(--accent-dark);
        border-color: var(--accent-dark);
    }

    .action-btn.secondary {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border-color: var(--border-color);
    }

    .action-btn.secondary:hover {
        background: var(--bg-tertiary);
        border-color: var(--accent-color);
    }

    [data-theme="dark"] .action-btn {
        background: var(--bg-secondary);
        border-color: var(--border-color);
        color: var(--text-primary);
    }

    [data-theme="dark"] .action-btn:hover {
        background: var(--bg-tertiary);
        border-color: var(--accent-color);
    }

    [data-theme="dark"] .action-btn.primary {
        background: var(--accent-color);
        color: white;
        border-color: var(--accent-color);
    }

    [data-theme="dark"] .action-btn.secondary {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border-color: var(--border-color);
    }

    /* Form Input Styles */
    .form-input {
        flex: 1;
        padding: 8px 12px;
        border: 2px solid var(--border-color);
        border-radius: 6px;
        background: var(--bg-primary);
        color: var(--text-primary);
        font-size: 14px;
        transition: border-color 0.2s ease;
    }

    .form-input:focus {
        outline: none;
        border-color: var(--accent-color);
    }

    /* This CSS was breaking modal layouts - removed flex display */

    [data-theme="dark"] .form-input {
        background: var(--bg-secondary);
        border-color: var(--border-color);
        color: var(--text-primary);
    }

    [data-theme="dark"] .form-input:focus {
        border-color: var(--accent-color);
    }

    /* Material and Turn Button Card Styles */
    .material-card, .turn-button-card {
        background: var(--bg-primary);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        padding: 20px;
        margin-bottom: 20px;
        transition: all 0.2s ease;
    }

    .material-card:hover, .turn-button-card:hover {
        border-color: var(--accent-color);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .material-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 16px;
        padding: 0;
        padding-bottom: 12px;
        border-bottom: 1px solid var(--border-color);
        background: transparent;
    }

    .turn-button-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 16px;
        padding-bottom: 12px;
        border-bottom: 1px solid var(--border-color);
    }

    .material-header h4, .turn-button-header h4 {
        margin: 0;
        padding: 0;
        font-size: 16px;
        font-weight: 600;
        color: var(--text-primary);
        background: transparent;
    }

    .material-status, .turn-button-status {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .status-badge {
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
        letter-spacing: normal;
        text-transform: none !important;
    }

    .status-badge.active {
        background: #dcfce7;
        color: #166534;
        border: 1px solid #bbf7d0;
    }

    .current-rate {
        font-size: 14px;
        font-weight: 600;
        color: var(--text-primary);
    }

    .material-content, .turn-button-content {
        padding-top: 8px;
    }

    .period-list {
        background: var(--bg-secondary);
        border-radius: 8px;
        border: 1px solid var(--border-color);
        margin-bottom: 16px;
        overflow: hidden;
    }

    .material-actions, .turn-button-actions {
        display: flex;
        justify-content: flex-start;
    }

    .period-info {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .period-rate {
        font-size: 16px;
        font-weight: 600;
        color: var(--text-primary);
    }

    .period-dates {
        font-size: 13px;
        color: var(--text-secondary);
    }

    .period-status {
        font-size: 11px;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        padding: 2px 8px;
        border-radius: 12px;
        width: fit-content;
    }

    .period-status.active {
        background: #dcfce7;
        color: #166534;
    }

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

    /* Dark Mode */
    [data-theme="dark"] .material-card, 
    [data-theme="dark"] .turn-button-card {
        background: transparent;
        border-color: var(--border-color);
    }

    [data-theme="dark"] .material-header {
        border-bottom-color: var(--border-color);
        background: transparent !important;
    }

    [data-theme="dark"] .turn-button-header {
        border-bottom-color: var(--border-color);
    }

    [data-theme="dark"] .material-header h4, 
    [data-theme="dark"] .turn-button-header h4 {
        background: transparent;
        color: var(--text-primary);
    }

    [data-theme="dark"] .status-badge.active {
        background: #166534;
        color: #dcfce7;
        border-color: #15803d;
    }

    [data-theme="dark"] .period-list {
        background: transparent;
        border: none;
    }

    [data-theme="dark"] .period-status.active {
        background: #166534;
        color: #dcfce7;
    }

    /* Fix cost period item backgrounds in dark mode */
    [data-theme="dark"] .cost-period-item {
        background: var(--bg-secondary) !important;
        border-color: var(--border-color) !important;
        color: var(--text-primary) !important;
    }

    /* Fix date text color in dark mode - make it muted */
    [data-theme="dark"] .cost-period-item span[style*="color: #6b7280"] {
        color: var(--text-secondary) !important;
    }

    /* Fix Active tag in period items to match header Active tags */
    [data-theme="dark"] .cost-period-item span[style*="background: #10b981"] {
        background: #166534 !important;
        color: #dcfce7 !important;
    }

    /* Cost Category Container */
    .cost-category {
        padding: 24px;
        margin-bottom: 32px;
    }

    .cost-category h3 {
        margin: 0 0 20px 0;
        font-size: 18px;
        font-weight: 600;
        color: var(--text-primary);
    }

    /* Remove double borders - let individual items have borders */
    .period-list {
        background: transparent;
        border-radius: 8px;
        border: none;
        margin-bottom: 16px;
        padding: 8px;
    }

    .period-item {
        border-bottom: none; /* Remove individual item borders since container has border */
        padding: 16px 20px;
    }

    .period-item:not(:last-child) {
        border-bottom: 1px solid var(--border-color);
    }

    [data-theme="dark"] .system-actions-grid {
        background: var(--bg-secondary);
    }

    [data-theme="dark"] .action-card {
        background: var(--bg-tertiary);
        border-color: var(--border-color);
        color: var(--text-primary);
    }

    [data-theme="dark"] .action-card:hover {
        border-color: var(--brand-color);
    }

    [data-theme="dark"] .action-card p {
        color: var(--text-muted);
    }

    [data-theme="dark"] .cost-overview {
        background: var(--bg-tertiary);
        border-color: var(--border-color);
    }

    [data-theme="dark"] .cost-stat-value {
        color: var(--text-primary);
    }

    [data-theme="dark"] .cost-stat-label {
        color: var(--text-muted);
    }

    [data-theme="dark"] .cost-category {
        border-color: var(--border-color);
    }

    [data-theme="dark"] .cost-category-header {
        background: var(--bg-tertiary);
        border-color: var(--border-color);
    }

    [data-theme="dark"] .cost-category-title {
        color: var(--text-primary);
    }

    [data-theme="dark"] .cost-category-subtitle {
        color: var(--text-muted);
    }

    [data-theme="dark"] .cost-category-content {
        background: var(--bg-secondary);
    }

    [data-theme="dark"] .material-item {
        border-color: var(--border-color);
    }

    [data-theme="dark"] .material-item:hover {
        border-color: var(--brand-color);
    }

    [data-theme="dark"] .material-header {
        background: var(--bg-tertiary);
        border-color: var(--border-color);
    }

    [data-theme="dark"] .material-name {
        color: var(--text-primary);
    }

    [data-theme="dark"] .material-rate {
        color: var(--brand-color);
    }

    [data-theme="dark"] .period-item {
        border-color: var(--border-color);
    }

    [data-theme="dark"] .period-item:hover {
        background: var(--bg-tertiary);
    }

    [data-theme="dark"] .period-rate {
        color: var(--text-primary);
    }

    [data-theme="dark"] .period-dates {
        color: var(--text-muted);
    }

    [data-theme="dark"] .btn-edit {
        background: var(--bg-tertiary);
        color: var(--text-primary);
        border-color: var(--border-color);
    }

    [data-theme="dark"] .btn-edit:hover {
        background: var(--bg-primary);
        border-color: var(--border-hover);
    }

    [data-theme="dark"] .add-period-section {
        background: var(--bg-tertiary);
        border-color: var(--border-color);
    }

    [data-theme="dark"] .maintenance-info {
        background: rgba(251, 191, 36, 0.1);
        border-color: var(--warning-color);
    }

    [data-theme="dark"] .maintenance-info h4 {
        color: var(--warning-color);
    }

    [data-theme="dark"] .maintenance-info ul {
        color: var(--text-muted);
    }

    [data-theme="dark"] .maintenance-info li strong {
        color: var(--warning-color);
    }

    [data-theme="dark"] .standard-products-input input {
        background: var(--bg-tertiary);
        border-color: var(--border-color);
        color: var(--text-primary);
    }

    [data-theme="dark"] .standard-products-list {
        background: var(--bg-tertiary);
        border-color: var(--border-color);
    }

    [data-theme="dark"] .standard-product-item {
        background: var(--bg-secondary);
        color: var(--text-primary);
    }

    [data-theme="dark"] .changelog-entry {
        background: var(--bg-tertiary);
        border-left-color: var(--brand-color);
    }

    [data-theme="dark"] .changelog-header h4 {
        color: var(--brand-color);
    }

    [data-theme="dark"] .changelog-date small {
        color: var(--text-muted);
    }

    [data-theme="dark"] .changelog-content ul {
        color: var(--text-muted);
    }

    /* Dark Mode - Cost Management Calculation Breakdowns */
    [data-theme="dark"] #material-breakdown div[style*="background: #f8fafc"],
    [data-theme="dark"] #fixings-breakdown div[style*="background: #f8fafc"] {
        background: var(--bg-tertiary) !important;
        border: 1px solid var(--border-color) !important;
    }

    /* Light Mode - Warehouse Transfers Action Buttons */
    #warehouse-transfers .data-table .btn.secondary {
        width: 42px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 6px 8px !important;
        min-height: auto !important;
        background: #f8fafc;
        color: #374151;
        border: 1px solid #d1d5db;
    }
    
    #warehouse-transfers .data-table .btn.secondary:hover {
        background: #f1f5f9;
        border-color: #cbd5e1;
    }
    
    #warehouse-transfers .data-table .btn.secondary svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }
    /* Light Mode - Products Action Buttons */
    #products .data-table .btn.secondary {
        width: 42px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 6px 8px !important;
        min-height: auto !important;
        background: #f8fafc;
        color: #374151;
        border: 1px solid #d1d5db;
    }
    
    #products .data-table .btn.secondary:hover {
        background: #f1f5f9;
        border-color: #cbd5e1;
    }
    
    #products .data-table .btn.secondary svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

    /* Dark Mode - Products Action Buttons */
    [data-theme="dark"] #products .data-table .btn.secondary {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
        width: 42px !important;
        height: 32px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 6px 8px !important;
        min-height: auto !important;
    }
    
    [data-theme="dark"] #products .data-table .btn.secondary:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }

    [data-theme="dark"] #warehouse-transfers .btn.primary {
        background: var(--brand-color);
        color: var(--text-primary);
        border: 1px solid var(--brand-color);
    }

    [data-theme="dark"] #warehouse-transfers .btn.primary:hover {
        background: var(--brand-hover);
        border-color: var(--brand-hover);
    }

    /* Dark Mode - Warehouse Transfers Factory Badges and Status Badges */
    [data-theme="dark"] #warehouse-transfers .factory-badge {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color);
    }

    [data-theme="dark"] #warehouse-transfers .status-badge {
        border: 1px solid var(--border-color);
    }

    /* Dark Mode - Warehouse Transfers Show All Links (keep original blue color, no hover background) */
    [data-theme="dark"] #warehouse-transfers button[onclick*="toggleTransferExpansion"] {
        color: #3b82f6 !important;
        background: none !important;
    }

    [data-theme="dark"] #warehouse-transfers button[onclick*="toggleTransferExpansion"]:hover {
        color: #2563eb !important;
        background: none !important;
    }

    /* Dark Mode - Sign out button hover */
    [data-theme="dark"] button[onclick="window.logoutUser()"]:hover {
        background: #2d2d2d !important;
        color: var(--text-primary) !important;
    }

    /* Dark Mode - Add PO Modal */
    [data-theme="dark"] #addPOModal .product-modal {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #addPOModal .product-modal-header {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border-bottom: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #addPOModal .product-modal-body {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #addPOModal label {
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #addPOModal input,
    [data-theme="dark"] #addPOModal select {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #addPOModal input[readonly] {
        background: var(--bg-primary) !important;
        color: var(--text-muted) !important;
    }

    [data-theme="dark"] #addPOModal .form-group span {
        background: var(--bg-primary) !important;
        color: var(--text-muted) !important;
        border-right: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #addPOModal button[onclick="hideAddPOModal()"] {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #addPOModal button[onclick="hideAddPOModal()"]:hover {
        background: var(--bg-primary) !important;
    }

    [data-theme="dark"] #addPOModal button[onclick="addPONumber()"] {
        background: #3b82f6 !important;
        color: white !important;
    }

    [data-theme="dark"] #addPOModal button[onclick="addPONumber()"]:hover {
        background: #2563eb !important;
    }

    [data-theme="dark"] #addPOModal .product-modal-header .modal-close-btn {
        color: var(--text-primary) !important;
        background: transparent !important;
        background-color: transparent !important;
        border: none !important;
    }

    [data-theme="dark"] #addPOModal .product-modal-header .modal-close-btn:hover {
        background: var(--bg-tertiary) !important;
        background-color: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #addPOModal .po-number-container {
        border: 1px solid var(--border-color) !important;
    }

    /* Dark Mode - Products Section */
    [data-theme="dark"] #products {
        background: var(--bg-primary);
        color: var(--text-primary);
    }

    [data-theme="dark"] #products .section {
        background: var(--bg-primary);
    }

    /* Dark Mode - Products Header and Controls */
    [data-theme="dark"] #products .products-header {
        background: transparent;
        border-color: var(--border-color);
    }

    [data-theme="dark"] #products .products-header h2 {
        color: var(--text-primary);
    }

    [data-theme="dark"] #products .search-box input {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 2px solid var(--border-color);
    }

    [data-theme="dark"] #products .search-box input:focus {
        border-color: var(--brand-color);
        outline: none;
    }

    [data-theme="dark"] #products .bulk-actions select {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 2px solid var(--border-color);
    }

    [data-theme="dark"] #products .btn {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #products .btn:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }

    /* Add border around products table container (matching other sections) */
    #products .table-container {
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

    /* Products table and pagination styling for cohesive appearance */
    #products .table-container + .pagination-container {
        border: 1px solid var(--border-color);
        border-top: none;
        border-radius: 0 0 8px 8px;
        background: var(--bg-secondary);
        padding: 12px 16px;
        margin-top: 0;
    }

    /* Remove bottom radius from table container when pagination follows */
    #products .table-container:has(+ .pagination-container) {
        border-radius: 8px 8px 0 0;
    }
    /* Dark Mode - Products Table */
    [data-theme="dark"] #products .table-container {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
    }

    /* Dark mode - Products table and pagination styling for cohesive appearance */
    [data-theme="dark"] #products .table-container + .pagination-container {
        border: 1px solid var(--border-color);
        border-top: none;
        border-radius: 0 0 8px 8px;
        background: var(--bg-secondary);
    }

    /* Dark mode - Remove bottom radius from table container when pagination follows */
    [data-theme="dark"] #products .table-container:has(+ .pagination-container) {
        border-radius: 8px 8px 0 0;
    }
    [data-theme="dark"] #products .data-table {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border-color: var(--border-color);
    }

    [data-theme="dark"] #products .data-table th {
        background: var(--bg-tertiary);
        color: var(--text-primary);
        border-color: var(--border-color);
        border-bottom: 2px solid var(--border-color);
    }

    [data-theme="dark"] #products .data-table th:hover {
        background: var(--bg-primary);
    }

    [data-theme="dark"] #products .data-table td {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border-color: var(--border-color);
    }

    [data-theme="dark"] #products .data-table tbody tr:hover {
        background: var(--bg-tertiary) !important;
    }

    [data-theme="dark"] #products .data-table tbody tr:hover td {
        background: var(--bg-tertiary) !important;
    }
    [data-theme="dark"] #products .data-table tbody tr:hover .col-keywords {
        background: transparent !important;
    }
    [data-theme="dark"] #products .data-table tbody tr:hover .col-keywords .keyword-tags-container {
        background: transparent !important;
    }
    [data-theme="dark"] #products .data-table tbody tr:hover .col-keywords .keyword-tags-table {
        background: transparent !important;
    }

    /* Dark Mode - Products Table Sticky Actions Column */
    [data-theme="dark"] #products .data-table .col-actions {
        background: var(--bg-secondary);
        border-left: 1px solid var(--border-color);
    }

    [data-theme="dark"] #products .data-table th.col-actions {
        background: var(--bg-tertiary) !important;
        border-left: 1px solid var(--border-color);
    }

    /* Dark Mode - Products Keywords Column */
    [data-theme="dark"] #products .col-keywords {
        color: var(--text-primary);
    }

    [data-theme="dark"] #products .keyword-tags-container {
        color: var(--text-primary);
    }

    [data-theme="dark"] #products .keyword-tags-table {
        color: var(--text-primary);
    }

    [data-theme="dark"] #products .keyword-tag-products {
        background: #1e3a8a !important;
        color: #93c5fd !important;
        border-color: #3b82f6 !important;
    }

    [data-theme="dark"] #products .keyword-tag-products.conflict {
        background: #7f1d1d !important;
        color: #fca5a5 !important;
        border-color: #ef4444 !important;
    }

    /* Dark Mode - Products Avg Opportunity Column */
    [data-theme="dark"] #products .col-avg-opportunity {
        color: var(--text-primary);
    }

    [data-theme="dark"] #products .opportunity-score {
        color: var(--text-primary);
    }

    [data-theme="dark"] #products .opportunity-score-new {
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #products .opportunity-tooltip {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
    }

    /* Opportunity squares maintain their original colors as they're semantic */

    /* Dark Mode - Products Avg Difficulty Column */
    [data-theme="dark"] #products .col-avg-difficulty {
        color: var(--text-primary);
    }

    [data-theme="dark"] #products .difficulty-score {
        color: var(--text-primary);
    }

    [data-theme="dark"] #products .difficulty-score > span:first-child {
        color: var(--text-primary) !important;
    }

    /* Keep difficulty color dots semantic - don't override their colors */

    [data-theme="dark"] #products .difficulty-tooltip {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
    }

    /* Dark Mode - Products Total Volume Column */
    [data-theme="dark"] #products .col-volume {
        color: var(--text-primary);
    }

    [data-theme="dark"] #products .col-volume .metric-value {
        color: var(--text-primary) !important;
    }

    /* Difficulty color dots maintain their original colors as they're semantic */

    /* Dark Mode - Products SEO Column */
    [data-theme="dark"] #products .col-seo {
        color: var(--text-primary);
    }

    [data-theme="dark"] #products .seo-score-table {
        color: white; /* Keep white text for contrast against colored backgrounds */
    }

    /* SEO score backgrounds maintain their original colors as they're semantic:
       - Red for poor scores
       - Orange for fair scores  
       - Green for good scores */

    /* Dark Mode - Products Conflicts Column */
    [data-theme="dark"] #products .col-conflicts {
        color: var(--text-primary);
    }

    [data-theme="dark"] #products .conflict-indicator {
        color: var(--text-primary);
    }

    [data-theme="dark"] #products .conflict-none {
        background: rgba(0, 208, 132, 0.2) !important;
        color: var(--success-color) !important;
        border: 1px solid var(--success-color);
    }

    [data-theme="dark"] #products .conflict-warning {
        background: #7f1d1d !important;
        color: #fca5a5 !important;
        border: 1px solid #ef4444 !important;
    }

    [data-theme="dark"] #products .conflict-error {
        background: #7f1d1d !important;
        color: #fca5a5 !important;
        border: 1px solid #ef4444 !important;
    }

    [data-theme="dark"] #products .conflict-indicator-tooltip {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    /* Dark Mode - Warehouse Transfers Expanded Content */
    [data-theme="dark"] #warehouse-transfers .expansion-content {
        background: var(--bg-tertiary) !important;
        border-left: 3px solid #3b82f6 !important;
    }

    [data-theme="dark"] #warehouse-transfers .expansion-content .line-item {
        border-bottom: 1px solid var(--border-color) !important;
    }

    [data-theme="dark"] #warehouse-transfers .expansion-content .item-name {
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #warehouse-transfers .expansion-content .item-details {
        color: var(--text-muted) !important;
    }

    /* Dark Mode - Warehouse Transfers Expanded Area Text and PO Tags */
    [data-theme="dark"] #warehouse-transfers .expansion-content div[style*="color: #1f2937"] {
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] #warehouse-transfers .expansion-content span[style*="background: #e5e7eb"] {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color);
    }

    /* Dark Mode - Warehouse Transfers Status Badges (match Design Approved styling) */
    [data-theme="dark"] #warehouse-transfers td span[style*="background: #dbeafe"] {
        background: #1e3a8a !important;
        color: #93c5fd !important;
        border: 1px solid #3b82f6;
    }

    [data-theme="dark"] #warehouse-transfers td span[style*="background: #fef3c7"] {
        background: #92400e !important;
        color: #fcd34d !important;
        border: 1px solid #f59e0b;
    }

    [data-theme="dark"] #warehouse-transfers td span[style*="background: #d1fae5"] {
        background: #065f46 !important;
        color: #6ee7b7 !important;
        border: 1px solid #10b981;
    }

    [data-theme="dark"] #warehouse-transfers td span[style*="background: #f3f4f6"] {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color);
    }

    /* Override automatic sort indicators for costs table to use manual spans instead */
    #costs .data-table th.sortable::after {
        content: none !important;
    }

    #costs .data-table th.sort-asc::after {
        content: none !important;
    }

    #costs .data-table th.sort-desc::after {
        content: none !important;
    }


    /* Dark Mode - Progress Bars and Percentages */
    [data-theme="dark"] #costs .data-table td div[style*="display: flex; align-items: center; gap: 8px;"] > div[style*="width: 60px; height: 4px"] {
        background: var(--border-color) !important;
    }

    [data-theme="dark"] #costs .data-table td div[style*="display: flex; align-items: center; gap: 8px;"] span[style*="font-size: 11px"] {
        color: var(--text-primary) !important;
        background: var(--bg-tertiary) !important;
        border: 1px solid var(--border-color) !important;
    }

    .calculation-highlight {
        background: #fef3c7;
        padding: 2px 4px;
        border-radius: 3px;
        font-family: 'SF Mono', Monaco, monospace;
        font-size: 13px;
    }

    .detail-section {
        margin-bottom: 12px;
    }

    .detail-section:last-child {
        margin-bottom: 0;
    }

    .detail-label {
        font-weight: 600;
        color: #374151;
        margin-bottom: 6px;
        font-size: 14px;
    }

    .detail-content {
        color: #475569;
        line-height: 1.6;
    }

    /* Set content-wrapper to SOLID BLACK background */
    [data-theme="dark"] .content-wrapper {
        background: #1a1a1a !important;
        position: relative;
    }

    /* Add gradient ON TOP of the black background */
    [data-theme="dark"] .content-wrapper::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(45deg, #006d6a, #ff6b35, #ffd23f, #1e40af, #7c3aed, #ff8c42, #00ffaa, #006d6a);
        background-size: 400% 400%;
        animation: gradientMove 30s ease-in-out infinite;
        opacity: 0.05;
        z-index: 1;
        pointer-events: none;
    }

    @keyframes gradientMove {
        0% { background-position: 0% 50%; }
        50% { background-position: 100% 50%; }
        100% { background-position: 0% 50%; }
    }

    /* Keep container transparent */
    [data-theme="dark"] .container {
        background-color: transparent !important;
    }
    
    /* Content Modules - Copy exact warehouse transfers pattern */
    #content-modules .table-container {
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

    #content-modules .data-table th {
        border-bottom: 2px solid var(--border-color);
        padding: 12px 8px !important;
    }

    /* Dark Mode - Content Modules Table Container */
    [data-theme="dark"] #content-modules .table-container {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
    }

    [data-theme="dark"] #content-modules .data-table {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border-color: var(--border-color);
    }

    [data-theme="dark"] #content-modules .data-table th {
        background: var(--bg-tertiary);
        color: var(--text-primary);
        border-color: var(--border-color);
        border-bottom: 2px solid var(--border-color);
    }

    [data-theme="dark"] #content-modules .data-table th:hover {
        background: var(--bg-primary);
    }

    [data-theme="dark"] #content-modules .data-table th.col-actions {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }

    [data-theme="dark"] #content-modules .data-table .col-actions {
        background: var(--bg-secondary);
        border-left: none !important;
    }

    [data-theme="dark"] #content-modules .data-table td {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border-bottom: 1px solid var(--border-color);
    }

    [data-theme="dark"] #content-modules .data-table tr:hover {
        background: var(--bg-tertiary) !important;
    }

    /* Content Modules - Force table layout and column widths */
    #contentModulesTable {
        table-layout: fixed !important;
        width: 100% !important;
        min-width: 0px !important;
        max-width: none !important;
    }
    
    #contentModulesTable th.col-checkbox,
    #contentModulesTable td.col-checkbox { 
        width: 50px !important; 
        min-width: 50px !important;
        max-width: 50px !important;
    }
    
    #contentModulesTable th.col-name,
    #contentModulesTable td.col-name { 
        width: 25% !important; 
        min-width: unset !important;
        max-width: none !important;
    }
    
    #contentModulesTable th.col-tags,
    #contentModulesTable td.col-tags { 
        width: 25% !important; 
        min-width: unset !important;
        max-width: none !important;
    }
    
    #contentModulesTable th.col-usage,
    #contentModulesTable td.col-usage { 
        width: 25% !important; 
        min-width: unset !important;
        max-width: none !important;
        text-align: left !important;
    }
    
    #contentModulesTable th.col-dates,
    #contentModulesTable td.col-dates { 
        width: 25% !important; 
        min-width: unset !important;
        max-width: none !important;
    }
    
    #contentModulesTable th.col-actions,
    #contentModulesTable td.col-actions { 
        width: 120px !important; 
        min-width: 120px !important;
        max-width: 120px !important;
    }
    
    /* Content Modules action buttons - copy warehouse transfers exactly */
    #content-modules .data-table .btn {
        padding: 6px 8px !important;
        min-height: auto !important;
    }
    
    /* Light Mode - Content Modules Action Buttons */
    #content-modules .data-table .btn.secondary {
        width: 42px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f8fafc;
        color: #374151;
        border: 1px solid #d1d5db;
        padding: 6px 8px !important;
        min-height: auto !important;
    }
    
    #content-modules .data-table .btn.secondary:hover {
        background: #f1f5f9;
        border-color: #cbd5e1;
    }
    
    /* Keyword Analyzer Dark Mode */
    [data-theme="dark"] .upload-zone {
        background: var(--bg-secondary) !important;
        border: 2px dashed var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    
    [data-theme="dark"] .upload-zone:hover {
        border-color: #3b82f6 !important;
        background: var(--bg-tertiary) !important;
    }
    
    [data-theme="dark"] .upload-zone.dragover {
        border-color: #10b981 !important;
        background: rgba(16, 185, 129, 0.1) !important;
    }
    
    [data-theme="dark"] .upload-zone h3 {
        color: var(--text-primary) !important;
    }
    
    [data-theme="dark"] .upload-zone p {
        color: var(--text-muted) !important;
    }
    
    [data-theme="dark"] .upload-icon-svg {
        stroke: var(--text-muted) !important;
    }
    
    [data-theme="dark"] .keyword-tags-table {
        background: var(--bg-secondary) !important;
    }
    
    [data-theme="dark"] .keyword-tag-table {
        background: rgba(59, 130, 246, 0.2) !important;
        color: #93c5fd !important;
        border: 1px solid rgba(59, 130, 246, 0.3) !important;
    }
    
    [data-theme="dark"] #keyword-analyzer-v2 {
        background: var(--bg-primary) !important;
        color: var(--text-primary) !important;
    }
    
    [data-theme="dark"] #keyword-analyzer-v2 h2 {
        color: var(--text-primary) !important;
    }
    
    [data-theme="dark"] #keyword-analyzer-v2 p {
        color: var(--text-muted) !important;
    }
    
    [data-theme="dark"] #keyword-analyzer-v2 .btn {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    
    [data-theme="dark"] #keyword-analyzer-v2 .btn:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }
    
    [data-theme="dark"] #keyword-analyzer-v2 input,
    [data-theme="dark"] #keyword-analyzer-v2 select,
    [data-theme="dark"] #keyword-analyzer-v2 textarea {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    
    [data-theme="dark"] #keyword-analyzer-v2 input:focus,
    [data-theme="dark"] #keyword-analyzer-v2 select:focus,
    [data-theme="dark"] #keyword-analyzer-v2 textarea:focus {
        border-color: var(--border-hover) !important;
        outline: none !important;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3) !important;
    }
    
    [data-theme="dark"] #keyword-analyzer-v2 input::placeholder,
    [data-theme="dark"] #keyword-analyzer-v2 textarea::placeholder {
        color: var(--text-muted) !important;
    }
    
    /* Keyword Analyzer Cards - Override white background */
    [data-theme="dark"] .card {
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
        color: var(--text-primary) !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
    }
    
    [data-theme="dark"] #keyword-analyzer-v2 .card {
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
        color: var(--text-primary) !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
    }
    
    /* Analysis Settings Labels */
    [data-theme="dark"] .analysis-settings .setting-group label {
        color: var(--text-primary) !important;
    }
    
    [data-theme="dark"] .setting-group label {
        color: var(--text-primary) !important;
    }
    
    /* Fix the specific stats cards with inline white backgrounds */
    [data-theme="dark"] #keyword-analyzer-v2 div[style*="background: white"] {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
    }
    
    [data-theme="dark"] #keyword-analyzer-v2 div[style*="color: #374151"] {
        color: var(--text-primary) !important;
    }
    
    [data-theme="dark"] #keyword-analyzer-v2 div[style*="color: #6b7280"] {
        color: var(--text-muted) !important;
    }
    
    [data-theme="dark"] #keyword-analyzer-v2 div[style*="color: #9ca3af"] {
        color: var(--text-muted) !important;
    }
    
    /* Keyword Analyzer Table Dark Mode - Fix the actual table */
    [data-theme="dark"] #keyword-analyzer-v2 .table-container {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
    }
    
    [data-theme="dark"] #keyword-analyzer-v2 table {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
    }
    
    [data-theme="dark"] #keyword-analyzer-v2 thead {
        background: var(--bg-tertiary) !important;
    }
    
    [data-theme="dark"] #keyword-analyzer-v2 th {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border-bottom: 2px solid var(--border-color) !important;
    }
    
    [data-theme="dark"] #keyword-analyzer-v2 th:hover {
        background: var(--bg-primary) !important;
    }
    
    /* Light Mode - Keyword Analyzer Actions Column Body Cells */
    #keyword-analyzer-v2 .col-actions {
        background: white;
        border-left: none !important;
    }
    
    /* Dark Mode - Keyword Analyzer Actions Column */
    [data-theme="dark"] #keyword-analyzer-v2 th.col-actions {
        background: var(--bg-tertiary) !important;
        border-left: none !important;
    }
    
    [data-theme="dark"] #keyword-analyzer-v2 td {
        color: var(--text-primary) !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    
    [data-theme="dark"] #keyword-analyzer-v2 td.col-actions {
        background: var(--bg-secondary) !important;
    }
    
    [data-theme="dark"] #keyword-analyzer-v2 tbody tr:hover {
        background: var(--bg-tertiary) !important;
    }
    
    /* Dark Mode - Report Analyzer Table */
    [data-theme="dark"] #report-analyzer .data-table {
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
    }
    
    [data-theme="dark"] #report-analyzer .table-container {
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 8px !important;
    }
    
    [data-theme="dark"] #report-analyzer .data-table th {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    
    [data-theme="dark"] #report-analyzer .data-table td {
        color: var(--text-primary) !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    
    /* Exception: Don't override colors for high opportunity column triangles (but not tooltip) */
    [data-theme="dark"] #report-analyzer .data-table .col-high-opportunity .high-opp-number > span[style*="color"] {
        color: inherit !important;
    }
    
    [data-theme="dark"] #report-analyzer .data-table th.col-actions {
        background: var(--bg-tertiary) !important;
        border-left: none !important;
    }
    
    [data-theme="dark"] #report-analyzer .data-table .col-actions {
        background: var(--bg-secondary) !important;
        border-left: none !important;
    }
    
    [data-theme="dark"] #report-analyzer .data-table tbody tr:hover {
        background: var(--bg-tertiary) !important;
    }
    
    /* Dark Mode - Report Analyzer Actions Column Sticky Positioning */
    [data-theme="dark"] #report-analyzer .data-table .col-actions {
        background: var(--bg-secondary) !important;
        border-left: 1px solid var(--border-color) !important;
        position: sticky !important;
        right: 0px !important;
        z-index: 5 !important;
    }
    
    /* Light Mode - Report Analyzer Actions Column Sticky Positioning */
    #report-analyzer .data-table .col-actions {
        background: white !important;
        border-left: 1px solid #e2e8f0 !important;
        position: sticky !important;
        right: 0px !important;
        z-index: 5 !important;
    }
    
    /* Dark Mode - Report Analyzer specific text colors (keep indicators colored) */
    [data-theme="dark"] #report-analyzer .col-avg-opportunity .opportunity-score-new {
        color: var(--text-primary) !important;
    }
    
    /* Remove any CSS that might override High Opportunity inline colors */
    
    /* Dark Mode - Report Analyzer Avg Difficulty numbers only (NOT the colored dots) */
    [data-theme="dark"] #report-analyzer .col-avg-difficulty .metric-value > span {
        color: var(--text-primary) !important;
    }
    
    /* Dark Mode - Force tooltip triangles to keep their specific colors */
    [data-theme="dark"] #report-analyzer .opportunity-tooltip span[style*="#22c55e"] {
        color: #22c55e !important;
    }
    [data-theme="dark"] #report-analyzer .opportunity-tooltip span[style*="#10b981"] {
        color: #10b981 !important;
    }
    [data-theme="dark"] #report-analyzer .opportunity-tooltip span[style*="#059669"] {
        color: #059669 !important;
    }
    [data-theme="dark"] #report-analyzer .opportunity-tooltip span[style*="#7c3aed"] {
        color: #7c3aed !important;
    }
    
    [data-theme="dark"] #report-analyzer .difficulty-tooltip span[style*="color:"] {
        color: inherit !important;
    }
    
    /* Make sure High Opportunity column triangles use proper colors (but not tooltip) */
    #report-analyzer .col-high-opportunity .high-opp-number > span[style*="color"] {
        color: inherit !important;
    }
    
    /* Ensure high opportunity triangles maintain their colors in both light and dark mode (but not tooltip) */
    [data-theme="dark"] #report-analyzer .col-high-opportunity .high-opp-number > span[style*="color"] {
        color: inherit !important;
    }
    
    /* High opportunity number text colors */
    #report-analyzer .high-opp-number {
        color: #374151; /* Dark gray for light mode */
    }
    
    [data-theme="dark"] #report-analyzer .high-opp-number {
        color: var(--text-primary) !important; /* White for dark mode */
    }
    
    [data-theme="dark"] #report-analyzer h3 {
        color: var(--text-primary) !important;
    }
    
    [data-theme="dark"] #report-analyzer p {
        color: var(--text-muted) !important;
    }
    
    /* Light Mode - Report Analyzer Action Buttons */
    #report-analyzer .btn.secondary {
        background: #f8fafc;
        color: #374151;
        border: 1px solid #d1d5db;
        padding: 6px 8px !important;
        min-height: auto !important;
        height: 32px !important;
        width: 42px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    #report-analyzer .btn.secondary:hover {
        background: #f1f5f9;
        border-color: #cbd5e1;
    }

    /* Dark Mode - Report Analyzer Action Buttons */
    [data-theme="dark"] #report-analyzer .btn.secondary {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
        padding: 6px 8px !important;
        min-height: auto !important;
        height: 32px !important;
        width: 42px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    [data-theme="dark"] #report-analyzer .btn.secondary:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }
    
    /* Dark Mode - Report Analyzer Header */
    [data-theme="dark"] #report-analyzer .products-header h2 {
        color: var(--text-primary) !important;
    }
    
    /* Dark Mode - Report Analyzer Controls */
    [data-theme="dark"] #report-analyzer .btn {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    
    [data-theme="dark"] #report-analyzer .btn:hover {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-hover) !important;
    }
    
    [data-theme="dark"] #report-analyzer label {
        color: var(--text-primary) !important;
    }
    
    [data-theme="dark"] #report-analyzer select {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    
    [data-theme="dark"] #report-analyzer select:focus {
        border-color: var(--blue-color) !important;
        outline: none !important;
    }
    
    [data-theme="dark"] #keyword-analyzer-v2 tbody tr:hover td {
        background: var(--bg-tertiary) !important;
    }
    
    [data-theme="dark"] #keyword-analyzer-v2 tbody tr.selected {
        background: rgba(59, 130, 246, 0.2) !important;
    }
    
    [data-theme="dark"] #keyword-analyzer-v2 tbody tr.selected td {
        background: rgba(59, 130, 246, 0.2) !important;
    }
    
    /* Fix the specific dark gray number text in difficulty and opportunity columns */
    [data-theme="dark"] #keyword-analyzer-v2 .difficulty-score span[style*="color: #374151"],
    [data-theme="dark"] #keyword-analyzer-v2 span[style*="color: #374151"],
    [data-theme="dark"] #keyword-analyzer-v2 .opportunity-score-new,
    [data-theme="dark"] #keyword-analyzer-v2 .opportunity-score span:first-child {
        color: var(--text-primary) !important;
    }
    
    
    /* Keyword Analyzer Results Card */
    [data-theme="dark"] #keywordTableResults .card {
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    
    [data-theme="dark"] #keywordTableResults h3 {
        color: var(--text-primary) !important;
    }
    
    /* Search box in keyword analyzer */
    [data-theme="dark"] #keyword-analyzer-v2 .search-box input {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    
    [data-theme="dark"] #keyword-analyzer-v2 .search-box input:focus {
        border-color: var(--border-hover) !important;
        outline: none !important;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3) !important;
    }

    /* Bulk Actions Section Dark Mode */
    [data-theme="dark"] #bulkActionsSection {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] .bulk-tab-headers {
        background: var(--bg-primary) !important;
    }

    [data-theme="dark"] .bulk-tab-header {
        color: var(--text-secondary) !important;
    }

    [data-theme="dark"] .bulk-tab-header.active {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
    }

    /* Keyword Analyzer Stats Panel Dark Mode */
    [data-theme="dark"] #keyword-analyzer-v2 div[style*="background: #f8fafc"] {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-color) !important;
        color: var(--text-primary) !important;
    }

    /* Analysis Selector Dropdown Styling */
    #analysisSelector {
        padding: 8px 12px !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 6px !important;
        background: white !important;
        font-size: 14px !important;
    }

    [data-theme="dark"] #analysisSelector {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }

    /* Keyword Analyzer Conflict Warning Dark Mode - Match Awaiting Design Orange Exactly */
    [data-theme="dark"] #keyword-analyzer-v2 .conflict-warning {
        background: #451a03 !important;
        color: #fdba74 !important;
        border: 1px solid #92400e !important;
    }
    
    /* Content Modules - Bulk actions dropdown styling */
    #content-modules #bulkActionModuleSelect {
        background: #f9fafb !important;
        color: #374151 !important;
        border: 1px solid #d1d5db !important;
        padding: 8px 12px;
        border-radius: 6px;
        font-size: 14px;
        min-width: 120px;
    }
    
    #content-modules #bulkActionModuleSelect:focus {
        border-color: #3b82f6 !important;
        outline: none !important;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3) !important;
    }
    
    [data-theme="dark"] #content-modules #bulkActionModuleSelect {
        background: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    
    [data-theme="dark"] #content-modules #bulkActionModuleSelect:focus {
        border-color: var(--border-hover) !important;
        outline: none !important;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3) !important;
    }
    
    /* Enhanced Cost Management Modal Styles */
    
    /* View toggle */
    .view-toggle {
        display: flex;
        background: var(--bg-tertiary);
        border-radius: 8px;
        padding: 4px;
        margin-bottom: 24px;
        width: fit-content;
    }

    .toggle-btn {
        padding: 8px 16px;
        border: none;
        border-radius: 6px;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s;
        background: transparent;
        color: var(--text-muted);
    }

    .toggle-btn.active {
        background: var(--bg-secondary);
        color: var(--text-primary);
        box-shadow: var(--shadow-sm);
    }

    /* Section headers */
    .section-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 16px;
        padding-bottom: 8px;
    }

    .section-title {
        font-size: 16px;
        font-weight: 600;
        color: var(--text-primary);
    }

    .total-amount {
        font-size: 14px;
        font-weight: 600;
        color: var(--success-color);
    }

    /* Revenue line items */
    .revenue-section {
        margin-bottom: 24px;
    }

    .line-item-card {
        border: 1px solid var(--border-color);
        border-radius: 8px;
        margin-bottom: 16px;
        background: var(--bg-secondary);
        transition: all 0.2s;
    }

    .line-item-card:hover {
        border-color: var(--border-hover);
    }

    .line-item-header {
        padding: 16px 20px;
        border-bottom: 1px solid var(--border-color);
        background: var(--bg-tertiary);
        border-radius: 8px 8px 0 0;
    }

    .product-title {
        font-size: 15px;
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 4px;
    }

    .product-details {
        font-size: 13px;
        color: var(--text-secondary);
    }

    .costs-section {
        padding: 16px 20px;
    }

    .costs-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
    }

    .costs-title {
        font-size: 14px;
        font-weight: 600;
        color: var(--text-primary);
    }

    .total-costs {
        font-size: 13px;
        font-weight: 600;
        color: var(--danger-color);
    }

    .cost-item {
        display: flex;
        align-items: center;
        gap: 4px;
        padding: 10px 12px;
        background: var(--bg-tertiary);
        border-radius: 6px;
        margin-bottom: 8px;
        border: 1px solid var(--border-color);
        position: relative;
    }

    .expandable-cost-item {
        background: var(--bg-tertiary);
        border: 1px solid var(--border-color);
        border-radius: 6px;
        margin-bottom: 8px;
    }

    .cost-item-header {
        display: flex;
        align-items: center;
        gap: 4px;
        padding: 10px 12px;
        cursor: pointer;
        transition: background-color 0.2s;
    }

    .cost-item-header:hover {
        background: var(--bg-primary);
    }

    .expand-arrow {
        font-size: 12px;
        color: var(--text-muted);
        transition: transform 0.2s;
        margin-right: 8px;
    }

    .expanded .expand-arrow {
        transform: rotate(90deg);
    }

    .cost-details {
        display: none;
        padding: 16px;
        background: var(--bg-secondary);
        border-top: 1px solid var(--border-color);
        font-size: 13px;
        color: var(--text-secondary);
        line-height: 1.5;
    }

    .expanded .cost-details {
        display: block;
    }

    .calculation-highlight {
        background: var(--bg-primary);
        padding: 2px 4px;
        border-radius: 3px;
        font-weight: 600;
        color: var(--accent-color);
    }

    .delete-cost-btn {
        background: none;
        border: none;
        cursor: pointer;
        color: #9ca3af;
        font-size: 14px;
        font-weight: bold;
        padding: 0;
        margin: 0;
        margin-right: 6px;
        transition: color 0.2s;
        line-height: 1;
        flex-shrink: 0;
    }

    .delete-cost-btn:hover {
        color: var(--danger-color);
    }

    [data-theme="dark"] .delete-cost-btn {
        color: white;
    }

    [data-theme="dark"] .delete-cost-btn:hover {
        color: var(--danger-color);
    }

    .delete-unassigned-btn {
        background: none;
        border: none;
        cursor: pointer;
        color: #9ca3af;
        font-size: 14px;
        font-weight: bold;
        padding: 0;
        margin: 0;
        margin-right: 6px;
        transition: color 0.2s;
        line-height: 1;
        flex-shrink: 0;
    }
    .delete-unassigned-btn:hover {
        color: var(--danger-color);
    }
    [data-theme="dark"] .delete-unassigned-btn {
        color: white;
    }
    [data-theme="dark"] .delete-unassigned-btn:hover {
        color: var(--danger-color);
    }

    .cost-description {
        flex: 1;
        font-size: 13px;
        color: var(--text-primary);
    }

    .cost-input {
        width: 100px;
        padding: 4px 8px;
        border: 1px solid var(--border-color);
        border-radius: 4px;
        font-size: 13px;
        font-weight: normal;
        font-family: system-ui, -apple-system, sans-serif;
        text-align: right;
        background: var(--bg-tertiary);
        color: var(--text-muted);
        cursor: not-allowed;
    }

    .cost-input.editable {
        background: var(--bg-secondary);
        color: var(--text-primary);
        cursor: text;
    }

    .cost-input.editable:focus {
        outline: none;
        border-color: var(--accent-color);
    }

    .invoice-badge {
        background: var(--bg-primary);
        color: var(--text-secondary);
        padding: 3px 8px;
        border-radius: 4px;
        font-size: 11px;
        font-weight: 500;
        border: 1px solid var(--border-color);
    }

    .add-cost-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 12px;
        background: var(--bg-primary);
        border: 1px dashed var(--border-color);
        border-radius: 6px;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 13px;
        transition: all 0.2s;
        cursor: pointer;
    }

    .add-cost-btn:hover {
        background: var(--bg-tertiary);
        border-color: var(--border-hover);
        color: var(--text-secondary);
    }

    .profit-summary {
        padding: 12px 20px;
        background: var(--bg-primary);
        border-top: 1px solid var(--border-color);
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-radius: 0 0 8px 8px;
    }

    .profit-amount {
        font-size: 14px;
        font-weight: 600;
        color: var(--success-color);
    }

    .margin-badge {
        padding: 4px 10px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 600;
        border: 1px solid;
    }

    .margin-excellent {
        background: var(--bg-secondary);
        color: var(--success-color);
        border-color: var(--success-color);
    }

    .margin-good {
        background: var(--bg-secondary);
        color: var(--warning-color);
        border-color: var(--warning-color);
    }

    .margin-poor {
        background: var(--bg-secondary);
        color: var(--danger-color);
        border-color: var(--danger-color);
    }

    /* Unassigned costs */
    .unassigned-section {
        background: var(--bg-tertiary);
        border: 1px solid var(--warning-color);
        border-radius: 8px;
        padding: 16px;
        margin-bottom: 24px;
        overflow: visible;
        position: relative;
    }

    .unassigned-title {
        font-size: 14px;
        font-weight: 600;
        color: var(--warning-color);
        margin-bottom: 12px;
    }

    .unassigned-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 12px;
        background: var(--bg-secondary);
        border-radius: 6px;
        margin-bottom: 8px;
        border: 1px solid var(--warning-color);
        cursor: grab;
        transition: all 0.2s;
        position: relative;
        z-index: 10;
    }

    .unassigned-item .cost-description {
        flex: 1;
    }

    .unassigned-item .cost-amount {
        font-weight: 600;
        color: var(--text-primary);
        margin-left: 8px;
    }

    .unassigned-item:hover {
        background: var(--bg-tertiary);
        transform: translateY(-1px);
        box-shadow: var(--shadow-sm);
    }

    .unassigned-item.dragging {
        opacity: 0.5;
        cursor: grabbing;
        transform: rotate(5deg);
    }

    .unassigned-item:active {
        cursor: grabbing;
    }

    .warning-text {
        font-size: 12px;
        color: var(--text-muted);
        font-style: italic;
        margin-top: 8px;
    }

    /* Other costs section */
    .other-costs-section {
        background: var(--bg-tertiary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 16px;
        margin-bottom: 24px;
    }

    /* Summary section */
    .summary-section {
    }

    .summary-title {
        font-size: 16px;
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 16px;
    }

    .summary-row {
        display: flex;
        justify-content: space-between;
        margin-bottom: 8px;
        font-size: 13px;
        color: var(--text-secondary);
    }

    .summary-row.total {
        border-top: 1px solid var(--border-color);
        padding-top: 12px;
        margin-top: 12px;
        font-size: 14px;
        font-weight: 600;
        color: var(--text-primary);
    }

    .summary-value.positive {
        color: var(--success-color);
        font-weight: 600;
    }

    .summary-value.negative {
        color: var(--danger-color);
        font-weight: 600;
    }

    /* Status indicators */
    .status-auto {
        background: #dcfce7;
        color: #166534;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
    }

    .status-manual {
        background: #fef3c7;
        color: #d97706;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
    }

    .status-invoice {
        background: var(--accent-color);
        color: white;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
    }

    .status-missing {
        background: #fee2e2;
        color: #991b1b;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
    }

    .status-override-active {
        background: var(--warning-color);
        color: white;
        padding: 2px 6px;
        border-radius: 3px;
        font-size: 10px;
        font-weight: 500;
    }

    .status-optional {
        background: #e5e7eb;
        color: #6b7280;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
    }

    [data-theme="dark"] .status-optional {
        background: var(--bg-tertiary);
        color: var(--text-muted);
        border: 1px solid var(--border-color);
    }

    /* Dark mode styling for all status badges */
    [data-theme="dark"] .status-auto {
        background: #14532d !important;
        color: #86efac !important;
        border: 1px solid #16a34a !important;
    }

    [data-theme="dark"] .status-manual {
        background: #451a03 !important;
        color: #fed7aa !important;
        border: 1px solid #f59e0b !important;
    }

    [data-theme="dark"] .status-missing {
        background: #7f1d1d !important;
        color: #fecaca !important;
        border: 1px solid #dc2626 !important;
    }

    [data-theme="dark"] .status-override-active {
        background: #451a03 !important;
        color: #fed7aa !important;
        border: 1px solid #f59e0b !important;
    }

    /* Sticky completion badge */
    .completion-badge {
        position: sticky;
        top: 20px;
        float: right;
        background: var(--warning-color);
        color: white;
        padding: 6px 12px;
        border-radius: 16px;
        font-size: 11px;
        font-weight: 600;
        z-index: 100;
        cursor: help;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        margin-bottom: -32px;
        margin-right: 0;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .completion-badge.complete {
        background: var(--success-color);
    }

    .completion-circle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .completion-ring {
        width: 16px;
        height: 16px;
    }

    .completion-text {
        white-space: nowrap;
        font-size: 11px;
        font-weight: 600;
    }



    /* Override buttons */
    .override-btn {
        background: none;
        border: 1px solid var(--border-color);
        border-radius: 4px;
        padding: 4px 8px;
        font-size: 11px;
        cursor: pointer;
        color: var(--text-muted);
        transition: all 0.2s;
    }

    .override-btn:hover {
        background: var(--bg-tertiary);
        border-color: var(--border-hover);
    }

    .override-btn.overridden {
        background: #fef3c7;
        border-color: #f59e0b;
        color: #92400e;
    }

    /* Dark mode override button styling */
    [data-theme="dark"] .override-btn {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border-color: var(--border-color);
    }

    [data-theme="dark"] .override-btn:hover {
        background: var(--bg-tertiary);
        border-color: var(--border-hover);
    }

    [data-theme="dark"] .override-btn.overridden {
        background: #451a03;
        color: #fed7aa;
        border-color: #f59e0b;
    }

    /* Drop zones */
    .drop-zone {
        border: 2px dashed var(--border-color);
        border-radius: 6px;
        padding: 8px;
        margin: 4px 0;
        min-height: 40px;
        display: none;
        align-items: center;
        justify-content: center;
        color: var(--text-muted);
        font-size: 12px;
        transition: all 0.2s;
        background: var(--bg-primary);
    }

    .drop-zone.drag-active {
        display: flex !important;
        border-color: var(--accent-color) !important;
        background: var(--accent-color) !important;
        color: white !important;
        opacity: 0.8;
        font-weight: bold;
        animation: pulse 1s infinite;
    }

    @keyframes pulse {
        0% { opacity: 0.8; }
        50% { opacity: 1; }
        100% { opacity: 0.8; }
    }

    .drop-zone.drag-over {
        border-color: var(--success-color);
        background: rgba(var(--accent-rgb), 0.1);
    }

    /* Question mark tooltip */
    .help-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 16px;
        height: 16px;
        background: var(--text-muted);
        color: white;
        border-radius: 50%;
        font-size: 10px;
        font-weight: bold;
        margin-left: 6px;
        cursor: help;
        position: relative;
    }

    .tooltip-container {
        position: absolute;
        left: calc(100% + 10px);
        top: 50%;
        transform: translateY(-50%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.2s;
        z-index: 1001;
        pointer-events: none;
    }

    .tooltip-arrow {
        position: absolute;
        right: 100%;
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        height: 0;
        border: 8px solid transparent;
        border-right-color: #2d2d2d;
        border-left: 0;
    }

    .tooltip-content {
        background: #2d2d2d;
        color: white;
        padding: 8px 12px;
        border-radius: 6px;
        font-size: 12px;
        font-weight: normal;
        width: 280px;
        white-space: normal;
        line-height: 1.4;
        border: 1px solid #404040;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }

    .help-icon:hover .tooltip-container {
        opacity: 1;
        visibility: visible;
    }

    /* Hide/Show Views */
    .line-items-view {
        display: block;
        overflow: visible;
    }

    .summary-view {
        display: none;
    }
    
    .product-modal-body {
        overflow-y: auto !important;
    }

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

    .line-items-view.active {
        display: block;
    }

    .line-items-view:not(.active) {
        display: none;
    }

    /* Simple view styling */
    .simple-summary {
        background: var(--bg-tertiary);
        padding: 24px;
        border-radius: 8px;
        text-align: center;
        border: 1px solid var(--border-color);
    }

    .simple-summary h3 {
        color: var(--text-secondary);
        margin-bottom: 16px;
        font-weight: 500;
    }

    .simple-summary p {
        color: var(--text-muted);
        font-size: 14px;
        line-height: 1.5;
    }

    .simple-totals {
        margin-top: 20px;
        padding: 16px;
        background: var(--bg-secondary);
        border-radius: 6px;
        border: 1px solid var(--border-color);
    }

    .simple-row {
        display: flex;
        justify-content: space-between;
        margin-bottom: 8px;
        font-size: 14px;
    }

    .simple-row.total {
        padding-top: 8px;
        border-top: 1px solid var(--border-color);
        font-weight: 600;
    }
    
    /* Hide spinner arrows on number inputs */
    .cost-input[type="number"]::-webkit-outer-spin-button,
    .cost-input[type="number"]::-webkit-inner-spin-button {
        -webkit-appearance: none !important;
        margin: 0 !important;
        display: none !important;
    }
    
    .cost-input[type="number"] {
        -moz-appearance: textfield !important;
    }
    
    /* Additional spinner removal for all number inputs */
    input[type="number"]::-webkit-outer-spin-button,
    input[type="number"]::-webkit-inner-spin-button {
        -webkit-appearance: none !important;
        margin: 0 !important;
        display: none !important;
        height: 0 !important;
        width: 0 !important;
    }
    
    input[type="number"] {
        -moz-appearance: textfield !important;
        appearance: textfield !important;
    }
    
    /* Cost input field states - Light Mode */
    /* Locked/disabled fields - more specific selectors to override inline styles */
    .product-modal input.cost-input[disabled],
    .product-modal input.cost-input[readonly],
    input.cost-input[disabled],
    input.cost-input[readonly] {
        background: #f1f5f9 !important;
        background-color: #f1f5f9 !important;
        color: #64748b !important;
        cursor: not-allowed !important;
        border: 1px solid #e2e8f0 !important;
        opacity: 0.75;
    }
    
    /* Editable fields - manual entry fields */
    .product-modal input.cost-input:not([disabled]):not([readonly]),
    input.cost-input:not([disabled]):not([readonly]) {
        background: #ffffff !important;
        background-color: #ffffff !important;
        color: #1e293b !important;
        cursor: text !important;
        border: 1px solid #d1d5db !important;
        opacity: 1;
    }
    
    /* Dark mode cost input states */
    [data-theme="dark"] .product-modal input.cost-input[disabled],
    [data-theme="dark"] .product-modal input.cost-input[readonly],
    [data-theme="dark"] input.cost-input[disabled],
    [data-theme="dark"] input.cost-input[readonly] {
        background: #2d2d2d !important;
        background-color: #2d2d2d !important;
        color: #9ca3af !important;
        cursor: not-allowed !important;
        border: 1px solid #404040 !important;
        opacity: 1;
    }
    
    [data-theme="dark"] .product-modal input.cost-input:not([disabled]):not([readonly]),
    [data-theme="dark"] input.cost-input:not([disabled]):not([readonly]) {
        background: #000000 !important;
        background-color: #000000 !important;
        color: #ffffff !important;
        cursor: text !important;
        border: 1px solid #404040 !important;
        opacity: 1;
    }
    
    /* Tax Amount field specific styling */
    /* Light mode */
    #vatOverrideInput[disabled] {
        background: #f1f5f9 !important;
        background-color: #f1f5f9 !important;
        color: #64748b !important;
        cursor: not-allowed !important;
        border: 1px solid #e2e8f0 !important;
    }
    
    #vatOverrideInput:not([disabled]) {
        background: #ffffff !important;
        background-color: #ffffff !important;
        color: #1e293b !important;
        cursor: text !important;
        border: 1px solid #d1d5db !important;
    }
    
    /* Dark mode - higher specificity selectors */
    [data-theme="dark"] .product-modal #vatOverrideInput[disabled],
    [data-theme="dark"] .summary-row #vatOverrideInput[disabled],
    [data-theme="dark"] #vatOverrideInput[disabled] {
        background: #2d2d2d !important;
        background-color: #2d2d2d !important;
        color: #9ca3af !important;
        cursor: not-allowed !important;
        border: 1px solid #404040 !important;
        border-color: #404040 !important;
    }
    
    [data-theme="dark"] .product-modal #vatOverrideInput:not([disabled]),
    [data-theme="dark"] .summary-row #vatOverrideInput:not([disabled]),
    [data-theme="dark"] #vatOverrideInput:not([disabled]) {
        background: #000000 !important;
        background-color: #000000 !important;
        color: #ffffff !important;
        cursor: text !important;
        border: 1px solid #404040 !important;
        border-color: #404040 !important;
    }
    
    

/* PROGRESS CIRCLE STYLES ONLY */
.progress-circle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.progress-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: conic-gradient(#3b82f6 0deg 234deg, #e2e8f0 234deg 360deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.progress-circle::before {
    content: '';
    width: 64px;
    height: 64px;
    background: white;
    border-radius: 50%;
    position: absolute;
}

.progress-text {
    position: relative;
    z-index: 1;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.progress-label {
    text-align: center;
    color: #64748b;
    margin-bottom: 32px;
    font-size: 15px;
    font-weight: 500;
}

.completion-circle-old {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: conic-gradient(#3b82f6 0deg 298deg, #e2e8f0 298deg 360deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.completion-circle-old::before {
    content: '';
    width: 64px;
    height: 64px;
    background: white;
    border-radius: 50%;
    position: absolute;
}

.completion-text-old {
    position: relative;
    z-index: 1;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

/* DARK MODE PROGRESS CIRCLE STYLES */
[data-theme="dark"] .progress-circle::before,
[data-theme="dark"] .completion-circle-old::before {
    background: var(--bg-primary);
}

[data-theme="dark"] .progress-text,
[data-theme="dark"] .completion-text-old {
    color: var(--text-primary);
}

[data-theme="dark"] .progress-label {
    color: var(--text-secondary);
}


/* MAIN COST CONTENT LEFT SIDE BORDER */
.main-cost-content {
    border: 1px solid #e2e8f0;
    padding: 20px;
    border-radius: 8px;
}

[data-theme="dark"] .main-cost-content {
    border-color: var(--border-color);
}


/* SUMMARY PANEL FONT SIZES, DIVIDERS AND SPACING FROM MOCKUP */
.summary-panel .summary-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
}

.summary-panel .summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 15px;
    border-bottom: 1px solid #f1f5f9;
}

.summary-panel .summary-row:last-child {
    border-bottom: none;
}

.summary-panel .revenue-section {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.summary-panel .revenue-ex-tax {
    color: #00d084;
    font-weight: bold;
}

.summary-panel .costs-section .summary-row span:last-child {
    color: #ef4444;
    font-weight: bold;
}

.summary-panel .sub-items {
    margin-left: 20px;
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 8px;
}

.summary-panel .sub-item {
    margin-bottom: 4px;
}

.summary-panel .summary-row.total {
    font-size: 16px;
    font-weight: 600;
    padding: 12px 0;
    border-top: 1px solid #e2e8f0;
    margin-top: 8px;
}

.summary-panel .profit-positive {
    color: #00d084;
    font-weight: bold;
}

.summary-panel .profit-negative {
    color: #ef4444;
    font-weight: bold;
}

/* DARK MODE COMPATIBILITY */
[data-theme="dark"] .summary-panel .summary-title {
    color: var(--text-primary);
}

[data-theme="dark"] .summary-panel .summary-row {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .summary-panel .revenue-section {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .summary-panel .summary-row.total {
    border-top-color: var(--border-color);
}

[data-theme="dark"] .summary-panel .sub-items {
    color: var(--text-muted);
}


/* TAX CONTROLS INLINE LAYOUT */
.summary-panel .tax-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-panel .tax-controls .status-auto {
    flex-shrink: 0;
}

.summary-panel .tax-controls .override-btn {
    flex-shrink: 0;
}

.summary-panel .tax-controls input {
    flex-shrink: 0;
}


/* REMOVE PADDING FROM COSTS SECTION IN SUMMARY PANEL ONLY */
.summary-panel .costs-section {
    padding: 0px;
}


/* HIDE ASSIGNED/UNASSIGNED SUB-ITEMS IN SUMMARY PANEL */
.summary-panel .sub-items {
    display: none;
}


/* SUMMARY PANEL STYLES - EQUAL SPACING */
#orderModalOverlay .summary-panel .summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 15px;
    border-bottom: 1px solid #f1f5f9;
    margin: 0;
}

#orderModalOverlay .summary-panel .summary-row.total:last-child {
    border-bottom: none;
}

#orderModalOverlay .summary-panel .revenue-section {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0px;
    margin-bottom: 20px;
}

#orderModalOverlay .summary-panel .revenue-section .summary-row:last-child {
    border-bottom: none;
}

#orderModalOverlay .summary-panel .costs-section {
    margin-bottom: 20px;
}

#orderModalOverlay .summary-panel .summary-row.total {
    font-size: 16px;
    font-weight: 600;
    padding: 12px 0;
    margin-top: 12px;
    margin-bottom: 0;
    border-bottom: none;
    border-top: none;
}

/* Dark mode */
[data-theme="dark"] #orderModalOverlay .summary-panel .summary-row {
    border-bottom-color: var(--border-color);
}
[data-theme="dark"] #orderModalOverlay .summary-panel .revenue-section {
    border-bottom-color: var(--border-color);
}
[data-theme="dark"] #orderModalOverlay .summary-panel .summary-row.total {
    border-top-color: var(--border-color);
}

/* Dark Mode - Conflict Resolution Modal */
[data-theme="dark"] .conflict-modal-overlay .product-modal {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .conflict-modal-overlay .product-modal-header {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .conflict-modal-overlay .product-modal-header h3 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .conflict-modal-overlay .product-modal-body {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .conflict-modal-overlay .modal-close-btn {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .conflict-modal-overlay .modal-close-btn:hover {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .conflict-modal-overlay .btn:not(.secondary) {
    background: #3b82f6 !important;
    color: white !important;
    border: 1px solid #3b82f6 !important;
}

[data-theme="dark"] .conflict-modal-overlay .btn:not(.secondary):hover {
    background: #2563eb !important;
    border-color: #2563eb !important;
}

[data-theme="dark"] .conflict-modal-overlay .btn.secondary {
    background: #6b7280 !important;
    color: white !important;
    border: 1px solid #6b7280 !important;
}

[data-theme="dark"] .conflict-modal-overlay .btn.secondary:hover {
    background: #4b5563 !important;
    border-color: #4b5563 !important;
}