.qb-images-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.5rem;
}


.qb-images-list {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}


.qb-image-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  background: #fff;
  align-items: center;
}


.qb-image-card__preview img {
  width: 100%;
  max-width: 140px;
  height: auto;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}


.qb-image-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}


.qb-image-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}


.qb-image-card__meta {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
}


.qb-image-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}


.qb-gallery-actions {
  display: flex;
  gap: 0.5rem;
}


.quote-builder {
  display: flex;
  flex-direction: column;
  gap: 24px;
}


.quote-builder__header {
  display: flex;
  flex-direction: column;
  gap: 16px;
}


.quote-builder__header-info h1 {
  margin: 0;
  font-size: 1.75rem;
}


.quote-builder__ref {
  display: flex;
  align-items: center;
  gap: 12px;
}


.quote-builder__ref-code {
  font-weight: 600;
  font-size: 1.1rem;
}


.quote-builder__header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

.quote-builder__action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button--icon-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.button__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button__icon svg {
  width: 16px;
  height: 16px;
}


.quote-builder__body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}


.quote-builder__main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}


.qb-main-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: transparent;
  padding: 0;
  border-radius: 14px;
}

.qb-main-tabs::-webkit-scrollbar {
  display: none;
}

.qb-main-tab {
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  background: #1f2937;
  color: #e5e7eb;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
  position: relative;
  top: 0;
  margin-right: 8px;
}

.qb-main-tab[data-active="true"] {
  background: rgba(248, 250, 252, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  color: #0f172a;
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.12);
  top: 0;
}


.qb-main-panels {
  display: block;
}


.qb-main-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.qb-main-panel[hidden] {
  display: none !important;
}


.quote-builder__sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}


.qb-card {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 20px 24px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}


.qb-card--sticky {
  position: static;
}


.qb-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}


.qb-card__header h2 {
  margin: 0;
  font-size: 1.2rem;
}


.qb-card__subtitle {
  margin: 4px 0 0;
  color: var(--fg-muted);
  font-size: 0.9rem;
}


.qb-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.qb-card__message {
  margin: 0 0 8px;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

.qb-document-sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.qb-document-field label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.95rem;
}

.qb-document-field__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.qb-document-field__label {
  flex: 1;
}

.qb-document-save-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #16a34a;
  margin-right: 8px;
}

.qb-document-field .wysiwyg {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.qb-document-field .wysiwyg__editor {
  height: 190px;
  min-height: 190px;
  max-height: 190px;
  overflow-y: auto;
  overflow-x: hidden;
  word-break: break-word;
}

.qb-document-field textarea {
  height: 190px;
  min-height: 190px;
  max-height: 190px;
  resize: none;
  overflow: auto;
  max-width: 100%;
  width: 100%;
}

.qb-document-hint {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.qb-pricing-preview {
  border: 1px dashed rgba(148, 163, 184, 0.5);
  border-radius: 14px;
  padding: 16px;
  background: rgba(248, 250, 252, 0.6);
}

.qb-pricing-preview h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}


.qb-grid {
  display: grid;
  gap: 16px;
}


.qb-grid--two {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}


.qb-field-display {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.12);
  min-height: 44px;
  white-space: pre-wrap;
}


.qb-field-display--compact {
  min-height: auto;
  padding: 8px 10px;
}

.qb-field-display--stacked {
  min-height: 80px;
}

.qb-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.qb-detail-label {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
  margin-bottom: 6px;
}


.qb-grid.qb-customer-inline {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}


.qb-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}


.qb-tab {
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 8px 14px;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}


.qb-tab[aria-selected="true"] {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.26);
}


.qb-panels {
  display: flex;
  flex-direction: column;
  gap: 16px;
}


.qb-panel {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 14px;
  padding: 16px;
  background: rgba(248, 250, 252, 0.8);
}


.qb-panel:not([data-active="true"]) {
  display: none;
}


.qb-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}


.qb-option-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}


.qb-option-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}


.qb-discount {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qb-discount__label {
  font-weight: 600;
}

.qb-discount__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.qb-discount-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qb-discount-line {
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.qb-discount-line__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.qb-discount-line__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  min-width: 160px;
}

.qb-discount-line__total {
  font-weight: 700;
  color: #0f172a;
}

.qb-discount-line__buttons {
  display: flex;
  gap: 8px;
}


.qb-panel__title {
  font-size: 1rem;
  margin: 0;
}


.qb-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}


.qb-accordion details {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: #fff;
  padding: 12px 16px;
}


.qb-accordion summary {
  list-style: none;
}


.qb-accordion summary::-webkit-details-marker {
  display: none;
}


.qb-accordion .qb-lines {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}


.qb-section-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 600;
}


.qb-section-summary__left {
  display: flex;
  align-items: center;
  gap: 12px;
}


.qb-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.16);
  color: var(--fg-muted);
}


.qb-section-icon svg {
  width: 20px;
  height: 20px;
}


.qb-section-title {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}


.qb-section-count {
  font-size: 0.85rem;
  color: var(--fg-muted);
}


.qb-section-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--fg-muted);
}


.qb-lines__actions {
  display: flex;
  justify-content: flex-end;
}


.qb-lines__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}


.qb-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.1);
}


.qb-line__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}


.qb-line__meta {
  font-size: 0.85rem;
  color: var(--fg-muted);
}


.qb-line__total {
  font-weight: 600;
}


.qb-line__actions {
  display: flex;
  gap: 6px;
  align-items: center;
}


.qb-summary {
  display: flex;
  flex-direction: column;
  gap: 16px;
}


.qb-summary__option {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  padding: 14px 16px;
  background: rgba(248, 250, 252, 0.8);
}


.qb-summary__list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}


.qb-summary__list li {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}


.qb-summary__total {
  font-weight: 700;
  font-size: 1.05rem;
}


.qb-upload {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}


.qb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1600;
  padding: 24px;
}


.qb-overlay[hidden] {
  display: none !important;
}


.qb-modal {
  background: #fff;
  border-radius: 18px;
  max-width: 900px;
  width: 100%;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}


.qb-modal--wide {
  max-width: 720px;
}


.qb-modal__header,
.qb-modal__footer {
  padding: 20px 24px;
  background: rgba(248, 250, 252, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}


.qb-modal__body {
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}


.qb-modal__close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}


.qb-modal__controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}


.qb-modal__footer--info {
  justify-content: flex-start;
}


.qb-modal__controls input {
  flex: 1;
  min-width: 220px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.4);
}


.qb-modal__table {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  overflow: hidden;
  overflow-x: auto;
  max-height: 60vh;
  overflow-y: auto;
}

.qb-picker-pagination {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.qb-picker-pagination .button {
  min-width: 64px;
}

@media (max-width: 640px) {
  .qb-modal {
    width: 95%;
    max-width: 520px;
  }
  .qb-modal__table {
    max-height: 60vh;
  }
  .data-table {
    min-width: 520px;
  }
}


.qb-modal__footer-actions {
  display: flex;
  gap: 8px;
}


.qb-overlay--center {
  background-color: rgba(15, 23, 42, 0.4);
  justify-content: center;
  align-items: center;
  padding: 24px;
  z-index: 1610;
}


.qb-modal--compact {
  width: auto;
  min-width: 240px;
  text-align: center;
}


.qb-modal--loading .spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 4px solid rgba(148, 163, 184, 0.4);
  border-top-color: #2563eb;
  margin: 0 auto 12px;
  animation: qb-spin 0.9s linear infinite;
}


.qb-form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}


.qb-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  color: var(--fg-muted);
}


.qb-form-grid input,
.qb-form-grid select,
.qb-form-grid textarea {
  font: inherit;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.4);
}


.qb-form-grid input[readonly] {
  background: rgba(148, 163, 184, 0.08);
  cursor: default;
}


.qb-form-row {
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
}


.qb-form-row--two {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}


.qb-line-empty {
  font-size: 0.9rem;
  color: var(--fg-muted);
  padding: 8px 0;
}


@media (max-width: 768px) {
  .qb-image-card {
    grid-template-columns: 1fr;
  }
  .qb-image-card__preview img {
    max-width: 100%;
  }
}
@media (min-width: 768px) {
  .quote-builder__header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
  .quote-builder__header-actions {
    width: auto;
  }
}
@media (min-width: 1024px) {
  .quote-builder__body {
    grid-template-columns: minmax(0, 2.1fr) minmax(280px, 1fr);
    gap: 28px;
  }
  .qb-card--sticky {
    position: sticky;
    top: 24px;
  }
}
@media (min-width: 1280px) {
  .quote-builder__body {
    grid-template-columns: minmax(0, 2.2fr) minmax(320px, 1fr);
    gap: 32px;
  }
}
