/* Shared dark/light theme overrides with user toggle support */
:root { color-scheme: light dark; }

/* Base (light) left mostly to existing styles */
body.theme-light {
	--cab-title-color:#222;
	--cab-desc-color:#444;
}

/* Explicit dark theme (mirrors existing index dark block) */
body.theme-dark { background:#111418; color:#e2e8f0; --cab-title-color:#e2e8f0; --cab-desc-color:#c8d2dc; }
body.theme-dark .nav-header { background:#1c2330; border-bottom-color:#2a3442; box-shadow:0 2px 8px rgba(0,0,0,0.6); }
body.theme-dark .nav-button { background:#2e425a; }
body.theme-dark .nav-button.active { background:#1a5a99; }
body.theme-dark .panel-left, body.theme-dark .panel-middle, body.theme-dark .panel-right { background:#1c2330; border-color:#2a3442; box-shadow:0 2px 6px rgba(0,0,0,0.4); }
body.theme-dark .panel-left h3, body.theme-dark .panel-left h4, body.theme-dark .panel-left label { color:#d6dee8; }
body.theme-dark .top-bar { background:#1c2330; border-bottom:1px solid #2a3442; }
body.theme-dark .top-bar label { color:#e2e8f0; }
body.theme-dark .top-bar select { background:#243142; color:#e2e8f0; border:1px solid #364b63; }
body.theme-dark #viewerContainer { background:#161c24; }
/* Reinforce viewer light background (some inline scripts might override) */
body.theme-light #viewerContainer { background:#ffffff !important; }
/* Defensive neutralization of stray inline background attributes */
body.theme-dark #viewerContainer[style], body.theme-light #viewerContainer[style]{ background:inherit !important; }
body.theme-dark #viewerContainer canvas { background:transparent; }
body.theme-dark .btn-secondary-lite { background:#243142; color:#d0d7de; border-color:#2f4257; }
body.theme-dark .btn-secondary-lite:hover { background:#2a3a4d; }
body.theme-dark #floatingCartSummary, body.theme-dark #floatingCartSummaryIndex { background:#1c2330; color:#e2e8f0; border-color:#2a3442; }
body.theme-dark .cart-sidebar { background:#1c2330; color:#e2e8f0; border-left:1px solid #2a3442; }
body.theme-dark .cart-sidebar h2, body.theme-dark .cart-sidebar h3 { color:#e2e8f0; }
body.theme-dark #pricingSection, body.theme-dark #priceBreakdown { background:#1c2330; border:none; border-radius:8px; }
body.theme-dark #pricingSection h5, body.theme-dark #priceBreakdown h5, body.theme-dark #priceBreakdown h4 { color:#d6dee8; }
/* 3D Controls heading */
body.theme-dark .inl-607a4cb9 { color:#e2e8f0 !important; }
/* Door page parity */
body.theme-dark .nav-header { background:#1c2330; border-bottom-color:#2a3442; }
body.theme-dark .nav-header .nav-button { background:#243142; color:#e2e8f0; }
body.theme-dark .nav-header .nav-button.active { background:#1a5a99; color:#fff; }
/* Door pricing basic info grid */
body.theme-dark .basic-info-grid { background:transparent; }
body.theme-dark .basic-info-grid .basic-info-item { color:#c8d2dc; }
/* Door pricing section wrapper */
body.theme-dark .door-pricing-section { background:#1c2330; border:1px solid #2a3442; border-radius:8px; padding:12px 14px; }
body.theme-light .door-pricing-section { background:#ffffff; }
/* Import section */
body.theme-dark #fileImportSection, body.theme-dark .door-import-section { background:#1c2330 !important; border:1px solid #2a3442; border-radius:8px; padding:12px 14px; }
body.theme-dark #fileImportSection * { color:#c8d2dc; }
body.theme-dark .door-import-heading { color:#e2e8f0 !important; }
body.theme-dark .door-file-upload-area { background:#243142 !important; border:2px dashed #3a536d !important; }
body.theme-dark .door-file-upload-desc { color:#d6dee8 !important; }
body.theme-dark .door-file-upload-btn { background:#1a5a99 !important; color:#fff !important; border:none !important; }
body.theme-dark .door-file-upload-btn:hover { background:#1f6fb8 !important; }
body.theme-dark .door-file-upload-note { color:#9ca3af !important; }
/* Door import fine-grained blocks */
.file-upload-section { background: var(--import-bg-secondary,#f8f9fa); border:2px solid var(--import-border-color,#dee2e6); border-radius:6px; padding:15px; margin-bottom:20px; text-align:center; }
.summary-stats-container { background: var(--import-bg-primary,#e9ecef); padding:15px; border-radius:6px; margin-bottom:20px; display:flex; gap:20px; flex-wrap:wrap; }
body.theme-dark .file-upload-section { background:#243142 !important; border:2px solid #364b63 !important; }
body.theme-dark .summary-stats-container { background:#233042 !important; border:1px solid #364b63; }
body.theme-dark .summary-stats-container * { color:#c8d2dc; }
/* Nav header parity adjustments */
body.theme-light .nav-header { background:#ffffff; border-bottom:1px solid #e2e8f0; }
body.theme-light .nav-header .nav-button { background:#f1f5f9; color:#1f2933; }
body.theme-light .nav-header .nav-button.active { background:#1a5a99; color:#fff; }
body.theme-dark .nav-header .nav-container { background:transparent; }
/* Enforce equal column min-heights similar to index */
.main-3col-layout { align-items:stretch; }
.main-3col-layout > .panel-left, .main-3col-layout > .panel-middle, .main-3col-layout > .panel-right { display:flex; flex-direction:column; }
/* Defensive: ensure layout-panels.css flex isn't overridden by legacy inline rules */
body .main-3col-layout { display:flex !important; }
body.theme-dark .panel-left h3, body.theme-dark .panel-right h3 { color:#e2e8f0; }
body.theme-dark #priceBreakdown, body.theme-dark #priceBreakdown * { color:#c8d2dc; }
body.theme-dark .drop-zone, body.theme-dark .import-drop-wrapper, body.theme-dark .inl-153b2178 { background:#1c2330 !important; color:#d6dee8 !important; }
body.theme-dark .tab-button { background:#243142; color:#d0d7de; border-color:#2f4257; }
body.theme-dark .tab-button.active { background:#1a5a99; color:#fff; border-color:#1a5a99; }
body.theme-dark select, body.theme-dark input, body.theme-dark textarea { background:#243142; color:#e2e8f0; border:1px solid #364b63; }
body.theme-dark input[type=text], body.theme-dark input[type=number] { background:#243142; }
/* Fixed-dimension inputs (readOnly when min===max) */
body.theme-dark input.dim-fixed-readonly { background:#1e293b !important; color:#e2e8f0 !important; border:1px solid #364b63 !important; }
body.theme-light input.dim-fixed-readonly { background:#f3f4f6 !important; color:#111827 !important; border:1px solid #d1d5db !important; }
body.theme-dark #modelSelect, body.theme-dark #categorySelect, body.theme-dark #series, body.theme-dark #caseTexture, body.theme-dark #doorCategory, body.theme-dark #doorStyle { background:#243142 !important; color:#e2e8f0 !important; border:1px solid #364b63 !important; }
body.theme-dark select option { background:#243142; color:#e2e8f0; }
/* Dark mode: fix cabinet dropdown option hover (override app.css light background) */
body.theme-dark #modelSelect option:hover, 
body.theme-dark #modelSelectMobile option:hover { background:#2a3a4d !important; color:#e2e8f0 !important; }
body.theme-dark .panel-right .inl-125adce4, body.theme-dark .panel-right .inl-b4534c93 { background:#1c2330 !important; border:none !important; }
body.theme-dark #btn-doors, body.theme-dark #btn-drawers, body.theme-dark #btn-hardware { background:#243142 !important; color:#e2e8f0 !important; border:1px solid #364b63 !important; }
body.theme-dark .dimension-invalid { background:#2a1c20 !important; }
body.theme-dark #customerNotes, body.theme-dark #customerNotesPreview, body.theme-dark #inlineTotal { background:#243142 !important; color:#e2e8f0 !important; border-color:#364b63 !important; }
body.theme-dark .btn-cart-primary { box-shadow:0 0 0 1px #0d3d66; }
/* Wireframe + layer buttons (index) */
body.theme-dark #btn-wireframe { background:#243142 !important; color:#e2e8f0 !important; border:1px solid #364b63 !important; }
body.theme-dark #btn-wireframe:hover { background:#2a3a4d !important; }
/* Notes / inline total (index) */
body.theme-dark #notesSection > div { background:#1c2330 !important; border-color:#2a3442 !important; }
body.theme-dark #customerNotes { background:#1e2a38 !important; color:#e2e8f0 !important; border-color:#364b63 !important; }
body.theme-dark #customerNotesPreview { background:#243142 !important; color:#e2e8f0 !important; border-color:#364b63 !important; }
body.theme-dark #inlineTotal { background:#243142 !important; color:#e2e8f0 !important; border-color:#364b63 !important; }
body.theme-dark #customerNotesPreview::placeholder, body.theme-dark #customerNotes::placeholder { color:#9ca3af !important; }
/* Dimension invalid highlight (reuse) */
body.theme-dark .dimension-invalid { border-color:#dc3545 !important; box-shadow:0 0 0 1px #dc3545 !important; }
/* Generic modal dark styling (index + shared) */
body.theme-dark .modal { background:rgba(0,0,0,0.85); }
body.theme-dark .modal .modal-content { background:#1c2330 !important; color:#e2e8f0 !important; border:1px solid #2a3442 !important; }
body.theme-dark .modal select, body.theme-dark .modal textarea, body.theme-dark .modal input[type=text], body.theme-dark .modal input[type=number], body.theme-dark .modal option { background:#243142 !important; color:#e2e8f0 !important; border:1px solid #364b63 !important; }
body.theme-dark .modal .tab-container, body.theme-dark .modal .preview-section, body.theme-dark .modal .list-group-item, body.theme-dark .modal .card, body.theme-dark .modal .card-body, body.theme-dark .modal .panel, body.theme-dark .modal .panel-body { background:#1c2330 !important; border-color:#2a3442 !important; }
body.theme-dark .modal hr { border-color:#2a3442 !important; }
body.theme-dark .modal strong, body.theme-dark .modal b, body.theme-dark .modal h4, body.theme-dark .modal h5 { color:#f1f5f9 !important; }
body.theme-dark .modal .tab-button { background:#243142 !important; color:#d0d7de !important; border:1px solid #2f4257 !important; }
body.theme-dark .modal .tab-button.active { background:#1a5a99 !important; color:#fff !important; border-color:#1a5a99 !important; }
/* Selection preview cards */
body.theme-dark #currentSelectionsList > div,
body.theme-dark #includedHardwareList > div,
body.theme-dark #additionalHardwareList > div,
body.theme-dark #doorStyleDetails > div,
body.theme-dark #hardwareDetails > div,
body.theme-dark #drawerDetails > div,
body.theme-dark #caseMaterialDetails > div,
body.theme-dark #cabinetDetails > div { background:#233042 !important; border:1px solid #2d4256 !important; color:#d6dee8 !important; }
body.theme-dark #cabinetDetails, body.theme-dark #cabinetDetails * { color:#d6dee8 !important; }
body.theme-dark #cabinetDetails .spec-block, body.theme-dark #cabinetDetails .specs, body.theme-dark #cabinetDetails [class*='spec'], body.theme-dark #cabinetDetails [class*='Spec'] { background:#233042 !important; border:1px solid #2d4256 !important; }
body.theme-dark #cabinetDetails p, body.theme-dark #cabinetDetails li, body.theme-dark #cabinetDetails span { color:#c8d2dc !important; }
body.theme-dark .preview-section h3, body.theme-dark .preview-section p, body.theme-dark .preview-section label { color:#d6dee8 !important; }
body.theme-dark .preview-section p { color:#c0ccd6 !important; }
/* Door & checkout shared adjustments */
body.theme-dark .container { background:#1c2330; border:1px solid #2a3442; }
body.theme-dark .disclaimer-box { background:#233042; border:1px solid #2d4256; color:#d6dee8; }

/* Door page specific dark theme variables */
body.theme-dark {
	--import-bg-primary:#233042;
	--import-bg-secondary:#243142;
	--import-text-primary:#e2e8f0;
	--import-text-secondary:#d6dee8;
	--import-border-color:#364b63;
	--import-accent-color:#3da5ff;
}

/* Door page: file import & upload areas */
body.theme-dark #fileImportSection { background:var(--import-bg); color:var(--import-fg); border:1px solid var(--import-border,#2a3442); border-radius:8px; padding:0 0 10px 0; }
body.theme-dark #fileImportSection * { color:inherit; }
body.theme-dark #fileImportSection[style] { background:var(--import-bg) !important; }
body.theme-dark #fileUploadArea { background:#233042 !important; border:1px solid #2d4256 !important; }
body.theme-dark #fileUploadArea div[style*="font-size: 24px"] { color:#3da5ff !important; }
body.theme-dark #fileUploadArea div[style*="font-size: 14px"],
body.theme-dark #fileUploadArea div[style*="color: #333"],
body.theme-dark #fileUploadArea div[style*="color: #666"],
body.theme-dark #fileUploadArea div[style*="color:#333"],
body.theme-dark #fileUploadArea div[style*="color:#666"] { color:#d6dee8 !important; }
body.theme-dark #fileUploadArea button { background:#1a5a99 !important; }
body.theme-dark #fileUploadArea button:hover { background:#2070bf !important; }
body.theme-dark #fileUploadArea div[style*="font-size: 12px"] { color:#9aa9b9 !important; }
body.theme-dark #fileUploadArea[style*="dashed"] { border-style:solid !important; }

/* Door selection & form sections */
body.theme-dark #doorSelectionSection h3,
body.theme-dark #doorSelectionSection label,
body.theme-dark #doorSelectionSection p { color:#d6dee8; }
body.theme-dark #doorSelectionSection input,
body.theme-dark #doorSelectionSection select { background:#243142; color:#e2e8f0; border:1px solid #364b63; }
body.theme-dark #doorSelectionSection input:focus,
body.theme-dark #doorSelectionSection select:focus { outline:2px solid #1a5a99; outline-offset:1px; }
body.theme-dark #customerNotesSection { background:#243142 !important; border-color:#364b63 !important; }
body.theme-dark #customerNotesSection label,
body.theme-dark #customerNotesSection small { color:#e2e8f0 !important; }
body.theme-dark #splitDoorRequirements { background:var(--panel-right-bg,#2d1b1b) !important; border-color:#dc3545 !important; }
body.theme-dark #splitDoorRequirements h4,
body.theme-dark #splitDoorRequirements label,
body.theme-dark #splitDoorRequirements small { color:#e2e8f0 !important; }
body.theme-dark #splitVertical,
body.theme-dark #splitHorizontal,
body.theme-dark #splitSpecialRequirements { background:#1c2330 !important; color:#e2e8f0 !important; border-color:#364b63 !important; }
body.theme-dark #buttonSection { background:#1c2330; }

/* Pricing & right panel refinement */
body.theme-dark #priceBreakdown, body.theme-dark #priceBreakdown * { background:transparent; color:#c8d2dc; }
body.theme-dark #pricingSection h3 { color:#f1f5f9; margin-top:0; }
body.theme-dark #pricingSection > div { border:none !important; }

/* Import Tab (door style modal) dark specifics */
body.theme-dark #doorStyleModal #import-tab .summary-stats-container { background: var(--import-bg-primary) !important; }
body.theme-dark #doorStyleModal #import-tab .summary-stats-item { color: var(--import-text-secondary) !important; }
body.theme-dark #doorStyleModal #import-tab .summary-stats.total-count,
body.theme-dark #doorStyleModal #import-tab .summary-stats.unique-sizes,
body.theme-dark #doorStyleModal #import-tab .summary-stats.total-sqft { color: var(--import-accent-color) !important; }
body.theme-dark #doorStyleModal #import-tab .bulk-edit-container { background: var(--import-bg-secondary) !important; border-color: var(--import-border-color) !important; }
body.theme-dark #doorStyleModal #import-tab .bulk-edit-container h4 { color: var(--import-text-primary) !important; }
body.theme-dark #doorStyleModal #import-tab .bulk-edit-container label { color: var(--import-text-secondary) !important; }
body.theme-dark #doorStyleModal #import-tab .bulk-edit-container select,
body.theme-dark #doorStyleModal #import-tab .bulk-edit-container input,
body.theme-dark #doorStyleModal #import-tab .bulk-edit-container button { background: var(--import-bg-primary) !important; color: var(--import-text-primary) !important; border-color: var(--import-border-color) !important; }
body.theme-dark #doorStyleModal #import-tab table { background: var(--import-bg-secondary) !important; }
body.theme-dark #doorStyleModal #import-tab th { background: var(--import-bg-primary) !important; color: var(--import-text-primary) !important; }
body.theme-dark #doorStyleModal #import-tab td { color: var(--import-text-secondary) !important; border-color: var(--import-border-color) !important; }
body.theme-dark #doorStyleModal #import-tab input[type=text],
body.theme-dark #doorStyleModal #import-tab input[type=number],
body.theme-dark #doorStyleModal #import-tab select,
body.theme-dark #doorStyleModal #import-tab textarea { background: var(--import-bg-primary) !important; color: var(--import-text-primary) !important; border:1px solid var(--import-border-color) !important; }
body.theme-dark #doorStyleModal #import-tab .file-upload-section { background: var(--import-bg-secondary) !important; border-color: var(--import-border-color) !important; color: var(--import-text-secondary) !important; }

/* Full Screen Import Modal */
body.theme-dark #fullScreenImportModal .modal-main { background:#1c2330 !important; }
body.theme-dark #fullScreenImportModal .modal-header { background:#243142 !important; border-bottom-color:#2a3442 !important; }
body.theme-dark #fullScreenImportModal .modal-header h2 { color:#e2e8f0 !important; }
body.theme-dark #fullScreenImportModal .modal-content { background:#1c2330 !important; }
body.theme-dark #fullScreenImportModal .summary-stats-container { background:#233042 !important; }
body.theme-dark #fullScreenImportModal .summary-stats-item { color:#d6dee8 !important; }
body.theme-dark #fullScreenImportModal .bulk-edit-container { background:#243142 !important; border-color:#2a3442 !important; }
body.theme-dark #fullScreenImportModal .bulk-edit-container h4 { color:#e2e8f0 !important; }
body.theme-dark #fullScreenImportModal .bulk-edit-container label { color:#d6dee8 !important; }
body.theme-dark #fullScreenImportModal .bulk-edit-container select,
body.theme-dark #fullScreenImportModal .bulk-edit-container input { background:#1c2330 !important; color:#e2e8f0 !important; border-color:#364b63 !important; }
body.theme-dark #fullScreenImportModal .bulk-edit-container button { background:#1a5a99 !important; color:#fff !important; border-color:#1a5a99 !important; }
body.theme-dark #fullScreenImportModal .bulk-edit-container button:hover { background:#2070bf !important; }
body.theme-dark #fullScreenImportModal .data-table { background:#1c2330 !important; }
body.theme-dark #fullScreenImportModal .data-table th { background:#243142 !important; color:#e2e8f0 !important; border-color:#2a3442 !important; }
body.theme-dark #fullScreenImportModal .data-table td { background:#1c2330 !important; color:#d6dee8 !important; border-color:#2a3442 !important; }
body.theme-dark #fullScreenImportModal .data-table input,
body.theme-dark #fullScreenImportModal .data-table select { background:#233042 !important; color:#e2e8f0 !important; border-color:#364b63 !important; }

/* Cart sidebar / items */
body.theme-dark .cart-sidebar,
body.theme-dark .cart-summary,
body.theme-dark .cart-content,
body.theme-dark .cart-header { background:#1c2330 !important; color:#e2e8f0 !important; }
body.theme-dark .cart-sidebar h3,
body.theme-dark .cart-summary strong { color:#e2e8f0 !important; }
body.theme-dark .cart-actions button,
body.theme-dark .cart-actions-row button { background:#243142 !important; color:#e2e8f0 !important; border:1px solid #364b63 !important; }
body.theme-dark .cart-actions button:hover { background:#2a3a4d !important; }
body.theme-dark #doorStyleModal .modal-content { background:#1c2330 !important; color:#e2e8f0 !important; }
body.theme-dark #doorStyleModal select { background:#243142 !important; color:#e2e8f0 !important; }
body.theme-dark #doorStyleModal .modal-content div[style*="f8f9fa"] { background:#243142 !important; color:#e2e8f0 !important; border-color:#364b63 !important; }
body.theme-dark #doorStyleModal .modal-content h1[style*="#333"],
body.theme-dark #doorStyleModal .modal-content h2[style*="#333"],
body.theme-dark #doorStyleModal .modal-content h3[style*="#333"],
body.theme-dark #doorStyleModal .modal-content h4[style*="#333"],
body.theme-dark #doorStyleModal .modal-content p[style*="#333"],
body.theme-dark #doorStyleModal .modal-content span[style*="#333"] { color:#e2e8f0 !important; }
body.theme-dark #doorStyleModal .modal-content li { color:#cbd5e1; }
body.theme-dark #doorStyleModal .modal-content strong { color:#f1f5f9; }
body.theme-dark .cart-item { background:#1f2935 !important; border:1px solid #2a3442 !important; }
body.theme-dark .cart-item h4[style*="#333"],
body.theme-dark .cart-item h3[style*="#333"],
body.theme-dark .cart-item p[style*="#333"],
body.theme-dark .cart-item span[style*="#333"] { color:#e2e8f0 !important; }
body.theme-dark .cart-item .price { color:#3da5ff !important; }
body.theme-dark .cart-item div[style*="f8f9fa"] { background:#243142 !important; border-color:#364b63 !important; }
body.theme-dark #cartSidebar::-webkit-scrollbar-track { background:#1c2330; }
body.theme-dark #doorStyleModal .modal-content [style*="color: #555"],
body.theme-dark #doorStyleModal .modal-content [style*="color: #666"],
body.theme-dark #doorStyleModal .modal-content [style*="color:#555"],
body.theme-dark #doorStyleModal .modal-content [style*="color:#666"],
body.theme-dark #doorStyleModal .modal-content [style*="color: #333"],
body.theme-dark #doorStyleModal .modal-content [style*="color:#333"],
body.theme-dark #doorStyleModal .modal-content p[style*="#555"],
body.theme-dark #doorStyleModal .modal-content ul[style*="#555"],
body.theme-dark #doorStyleModal .modal-content li[style*="#555"],
body.theme-dark #doorStyleModal .modal-content div[style*="#555"],
body.theme-dark #doorStyleModal .modal-content div[style*="#666"],
body.theme-dark #doorStyleModal .modal-content div[style*="#333"],
body.theme-dark #doorStyleModal .modal-content ul[style*="#333"],
body.theme-dark #doorStyleModal .modal-content li[style*="#333"] { color:#d6dee8 !important; }
body.theme-dark #doorStyleModal .modal-content h3[style*="#333"],
body.theme-dark #doorStyleModal .modal-content h4[style*="#333"],
body.theme-dark #doorStyleModal .modal-content h2[style*="#333"],
body.theme-dark #doorStyleModal .modal-content h1[style*="#333"] { color:#f1f5f9 !important; }
body.theme-dark .cart-item [style*="background: #fff"],
body.theme-dark .cart-item [style*="background:#fff"],
body.theme-dark .cart-item [style*="background: #f8f9fa"],
body.theme-dark .cart-item [style*="background:#f8f9fa"],
body.theme-dark .cart-item [style*="background: #FFFFFF"],
body.theme-dark .cart-item [style*="background:#FFFFFF"] { background:#243142 !important; color:#e2e8f0 !important; border-color:#364b63 !important; }
body.theme-dark .cart-item [style*="color: #333"],
body.theme-dark .cart-item [style*="color:#333"],
body.theme-dark .cart-item [style*="color: #555"],
body.theme-dark .cart-item [style*="color:#555"],
body.theme-dark .cart-item [style*="color: #666"],
body.theme-dark .cart-item [style*="color:#666"] { color:#d6dee8 !important; }
body.theme-dark .cart-item-minimized,
body.theme-dark .cart-item-detailed,
body.theme-dark .edit-fields { background:#233042 !important; border-color:#2d4256 !important; color:#d6dee8 !important; }
body.theme-dark .edit-fields input,
body.theme-dark .edit-fields select { background:#243142 !important; color:#e2e8f0 !important; border:1px solid #364b63 !important; }
body.theme-dark .edit-fields button { background:#1a5a99 !important; }
body.theme-dark .edit-fields button:hover { background:#2070bf !important; }
/* Dark: left column search input */
body.theme-dark #searchInput { background:#243142 !important; color:#e2e8f0 !important; border:1px solid #364b63 !important; }
/* Dark: cabinets tab / modal specific white strip fixes */
body.theme-dark #cabinets-tab select { background:#243142 !important; color:#e2e8f0 !important; border:1px solid #364b63 !important; }
body.theme-dark #cabinetDetails { background:#233042 !important; border:1px solid #2d4256 !important; }
body.theme-dark #cabinetDetails *[style*="background: #fff"],
body.theme-dark #cabinetDetails *[style*="background:#fff"],
body.theme-dark #cabinetDetails *[style*="background: #f8f9fa"],
body.theme-dark #cabinetDetails *[style*="background:#f8f9fa"],
body.theme-dark #cabinetDetails *[style*="background:#FFF"],
body.theme-dark #cabinetDetails *[style*="background: #FFF"],
body.theme-dark #cabinetDetails *[style*="background:#FFFFFF"],
body.theme-dark #cabinetDetails *[style*="background: #FFFFFF"],
body.theme-dark #cabinetDetails *[style*="color: #333"],
body.theme-dark #cabinetDetails *[style*="color:#333"],
body.theme-dark #cabinetDetails *[style*="color: #555"],
body.theme-dark #cabinetDetails *[style*="color:#555"],
body.theme-dark #cabinetDetails *[style*="color: #666"],
body.theme-dark #cabinetDetails *[style*="color:#666"] { background:transparent !important; color:#d6dee8 !important; }
/* Dark: current selections sub-nav buttons */
body.theme-dark #subNavButtons button { background:#243142 !important; color:#e2e8f0 !important; border:1px solid #364b63 !important; }
body.theme-dark #subNavButtons button:hover { background:#2a3a4d !important; }
/* Dark: force any stray white backgrounds in current selections / hardware lists */
body.theme-dark #currentSelectionsList [style*="background: #fff"],
body.theme-dark #currentSelectionsList [style*="background:#fff"],
body.theme-dark #currentSelectionsList [style*="background: #f8f9fa"],
body.theme-dark #currentSelectionsList [style*="background:#f8f9fa"],
body.theme-dark #includedHardwareList [style*="background: #fff"],
body.theme-dark #includedHardwareList [style*="background:#fff"],
body.theme-dark #additionalHardwareList [style*="background: #fff"],
body.theme-dark #additionalHardwareList [style*="background:#fff"],
body.theme-dark #additionalHardwareList [style*="background: #f8f9fa"],
body.theme-dark #additionalHardwareList [style*="background:#f8f9fa"] { background:#233042 !important; color:#d6dee8 !important; }
/* Dark: selection cards already handled above; ensure buttons inside are themed */
body.theme-dark #currentSelectionsList button,
body.theme-dark #includedHardwareList button,
body.theme-dark #additionalHardwareList button { background:#1a5a99 !important; color:#fff !important; border:1px solid #1a5a99 !important; }
body.theme-dark #currentSelectionsList button:hover,
body.theme-dark #includedHardwareList button:hover,
body.theme-dark #additionalHardwareList button:hover { background:#2070bf !important; }
/* Dark: preview sections & sub-nav container */
body.theme-dark .sub-nav-container { background:#1c2330 !important; border:1px solid #2a3442 !important; }
body.theme-dark .preview-section { background:#1c2330 !important; border:1px solid #2a3442 !important; }
body.theme-dark .preview-section [style*="background: #fff"],
body.theme-dark .preview-section [style*="background:#fff"],
body.theme-dark .preview-section [style*="background: #f8f9fa"],
body.theme-dark .preview-section [style*="background:#f8f9fa"] { background:transparent !important; }
/* Dark: enforce list item card backgrounds in current selections tab */
body.theme-dark #details-preview-tab #currentSelectionsList > *,
body.theme-dark #details-preview-tab #includedHardwareList > *,
body.theme-dark #details-preview-tab #additionalHardwareList > * { background:#233042 !important; color:#d6dee8 !important; border:1px solid #2d4256 !important; }
body.theme-dark #details-preview-tab #currentSelectionsList > * a,
body.theme-dark #details-preview-tab #includedHardwareList > * a,
body.theme-dark #details-preview-tab #additionalHardwareList > * a { color:#3da5ff !important; }
body.theme-dark #details-preview-tab #currentSelectionsList > * button,
body.theme-dark #details-preview-tab #includedHardwareList > * button,
body.theme-dark #details-preview-tab #additionalHardwareList > * button { background:#243142 !important; color:#e2e8f0 !important; border:1px solid #364b63 !important; }
/* Dark: selection-item elements nested inside grids */
body.theme-dark #currentSelectionsList .selection-item,
body.theme-dark #includedHardwareList .selection-item,
body.theme-dark #additionalHardwareList .selection-item { background:#233042 !important; color:#d6dee8 !important; border:1px solid #2d4256 !important; }
body.theme-dark #currentSelectionsList .selection-item a,
body.theme-dark #includedHardwareList .selection-item a,
body.theme-dark #additionalHardwareList .selection-item a { color:#3da5ff !important; }
/* Dark: links & spec buttons */
body.theme-dark #cabinetDetails a, body.theme-dark #cabinetDetails button { background:#243142 !important; color:#e2e8f0 !important; border:1px solid #364b63 !important; }
body.theme-dark #cabinetDetails a:hover, body.theme-dark #cabinetDetails button:hover { background:#2a3a4d !important; }
/* Dark: force spec sheet / key specs inner blocks */
body.theme-dark #cabinetDetails [class*='spec'], body.theme-dark #cabinetDetails .spec-block, body.theme-dark #cabinetDetails .specs { background:#233042 !important; border:1px solid #2d4256 !important; }
/* Dark: cabinets tab specific inner panels */
body.theme-dark #cabinets-tab .pdf-viewer,
body.theme-dark #cabinets-tab .key-specs,
body.theme-dark #cabinets-tab .features-section { background:#1c2330 !important; border:1px solid #2a3442 !important; color:#d6dee8 !important; }
/* Dark: hardware grids */
body.theme-dark .hardware-grid .hardware-item,
body.theme-dark .additional-hardware-grid .hardware-item { background:#233042 !important; color:#d6dee8 !important; border:1px solid #2d4256 !important; }
body.theme-dark .hardware-grid .hardware-item [style*="color:#666"],
body.theme-dark .hardware-grid .hardware-item [style*="color:#333"],
body.theme-dark .hardware-grid .hardware-item [style*="color:#555"],
body.theme-dark .hardware-grid .hardware-item [style*="color: #666"],
body.theme-dark .hardware-grid .hardware-item [style*="color: #333"],
body.theme-dark .hardware-grid .hardware-item [style*="color: #555"]{ color:#d6dee8 !important; }
body.theme-dark .hardware-grid .hardware-item a { color:#3da5ff !important; }

/* Mobile model select overlay (search window) */
body.theme-dark #modelSelectOverlay { background:rgba(0,0,0,0.85); }
body.theme-dark #modelSelectOverlay header { background:#1c2330; border-bottom:1px solid #2a3442; }
body.theme-dark #modelSelectOverlay h3 { color:#e2e8f0; }
body.theme-dark #modelSelectOverlay button.close-btn { background:#243142; color:#e2e8f0; border:1px solid #364b63; }
body.theme-dark #modelSelectOverlay button.close-btn:hover { background:#2a3a4d; }
body.theme-dark #modelSelectOverlay input[type=search] { background:#243142; color:#e2e8f0; border:1px solid #364b63; }
body.theme-dark #modelSelectOverlay .list { background:#1c2330; border:1px solid #2a3442; }
body.theme-dark #modelSelectOverlay .list .item { background:#243142; color:#e2e8f0; border-bottom:1px solid #2a3442; }
body.theme-dark #modelSelectOverlay .list .item:hover { background:#2a3a4d; }
body.theme-dark #modelSelectOverlay .list .item:last-child { border-bottom:none; }
body.theme-dark #modelSelectOverlay::-webkit-scrollbar { width:10px; }
body.theme-dark #modelSelectOverlay::-webkit-scrollbar-track { background:#1c2330; }
body.theme-dark #modelSelectOverlay::-webkit-scrollbar-thumb { background:#364b63; border-radius:6px; }
body.theme-dark #modelSelectOverlay::-webkit-scrollbar-thumb:hover { background:#44607d; }

/* ---------------------------------- */
/* Light Mode Explicit Resets         */
/* ---------------------------------- */
body.theme-light #viewerContainer { background:#ffffff !important; }
body.theme-light select,
body.theme-light input[type=text],
body.theme-light input[type=number],
body.theme-light textarea { background:#ffffff !important; color:#222 !important; border:1px solid #ced4da !important; }
/* Fixed-dimension inputs (light theme) */
body.theme-light input.dim-fixed-readonly { background:#f3f4f6 !important; color:#111827 !important; border:1px solid #d1d5db !important; }
body.theme-light #modelSelect,
body.theme-light #categorySelect,
body.theme-light #series,
body.theme-light #caseTexture,
body.theme-light #doorCategory,
body.theme-light #doorStyle { background:#ffffff !important; color:#222 !important; border:1px solid #ced4da !important; }
body.theme-light #customerNotesPreview,
body.theme-light #customerNotes,
body.theme-light #inlineTotal { background:#f8f9fa !important; color:#212529 !important; border:1px solid #dee2e6 !important; }
body.theme-light .panel-left h3,
body.theme-light .panel-left h4,
body.theme-light .panel-left label { color:#222 !important; }
body.theme-light .dimension-invalid { background:#ffecec !important; border-color:#dc3545 !important; }
/* Modal (light baseline) */
body.theme-light .modal { background:rgba(0,0,0,0.55); }
body.theme-light .modal .modal-content { background:#ffffff !important; color:#222 !important; border:1px solid #d8dee4 !important; }
body.theme-light .modal .tab-button { background:#f5f7f9; color:#2d3742; border:2px solid #d0d7de; }
body.theme-light .modal .tab-button.active { background:#ffffff; color:#1a5a99; border-color:#1a5a99; }
body.theme-light .modal select,
body.theme-light .modal textarea,
body.theme-light .modal input[type=text],
body.theme-light .modal input[type=number] { background:#ffffff !important; color:#222 !important; border:1px solid #ced4da !important; }
/* Scrollbar / dropdown (WebKit) */
body.theme-dark select::-webkit-scrollbar { width:12px; }
body.theme-dark select::-webkit-scrollbar-track { background:#1c2330; }
body.theme-dark select::-webkit-scrollbar-thumb { background:#364b63; border-radius:8px; border:2px solid #1c2330; }
body.theme-dark select::-webkit-scrollbar-thumb:hover { background:#44607d; }
body.theme-light select::-webkit-scrollbar { width:12px; }
body.theme-light select::-webkit-scrollbar-track { background:#ffffff; }
body.theme-light select::-webkit-scrollbar-thumb { background:#c1c9d0; border-radius:8px; border:2px solid #ffffff; }
body.theme-light select::-webkit-scrollbar-thumb:hover { background:#b1bcc4; }
body.theme-light #cabinetDetails .spec-block,
body.theme-light #cabinetDetails .specs { background:#f8f9fa !important; color:#222 !important; border:1px solid #d8dee4 !important; }
body.theme-light #currentSelectionsList > div,
body.theme-light #includedHardwareList > div,
body.theme-light #additionalHardwareList > div { background:#ffffff !important; color:#222 !important; border:1px solid #d8dee4 !important; }
body.theme-light .preview-section h3,
body.theme-light .preview-section p,
body.theme-light .preview-section label { color:#222 !important; }
/* Light: search input explicit */
body.theme-light #searchInput { background:#ffffff !important; color:#222 !important; border:1px solid #ced4da !important; }
/* Light: sub-nav buttons (current selections) */
body.theme-light #subNavButtons button { background:#f5f7f9; color:#2d3742; border:1px solid #d0d7de; }
body.theme-light #subNavButtons button:hover { background:#e8edf2; }
/* Light: cabinet details blocks */
body.theme-light #cabinetDetails { background:#f8f9fa !important; border:1px solid #d8dee4 !important; }
body.theme-light #cabinetDetails .spec-block { background:#ffffff !important; }
body.theme-light .sub-nav-container { background:#ffffff !important; border:1px solid #d8dee4 !important; }
body.theme-light .preview-section { background:#ffffff !important; border:1px solid #d8dee4 !important; }
body.theme-light #cabinetDetails a, body.theme-light #cabinetDetails button { background:#f5f7f9; color:#1a5a99; border:1px solid #d0d7de; }
body.theme-light #cabinetDetails a:hover, body.theme-light #cabinetDetails button:hover { background:#e8edf2; }
/* Light: cabinets tab specific inner panels */
body.theme-light #cabinets-tab .pdf-viewer,
body.theme-light #cabinets-tab .key-specs,
body.theme-light #cabinets-tab .features-section { background:#ffffff !important; border:1px solid #d8dee4 !important; color:#222 !important; }
/* Light: ensure list items uniformly light */
body.theme-light #currentSelectionsList > div,
body.theme-light #includedHardwareList > div,
body.theme-light #additionalHardwareList > div { background:#ffffff !important; color:#222 !important; border:1px solid #d8dee4 !important; }
body.theme-light #currentSelectionsList button,
body.theme-light #includedHardwareList button,
body.theme-light #additionalHardwareList button { background:#f5f7f9; color:#1a5a99; border:1px solid #d0d7de; }
body.theme-light #currentSelectionsList button:hover,
body.theme-light #includedHardwareList button:hover,
body.theme-light #additionalHardwareList button:hover { background:#e8edf2; }
/* Light: ensure selection lists don't retain dark overlays */
body.theme-light #details-preview-tab #currentSelectionsList > *,
body.theme-light #details-preview-tab #includedHardwareList > *,
body.theme-light #details-preview-tab #additionalHardwareList > * { background:#ffffff !important; color:#222 !important; border:1px solid #d8dee4 !important; }
body.theme-light #currentSelectionsList .selection-item,
body.theme-light #includedHardwareList .selection-item,
body.theme-light #additionalHardwareList .selection-item { background:#ffffff !important; color:#222 !important; border:1px solid #d8dee4 !important; }
/* Light: cabinet details forced reset for dark inline remnants */
body.theme-light #cabinetDetails [style*='#233042'],
body.theme-light #cabinetDetails [style*='#1c2330'],
body.theme-light #cabinetDetails [style*='#243142'],
body.theme-light #cabinetDetails [style*='rgb(28, 35, 48)'],
body.theme-light #cabinetDetails [style*='rgb(36, 49, 66)'],
body.theme-light #cabinetDetails [style*='rgb(22, 28, 36)'] { background:#ffffff !important; color:#222 !important; border-color:#d8dee4 !important; }
/* Light: hardware grids */
body.theme-light .hardware-grid .hardware-item,
body.theme-light .additional-hardware-grid .hardware-item { background:#ffffff !important; color:#222 !important; border:1px solid #d8dee4 !important; }
body.theme-light .hardware-grid .hardware-item a { color:#1a5a99 !important; }
/* Light: ensure textual content in cabinetDetails & lists is dark */
body.theme-light #cabinetDetails p,
body.theme-light #cabinetDetails li,
body.theme-light #cabinetDetails span,
body.theme-light #cabinetDetails h1,
body.theme-light #cabinetDetails h2,
body.theme-light #cabinetDetails h3,
body.theme-light #cabinetDetails h4,
body.theme-light #cabinetDetails h5,
body.theme-light #cabinetDetails h6,
body.theme-light #currentSelectionsList p,
body.theme-light #currentSelectionsList span,
body.theme-light #includedHardwareList p,
body.theme-light #includedHardwareList span,
body.theme-light #additionalHardwareList p,
body.theme-light #additionalHardwareList span { color:#222 !important; }
body.theme-light #cabinetDetails strong { color:#111 !important; }
/* Light: cabinet description variable-based inline styles force darker text */
body.theme-light #cabinetDetails [style*="--cab-desc-color"],
body.theme-light #cabinetDetails [style*="cab-desc-color"] { color:#444 !important; }

/* Light mode explicit resets for model select overlay */
body.theme-light #modelSelectOverlay { background:rgba(0,0,0,0.55); }
body.theme-light #modelSelectOverlay header { background:#ffffff; border-bottom:1px solid #d8dee4; }
body.theme-light #modelSelectOverlay h3 { color:#222 !important; }
body.theme-light #modelSelectOverlay button.close-btn { background:#f4f6f8; color:#222; border:1px solid #d0d7de; }
body.theme-light #modelSelectOverlay button.close-btn:hover { background:#e8ecf0; }
body.theme-light #modelSelectOverlay input[type=search] { background:#ffffff !important; color:#222 !important; border:1px solid #ced4da !important; }
body.theme-light #modelSelectOverlay .list { background:#ffffff; border:1px solid #d8dee4; }
body.theme-light #modelSelectOverlay .list .item { background:#f8f9fa; color:#222; border-bottom:1px solid #e2e6ea; }
body.theme-light #modelSelectOverlay .list .item:hover { background:#eef2f5; }
body.theme-light #modelSelectOverlay .list .item:last-child { border-bottom:none; }
body.theme-light #modelSelectOverlay::-webkit-scrollbar { width:10px; }
body.theme-light #modelSelectOverlay::-webkit-scrollbar-track { background:#ffffff; }
body.theme-light #modelSelectOverlay::-webkit-scrollbar-thumb { background:#c5ccd2; border-radius:6px; }
body.theme-light #modelSelectOverlay::-webkit-scrollbar-thumb:hover { background:#b3bcc4; }

/* Theme toggle button */
.header-theme-toggle { background:#243142; color:#e2e8f0; border:1px solid #364b63; border-radius:6px; padding:6px 10px; cursor:pointer; font-size:13px; }
body.theme-light .header-theme-toggle { background:#f4f6f8; color:#222; border:1px solid #d0d7de; }
.header-theme-toggle:focus { outline:2px solid #1a5a99; }
