.bp-orders-filters > [hidden] { display: none !important; }
.bp-order-filter-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; }
.business-portal-mode .bp-order-filter-tile { position: relative; display: grid; align-content: center; justify-items: start; gap: 7px; min-width: 0; min-height: 108px; padding: 14px; border: 1px solid #cbded4; border-radius: 9px; background: #fff; box-shadow: 0 2px 5px #17473308; color: #195c48; text-align: left; font: inherit; }
.business-portal-mode .bp-order-filter-tile:hover { background: #f5faf7; border-color: #87b6a1; }
.business-portal-mode .bp-order-filter-tile.is-filtered { border-color: #1f8063; background: #edf7f1; }
.bp-order-filter-tile svg { width: 22px; height: 22px; stroke: #388b6c; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.bp-order-filter-tile-title { font-size: 11px; color: #607a6c; }
.bp-order-filter-tile strong { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; font-weight: 650; }
.bp-order-filter-tile-edit { position: absolute; right: 12px; top: 12px; font-size: 12px; color: #719b87; }
.bp-order-filter-tile:focus-visible, .bp-order-receipt-panel:focus-visible { outline: 3px solid #319879; outline-offset: 3px; }
.bp-orders-filter-workspace:has(.bp-order-filter-panels) .bp-order-filter-summary { margin-top: 14px; padding-top: 12px; border-top: 1px solid #e1ebe5; font-size: 12px; }
.bp-order-filter-dialog { width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: 0; margin: auto; border: 1px solid #cadbd1; border-radius: 14px; background: #fff; color: #163d2e; box-shadow: 0 20px 80px #102a2240; }
.bp-order-filter-dialog::backdrop { background: #102a2250; }
.bp-order-filter-dialog header { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-bottom: 1px solid #e1ebe5; }
.bp-order-filter-dialog header span { font-size: 11px; color: #72877b; }
.bp-order-filter-dialog h3 { margin: 4px 0 0; font-size: 20px; }
.bp-order-filter-dialog header button { width: 36px; height: 36px; padding: 0; border: 1px solid #d9e5dd; border-radius: 7px; background: #fff; color: #476c58; font-size: 22px; }
.bp-order-filter-dialog-body { padding: 24px 20px; }
.bp-order-filter-dialog-body > :is(label, div), .bp-order-filter-dialog-body .bp-range-control { display: grid; gap: 10px; width: 100%; padding: 0; margin: 0; border: 0; background: transparent; }
.bp-order-filter-dialog-body label { display: grid; gap: 8px; font-size: 12px; font-weight: 600; }
.bp-order-filter-dialog-body :is(select, input) { width: 100%; height: 44px; padding: 0 12px; border: 1px solid #b7d2c3; border-radius: 7px; background: #fff; color: #234d3c; font-size: 14px; }
.bp-order-filter-dialog-body .bp-custom-days.hidden { display: none; }
.bp-order-filter-dialog-body .bp-range-date-label { color: #6c8074; font-size: 12px; }
.bp-order-filter-dialog footer { display: flex; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid #e1ebe5; }
.bp-order-filter-dialog footer button { padding: 10px 22px; border: 0; border-radius: 7px; background: #1f6f5b; color: #fff; font-size: 13px; font-weight: 600; }
.business-portal-mode [data-business-view="orders"] .bp-order-library-toolbar { display: flex; align-items: end; gap: 10px; max-width: 780px; margin: 16px 0 20px; }
.business-portal-mode [data-business-view="orders"] .bp-order-library-toolbar .bp-order-search { flex: 1; min-width: 0; display: grid; gap: 7px; margin: 0; padding: 0; font-size: 12px; }
.business-portal-mode [data-business-view="orders"] .bp-order-library-toolbar input { height: 42px; border: 1px solid #b9d4c6; border-radius: 7px; background: #fff; padding: 0 12px; font-size: 13px; font-weight: 400; }
.business-portal-mode .bp-order-library-refresh { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid #b9d4c6; border-radius: 7px; background: #fff; color: #27654d; }
.bp-order-library-refresh svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.business-portal-mode:not(.organization-portal-mode) [data-business-view="orders"] .bp-order-receipt-row.has-receipt-panel { grid-template-columns: 92px minmax(0, 1fr) auto auto auto; gap: 16px; }
.business-portal-mode:not(.organization-portal-mode) [data-business-view="orders"] .bp-order-receipt-row.is-square-import.has-receipt-panel { grid-template-columns: 92px minmax(0, 1fr) auto max-content; }
.business-portal-mode:not(.organization-portal-mode) [data-business-view="orders"] .has-receipt-panel .bp-order-receipt-main { grid-column: 2; grid-row: 1; min-width: 0; }
.business-portal-mode:not(.organization-portal-mode) [data-business-view="orders"] .has-receipt-panel .bp-order-receipt-total { grid-column: 3; grid-row: 1; }
.business-portal-mode:not(.organization-portal-mode) [data-business-view="orders"] .has-receipt-panel .bp-order-receipt-state { grid-column: 4; grid-row: 1; }
.business-portal-mode:not(.organization-portal-mode) [data-business-view="orders"] .has-receipt-panel .bp-order-receipt-actions { grid-column: 5; grid-row: 1; }
.business-portal-mode:not(.organization-portal-mode) [data-business-view="orders"] .is-square-import.has-receipt-panel .bp-order-receipt-actions { grid-column: 4; }
.business-portal-mode .bp-order-receipt-panel { display: grid; grid-column: 1; grid-row: 1; align-content: center; justify-items: center; gap: 6px; width: 92px; min-width: 0; min-height: 96px; padding: 10px 8px; border: 1px solid #a9cabc; border-radius: 9px; background: #f5faf7; color: #195c48; text-align: center; }
.bp-order-receipt-panel:hover { border-color: #579d7f; box-shadow: 0 2px 8px #17473315; }
.bp-order-receipt-panel strong { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; line-height: 1.3; }
.bp-order-receipt-panel small { color: #587e69; font-size: 10px; font-weight: 400; }
.bp-order-receipt-paper { display: block; width: 24px; height: 30px; border: 1px solid #9cbaae; border-radius: 2px; background: linear-gradient(#13725a,#13725a) 5px 6px/8px 3px no-repeat, linear-gradient(#bed6cb,#bed6cb) 5px 14px/12px 1px no-repeat, linear-gradient(#bed6cb,#bed6cb) 5px 19px/12px 1px no-repeat, linear-gradient(#bed6cb,#bed6cb) 5px 24px/8px 1px no-repeat, #fff; box-shadow: 3px 3px 0 #dceae3; }
@media (max-width: 700px) {
  .bp-order-filter-panels { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .business-portal-mode .bp-order-filter-tile { min-height: 96px; padding: 10px; gap: 5px; }
  .bp-order-filter-tile strong { font-size: 11px; }
  .business-portal-mode:not(.organization-portal-mode) [data-business-view="orders"] .bp-order-receipt-row.has-receipt-panel { grid-template-columns: 76px minmax(0, 1fr) auto; gap: 10px; }
  .business-portal-mode:not(.organization-portal-mode) [data-business-view="orders"] .bp-order-receipt-row.is-square-import.has-receipt-panel { grid-template-columns: 76px minmax(0, 1fr) auto; }
  .business-portal-mode .bp-order-receipt-panel { width: 76px; min-height: 92px; }
  .business-portal-mode:not(.organization-portal-mode) [data-business-view="orders"] .has-receipt-panel .bp-order-receipt-panel { grid-column: 1; grid-row: 1 / span 2; }
  .business-portal-mode:not(.organization-portal-mode) [data-business-view="orders"] .has-receipt-panel .bp-order-receipt-main { grid-column: 2 / -1; grid-row: 1; }
  .business-portal-mode:not(.organization-portal-mode) [data-business-view="orders"] .has-receipt-panel .bp-order-receipt-total { grid-column: 2; grid-row: 2; justify-self: start; display: flex; align-items: center; gap: 8px; }
  .business-portal-mode:not(.organization-portal-mode) [data-business-view="orders"] .is-square-import.has-receipt-panel .bp-order-receipt-total { display: grid; justify-items: start; }
  .business-portal-mode:not(.organization-portal-mode) [data-business-view="orders"] .has-receipt-panel .bp-order-receipt-state { grid-column: 2 / -1; grid-row: 3; }
  .business-portal-mode:not(.organization-portal-mode) [data-business-view="orders"] .has-receipt-panel .bp-order-receipt-actions { grid-column: 3; grid-row: 2; }
  .business-portal-mode:not(.organization-portal-mode) [data-business-view="orders"] .is-square-import.has-receipt-panel .bp-order-receipt-actions { display: inline-flex; grid-column: 3; grid-row: 2; }
}
.business-portal-mode [data-business-view="orders"] .bp-order-compact-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
:is(.business-portal-mode [data-business-view="orders"] .bp-order-icon-action, .csv-import-drawer .csv-action-button) { display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; min-width: 66px; min-height: 60px; padding: 8px 10px; border: 1px solid #c6dcd0; border-radius: 8px; background: #f7fbf8; color: #22664e; font-size: 10px; font-weight: 600; line-height: 1.2; white-space: nowrap; box-shadow: 0 2px 0 #bbd4c6, 0 2px 5px #17473312; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: transform .14s ease-out, box-shadow .14s ease-out, background-color .14s ease-out, border-color .14s ease-out, filter .14s ease-out; }
:is(.business-portal-mode [data-business-view="orders"] .bp-order-icon-action, .csv-import-drawer .csv-action-button) svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
:is(.business-portal-mode [data-business-view="orders"] .bp-order-icon-action, .csv-import-drawer .csv-action-button).is-primary { background: #1f6f5b; color: #fff; border-color: #1f6f5b; box-shadow: 0 2px 0 #124d3d, 0 2px 5px #17473324; }
:is(.business-portal-mode [data-business-view="orders"] .bp-order-icon-action, .csv-import-drawer .csv-action-button).is-importing { background: #edf8f1; border-color: #9fc8b3; }
:is(.business-portal-mode [data-business-view="orders"] .bp-order-icon-action, .csv-import-drawer .csv-action-button).is-paused { color: #7b6333; background: #fcf9f0; border-color: #e1d5b9; }
:is(.business-portal-mode [data-business-view="orders"] .bp-order-icon-action, .csv-import-drawer .csv-action-button):is(:active, .is-pressed):not(:disabled) { transform: translateY(2px) scale(.98); background: #dcefe5; border-color: #6ba98b; box-shadow: inset 0 2px 5px #17473328; filter: none; }
:is(.business-portal-mode [data-business-view="orders"] .bp-order-icon-action, .csv-import-drawer .csv-action-button).is-primary:is(:active, .is-pressed):not(:disabled) { background: #14513f; border-color: #14513f; box-shadow: inset 0 2px 6px #082e245c; }
@media (hover: hover) { :is(.business-portal-mode [data-business-view="orders"] .bp-order-icon-action, .csv-import-drawer .csv-action-button):hover:not(:active):not(.is-pressed):not(:disabled) { filter: brightness(.97); } }
:is(.business-portal-mode [data-business-view="orders"] .bp-order-icon-action, .csv-import-drawer .csv-action-button):focus-visible { outline: 3px solid #319879; outline-offset: 3px; }
:is(.business-portal-mode [data-business-view="orders"] .bp-order-icon-action, .csv-import-drawer .csv-action-button):disabled { opacity: .55; cursor: wait; }
.bp-order-icon-action.is-syncing svg { animation: bp-order-sync-spin 1.2s linear infinite; }
.bp-order-filter-empty { margin: 16px 0 0; color: #62766b; font-size: 13px; line-height: 1.5; }
@keyframes bp-order-sync-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .bp-order-icon-action.is-syncing svg { animation: none; } }
@media (prefers-reduced-motion: reduce) { :is(.business-portal-mode [data-business-view="orders"] .bp-order-icon-action, .csv-import-drawer .csv-action-button) { transition: none; } }
@media (max-width: 700px) {
  .business-portal-mode [data-business-view="orders"] .bp-orders-heading { flex-wrap: wrap; gap: 12px; }
  .business-portal-mode [data-business-view="orders"] [data-square-import-panel] .bp-card-head { flex-wrap: wrap; gap: 12px; }
  .business-portal-mode [data-business-view="orders"] .bp-order-compact-actions { gap: 6px; }
  :is(.business-portal-mode [data-business-view="orders"] .bp-order-icon-action, .csv-import-drawer .csv-action-button) { min-width: 60px; padding: 7px 8px; }
}
.bp-order-filter-dialog-body:has(.bp-order-dependent-field) { display: grid; gap: 14px; max-height: calc(100dvh - 225px); overflow-y: auto; }
.business-portal-mode [data-business-view="orders"] .bp-orders-filters .bp-order-dependent-field { display: grid; gap: 7px; padding: 0; border: 0; border-radius: 0; background: transparent; }
.business-portal-mode [data-business-view="orders"] .bp-orders-filters .bp-order-dependent-field[data-dependent] { border-left: 0; }
.business-portal-mode [data-business-view="orders"] .bp-orders-filters .bp-order-dependent-field :is(select, input) { min-height: 42px; padding: 0 10px; border: 1px solid #bfd6c9; border-radius: 6px; background: #fff; font-size: 13px; font-weight: 500; }
.bp-order-filter-preview { margin: 2px 0 0; color: #60766a; font-size: 12px; line-height: 1.5; }
.bp-order-dependent-field .bp-order-filter-empty { margin: 0; font-size: 12px; }
.business-portal-mode [data-business-view="orders"] .bp-order-sync-action { display: contents; }
.bp-order-sync-feedback { max-width: 190px; font-size: 12px; line-height: 1.4; color: #60766a; overflow-wrap: anywhere; }
.bp-order-sync-feedback[hidden] { display: none; }
.business-portal-mode [data-business-view="orders"] .bp-order-insights-open { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border: 1px solid #c6dcd0; border-radius: 8px; background: #f7fbf8; color: #22664e; font-size: 12px; white-space: nowrap; }
.bp-order-insights-open svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.bp-order-insights-dialog { width: min(1120px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: 0; border: 1px solid #cadbd1; border-radius: 14px; background: #fff; color: #163d2e; }
.bp-order-insights-dialog::backdrop { background: #102a2260; }
.bp-order-insights-dialog > header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid #dce7e0; background: #fff; }
.bp-order-insights-dialog > header h3 { margin: 0; font-size: 20px; }
.bp-order-insights-dialog > header p { margin: 5px 0 0; color: #60766a; font-size: 12px; }
.bp-order-insights-dialog > header button { width: 38px; height: 38px; min-width: 38px; padding: 0; border: 1px solid #d9e5dd; border-radius: 7px; background: #fff; color: #476c58; font-size: 24px; }
.bp-order-insights-content { padding: 20px; }
.bp-order-insights-content .bp-orders-source-report { margin: 0; border: 0; padding: 0; }
.bp-order-insights-content .bp-event-bar-track { background: #edf3ef; }
.bp-order-insights-content .bp-event-bar-track i { background: #287d61 !important; }
.bp-order-time-note { margin: 0 0 16px; font-size: 12px; line-height: 1.5; color: #60766a; }
@media (max-width: 700px) { .bp-order-insights-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); } .bp-order-insights-content { padding: 12px; } }
.business-portal-mode [data-business-view="orders"] .bp-orders-heading { display: grid; grid-template-columns: minmax(190px, .7fr) minmax(220px, 1fr) auto; align-items: center; gap: 20px; }
.business-portal-mode [data-business-view="orders"] .bp-orders-heading .bp-order-library-toolbar { width: 100%; max-width: none; margin: 0; }
.business-portal-mode [data-business-view="orders"] .bp-orders-heading .bp-order-compact-actions { flex-wrap: nowrap; }
.business-portal-mode [data-business-view="orders"] [data-order-assignment-toggle][aria-expanded="true"] { background: #e7f3ed; border-color: #398e6c; }
.bp-order-assignment-disclosure { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .22s ease, visibility .22s; }
.bp-order-assignment-disclosure > div { min-height: 0; overflow: hidden; }
.is-assigning-orders .bp-order-assignment-disclosure { grid-template-rows: 1fr; visibility: visible; }
.bp-order-assignment-disclosure .square-sale-event-form { margin: 16px 0 0; }
.business-portal-mode:not(.organization-portal-mode) [data-business-view="orders"].has-order-assignment-toggle:not(.is-assigning-orders) .square-sale-selection { display: none; }
.business-portal-mode:not(.organization-portal-mode) [data-business-view="orders"].has-order-assignment-toggle:not(.is-assigning-orders) .has-square-selection { padding-left: 16px; }
.business-portal-mode:not(.organization-portal-mode) [data-business-view="orders"].has-order-assignment-toggle:not(.is-assigning-orders) .is-square-selected { background: #fff; border-color: #e0e7e3; box-shadow: none; }
@media (max-width: 1200px) {
  .business-portal-mode [data-business-view="orders"] .bp-orders-heading { grid-template-columns: 1fr auto; gap: 14px; }
  .business-portal-mode [data-business-view="orders"] .bp-orders-heading .bp-order-library-toolbar { grid-row: 2; grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .business-portal-mode [data-business-view="orders"] .bp-orders-heading { grid-template-columns: minmax(0, 1fr); }
  .business-portal-mode [data-business-view="orders"] .bp-orders-heading .bp-order-compact-actions { grid-row: 3; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
  .business-portal-mode [data-business-view="orders"] .bp-orders-heading .bp-order-icon-action { width: 100%; min-width: 0; min-height: 60px; padding: 8px 4px; white-space: normal; text-align: center; }
  .business-portal-mode [data-business-view="orders"] .bp-order-sync-feedback { grid-column: 1 / -1; grid-row: 3; max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .bp-order-assignment-disclosure { transition: none; } }
.bp-order-correction { margin: 0 0 18px; border: 1px solid #bfd6c9; border-radius: 12px; background: #f7fbf8; color: #194634; }
.bp-order-correction > summary { padding: 15px 18px; font-weight: 700; cursor: pointer; }
.bp-order-correction form { display: grid; gap: 14px; padding: 0 18px 18px; }
.bp-order-correction form > p { margin: 0; font-size: 13px; line-height: 1.45; }
.bp-order-correction label { display: grid; gap: 5px; min-width: 0; font-size: 12px; font-weight: 650; }
.bp-order-correction :is(input, select, textarea) { width: 100%; min-width: 0; min-height: 42px; padding: 8px 10px; border: 1px solid #bed5c9; border-radius: 8px; background: #fff; color: #183d2d; font: inherit; }
.bp-order-correction-head { display: flex; align-items: center; justify-content: space-between; }
.bp-order-correction-head button, .bp-order-correction-line button { min-height: 36px; padding: 4px 10px; border: 1px solid #bed5c9; border-radius: 8px; background: #fff; color: #18553e; cursor: pointer; }
.bp-order-correction-line { display: grid; grid-template-columns: minmax(0, 2fr) 75px 110px 38px; gap: 8px; align-items: end; margin-top: 8px; }
.bp-correction-line-product { display: grid; gap: 5px; min-width: 0; }
.bp-correction-line-product > small { font-size: 12px; font-weight: 650; }
.bp-order-correction-line [data-correction-change] { display: grid; gap: 4px; width: 100%; text-align: left; padding: 8px 10px; font: inherit; overflow-wrap: anywhere; }
.bp-order-correction-line [data-correction-change] strong { font-size: 12px; }
.bp-order-correction-line [data-correction-change] span { font-size: 11px; color: #526f63; }
.bp-order-correction-line.is-product-target [data-correction-change] { border-color: #138162; background: #eaf7f1; }
.bp-correction-picker { min-width: 0; padding: 12px; border: 1px solid #c9ded5; border-radius: 10px; background: #f6faf8; }
.bp-correction-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bp-correction-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); grid-auto-rows: 132px; align-content: start; gap: 10px; height: 282px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 4px; margin: 14px 0; min-width: 0; box-sizing: border-box; }
.bp-order-correction .bp-correction-product-card { display: grid; grid-template-rows: 56px minmax(0, 1fr) 14px; gap: 5px; align-items: center; min-width: 0; width: 100%; height: 132px; box-sizing: border-box; padding: 8px; border: 1px solid #c7ddd2; border-radius: 9px; background: #fff; box-shadow: 0 2px 5px #164a3510; color: #18553e; text-align: center; font: inherit; cursor: pointer; }
.bp-order-correction .bp-correction-product-card[aria-pressed=true] { border: 2px solid #138162; background: #eaf7f1; box-shadow: 0 0 0 1px #13816220; }
.bp-correction-product-photo { position: relative; display: grid; place-items: center; width: 100%; height: 56px; overflow: hidden; border-radius: 5px; background: #f2f7f4; color: #558171; font-size: 20px; font-weight: bold; }
.bp-correction-product-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.bp-correction-product-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; font-size: 12px; line-height: 15px; font-weight: bold; }
.bp-correction-product-card small { font-size: 11px; line-height: 14px; color: #526f63; }
.bp-correction-selection { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bp-correction-selection > div:first-child { display: grid; gap: 6px; min-width: 0; flex: 1 1 140px; }
.bp-correction-selection small { font-size: 11px; color: #526f63; }
.bp-correction-selection strong { font-size: 13px; overflow-wrap: anywhere; }
.bp-correction-picker-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bp-correction-picker-actions button { min-height: 42px; padding: 8px 12px; border: 1px solid #bed5c9; border-radius: 8px; background: #fff; color: #18553e; font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
.bp-correction-picker-actions button:disabled, .bp-order-correction-line > button:disabled { opacity: .5; cursor: default; }
.bp-correction-picker [data-correction-picker-hint] { margin: 10px 0 0; font-size: 12px; line-height: 1.45; color: #526f63; }
.bp-correction-product-empty { grid-column: 1 / -1; align-self: center; text-align: center; color: #526f63; font-size: 13px; }
.bp-order-correction :is(button, [data-correction-grid]):focus-visible { outline: 2px solid #138162; outline-offset: 2px; }
.bp-order-correction-total { padding-top: 10px; border-top: 1px solid #d7e4dc; }
.bp-order-correction-resolution-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 10px; }
.bp-order-resolution { margin: 0 0 14px; padding: 14px 16px; border: 1px solid #a7cdbc; border-radius: 10px; background: #eff8f2; color: #194634; }
.bp-order-resolution strong { display: block; font-size: 13px; }
.bp-order-resolution p { margin: 6px 0 0; font-size: 12px; line-height: 1.45; }
.bp-order-resolution-note { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .bp-order-correction-line { grid-template-columns: repeat(2, minmax(0, 1fr)) 36px; gap: 8px; }
  .bp-order-correction-line .bp-correction-line-product { grid-column: 1 / -1; grid-row: 1; }
  .bp-order-correction-line label:nth-child(2) { grid-column: 1; grid-row: 2; }
  .bp-order-correction-line label:nth-child(3) { grid-column: 2; grid-row: 2; }
  .bp-order-correction-line > button { grid-column: 3; grid-row: 2; }
  .bp-correction-filters { grid-template-columns: minmax(0, 1fr); }
  .bp-correction-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bp-order-correction form { padding-inline: 12px; }
  .bp-order-correction-resolution-fields { grid-template-columns: minmax(0, 1fr); }
}

/* Order correction workspace follows the product editor's section cards and fixed footer. */
.bp-correction-workspace, .bp-correction-workspace form, .bp-correction-body, .bp-correction-tabs { min-width: 0; max-width: 100%; box-sizing: border-box; }
.bp-correction-tabs { contain: inline-size; }
.business-order-receipt-panel.has-order-correction .mobile-receipt-sheet { width: min(1200px, 100vw); max-width: 100vw; }
.business-order-receipt-panel.has-order-correction .mobile-receipt-content.order-detail { display: flex; flex-direction: column; padding: 0; gap: 0; overflow: hidden; flex: 1; min-height: 0; }
.has-order-correction .business-receipt-delete-status:empty { display: none; }
.bp-order-correction.bp-correction-workspace { display: flex; flex-direction: column; flex: 1; min-height: 0; margin: 0; border: 0; border-radius: 0; background: white; }
.bp-correction-workspace [hidden] { display: none !important; }
.bp-order-correction.bp-correction-workspace form { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 0; gap: 0; }
.bp-correction-workspace-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 24px; background: #f5faf7; border-bottom: 1px solid #d5e5dc; }
.bp-correction-workspace-heading h2 { margin: 3px 0 6px; font-size: 22px; color: #173c30; }
.bp-correction-workspace-heading p { margin: 0; font-size: 13px; color: #56766a; }
.bp-correction-workspace-heading small { font-size: 11px; font-weight: 700; color: #426e5c; }
.bp-correction-recorded { display: grid; gap: 4px; text-align: right; flex-shrink: 0; }
.bp-correction-recorded strong { font-size: 24px; color: #133e2f; }
.bp-correction-recorded span { color: #527666; font-size: 11px; }
.bp-correction-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 16px 24px; border-bottom: 1px solid #d5e5dc; flex-shrink: 0; }
.bp-correction-tabs button { display: grid; text-align: left; gap: 7px; align-content: center; min-width: 0; min-height: 100px; padding: 12px; border: 1px solid #bdd9cb; border-radius: 14px; background: white; color: #174b39; cursor: pointer; }
.bp-correction-tabs button[aria-pressed=true] { background: #e8f5ee; border-color: #00866a; box-shadow: inset 0 0 0 1px #00866a; }
.bp-correction-tabs svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bp-correction-tabs strong { font-size: 13px; overflow-wrap: anywhere; }
.bp-correction-tabs small { font-size: 11px; color: #56766a; }
.bp-correction-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px; }
.bp-correction-body h3 { font-size: 21px; margin: 0 0 8px; color: #182e25; }
.bp-correction-body p { font-size: 13px; line-height: 1.5; }
.bp-correction-body > section > label, .bp-correction-extra > label { margin-top: 18px; }
.bp-correction-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.bp-correction-section-heading p { margin: 0; color: #56766a; }
.bp-correction-tools { margin-bottom: 14px; }
.bp-correction-workspace :is(.bp-correction-tools, .bp-correction-section-heading, .bp-correction-batch, .bp-correction-footer) button { min-height: 42px; padding: 10px 16px; border: 1px solid #bad8c9; border-radius: 9px; background: white; color: #18553e; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.bp-correction-workspace button:disabled { opacity: .5; cursor: default; }
.bp-correction-workspace .bp-order-correction-line { padding: 14px; margin-top: 12px; border: 1px solid #d6e5dd; border-radius: 12px; background: #fbfdfb; grid-template-columns: minmax(0, 1fr) 95px 150px 38px; }
.bp-correction-workspace .bp-correction-line-product > strong { font-size: 14px; overflow-wrap: anywhere; }
.bp-correction-workspace .bp-order-correction-line [data-correction-change] { display: block; width: fit-content; font-size: 12px; min-height: 30px; padding: 3px 8px; background: transparent; border-color: transparent; color: #216e56; }
.bp-correction-workspace .bp-correction-product-grid { height: auto; overflow: visible; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); grid-auto-rows: auto; padding: 4px; margin: 20px 0; }
.bp-correction-card-wrap { position: relative; min-width: 0; border: 1px solid #c7ddd2; border-radius: 12px; background: white; overflow: hidden; box-shadow: 0 2px 5px #164a3510; }
.bp-correction-card-wrap.is-selected { border-color: #00866a; box-shadow: inset 0 0 0 1px #00866a; background: #eaf7f1; }
.bp-correction-workspace .bp-correction-product-card { border: 0; border-radius: 0; box-shadow: none; height: 144px; grid-template-rows: 64px minmax(0, 1fr) 14px; background: transparent; }
.bp-correction-workspace .bp-correction-product-card[aria-pressed=true] { border: 0; box-shadow: none; background: transparent; }
.bp-correction-workspace .bp-correction-product-photo { height: 64px; }
.bp-correction-workspace .bp-correction-card-quantity { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid #e2ece6; }
.bp-correction-workspace .bp-correction-card-quantity input { min-height: 34px; padding: 4px 8px; }
.bp-correction-check { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #087e61; color: white; opacity: 0; font-size: 14px; }
.is-selected .bp-correction-check { opacity: 1; }
.bp-correction-batch { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px; background: #f0f8f3; border: 1px solid #c9dfd2; border-radius: 10px; position: sticky; bottom: -24px; z-index: 1; }
.bp-correction-batch > div { flex: 1 1 220px; }
.bp-correction-batch strong { font-size: 14px; }
.bp-correction-batch p { margin: 5px 0 0; color: #527363; font-size: 12px; }
.bp-correction-workspace .bp-correction-batch [data-correction-add], .bp-correction-workspace .bp-correction-footer [data-correction-confirm] { background: #197b60; color: white; border-color: #197b60; }
.bp-correction-help { color: #56766a; font-size: 12px !important; }
.bp-correction-extra { margin-top: 24px; border-top: 1px solid #d6e5dc; padding-top: 16px; }
.bp-correction-extra summary { cursor: pointer; font-weight: 650; font-size: 13px; }
.bp-correction-workspace dl { max-width: 580px; padding: 18px; background: #f5faf7; border: 1px solid #d7e6dd; border-radius: 12px; margin: 24px 0; }
.bp-correction-workspace dl > div { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; font-size: 14px; }
.bp-correction-workspace dl > div:last-child { border-top: 1px solid #cadfd2; margin-top: 6px; padding-top: 14px; font-weight: 750; }
.bp-correction-workspace dd { margin: 0; font-weight: 650; }
.bp-correction-review-items { padding: 0; list-style: none; max-width: 580px; }
.bp-correction-review-items li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #e1ece5; font-size: 14px; }
.bp-correction-footer { display: flex; justify-content: flex-end; align-items: center; flex-shrink: 0; gap: 12px; padding: 16px 24px max(16px, env(safe-area-inset-bottom)); background: #f5faf7; border-top: 1px solid #d5e5dc; }
.bp-correction-footer > div { flex: 1; min-width: 0; }
.bp-correction-footer strong { font-size: 13px; }
.bp-correction-footer .status { margin: 5px 0 0; font-size: 12px; line-height: 1.4; }
.bp-correction-footer .status:empty { display: none; }
@media (max-width: 650px) {
  .bp-correction-workspace-heading { padding: 14px; gap: 10px; }
  .bp-correction-workspace-heading h2 { font-size: 18px; }
  .bp-correction-workspace-heading p { font-size: 11px; }
  .bp-correction-recorded strong { font-size: 20px; }
  .bp-correction-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 12px 14px; }
  .bp-correction-tabs button { flex: 0 0 106px; min-height: 80px; padding: 10px; gap: 6px; }
  .bp-correction-tabs small { display: none; }
  .bp-correction-tabs strong { font-size: 12px; }
  .bp-correction-body { padding: 16px 14px; }
  .bp-correction-section-heading { align-items: flex-start; flex-wrap: wrap; }
  .bp-correction-workspace .bp-order-correction-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) 32px; padding: 10px; }
  .bp-correction-workspace .bp-correction-line-product { grid-column: 1 / -1; grid-row: 1; }
  .bp-correction-workspace .bp-order-correction-line > label:nth-child(2) { grid-column: 1; grid-row: 2; }
  .bp-correction-workspace .bp-order-correction-line > label:nth-child(3) { grid-column: 2; grid-row: 2; }
  .bp-correction-workspace .bp-order-correction-line > button { grid-column: 3; grid-row: 2; }
  .bp-correction-workspace .bp-correction-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .bp-correction-batch { bottom: -16px; padding: 10px; }
  .bp-correction-batch > div { flex-basis: 100%; }
  .bp-correction-footer { padding: 12px 14px; flex-wrap: wrap; }
  .bp-correction-footer > div { flex-basis: 100%; }
  .bp-correction-footer > button { width: 100%; }
}

/* CSV import stays alongside the order list, with independently scrolling results. */
.bp-action-dialog.csv-import-drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(580px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 16px 0 0 16px; box-sizing: border-box; }
.csv-import-drawer[open] { display: flex; flex-direction: column; overflow: hidden; animation: csv-import-enter .22s ease-out; }
.csv-import-drawer form { display: flex; flex: 1; flex-direction: column; overflow: hidden; min-height: 0; margin: 0; }
.csv-import-drawer > header, .csv-import-drawer form > footer { flex-shrink: 0; }
.csv-import-drawer > header button { display: grid; place-items: center; padding: 0; }
.csv-import-drawer > header button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.csv-import-drawer .bp-action-dialog-body { flex: 1; overflow-y: auto; min-height: 0; overflow-wrap: anywhere; overscroll-behavior: contain; }
.csv-import-drawer form > footer { flex-wrap: wrap; border-top: 1px solid #deebe5; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.csv-import-drawer [hidden] { display: none !important; }
.csv-import-drawer label { display: grid; gap: 8px; font-size: 14px; font-weight: 700; }
.csv-import-drawer :is(input, select) { min-width: 0; width: 100%; max-width: 100%; box-sizing: border-box; font: inherit; }
.csv-import-drawer select { min-height: 46px; padding: 10px; border: 1px solid #bdd7ca; border-radius: 8px; background: white; color: #153e31; }
.csv-import-drawer input[type=file] { padding: 12px; border: 1px dashed #a8c9b9; border-radius: 8px; font-size: 13px; background: #f7fbf8; }
.csv-import-drawer p { line-height: 1.5; font-size: 14px; }
.csv-import-drawer [data-platform-help] { margin: 12px 0 24px; }
.csv-import-drawer [data-status]:not(:empty) { margin: 20px 0 12px; }
.csv-import-note { margin: 20px 0; color: #567267; font-size: 13px; }
.csv-import-note summary { cursor: pointer; }
.csv-import-drawer button:disabled { opacity: .5; cursor: default; }
@keyframes csv-import-enter { from { transform: translateX(100%); } to { transform: translateX(0); } }
@media (max-width: 600px) {
  .bp-action-dialog.csv-import-drawer { width: 100vw; border-radius: 0; }
  .csv-import-drawer form > footer { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-inline: 16px; }
  .csv-import-drawer footer button { min-height: 46px; padding: 10px 8px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { .csv-import-drawer[open] { animation: none; } }
.csv-product-matches { margin: 16px 0 24px; padding: 14px; border: 1px solid #c5dbd1; border-radius: 10px; background: #f7fbf8; }
.csv-product-matches > summary { cursor: pointer; }
.csv-product-matches > p { margin: 12px 0; }
.csv-product-match { padding: 14px 0; border-top: 1px solid #deebe5; }
.csv-product-match small { color: #567267; font-weight: 400; }
.csv-product-matches > button { width: 100%; min-height: 44px; margin-top: 12px; border: 1px solid #9ebfae; border-radius: 8px; background: white; color: #15553f; font-weight: 700; }
.csv-product-match { display: grid; gap: 10px; }
.csv-product-match input[type=number] { min-height: 44px; padding: 10px; border: 1px solid #bdd7ca; border-radius: 8px; color: #153e31; background: white; }
.csv-item-units { display: block; color: #567267; font-size: 12px; line-height: 1.5; margin-top: 4px; }
.csv-review-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 12px 0; }
.csv-import-drawer .csv-review-filters button { position: relative; min-width: 0; min-height: 68px; padding: 10px 4px 8px; white-space: normal; text-align: center; }
.csv-import-drawer .csv-review-filters button[aria-pressed=true] { background: #e7f4ee; border-color: #17866a; color: #10503c; box-shadow: inset 0 1px 3px #184c321a; }
.csv-review-filters .csv-review-count { position: absolute; top: -5px; right: 5px; min-width: 20px; box-sizing: border-box; padding: 2px 5px; border: 1px solid #bfd6c9; border-radius: 12px; background: #fff; color: #22664e; font-size: 10px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.csv-review-filters button:focus-visible { outline: 2px solid #17866a; outline-offset: 2px; }
.csv-import-drawer .csv-review-note { font-size: 12px; color: #567267; margin-bottom: 16px; }
.csv-review-order { padding: 12px 0; border-top: 1px solid #deebe5; }
.csv-review-order summary { cursor: pointer; }
.csv-review-order > p { margin: 10px 0; }

.csv-import-drawer footer .csv-action-button { flex: 1; min-width: 0; white-space: normal; text-align: center; }

.bp-correction-tabs { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.bp-correction-footer[hidden] { display: none; }
