/* Shared contextual details: one stable rectangle for every business module. */
.app:not(.label-fullscreen-mode) .oms-wide-detail-host {
  position: relative !important;
  display: block !important;
  min-width: 0;
  overflow: hidden !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-host > :is(
  .product-list-panel,
  .quote-list-panel,
  .oms-list-panel,
  .oms-finance-main,
  .approval-center-list,
  .price-catalog-list-panel,
  .label-template-list-panel,
  .label-stage1-generation-list-panel
) {
  width: 100%;
  height: 100%;
  min-width: 0;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-host > .oms-wide-detail-panel {
  position: fixed !important;
  z-index: 40 !important;
  top: var(--oms-detail-top, 0) !important;
  right: var(--oms-detail-right, 0) !important;
  bottom: auto !important;
  left: var(--oms-detail-left, 360px) !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: var(--oms-detail-height, calc(100% - var(--oms-detail-top, 0px))) !important;
  max-height: none !important;
  border: 0 !important;
  border-left: 1px solid var(--oms-line, #dfe6ef) !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: -16px 0 34px rgba(31, 52, 85, .16) !important;
  overflow: hidden !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-host.oms-wide-detail-full > .oms-wide-detail-panel {
  left: var(--oms-detail-left, 0) !important;
}

/* Closed or empty drawers must disappear immediately, before the next layout frame. */
.app:not(.label-fullscreen-mode) :is(
  .product-workspace,
  .oms-document-workspace,
  .oms-partner-workspace,
  .approval-center-workspace,
  .label-template-manager,
  .label-stage1-generation-records
).details-closed > :is(
  .product-details-panel,
  .oms-document-details,
  .oms-partner-details,
  .approval-center-details,
  .label-template-details,
  .label-generation-details
),
.app:not(.label-fullscreen-mode) :is(
  .product-details-panel,
  .oms-document-details,
  .oms-partner-details,
  .approval-center-details,
  .price-detail,
  .label-template-details,
  .label-generation-details
):empty,
.app:not(.label-fullscreen-mode) :is(
  .product-details-panel,
  .oms-document-details,
  .oms-partner-details,
  .approval-center-details,
  .price-detail,
  .label-template-details,
  .label-generation-details
)[hidden] {
  display: none !important;
  pointer-events: none !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
  .product-details-head,
  .quote-details-head,
  .oms-document-details-head,
  .oms-partner-details-head,
  .finance-details-head,
  .approval-details-head,
  .label-template-details-head,
  .label-generation-details-head
) {
  min-height: 72px !important;
  height: auto !important;
  flex: 0 0 auto !important;
  align-items: flex-start !important;
  padding: 11px 20px !important;
  background: #fff;
  overflow: visible !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
  .product-details-head,
  .quote-details-head,
  .oms-document-details-head,
  .oms-partner-details-head,
  .finance-details-head,
  .approval-details-head,
  .label-template-details-head,
  .label-generation-details-head
) :is(h2, strong, .approval-details-title > b) {
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: .88px !important;
  line-height: 1.4 !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
  .product-details-head,
  .quote-details-head,
  .oms-document-details-head,
  .oms-partner-details-head,
  .finance-details-head,
  .approval-details-head,
  .label-template-details-head,
  .label-generation-details-head
) :is(span, .quote-details-identity > span) {
  margin-top: 4px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: .88px !important;
  line-height: 1.45 !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel button.oms-details-close {
  flex-basis: 36px !important;
  width: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel button.oms-details-close::before {
  width: 24px;
  height: 24px;
}

/* Use the new width: facts become two-column groups and line tables fill the drawer. */
@media (min-width: 1181px) {
  .app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
    .quote-detail-list,
    .oms-detail-list,
    .approval-summary-grid,
    .product-details-section > dl,
    .product-details-accordion dl,
    .label-template-meta-grid
  ) {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 28px !important;
  }

  .app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
    .quote-detail-list,
    .oms-detail-list,
    .approval-summary-grid,
    .product-details-section > dl,
    .product-details-accordion dl
  ) > .wide {
    grid-column: 1 / -1;
  }

  .app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
    .quote-item-table,
    .statement-detail-table,
    .finance-history-table
  ) {
    width: 100%;
    min-width: 680px;
    table-layout: fixed;
  }

  .app:not(.label-fullscreen-mode) #module-approvals .oms-wide-detail-panel .approval-summary-grid > div {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
  }

  #module-labels .oms-wide-detail-panel .label-template-preview-section,
  #module-labels .oms-wide-detail-panel .label-generation-preview-section {
    display: grid;
    grid-template-columns: minmax(260px, .85fr) minmax(300px, 1.15fr);
    align-items: start;
    gap: 22px;
  }
}

@media (max-width: 900px) {
  .app:not(.label-fullscreen-mode) .oms-wide-detail-host > .oms-wide-detail-panel {
    left: 0 !important;
  }
}

@media (max-width: 700px) {
  .app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
    .product-details-head,
    .quote-details-head,
    .oms-document-details-head,
    .oms-partner-details-head,
    .finance-details-head,
    .approval-details-head,
    .label-template-details-head,
    .label-generation-details-head
  ) {
    padding-inline: 12px !important;
  }
}

/* Detail design language -------------------------------------------------- */
.app:not(.label-fullscreen-mode) .oms-wide-detail-panel {
  --oms-detail-title: 11px;
  --oms-detail-section-title: 11px;
  --oms-detail-body: 12px;
  --oms-detail-meta: 12px;
  display: flex !important;
  flex-direction: column !important;
  color: #34445e;
  font-size: var(--oms-detail-body) !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel > :is(
  .product-details-scroll,
  .price-detail-scroll,
  .quote-details-scroll,
  .oms-document-details-scroll,
  .oms-partner-details-scroll,
  .approval-details-scroll,
  .label-template-details-scroll,
  .label-generation-details-scroll
) {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.app:not(.label-fullscreen-mode) #module-products .oms-wide-detail-panel.product-details-panel {
  overflow: hidden !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel > :is(
  .finance-details-actions,
  .oms-document-details-actions,
  .oms-partner-details-actions,
  .approval-details-actions,
  .label-template-detail-actions,
  .label-generation-detail-actions
) {
  flex: 0 0 auto !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
  .product-details-head,
  .quote-details-head,
  .oms-document-details-head,
  .oms-partner-details-head,
  .finance-details-head,
  .approval-details-head,
  .label-template-details-head,
  .label-generation-details-head
) > :first-child {
  min-width: 0;
  max-width: calc(100% - 52px);
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
  .product-details-head,
  .quote-details-head,
  .oms-document-details-head,
  .oms-partner-details-head,
  .finance-details-head,
  .approval-details-head,
  .label-template-details-head,
  .label-generation-details-head
) :is(strong, h2, .approval-details-title > b) {
  margin: 0 !important;
  color: #1f2f49 !important;
  font-size: var(--oms-detail-title) !important;
  font-weight: 700 !important;
  letter-spacing: .88px !important;
  line-height: 1.4 !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
  .product-details-head,
  .quote-details-head,
  .oms-document-details-head,
  .oms-partner-details-head,
  .finance-details-head,
  .approval-details-head,
  .label-template-details-head,
  .label-generation-details-head
) :is(span, .quote-details-identity > span) {
  color: #64748b !important;
  font-size: var(--oms-detail-title) !important;
  font-weight: 700 !important;
  letter-spacing: .88px !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
  .sales-details-statuses,
  .delivery-heading-statuses,
  .finance-heading-status,
  .badge
) {
  letter-spacing: normal !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
  .finance-heading-status,
  .sales-details-statuses,
  .delivery-heading-statuses
) {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px !important;
  margin-top: 8px !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
  .finance-details-head,
  .delivery-details-head
) .quote-details-identity {
  display: grid;
  grid-template-columns: minmax(0, auto) auto;
  align-items: center;
  justify-content: start;
  gap: 5px 10px;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
  .finance-details-head,
  .delivery-details-head
) .quote-details-identity > strong {
  grid-column: 1 / -1;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
  .finance-details-head,
  .delivery-details-head
) .quote-details-identity > :is(.finance-heading-status, .delivery-heading-statuses) {
  margin-top: 0 !important;
}

.app:not(.label-fullscreen-mode) #module-approvals .oms-wide-detail-panel .approval-details-title {
  display: grid !important;
  grid-template-columns: minmax(0, auto) auto;
  align-items: center;
  justify-content: start;
  gap: 5px 10px !important;
}

.app:not(.label-fullscreen-mode) #module-approvals .oms-wide-detail-panel .approval-details-title > :is(b, strong) {
  grid-column: 1 / -1;
}

.app:not(.label-fullscreen-mode) #module-approvals .oms-wide-detail-panel .approval-details-subtitle {
  margin: 0 !important;
  color: #64748b !important;
  font-size: 11px !important;
}

.app:not(.label-fullscreen-mode) #module-approvals .oms-wide-detail-panel .approval-details-title > .badge {
  margin: 0 !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
  .product-details-section,
  .quote-detail-section,
  .oms-document-details-section,
  .oms-partner-details-scroll > section,
  .label-template-details-scroll > section,
  .label-generation-details-scroll > section,
  .quote-approval-records
) {
  padding: 18px 20px !important;
  border-bottom: 1px solid #e5ebf3 !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
  .product-details-section,
  .quote-detail-section,
  .oms-document-details-section,
  .oms-partner-details-scroll > section,
  .label-template-details-scroll > section,
  .label-generation-details-scroll > section
) :is(h3, h4) {
  margin: 0 0 14px !important;
  color: #17233b !important;
  font-size: var(--oms-detail-section-title) !important;
  font-weight: 700 !important;
  line-height: 1.45 !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel .quote-approval-records > summary {
  color: #17233b !important;
  font-size: var(--oms-detail-section-title) !important;
  font-weight: 700 !important;
  line-height: 1.45 !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(dt, small) {
  color: #64748b !important;
  font-size: var(--oms-detail-meta) !important;
  line-height: 1.55 !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(dd, p, .quote-record-list, .oms-document-item span) {
  font-size: var(--oms-detail-body) !important;
  line-height: 1.55 !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel dd {
  color: #17233b !important;
  font-size: var(--oms-detail-meta) !important;
  font-weight: 400 !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel table th {
  color: #45536a !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel table td {
  color: #45536a !important;
  font-size: 11px !important;
  font-weight: 400 !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
  .quote-detail-list,
  .oms-detail-list,
  .product-details-section > dl,
  .oms-document-details-section > dl,
  .oms-partner-details-scroll dl
) > div {
  min-width: 0;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(dd, .quote-details-identity, .approval-details-title) {
  overflow-wrap: anywhere;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
  .quote-item-table-wrap,
  .statement-detail-table-wrap,
  .finance-history-details .quote-item-table-wrap
) {
  max-width: 100%;
  overflow-x: auto !important;
  overflow-y: visible !important;
}

/* Approval and logistics use one horizontal process component. */
.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
  .quote-approval-timeline,
  .delivery-logistics-timeline,
  .sales-delivery-progress
) {
  display: flex !important;
  grid-row: 1;
  grid-column: 2;
  width: min(100%, var(--oms-process-max-width, 600px));
  gap: 0 !important;
  margin: 0 auto !important;
  padding: 0 2px !important;
  overflow-x: auto;
  overflow-y: hidden;
  list-style: none;
  scrollbar-width: thin;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel .process-steps-2 {
  --oms-process-max-width: 320px;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel .process-steps-3 {
  --oms-process-max-width: 440px;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel .process-steps-4 {
  --oms-process-max-width: 560px;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
  .quote-detail-section:has(> .quote-approval-timeline),
  .delivery-logistics-section,
  .sales-delivery-section
) {
  display: grid !important;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 6px 20px !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
  .quote-detail-section:has(> .quote-approval-timeline),
  .delivery-logistics-section,
  .sales-delivery-section
) .quote-detail-title-row {
  display: contents !important;
  min-height: 0;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
  .quote-detail-section:has(> .quote-approval-timeline),
  .delivery-logistics-section,
  .sales-delivery-section
) .quote-detail-title-row > h3 {
  grid-row: 1;
  grid-column: 1;
  margin: 0 !important;
  white-space: nowrap;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
  .quote-detail-section:has(> .quote-approval-timeline),
  .delivery-logistics-section,
  .sales-delivery-section
) .quote-detail-title-row > :not(h3) {
  grid-row: 1;
  grid-column: 3;
  margin: 0 !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel .approval-center-timeline + .muted {
  display: none !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
  .quote-approval-timeline,
  .delivery-logistics-timeline,
  .sales-delivery-progress
) > li {
  position: relative !important;
  display: grid !important;
  flex: 1 1 90px;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: 8px auto !important;
  justify-items: center !important;
  align-content: center !important;
  gap: 4px !important;
  min-width: 72px !important;
  min-height: 30px !important;
  padding: 0 5px !important;
  text-align: center !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
  .quote-approval-timeline,
  .delivery-logistics-timeline,
  .sales-delivery-progress
) > li:not(:last-child)::after {
  content: "" !important;
  position: absolute !important;
  z-index: 0;
  top: 3px !important;
  right: calc(-50% + 8px) !important;
  bottom: auto !important;
  left: calc(50% + 8px) !important;
  width: auto !important;
  height: 2px !important;
  background: #dbe3ef !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
  .quote-approval-timeline .timeline-dot,
  .delivery-logistics-timeline .delivery-logistics-dot,
  .sales-delivery-progress .sales-progress-dot
) {
  position: relative !important;
  z-index: 1 !important;
  grid-row: 1;
  grid-column: 1;
  width: 8px !important;
  height: 8px !important;
  margin: 0 !important;
  border-width: 2px !important;
  border-radius: 50% !important;
  background: #fff;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
  .quote-approval-timeline,
  .delivery-logistics-timeline,
  .sales-delivery-progress
) > li > div {
  min-width: 0;
  grid-row: 2;
  grid-column: 1;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
  .quote-approval-timeline,
  .delivery-logistics-timeline,
  .sales-delivery-progress
) :is(b, small) {
  display: block !important;
  text-align: center !important;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel .sales-delivery-progress > li > b {
  grid-row: 2;
  grid-column: 1;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
  .quote-approval-timeline,
  .delivery-logistics-timeline,
  .sales-delivery-progress
) b {
  color: #6f7d92 !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  line-height: 1.3 !important;
  white-space: nowrap;
}

.app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
  .quote-approval-timeline,
  .delivery-logistics-timeline,
  .sales-delivery-progress
) small {
  display: none !important;
}

@media (max-width: 620px) {
  .app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
    .quote-detail-section:has(> .quote-approval-timeline),
    .delivery-logistics-section,
    .sales-delivery-section
  ) {
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 5px 10px;
    padding: 6px 14px !important;
  }

  .app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
    .quote-approval-timeline,
    .delivery-logistics-timeline,
    .sales-delivery-progress
  ) {
    grid-row: 2;
    grid-column: 1 / -1;
  }

  .app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
    .quote-detail-section:has(> .quote-approval-timeline),
    .delivery-logistics-section,
    .sales-delivery-section
  ) .quote-detail-title-row > :not(h3) {
    grid-row: 1;
    grid-column: 2;
  }
}

@media (max-width: 900px) {
  .app:not(.label-fullscreen-mode) .oms-wide-detail-panel {
    --oms-detail-title: 11px;
  }

  .app:not(.label-fullscreen-mode) .oms-wide-detail-panel :is(
    .product-details-head,
    .quote-details-head,
    .oms-document-details-head,
    .oms-partner-details-head,
    .finance-details-head,
    .approval-details-head,
    .label-template-details-head,
    .label-generation-details-head
  ) {
    min-height: 68px !important;
    padding: 12px 16px !important;
  }
}
