/*
 * Quotation pricing readability hotfix.
 *
 * The legacy pricing-adjustment widget is injected into both quotation create
 * and edit forms. It must remain a light document surface even when the
 * surrounding dashboard and modal use the dark application theme.
 */

:is(
  .quotation-new-editor,
  .live-quotation-editor,
  .quotation-new-modal,
  .quotation-edit-modal
) .pricing-adjustments {
  border-color: #d0d5dd !important;
  background: #f8fafc !important;
  color: #101828 !important;
  color-scheme: light !important;
}

:is(
  .quotation-new-editor,
  .live-quotation-editor,
  .quotation-new-modal,
  .quotation-edit-modal
) .pricing-adjustments :is(h1, h2, h3, h4, p, label, span, strong, small, div) {
  color: #101828 !important;
}

:is(
  .quotation-new-editor,
  .live-quotation-editor,
  .quotation-new-modal,
  .quotation-edit-modal
) .pricing-grid label {
  color: #344054 !important;
}

:is(
  .quotation-new-editor,
  .live-quotation-editor,
  .quotation-new-modal,
  .quotation-edit-modal
) .pricing-grid :is(input, select, textarea) {
  border: 1px solid #98a2b3 !important;
  background: #ffffff !important;
  color: #101828 !important;
  -webkit-text-fill-color: #101828 !important;
  caret-color: #101828 !important;
  box-shadow: none !important;
  opacity: 1 !important;
}

:is(
  .quotation-new-editor,
  .live-quotation-editor,
  .quotation-new-modal,
  .quotation-edit-modal
) .pricing-grid :is(input, select, textarea)::placeholder {
  color: #667085 !important;
  -webkit-text-fill-color: #667085 !important;
  opacity: 1 !important;
}

:is(
  .quotation-new-editor,
  .live-quotation-editor,
  .quotation-new-modal,
  .quotation-edit-modal
) .pricing-grid select option {
  background: #ffffff !important;
  color: #101828 !important;
}

:is(
  .quotation-new-editor,
  .live-quotation-editor,
  .quotation-new-modal,
  .quotation-edit-modal
) .pricing-grid :is(input, select, textarea):focus {
  border-color: #b00714 !important;
  outline: 3px solid rgba(176, 7, 20, 0.2) !important;
  outline-offset: 1px !important;
}

:is(
  .quotation-new-editor,
  .live-quotation-editor,
  .quotation-new-modal,
  .quotation-edit-modal
) .pricing-grid :is(input, select, textarea):disabled,
:is(
  .quotation-new-editor,
  .live-quotation-editor,
  .quotation-new-modal,
  .quotation-edit-modal
) .pricing-grid :is(input, select, textarea)[readonly] {
  border-color: #d0d5dd !important;
  background: #f2f4f7 !important;
  color: #475467 !important;
  -webkit-text-fill-color: #475467 !important;
  opacity: 1 !important;
}

:is(
  .quotation-new-editor,
  .live-quotation-editor,
  .quotation-new-modal,
  .quotation-edit-modal
) .pricing-summary {
  border: 1px solid #d0d5dd !important;
  background: #ffffff !important;
  color: #101828 !important;
}

:is(
  .quotation-new-editor,
  .live-quotation-editor,
  .quotation-new-modal,
  .quotation-edit-modal
) .pricing-summary :is(div, span, strong) {
  color: #101828 !important;
}

:is(
  .quotation-new-editor,
  .live-quotation-editor,
  .quotation-new-modal,
  .quotation-edit-modal
) .pricing-summary .grand {
  border-top-color: #d0d5dd !important;
  font-weight: 900 !important;
}

@media (max-width: 700px) {
  :is(
    .quotation-new-editor,
    .live-quotation-editor,
    .quotation-new-modal,
    .quotation-edit-modal
  ) .pricing-adjustments {
    margin-inline: 0 !important;
    padding: 16px !important;
  }

  :is(
    .quotation-new-editor,
    .live-quotation-editor,
    .quotation-new-modal,
    .quotation-edit-modal
  ) .pricing-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  :is(
    .quotation-new-editor,
    .live-quotation-editor,
    .quotation-new-modal,
    .quotation-edit-modal
  ) .pricing-grid > * {
    min-width: 0 !important;
  }
}

@media (forced-colors: active) {
  :is(
    .quotation-new-editor,
    .live-quotation-editor,
    .quotation-new-modal,
    .quotation-edit-modal
  ) .pricing-adjustments,
  :is(
    .quotation-new-editor,
    .live-quotation-editor,
    .quotation-new-modal,
    .quotation-edit-modal
  ) .pricing-summary {
    border: 1px solid CanvasText !important;
  }
}
