/* =========================================================
   UNIVERSAL QUOTE BUILDER - SHARED THEME SYSTEM (V2)
   ========================================================= */

.builder-wrap[data-ui-theme] .section-card,
.builder-wrap[data-ui-theme] .result-card,
.builder-wrap[data-ui-theme] .cta-card,
.builder-wrap[data-ui-theme] .saved-card,
.builder-wrap[data-ui-theme] .mini-stat,
.builder-wrap[data-ui-theme] .header-settings-card,
.builder-wrap[data-ui-theme] .summary-box,
.builder-wrap[data-ui-theme] .guidance-note,
.builder-wrap[data-ui-theme] .pdf-note,
.builder-wrap[data-ui-theme] .table-wrap,
.builder-wrap[data-ui-theme] .quick-action-card,
.builder-wrap[data-ui-theme] .workspace-modal .modal-content,
.builder-wrap[data-ui-theme] .quick-actions-modal .modal-content,
.builder-wrap[data-ui-theme] .proposal-preview-sheet {
  border-radius: var(--theme-radius-card);
}

.builder-wrap[data-ui-theme] .accordion-item,
.builder-wrap[data-ui-theme] .accordion-button,
.builder-wrap[data-ui-theme] .accordion-button:not(.collapsed) {
  border-radius: var(--theme-radius-accordion) !important;
}

.builder-wrap[data-ui-theme] .btn,
.builder-wrap[data-ui-theme] .template-chip-delete,
.builder-wrap[data-ui-theme] .template-chip-load {
  border-radius: var(--theme-radius-button);
}

.builder-wrap[data-ui-theme],
.builder-wrap[data-ui-theme] .table td,
.builder-wrap[data-ui-theme] .table tbody th,
.builder-wrap[data-ui-theme] .workspace-expand-host .table td {
  color: var(--theme-table-body-text);
}

.builder-wrap[data-ui-theme] .row-total,
.builder-wrap[data-ui-theme] .material-row-total,
.builder-wrap[data-ui-theme] .worker-row-total {
  color: var(--theme-row-total-text);
}

.builder-wrap[data-ui-theme] .worker-actions .btn,
.builder-wrap[data-ui-theme] .saved-actions .btn,
.builder-wrap[data-ui-theme] .template-buttons .btn,
.builder-wrap[data-ui-theme] .action-buttons .btn {
  box-shadow: none;
}

.builder-wrap[data-ui-theme] {
  color: var(--text-main);
}

.builder-wrap[data-ui-theme] .section-card,
.builder-wrap[data-ui-theme] .result-card,
.builder-wrap[data-ui-theme] .cta-card,
.builder-wrap[data-ui-theme] .saved-card,
.builder-wrap[data-ui-theme] .accordion-item,
.builder-wrap[data-ui-theme] .quick-action-card,
.builder-wrap[data-ui-theme] .workspace-modal .modal-content,
.builder-wrap[data-ui-theme] .quick-actions-modal .modal-content,
.builder-wrap[data-ui-theme] .proposal-preview-sheet,
.builder-wrap[data-ui-theme] .mini-stat,
.builder-wrap[data-ui-theme] .header-settings-card {
  box-shadow: var(--theme-highlight-shadow);
}

.builder-wrap[data-ui-theme] .guidance-note,
.builder-wrap[data-ui-theme] .pdf-note,
.builder-wrap[data-ui-theme] .summary-box,
.builder-wrap[data-ui-theme] .quick-actions-placeholder,
.builder-wrap[data-ui-theme] .branding-note {
  background: var(--theme-note-bg);
  border-color: var(--theme-note-border);
}

.builder-wrap[data-ui-theme] .table-light,
.builder-wrap[data-ui-theme] .table thead th,
.builder-wrap[data-ui-theme] .workspace-expand-host .table thead th {
  --bs-table-bg: var(--theme-table-head);
  --bs-table-color: var(--theme-table-head-text);
  background: var(--theme-table-head) !important;
  color: var(--theme-table-head-text) !important;
}

.builder-wrap[data-ui-theme] .table,
.builder-wrap[data-ui-theme] .table td,
.builder-wrap[data-ui-theme] .table tbody th,
.builder-wrap[data-ui-theme] .workspace-expand-host .table,
.builder-wrap[data-ui-theme] .workspace-expand-host .table td {
  background: var(--theme-table-body-bg);
}

.builder-wrap[data-ui-theme] .form-control,
.builder-wrap[data-ui-theme] .form-select,
.builder-wrap[data-ui-theme] .form-control-color {
  background-color: var(--theme-input-bg);
  border-color: var(--theme-input-border);
  color: var(--text-main);
}

.builder-wrap[data-ui-theme] .form-control::placeholder {
  color: var(--text-muted);
}

.builder-wrap[data-ui-theme] .form-control:focus,
.builder-wrap[data-ui-theme] .form-select:focus,
.builder-wrap[data-ui-theme] .form-check-input:focus {
  border-color: rgba(var(--brand-rgb), 0.45);
  box-shadow: 0 0 0 0.2rem rgba(var(--brand-rgb), 0.15);
}

.builder-wrap[data-ui-theme] .form-check-input:checked {
  background-color: var(--brand);
  border-color: var(--brand);
}

.builder-wrap[data-ui-theme] .btn-brand {
  background: var(--theme-accent-strong);
  border-color: var(--theme-accent-strong);
  color: var(--theme-btn-primary-text);
}

.builder-wrap[data-ui-theme] .btn-brand:hover,
.builder-wrap[data-ui-theme] .btn-brand:focus {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: var(--theme-btn-primary-text);
}

.builder-wrap[data-ui-theme] .btn-outline-primary {
  background: var(--theme-btn-outline-bg);
  color: var(--theme-btn-outline-text);
  border-color: var(--theme-btn-outline-border);
}

.builder-wrap[data-ui-theme] .btn-outline-primary:hover,
.builder-wrap[data-ui-theme] .btn-outline-primary:focus,
.builder-wrap[data-ui-theme] .btn-outline-primary:active {
  background: rgba(var(--brand-rgb), 0.12);
  color: var(--theme-btn-outline-text);
  border-color: rgba(var(--brand-rgb), 0.42);
}

.builder-wrap[data-ui-theme] .btn-outline-secondary,
.builder-wrap[data-ui-theme] .btn-outline-success,
.builder-wrap[data-ui-theme] .worker-actions .btn,
.builder-wrap[data-ui-theme] .saved-actions .btn {
  background: var(--theme-action-btn-bg);
  color: var(--theme-action-btn-text);
  border-color: var(--theme-action-btn-border);
}

.builder-wrap[data-ui-theme] .btn-outline-secondary:hover,
.builder-wrap[data-ui-theme] .btn-outline-secondary:focus,
.builder-wrap[data-ui-theme] .btn-outline-success:hover,
.builder-wrap[data-ui-theme] .btn-outline-success:focus,
.builder-wrap[data-ui-theme] .worker-actions .btn:hover,
.builder-wrap[data-ui-theme] .worker-actions .btn:focus,
.builder-wrap[data-ui-theme] .saved-actions .btn:hover,
.builder-wrap[data-ui-theme] .saved-actions .btn:focus {
  background: rgba(var(--brand-rgb), 0.08);
  color: var(--text-main);
  border-color: rgba(var(--brand-rgb), 0.32);
}

.builder-wrap[data-ui-theme] .template-chip:hover,
.builder-wrap[data-ui-theme] .template-chip-delete:hover,
.builder-wrap[data-ui-theme] .template-chip-load:hover,
.builder-wrap[data-ui-theme] .proposal-preview-card.is-selected,
.builder-wrap[data-ui-theme] .workspace-toggle-row .btn:hover,
.builder-wrap[data-ui-theme] .accordion-item:has(.accordion-collapse.show) {
  border-color: var(--theme-accent-border);
}

.builder-wrap[data-ui-theme] .badge-soft,
.builder-wrap[data-ui-theme] .optional-chip,
.builder-wrap[data-ui-theme] .version-pill {
  background: var(--badge-bg);
  color: var(--badge-text);
}

.builder-wrap[data-ui-theme] .accordion-button.collapsed {
  background: var(--theme-accordion-closed-bg);
  color: var(--theme-accordion-closed-text);
}

.builder-wrap[data-ui-theme] .accordion-button:not(.collapsed) {
  background: var(--theme-accordion-open-bg);
  color: var(--theme-accordion-open-text);
  border-color: var(--theme-accordion-open-border);
}

.builder-wrap[data-ui-theme] .accordion-body,
.builder-wrap[data-ui-theme] .workspace-modal .modal-header,
.builder-wrap[data-ui-theme] .quick-actions-modal .modal-header {
  color: var(--text-main);
}

.builder-wrap[data-ui-theme] .hero {
  box-shadow: var(--theme-highlight-shadow);
}
