/* Approved production screens. Status colors live in this stylesheet so the
   application's strict Content Security Policy does not discard them. */
@font-face { font-family: Inter; src: url('/fonts/Inter.ttf') format('truetype'); font-style: normal; font-weight: 100 900; font-display: swap; }
[data-production-tone="nao_informado"] { --production-tone: #bdbdbd; }
[data-production-tone="so_tecido"] { --production-tone: #efe6d8; --production-ink: #6b4f2a; }
[data-production-tone="separado"] { --production-tone: #5b4bb2; }
[data-production-tone="cortada"] { --production-tone: #f6d9bf; --production-ink: #8a3d0b; }
[data-production-tone="na_costura"] { --production-tone: #1d7a8c; }
[data-production-tone="pronta"] { --production-tone: #137549; }
[data-production-tone="enviada"] { --production-tone: #ececec; --production-ink: #7a7a7a; }
[data-production-tone="falta_molde"] { --production-tone: #9b1c48; }
[data-production-tone="esperando_estamparia"] { --production-tone: #c2410c; }
[data-production-tone="falta_tecido"] { --production-tone: #b52f3e; }
[data-production-tone="falta_aviamento"] { --production-tone: #7c2d12; }
[data-production-tone="cancelada"] { --production-tone: #3a3a3a; }
.production-status-chip, .production-status-trigger, .production-action,
.production-status-menu button { border-left: 3px solid var(--production-tone, #999); }
.production-status-chip, .production-status-trigger, .production-status-menu button { color: var(--production-ink, #fff); background: var(--production-tone, #999); border-color: var(--production-tone, #999); }
.production-status-chip[data-production-tone="nao_informado"], .production-status-trigger[data-production-tone="nao_informado"], .production-status-menu button[data-production-tone="nao_informado"] { color: #555; background: #fff; border-color: #bdbdbd; }
.production-status-chip[data-production-tone="enviada"], .production-status-trigger[data-production-tone="enviada"], .production-status-menu button[data-production-tone="enviada"] { color: #7a7a7a; background: #ececec; border-color: #ececec; }
.production-status-chip > i, .production-status-trigger span > i, .production-status-menu button > i { margin-right: 5px; font-style: normal; }
.production-status-trigger:focus-visible, .production-status-menu button:focus-visible,
.production-action button:focus-visible { outline: 2px solid #111; outline-offset: 2px; }
.production-status-menu { max-height: calc(100vh - 16px); overflow-y: auto; }
.production-action { grid-template-columns: minmax(0,1fr) 30px; height: 32px; }
.production-action button { font-size: 9px; letter-spacing: .4px; }
.production-action .production-action-menu { width: 30px; }
.production-action button:disabled { color: #9a9a9a; cursor: default; }
.production-impact progress, .production-progress progress { display: block; appearance: none; width: 100%; height: 4px; border: 0; border-radius: 0; background: #ededed; color: #111; }
.production-impact progress::-webkit-progress-bar, .production-progress progress::-webkit-progress-bar { background: #ededed; }
.production-impact progress::-webkit-progress-value, .production-progress progress::-webkit-progress-value { background: #111; }
.production-impact progress::-moz-progress-bar, .production-progress progress::-moz-progress-bar { background: #111; }
.production-progress progress { height: 3px; }
.production-progress.ready progress::-webkit-progress-value { background: #137549; }
.production-progress.ready progress::-moz-progress-bar { background: #137549; }
.production-progress.problem progress::-webkit-progress-value { background: #b52f3e; }
.production-progress.problem progress::-moz-progress-bar { background: #b52f3e; }
.production-impact small { font-size: 9px; }
.production-kpi { min-height: 106px; padding: 20px 22px; }
.production-kpi span { font-size: 9px; }
.production-kpi small { font-size: 10px; }
.production-ranking-head { font-size: 9px; }
.production-panel, .production-queue-panel, #labelsView .panel { box-shadow: none; border-radius: 0; }
.production-filters { padding: 6px 20px; }
.production-filter-row > span { font-size: 8px; }
.production-filter-chip, .production-modal-chip { min-height: 36px; font-size: 11px; }
.production-filter-chip b { font-size: 8px; background: rgba(0,0,0,.05); }
.production-filter-chip.active:not([data-production-filter="all"]) { border-top-color: #ded889; border-right-color: #ded889; border-bottom-color: #ded889; background: #fcffd7; color: #5f5800; }
.production-filter-chip.active[data-production-filter="falta_molde"],
.production-filter-chip.active[data-production-filter="esperando_estamparia"],
.production-filter-chip.active[data-production-filter="falta_tecido"],
.production-filter-chip.active[data-production-filter="falta_aviamento"] { border-top-color: #efd2d6; border-right-color: #efd2d6; border-bottom-color: #efd2d6; background: #fff1f2; color: #9c2634; }
.production-no-status-alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #e5e5e5; background: #fff2f2; color: #7f1d2d; }
.production-no-status-alert strong { font-size: 12px; }
.production-no-status-alert span { color: #5f5f5f; font-size: 11px; }
.production-no-status-alert button { margin-left: auto; border: 0; background: transparent; color: #7f1d2d; font-size: 10px; font-weight: 800; text-decoration: underline; cursor: pointer; }
.priorities-lead { align-items: flex-end; }
.priority-period-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.priority-period-row > small { color: #696969; font-size: 11px; }
.priority-periods { display: flex; gap: 7px; }
.priority-periods button { height: 34px; padding: 0 13px; border: 1px solid #d4d4d4; border-radius: 2px; background: #fff; color: #111; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.priority-periods button.active { border-color: #111; background: #111; color: #fff; }
.priority-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 14px; border: 1px solid #e5e5e5; background: #fff; }
.priority-metrics article { display: grid; gap: 4px; min-width: 0; padding: 15px 16px; border-right: 1px solid #e5e5e5; }
.priority-metrics article:last-child { border-right: 0; }
.priority-metrics span { color: #626262; font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.priority-metrics strong { font-size: 24px; font-weight: 650; }
.priority-metrics article:nth-child(n+2) strong { color: #a82335; }
.priority-metrics small { overflow: hidden; color: #666; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.priorities-workspace { overflow: hidden; border-radius: 2px; box-shadow: none; }
.priority-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; gap: 12px; padding: 14px; background: #f7f7f7; }
.priority-column { overflow: hidden; min-width: 0; border-radius: 2px; background: #ececec; }
.priority-column > header { display: flex; align-items: center; gap: 10px; padding: 14px; color: #fff; }
.priority-column[data-priority-action="buy_fabric"] > header { background: #b52f3e; }
.priority-column[data-priority-action="charge_printing"] > header { background: #c2410c; }
.priority-column[data-priority-action="make_pattern"] > header { background: #9b1c48; }
.priority-column[data-priority-action="fill_status"] > header { background: #5f5f5f; }
.priority-column > header > span { display: grid; width: 21px; height: 21px; place-items: center; font-size: 15px; }
.priority-column > header div { display: grid; gap: 2px; min-width: 0; }
.priority-column > header b { font-size: 13px; }
.priority-column > header small { color: rgba(255,255,255,.88); font-size: 10px; }
.priority-column > div { display: grid; gap: 9px; padding: 10px; }
.priority-card { display: grid; gap: 9px; padding: 11px; border: 1px solid #ddd; border-radius: 2px; background: #fff; color: #111; text-align: left; cursor: pointer; }
.priority-card:hover, .priority-card:focus-visible { border-color: #111; outline: 0; }
.priority-card-head { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 9px; align-items: center; }
.priority-card-head img, .priority-card-image { display: grid; width: 36px; height: 44px; place-items: center; border: 1px solid #e2e2e2; background: #ececec; color: #8a8a8a; object-fit: cover; font-size: 8px; }
.priority-card-head span { display: grid; gap: 2px; min-width: 0; }
.priority-card-head b { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.priority-card-head small { overflow: hidden; color: #656565; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.priority-card-value { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: #606060; font-size: 10px; }
.priority-card-value b { color: #111; font-size: 15px; }
.priority-card-meta { color: #777; font-size: 9px; }
.priority-empty-column { padding: 14px 5px; color: #777; font-size: 10px; text-align: center; }
.daily-report-dialog { width: min(640px, calc(100vw - 28px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 3px; box-shadow: 0 24px 80px rgba(0,0,0,.28); }
.daily-report-dialog::backdrop { background: rgba(0,0,0,.48); }
.daily-report-dialog > form { position: absolute; top: 12px; right: 12px; }
.daily-report-head { display: grid; gap: 6px; padding: 28px 30px 18px; border-bottom: 1px solid #e6e6e6; }
.daily-report-head h2, .daily-report-head p { margin: 0; }
.daily-report-head p { max-width: 520px; color: #666; font-size: 11px; line-height: 1.5; }
.daily-report-disabled { display: grid; grid-template-columns: 10px 1fr; gap: 2px 9px; align-items: center; margin: 18px 30px 0; padding: 11px 12px; background: #fff4dc; color: #774800; }
.daily-report-disabled > span { grid-row: 1 / span 2; width: 9px; height: 9px; border-radius: 50%; background: #d18400; }
.daily-report-disabled b { font-size: 11px; }
.daily-report-disabled small { font-size: 9px; }
.daily-report-dialog pre { margin: 16px 30px; padding: 20px; overflow: auto; border: 1px solid #e2e2e2; background: #fafafa; color: #202020; font: 12px/1.6 Inter, sans-serif; white-space: pre-wrap; }
.daily-report-dialog footer { display: flex; justify-content: flex-end; padding: 0 30px 24px; }
.production-selection-bar strong { font-size: 12px; }
.production-queue-main .production-model b { font-size: 13px; white-space: normal; }
.production-quantity small { font-size: 10px; }
.production-queue-main { grid-template-columns: 25px 30px 52px minmax(220px,1fr) 72px 150px 110px 100px 100px; }
.production-queue-main .production-status-trigger { width: 100%; }
.production-queue-panel { overflow: visible; }

.orders-approved-workspace { display: flex; align-items: stretch; margin-inline: -42px; }
.orders-approved-list { flex: 1 1 auto; min-width: 0; padding: 0 40px 0 42px; }
.orders-approved-panel { flex: 0 0 600px; min-width: 0; margin: -112px 0 -52px; background: #fff; }
.orders-approved-panel .pz-panel { position: sticky; top: 0; height: 100vh; }
.orders-approved-panel.is-page { position: fixed; z-index: 180; inset: 0 0 0 246px; margin: 0; overflow: auto; }
.orders-approved-panel.is-page .pz-panel { width: 100%; min-height: 100vh; border-left: 0; }

/* The production CSP blocks the inline width/height emitted by the approved
   renderers. Keep product photos at their intended sizes even when the source
   image has very large intrinsic dimensions. */
.orders-approved-list .pz-piece .pz-photo {
  width: 42px;
  height: 42px;
  max-width: 42px;
  max-height: 42px;
  object-fit: contain;
}
.orders-approved-panel .pz-ppiece .pz-photo {
  width: 54px;
  height: 54px;
  max-width: 54px;
  max-height: 54px;
  object-fit: contain;
}
#productionQueue .fz-phead .fz-photo {
  width: 50px;
  height: 62px;
  max-width: 50px;
  max-height: 62px;
  object-fit: contain;
}
#productionQueue .fz-row .fz-photo {
  width: 36px;
  height: 36px;
  max-width: 36px;
  max-height: 36px;
  object-fit: contain;
}
#productionQueue .fz-card-top .fz-photo {
  width: 40px;
  height: 40px;
  max-width: 40px;
  max-height: 40px;
  object-fit: contain;
}
/* The CSP also strips the inline dimensions emitted by the approved cut-plan
   renderer. These selectors mirror its intended 34px and 46px thumbnails. */
#productionQueue .ct-chead > .fz-photo,
#productionQueue .ct-pinfo > .fz-photo,
#productionQueue .ct-mhead > .fz-photo {
  width: 46px;
  height: 57px;
  max-width: 46px;
  max-height: 57px;
  object-fit: contain;
}
#productionQueue .ct-row > .fz-photo,
#productionQueue .ct-rest-row > .fz-photo,
#productionQueue .ct-prow2 > .fz-photo {
  width: 34px;
  height: 43px;
  max-width: 34px;
  max-height: 43px;
  object-fit: contain;
}

#productionQueue .cs-model > .fz-photo {
  width: 30px;
  height: 38px;
  max-width: 30px;
  max-height: 38px;
  object-fit: contain;
}
#productionQueue .mm-prod > .fz-photo {
  width: 36px;
  height: 45px;
  max-width: 36px;
  max-height: 45px;
  object-fit: contain;
}
/* Intrinsic dimensions from catalog images must never expand approved plan
   rows. Logical sizes plus !important also protect browsers that retain an
   older inline width while refreshing the module graph. */
#productionQueue .ct-chead > img.fz-photo,
#productionQueue .ct-pinfo > img.fz-photo,
#productionQueue .ct-mhead > img.fz-photo {
  width: 46px !important;
  height: 57px !important;
  min-width: 46px !important;
  min-height: 57px !important;
  max-width: 46px !important;
  max-height: 57px !important;
  flex: 0 0 46px !important;
  object-fit: contain !important;
}
#productionQueue .ct-row > img.fz-photo,
#productionQueue .ct-rest-row > img.fz-photo,
#productionQueue .ct-prow2 > img.fz-photo {
  width: 34px !important;
  height: 43px !important;
  min-width: 34px !important;
  min-height: 43px !important;
  max-width: 34px !important;
  max-height: 43px !important;
  object-fit: contain !important;
}
#productionQueue .fz-cardsbox {
  display: none;
}
#priorityOrderRanking .pr-photo {
  width: 32px;
  height: 32px;
  max-width: 32px;
  max-height: 32px;
  object-fit: cover;
}
.orders-approved-list .pz-photo,
.orders-approved-panel .pz-photo,
#productionQueue .fz-photo,
#priorityOrderRanking .pr-photo {
  flex: 0 0 auto;
  overflow: hidden;
}

@media (max-width: 1050px) {
  .orders-approved-workspace { margin-inline: -25px; }
  .orders-approved-list { padding-inline: 25px; }
  .orders-approved-panel { flex-basis: min(600px, 48vw); }
}

@media (max-width: 760px) {
  .orders-approved-workspace { margin-inline: -14px; }
  .orders-approved-list { padding-left: 14px; padding-right: 14px; }
  .orders-approved-panel { position: fixed; z-index: 180; inset: 0; margin: 0; overflow: auto; }
  .orders-approved-panel .pz-panel { width: 100%; min-height: 100vh; border-left: 0; }
  .orders-approved-panel.is-page { inset: 0; }
}
/* Keep selected work actions reachable without scrolling back to the list head. */
#productionQueueView.has-production-selection { padding-bottom: 94px; }
#productionQueueView.has-production-selection .production-selection-bar,
#labelsView.has-label-selection .label-bulk-actions:not([hidden]) {
  position: fixed;
  z-index: 25;
  right: 42px;
  bottom: 16px;
  left: 288px;
  border: 1px solid #e7e39d;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .16);
}
#productionQueueView.has-production-selection .production-selection-bar { background: #fcffd7; }
#labelsView.has-label-selection { padding-bottom: 98px; }
#labelsView.has-label-selection .label-bulk-actions:not([hidden]) { border-radius: 2px; }
@media (max-width: 1050px) {
  #productionQueueView.has-production-selection .production-selection-bar,
  #labelsView.has-label-selection .label-bulk-actions:not([hidden]) { right: 25px; left: 103px; }
}
@media (max-width: 760px) {
  #productionQueueView.has-production-selection { padding-bottom: 150px; }
  #productionQueueView.has-production-selection .production-selection-bar,
  #labelsView.has-label-selection .label-bulk-actions:not([hidden]) {
    right: 14px;
    bottom: 74px;
    left: 14px;
    max-height: 42vh;
    overflow-y: auto;
    padding: 12px;
  }
  #labelsView.has-label-selection { padding-bottom: 160px; }
  .production-selection-bar > div { display: grid; grid-template-columns: 1fr; }
}

/* Keep the production queue inside the viewport on tablet widths. */
@media (min-width: 761px) and (max-width: 1180px) {
  .production-queue-panel { overflow-x: clip; overflow-y: visible; }
  .production-filters { padding-inline: 14px; }
  .production-filter-row { grid-template-columns: 88px minmax(0, 1fr); }
  .production-filter-search { flex-wrap: wrap; padding-block: 10px; }
  .production-filter-search .search-box { width: min(280px, 100%); }
  .production-queue-main {
    grid-template-columns: 22px 24px 44px minmax(0, 1fr);
    grid-template-areas: "position select thumb model" "quantity status status status" "impact impact delay delay" "modals modals modals modals";
    gap: 9px;
    padding: 13px 14px;
  }
  .production-queue-main > :nth-child(1) { grid-area: position; }
  .production-queue-main > :nth-child(2) { grid-area: select; }
  .production-queue-main > :nth-child(3) { grid-area: thumb; }
  .production-queue-main > :nth-child(4) { grid-area: model; }
  .production-queue-main > :nth-child(5) { grid-area: quantity; }
  .production-queue-main > :nth-child(6) { grid-area: status; }
  .production-queue-main > :nth-child(7) { grid-area: impact; }
  .production-queue-main > :nth-child(8) { grid-area: delay; text-align: right; }
  .production-queue-main > :nth-child(9) { grid-area: modals; }
  .production-queue-main .production-model b { white-space: normal; }
  .production-order-lines { padding: 0 14px 10px; }
  .production-order-lines > div { grid-template-columns: 110px minmax(0, 1fr); gap: 5px 10px; padding: 8px 0; }
  .production-order-lines > div > :nth-child(n+3) { grid-column: 2; }
  .production-selection-bar { padding-inline: 14px; }
  .production-selection-bar > div { flex-wrap: wrap; justify-content: flex-end; }
}

/* Keep every approved label column visible; use horizontal scrolling on a
   smaller desktop instead of silently hiding shipping and order progress. */
@media (min-width: 761px) {
  #labelsView .operations-table-wrap { overflow-x: auto; }
  #labelsView .labels-table { min-width: 1100px; table-layout: fixed; }
  #labelsView .labels-table th, #labelsView .labels-table td { display: table-cell; min-width: 0; padding: 16px 10px; vertical-align: top; }
  #labelsView .labels-table th { padding-block: 12px; font-size: 9px; }
  #labelsView .selection-column { width: 36px; }
  #labelsView .label-reference-column { width: 140px; }
  #labelsView .label-customer-column { width: 145px; }
  #labelsView .label-products-column { width: auto; }
  #labelsView .label-production-column { width: 170px; }
  #labelsView .label-shipping-column { width: 85px; }
  #labelsView .label-state-column { width: 135px; }
  #labelsView .label-actions-column { width: 130px; }
  #labelsView .label-actions-column { padding-right: 22px; }
  #labelsView .labels-table td:last-child, #labelsView .labels-table th:last-child { position: static; box-shadow: none; }
}
#labelsView .order-products-list { min-width: 0; gap: 10px; }
#labelsView .customer-cell, #labelsView .order-reference { min-width: 0; }
#labelsView .order-product-row { min-height: 48px; gap: 10px; }
#labelsView .order-product-row + .order-product-row { padding-top: 0; border: 0; }
#labelsView .order-product-thumb { width: 38px; height: 48px; border: 1px solid #ececec; background: white; }
#labelsView .order-product-thumb img { object-fit: contain; }
#labelsView .order-product-copy b { font-size: 11px; }
#labelsView .order-product-copy small { font-size: 9px; }
#labelsView .order-product-copy em { font-size: 8px; }
#labelsView .label-production-list { gap: 10px; }
#labelsView .order-reference b, #labelsView .customer-cell b { font-size: 11px; }
#labelsView .order-reference small, #labelsView .customer-cell small { font-size: 9px; }
#labelsView .production-progress { min-width: 0; padding-top: 5px; }
#labelsView .production-progress > strong { font-size: 9px; }
#labelsView .production-progress > div small { font-size: 10px; }
#labelsView .shipping-cell { min-width: 0; padding-top: 5px; }
#labelsView .order-open-button { font-size: 11px; border-radius: 0; }
#labelsView .label-row-actions { gap: 8px; padding-right: 6px; }
#labelsView .label-queue-tabs { padding: 0; }
#labelsView .label-queue-tabs button { min-height: 44px; font-size: 11px; border: 0; border-radius: 0; }
#labelsView .label-queue-tabs button.active { background: #f2ff58; }
@media (max-width: 760px) {
  #labelsView .labels-table { min-width: 0; width: 100%; }
  #labelsView .labels-table td { min-width: 0; width: auto; }
  #labelsView .labels-table .label-actions-column { width: 100px; min-width: 0; }
  #labelsView .labels-table .label-actions-column { padding-right: 10px; }
  #labelsView .labels-table .order-open-button { font-size: 10px; padding-inline: 6px; }
  #labelsView .labels-table tr { grid-template-areas: "select reference action" "customer customer customer" "products products products" "production production production" "shipping shipping shipping" "state state state"; }
  #labelsView .label-customer-column { display: block; grid-area: customer; }
  #labelsView .label-shipping-column { display: block; grid-area: shipping; }
  #labelsView .label-production-column { min-width: 0; }
  #labelsView .production-status-trigger { max-width: 100%; }
  .production-queue-main { grid-template-columns: 22px 24px 44px minmax(0,1fr); }
}
.order-number-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.order-number-link:hover { text-decoration: underline; }
.order-number-link:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
[hidden] { display: none !important; }

.paid-filter { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 10px; border: 1px solid var(--border, #d8d8d8); border-radius: 3px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.paid-filter input { accent-color: #111; }
.unpaid-order { opacity: .58; background: #f7f7f7; }
.duplicate-warning { display: block; width: max-content; margin-top: 4px; padding: 2px 5px; border-radius: 2px; background: #fff0f1; color: #9a1f2e; font-size: 10px; font-style: normal; font-weight: 800; }
.order-marks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.order-marks span, .order-mark-editor button { border: 1px solid #d3d3d3; border-radius: 999px; background: #fff; padding: 3px 8px; color: #333; font-size: 10px; font-weight: 750; }
.order-marks [data-order-mark="urgent"], .order-mark-editor [data-toggle-order-mark="urgent"].active { border-color: #c8d12e; background: #f2ff58; color: #111; }
.order-marks [data-order-mark="customer_waiting"], .order-mark-editor [data-toggle-order-mark="customer_waiting"].active { border-color: #9a1f2e; color: #9a1f2e; }
.order-marks [data-order-mark="waiting_product"], .order-mark-editor [data-toggle-order-mark="waiting_product"].active { border-color: #7a4a26; color: #6b421f; }
.order-marks [data-order-mark="partial"] { border-style: dashed; border-color: #315fc5; color: #315fc5; }
.piece-progress { width: 100%; height: 7px; margin-top: 6px; accent-color: #137549; }
.order-mark-editor { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 20px; border-bottom: 1px solid #e5e5e5; }
.order-mark-editor > span { margin-right: 4px; color: #666; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.order-mark-editor button { cursor: pointer; font-family: inherit; }
.order-mark-editor button.active { background: #f2f2f2; box-shadow: inset 0 0 0 1px currentColor; }
.production-bulk-status { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-size: 12px; }
.production-workflow-tabs { display: flex; gap: 0; border-bottom: 1px solid #ddd; background: #fff; }
.production-workflow-tabs button { min-height: 48px; padding: 0 22px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: #666; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.production-workflow-tabs button.active { border-color: #111; color: #111; }
.production-workflow-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-height: 54px; padding: 8px 18px; border-bottom: 1px solid #e5e5e5; background: #fafafa; }
.production-workflow-actions label { margin-right: auto; color: #555; font-size: 11px; font-weight: 750; }
.production-workflow-actions select { margin-left: 8px; min-height: 32px; border: 1px solid #ccc; background: #fff; padding: 0 28px 0 8px; font: inherit; }
.production-product-locks { display: flex; align-items: center; gap: 8px; grid-column: 2 / -1; }
.production-product-locks label { color: #ddd; font-size: 10px; font-weight: 750; }
.production-product-locks select { margin-left: 5px; min-height: 28px; border: 1px solid #555; border-radius: 2px; background: #181818; color: #fff; font: inherit; font-size: 10px; }
.production-lock-warning { padding: 8px 44px; background: #fff0f1; color: #9a1f2e; font-size: 11px; font-weight: 800; }
.production-piece-line.locked { opacity: .55; background: #f8f8f8; }
.production-piece-line.ready { background: #effaf4; }
.production-piece-line .piece-print-state { color: #666; font-size: 10px; }
.production-piece-thumb { width: 36px; height: 42px; object-fit: cover; border: 1px solid #ddd; background: #eee; }
.production-loose-card, .seamstress-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px; min-height: 64px; padding: 10px 18px; border-bottom: 1px solid #eee; }
.production-loose-card label { display: flex; align-items: center; gap: 12px; }
.seamstress-card strong { display: block; }
.seamstress-card small { color: #666; }
.production-workflow-dialog { width: min(720px, calc(100vw - 32px)); border: 0; border-radius: 3px; padding: 0; box-shadow: 0 25px 70px rgba(0,0,0,.35); }
.production-workflow-dialog::backdrop { background: rgba(0,0,0,.45); }
.production-workflow-dialog > form:first-child { position: absolute; right: 10px; top: 8px; z-index: 2; }
.production-workflow-dialog .dialog-close { border: 0; background: transparent; font-size: 24px; cursor: pointer; }
.production-dialog-body { padding: 28px; }
.production-dialog-body h2 { margin: 0 0 18px; }
.production-dialog-body label { display: grid; gap: 5px; margin: 12px 0; color: #555; font-size: 11px; font-weight: 800; }
.production-dialog-body input, .production-dialog-body select, .production-dialog-body textarea { min-height: 40px; border: 1px solid #ccc; padding: 8px; font: inherit; }
.production-dialog-body footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.production-bulk-status select { height: 32px; border: 1px solid #555; border-radius: 3px; background: #fff; color: #111; font: inherit; font-weight: 750; padding: 0 28px 0 9px; }
.production-color-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-left: auto; }
#productionQueue .production-queue-main { grid-template-columns: 52px minmax(240px,1fr) auto; min-height: 72px; background: #0b0b0b; color: #fff; }
#productionQueue .production-queue-main > * { grid-area: auto; }
#productionQueue .production-queue-main .production-model b { color: #fff; }
#productionQueue .production-queue-main .production-model small { color: #bdbdbd; }
#productionQueue .production-queue-main .production-color-legend span { color: #fff; }
#productionQueue .production-queue-main .production-color-legend i { border-color: rgba(255,255,255,.7); }
.production-color-legend span, .production-color-heading { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.production-color-legend i, .production-color-heading i { width: 16px; height: 16px; flex: 0 0 16px; border: 1px solid rgba(0,0,0,.25); border-radius: 50%; background: var(--piece-color); }
.production-color-group { border-top: 1px solid #e6e6e6; }
.production-color-heading { width: 100%; box-sizing: border-box; min-height: 38px; padding: 8px 44px; background: #fafafa; }
.production-color-heading span { color: #666; }
.production-piece-lines { display: grid; }
.production-piece-line { display: grid; grid-template-columns: 28px 38px 82px minmax(120px,1fr) 42px 58px 70px 76px 160px 72px; align-items: center; gap: 10px; min-height: 60px; padding: 6px 16px 6px 30px; border-top: 1px solid #eee; font-size: 12px; }
.production-piece-line.selected { background: #fbfde6; }
.production-piece-line strong { display: inline-flex; justify-content: center; width: 34px; padding: 3px; border: 1px solid #333; border-radius: 3px; }
.production-piece-line em { width: max-content; padding: 3px 6px; border-radius: 2px; background: #ededed; color: #111; font-style: normal; font-weight: 800; }
.production-piece-line > button { border: 0; background: transparent; color: #111; font: inherit; text-decoration: underline; cursor: pointer; }
@media (max-width: 1050px) { .production-piece-line { grid-template-columns: 28px 86px minmax(120px,1fr) 40px 160px 60px 70px; } .production-piece-line > button { display: none; } }
@media (max-width: 760px) { #productionQueue .production-queue-main { grid-template-columns: 44px 1fr; } #productionQueue .production-color-legend { grid-column: 1 / -1; margin-left: 0; } .production-piece-line { grid-template-columns: 28px 78px 1fr 40px; padding-left: 12px; } .production-piece-line > :nth-child(n+5) { grid-column: 3 / -1; } }
.quick-search-button { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 11px; border: 1px solid #d7d7d7; border-radius: 3px; background: #fff; color: #222; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.quick-search-button kbd, .quick-search-dialog kbd { border: 1px solid #d4d4d4; border-radius: 3px; background: #fafafa; padding: 2px 6px; color: #666; font: inherit; font-size: 11px; }
.quick-search-dialog { width: min(980px, calc(100vw - 32px)); max-height: min(760px, calc(100vh - 32px)); margin-top: 6vh; padding: 0; border: 0; border-radius: 4px; box-shadow: 0 25px 70px rgba(0,0,0,.35); }
.quick-search-dialog::backdrop { background: rgba(0,0,0,.43); }
.quick-search-shell > header { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid #e5e5e5; font-size: 22px; }
.quick-search-shell > header input { border: 0; outline: 0; font: inherit; font-size: 18px; }
.quick-search-shell > nav { display: flex; gap: 8px; padding: 12px 22px; border-bottom: 1px solid #e5e5e5; }
.quick-search-shell > nav button { min-height: 34px; padding: 0 12px; border: 1px solid #d7d7d7; border-radius: 3px; background: #fff; font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; }
.quick-search-shell > nav button.active { border-color: #000; background: #000; color: #fff; }
.quick-search-results { max-height: 560px; overflow: auto; padding: 18px 22px; }
.quick-search-results > p { color: #666; }
.quick-search-results h3 { margin: 6px 0 12px; color: #666; font-size: 10px; letter-spacing: .13em; }
.quick-product { border: 1px solid #e5e5e5; border-radius: 3px; margin-bottom: 12px; }
.quick-product-head { display: flex; align-items: center; gap: 12px; padding: 12px; }
.quick-product-head > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; gap: 3px; }
.quick-product-head small { color: #666; }
.quick-product-head button { border: 1px solid #ccc; border-radius: 3px; background: #fff; padding: 8px 12px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.quick-product-pieces { border-top: 1px solid #eee; }
.quick-product-pieces > button, .quick-order-result { width: 100%; display: grid; grid-template-columns: 110px minmax(150px,1fr) minmax(180px,1fr) 170px; align-items: center; gap: 12px; min-height: 50px; padding: 8px 12px; border: 0; border-top: 1px solid #f0f0f0; background: #fff; text-align: left; font: inherit; cursor: pointer; }
.quick-product-pieces > button:first-child { border-top: 0; }
.quick-order-result { grid-template-columns: 110px minmax(180px,1fr) 2fr; border: 1px solid #eee; border-bottom: 0; }
.quick-order-result:last-child { border-bottom: 1px solid #eee; }
.quick-search-shell > footer { display: flex; justify-content: space-between; padding: 10px 22px; border-top: 1px solid #e5e5e5; color: #666; font-size: 11px; }
.shipment-piece-check { display: inline-flex; align-items: center; justify-content: center; }
.shipment-piece-check input { position: absolute; opacity: 0; }
.shipment-piece-check span { width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid #aaa; border-radius: 2px; background: #fff; color: transparent; font-size: 11px; }
.shipment-piece-check input:checked + span { border-color: #111; background: #111; color: #fff; }
.shipment-piece-check input:disabled + span { opacity: .35; }
.order-item-list .order-item { grid-template-columns: 28px 62px minmax(220px,1fr) minmax(180px,240px) auto; }
.piece-tracking { color: #666; font-weight: 700; }
.order-shipment-section { padding: 20px; border-bottom: 1px solid #e5e5e5; }
.order-shipment-history { display: grid; gap: 8px; margin: 12px 0; }
.order-shipment-history > p { color: #777; font-size: 12px; }
.order-shipment-history article { display: grid; grid-template-columns: 130px minmax(180px,1fr) auto auto; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid #e2e2e2; background: #fafafa; font-size: 12px; }
.order-shipment-history article span { font-weight: 800; }
.order-shipment-history article small { color: #666; }
.order-shipment-history article a { color: #111; }
.new-shipment-panel { margin-top: 14px; padding: 16px; border-radius: 3px; background: #050505; color: #fff; }
.shipment-steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; margin-bottom: 15px; }
.shipment-steps span { padding: 7px 9px; border-bottom: 3px solid #333; color: #888; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.shipment-steps span.active { border-color: #f2ff58; color: #fff; }
#shipmentStepCopy b { font-size: 18px; }
#shipmentStepCopy p { color: #aaa; font-size: 12px; }
.shipment-options { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 9px; margin: 14px 0; }
.shipment-options label { color: #aaa; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.shipment-options select { width: 100%; height: 38px; margin-top: 5px; border: 1px solid #555; border-radius: 3px; background: #181818; color: #fff; font: inherit; }
.shipment-dce-confirm { display: flex; gap: 8px; margin: 12px 0; color: #ccc; font-size: 11px; }
.shipment-emission-error { margin: 12px 0; padding: 12px 14px; border: 1px solid #d55865; background: #4b1118; color: #fff; }
.shipment-emission-error b { display: block; margin-bottom: 5px; color: #ffb9c0; font-size: 12px; }
.shipment-emission-error p { margin: 0; color: #fff; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.shipment-emission-error small { display: block; margin-top: 6px; color: #e9aab1; font-size: 9px; }
.new-shipment-panel .primary-button { width: 100%; background: #f2ff58; color: #111; }
.tracking-stats { grid-template-columns: repeat(5, minmax(0,1fr)); }
.tracking-filters { display: flex; gap: 6px; }
.tracking-filters button { min-height: 34px; padding: 0 11px; border: 1px solid #d7d7d7; border-radius: 3px; background: #fff; font: inherit; font-size: 11px; font-weight: 750; cursor: pointer; }
.tracking-filters button.active { border-color: #000; background: #000; color: #fff; }
.tracking-piece-list { display: grid; gap: 6px; min-width: 270px; }
.tracking-piece-list > div { display: flex; align-items: center; gap: 8px; }
.tracking-piece-list > div > span { display: flex; flex-direction: column; gap: 2px; }
.tracking-piece-list small { display: flex; align-items: center; gap: 5px; color: #666; }
.tracking-piece-list small i { width: 12px; height: 12px; border: 1px solid rgba(0,0,0,.2); border-radius: 50%; background: var(--piece-color); }
.shipment-sequence { display: inline-flex; width: max-content; padding: 5px 7px; border-radius: 2px; background: #eee; font-size: 11px; font-weight: 800; }
.shipment-sequence.partial { background: #f2ff58; }
.tracking-table td:nth-child(5) { display: table-cell; }
.tracking-table td:nth-child(5) > small { display: block; margin-top: 4px; color: #666; }
@media (max-width: 1100px) { .tracking-stats { grid-template-columns: repeat(3, minmax(0,1fr)); } }

.quick-search-results .keyboard-active { box-shadow: inset 0 0 0 2px #111; }
.order-dialog-header-actions { align-items: center; display: flex; gap: 10px; }
.order-tracking-card { display: grid; gap: 12px; margin: 16px 0; padding: 16px; border: 1px solid #555; background: #fff; color: #222; }
.order-tracking-card.label_issued { border-color: #6c3aa8; background: #6c3aa8; color: #fff; }
.order-tracking-card.partial { border-color: #e4d46a; background: #fff6c2; color: #6b5a00; }
.order-tracking-card.sent { border-color: #1f4fbf; background: #1f4fbf; color: #fff; }
.order-tracking-card.delivered { border-color: #137549; background: #137549; color: #fff; }
.order-tracking-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.order-tracking-card-heading > div { min-width: 0; display: grid; gap: 5px; }
.order-tracking-card-heading span { font-size: 10px; font-weight: 850; letter-spacing: .08em; }
.order-tracking-card-heading code { overflow-wrap: anywhere; font-size: 24px; font-weight: 850; letter-spacing: .04em; }
.order-tracking-card-heading small { color: inherit; opacity: .72; }
.order-tracking-card button, .order-tracking-card a { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 0 11px; border: 1px solid currentColor; background: transparent; color: inherit; font: inherit; font-size: 10px; font-weight: 800; text-decoration: none; cursor: pointer; }
.order-tracking-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.order-contact-copy { display: grid; gap: 1px; background: rgba(127,127,127,.2); }
.order-contact-copy > div { display: grid; grid-template-columns: 72px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 9px 10px; background: rgba(255,255,255,.92); color: #222; }
.order-contact-copy span { font-size: 9px; font-weight: 850; letter-spacing: .08em; }
.order-contact-copy b { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.order-contact-copy button { min-height: 28px; color: #222; }
.order-item-list .order-item { grid-template-columns: 62px minmax(220px,1fr) minmax(180px,240px) auto; }
.order-item-list .order-item.has-shipment-select { grid-template-columns: 28px 62px minmax(220px,1fr) minmax(180px,240px) auto; }
.order-item.sent { opacity: .58; }
.order-notes-section { border-top: 1px solid #e6e6e6; padding: 20px 24px; }
.order-notes-section form { align-items: flex-end; display: grid; gap: 10px; grid-template-columns: 1fr auto; margin: 12px 0 16px; }
.order-notes-section textarea { border: 1px solid #ccc; border-radius: 4px; min-height: 72px; padding: 10px; resize: vertical; }
#orderNotesList { display: grid; gap: 8px; }
#orderNotesList article { background: #f6f6f6; border-left: 3px solid #111; padding: 10px 12px; }
#orderNotesList p { margin: 0 0 5px; white-space: pre-wrap; }
#orderNotesList small { color: #777; }
#orderDialog.full-page { height: 100vh; max-height: none; max-width: none; padding: 20px; width: 100vw; }
#orderDialog.full-page .order-dialog-shell { margin: 0 auto; max-width: 1440px; }
.order-modal:not(.label-context):not(.full-page) { border-radius: 0; height: 100vh; inset: 0 0 0 auto; margin: 0; max-height: none; width: min(600px, 100vw); }
.order-modal:not(.label-context):not(.full-page) .order-dialog-shell { padding: 0 22px 28px; }
@media (max-width: 760px) { .order-notes-section form { grid-template-columns: 1fr; } }
.shipments-workspace {
  overflow: hidden;
}

.shipments-lead {
  align-items: flex-end;
}

.shipments-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px 16px;
}

.shipments-toolbar > div {
  display: grid;
  gap: 4px;
}

.shipments-toolbar > .shipments-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.shipments-toolbar .search-box {
  width: min(440px, 48vw);
}

.shipment-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-block: 1px solid var(--line, #dedede);
  background: #fafafa;
}

.shipment-tabs button {
  min-height: 56px;
  padding: 0 20px;
  border: 0;
  border-right: 1px solid var(--line, #dedede);
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #676767;
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.shipment-tabs button.active {
  border-bottom-color: #111;
  background: #fff;
  color: #111;
}

.shipment-tabs b {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  margin-left: 8px;
  place-items: center;
  border-radius: 999px;
  background: #ececec;
  font-size: 12px;
}

.shipments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr));
  gap: 16px;
  padding: 20px;
}

.shipments-grid.is-ready-list {
  display: block;
  overflow-x: auto;
  padding: 0;
}

.shipment-ready-list {
  min-width: 980px;
  background: #fff;
}

/* The approved renderer emits the thumbnail dimensions inline, but the
   production CSP blocks inline styles. Envios reuses those rows outside of
   .orders-approved-list, so constrain its thumbnails here as well. */
.shipment-ready-list .pz-piece .pz-photo {
  width: 42px;
  height: 42px;
  max-width: 42px;
  max-height: 42px;
  object-fit: contain;
  overflow: hidden;
}

.shipment-ready-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid #dedede;
  background: #fafafa;
}

.shipment-ready-tabs,
.shipment-ready-modalities {
  display: flex;
  align-items: center;
  gap: 0;
}

.shipment-ready-tabs button,
.shipment-ready-modalities button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #d4d4d4;
  border-left: 0;
  background: #fff;
  color: #111;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.shipment-ready-tabs button:first-child,
.shipment-ready-modalities button:first-child { border-left: 1px solid #d4d4d4; }
.shipment-ready-tabs button.is-on,
.shipment-ready-modalities button.is-on { border-color: #111; background: #111; color: #fff; font-weight: 750; }
.shipment-ready-tabs small,
.shipment-ready-modalities small { margin-left: 6px; opacity: .7; }

.shipment-bulk-bar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 16px;
  box-sizing: border-box;
  border-bottom: 1px solid #d7d7d7;
  background: #fff;
}

.shipment-bulk-bar.is-active { background: #080808; color: #fff; }
.shipment-bulk-all { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.shipment-bulk-all > input,
.shipment-ready-group-select > input { position: absolute; opacity: 0; pointer-events: none; }
.shipment-bulk-all > span:first-of-type,
.shipment-ready-group-select > span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  box-sizing: border-box;
  border: 1.5px solid #888;
  border-radius: 2px;
  background: #fff;
  color: transparent;
  font-size: 14px;
  font-weight: 900;
}
.shipment-bulk-all > input:checked + span,
.shipment-ready-group-select > input:checked + span { border-color: #111; background: #111; color: #fff; }
.shipment-bulk-bar.is-active .shipment-bulk-all > input:checked + span { border-color: #fff; background: #fff; color: #111; }
.shipment-bulk-all > input:focus-visible + span,
.shipment-ready-group-select > input:focus-visible + span { outline: 2px solid #1f63d5; outline-offset: 2px; }
.shipment-bulk-all > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.shipment-bulk-all b { font-size: 14px; }
.shipment-bulk-all small { color: #707070; font-size: 11.5px; }
.shipment-bulk-bar.is-active .shipment-bulk-all small { color: #c9c9c9; }
.shipment-bulk-bar > div { display: flex; align-items: center; gap: 10px; }
.shipment-bulk-clear,
.shipment-bulk-generate,
.shipment-bulk-result-close {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid #555;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}
.shipment-bulk-generate { border-color: #efff3f; background: #efff3f; color: #111; }
.shipment-bulk-generate:disabled { border-color: #d8d8d8; background: #eee; color: #999; cursor: default; }
.shipment-bulk-result {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 16px;
  border-bottom: 1px solid #a8d8b7;
  background: #e8f7ed;
  color: #0d5f36;
}
.shipment-bulk-result.has-failures { border-color: #e8cf83; background: #fff7d9; color: #6e5800; }
.shipment-bulk-result > div { display: flex; align-items: center; gap: 10px; }
.shipment-bulk-result > div:first-child { align-items: flex-start; flex-direction: column; gap: 2px; }
.shipment-bulk-result small { font-size: 11.5px; }
.shipment-bulk-result details { font-size: 11.5px; }
.shipment-bulk-result summary { cursor: pointer; font-weight: 750; }
.shipment-bulk-result details p { margin: 5px 0 0; color: #7a2832; }
.shipment-bulk-result-close { width: 36px; min-width: 36px; padding: 0; border-color: currentColor; }

.shipment-ready-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 16px;
  border-top: 1px solid #dedede;
  background: #f3f3f3;
  color: #555;
  font-size: 12px;
  letter-spacing: .04em;
}

.shipment-ready-group > header strong { color: #111; font-size: 13px; }
.shipment-ready-group-select { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.shipment-ready-group > header span { letter-spacing: 0; }
.shipment-ready-list .pz-row.is-selected { outline: 0; background: #fffde0; }
.shipment-ready-block > strong { font-size: 14px; }
.shipment-ready-state { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 750; }
.shipment-ready-state.complete { color: #137549; }
.shipment-ready-state.separated { color: #5b4bb2; }
.shipment-ready-state.partial { color: #796500; }
.shipment-duplicate-tag { display: block; width: fit-content; max-width: 100%; margin-top: 6px; padding: 5px 8px; border-left: 3px solid #bd8300; background: #fff4cc; color: #6b5100; font-size: 11px; font-weight: 750; overflow-wrap: anywhere; }
.shipment-ready-action { align-self: stretch; justify-content: center; }
.shipment-line-block > .primary-button,
.shipment-line-block > .secondary-button { align-self: stretch; justify-content: center; }

.shipment-bulk-dialog {
  width: min(1180px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 0;
  border-radius: 3px;
  box-shadow: 0 25px 80px rgba(0,0,0,.36);
}
.shipment-bulk-dialog::backdrop { background: rgba(0,0,0,.5); }
.shipment-bulk-dialog-shell { background: #fff; }
.shipment-bulk-dialog header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 24px 18px; border-bottom: 1px solid #ddd; }
.shipment-bulk-dialog header h2 { margin: 4px 0; font-size: 25px; }
.shipment-bulk-dialog header p { margin: 0; color: #707070; font-size: 12px; }
.shipment-bulk-dialog header > button { width: 36px; height: 36px; border: 0; background: transparent; font-size: 25px; cursor: pointer; }
.shipment-bulk-columns,
.shipment-bulk-order {
  display: grid;
  grid-template-columns: 120px minmax(180px, 1.4fr) 80px 160px 180px 110px;
  gap: 12px;
  align-items: center;
  padding: 10px 24px;
}
.shipment-bulk-columns { position: sticky; top: 0; z-index: 1; border-bottom: 1px solid #ddd; background: #f6f6f6; color: #6d6d6d; font-size: 10.5px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.shipment-bulk-orders { max-height: min(48vh, 520px); overflow-y: auto; }
.shipment-price-controls { padding: 12px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.shipment-price-controls p { margin: 0; font-size: 12px; color: #555; }
.shipment-price-preview { grid-column: 1 / -1; padding: 8px 0 12px; font-size: 12px; }
.shipment-price-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.shipment-price-options > div { border: 1px solid #ddd; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.shipment-price-options strong { font-size: 16px; }
.shipment-price-options .lowest-price { background: #eff8f1; border-color: #86b791; }
.shipment-bulk-order { min-height: 58px; border-bottom: 1px solid #ececec; }
.shipment-bulk-order.needs-service { background: #fff2f2; }
.shipment-bulk-order b { font-size: 13.5px; }
.shipment-bulk-order small { display: block; margin-top: 2px; color: #777; font-size: 11px; }
.shipment-bulk-order select { width: 100%; min-height: 36px; border: 1px solid #cfcfcf; background: #fff; padding: 0 9px; font: inherit; font-size: 12px; font-weight: 650; }
.shipment-bulk-order.needs-service select[data-shipment-bulk-service] { border: 2px solid #b52f3e; color: #9f2635; }
.shipment-bulk-order .shipment-bulk-piece-count { font-weight: 750; }
.shipment-bulk-order .shipment-bulk-weight { font-variant-numeric: tabular-nums; }
.shipment-bulk-confirmations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 18px 24px 12px; }
.shipment-bulk-confirmations label { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; padding: 13px; border: 1px solid #d8d8d8; cursor: pointer; }
.shipment-bulk-confirmations input { position: absolute; opacity: 0; pointer-events: none; }
.shipment-bulk-confirmations label > span:first-of-type { display: grid; width: 22px; height: 22px; place-items: center; border: 1.5px solid #999; border-radius: 2px; box-sizing: border-box; color: transparent; font-weight: 900; }
.shipment-bulk-confirmations input:checked + span { border-color: #111; background: #111; color: #fff; }
.shipment-bulk-confirmations input:focus-visible + span { outline: 2px solid #1f63d5; outline-offset: 2px; }
.shipment-bulk-confirmations label > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.shipment-bulk-confirmations b { font-size: 12.5px; }
.shipment-bulk-confirmations small { color: #777; font-size: 10.5px; line-height: 1.35; }
.shipment-bulk-warning { margin: 0 24px 16px; padding: 10px 12px; border-left: 3px solid #bd8300; background: #fff8df; color: #5e4b00; font-size: 11.5px; line-height: 1.4; }
.shipment-bulk-dialog footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; border-top: 1px solid #ddd; background: #fafafa; }
.shipment-bulk-dialog footer > span { color: #666; font-size: 11.5px; }
.shipment-bulk-dialog footer > div { display: flex; gap: 8px; }

@media (max-width: 900px) {
  .shipment-ready-toolbar,
  .shipment-bulk-bar,
  .shipment-bulk-result { align-items: flex-start; flex-direction: column; }
  .shipment-bulk-columns { display: none; }
  .shipment-bulk-order { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shipment-bulk-confirmations { grid-template-columns: 1fr; }
}

.shipment-card {
  display: grid;
  gap: 18px;
  align-content: start;
  padding: 20px;
  border: 1px solid #dedede;
  background: #fff;
}

.shipment-card > header,
.shipment-card > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.shipment-card > footer { flex-wrap: wrap; }
.shipment-card.is-selected { border-color: #111; background: #fcffe8; }
.shipment-card.is-packed { background: var(--accent-soft, #fcffd7); }
.shipment-packed-check[aria-pressed="true"] { background: var(--accent-soft, #fcffd7); color: #333; }
.shipment-card button:disabled, .shipment-issued-toolbar button:disabled { opacity: .45; cursor: not-allowed; }
.shipment-dispatch-result { grid-column: 1 / -1; padding: 16px; border: 1px solid #d3d3d3; background: #fffde7; overflow-wrap: anywhere; }
.shipment-dispatch-result p { margin: 8px 0; }
#shipmentsGrid[aria-busy="true"] { opacity: .65; }
.shipment-issued-select { display: flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; }
.shipment-issued-select input { width: 20px; height: 20px; accent-color: #111; flex-shrink: 0; }
.shipment-issued-toolbar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 16px; border: 1px solid #dedede; background: #f5f5f5; }
.shipment-issued-toolbar p { margin: 8px 0 0; font-size: 13px; color: #555; }
.shipment-issued-toolbar .shipment-actions { flex-wrap: wrap; }

.shipment-card header span,
.shipment-card header p,
.shipment-card footer small {
  color: #767676;
  font-size: 12px;
}

.shipment-card h3 {
  margin: 4px 0;
  font-size: 22px;
}

.shipment-card p {
  margin: 0;
}

.shipment-scope {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.shipment-scope.partial { background: #fff1d8; color: #8a5200; }
.shipment-scope.complete { background: #e6f4ec; color: #137549; }

.shipment-piece-cards {
  display: grid;
  gap: 8px;
}

.shipment-piece-cards > div {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.shipment-piece-cards img,
.shipment-photo-placeholder {
  width: 48px;
  height: 56px;
  border: 1px solid #e2e2e2;
  background: #f1f1f1;
  object-fit: cover;
}

.shipment-photo-placeholder {
  display: grid;
  place-items: center;
  color: #999;
  font-size: 10px;
}

.shipment-piece-cards span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.shipment-piece-cards b,
.shipment-piece-cards small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shipment-piece-cards em { width: max-content; margin-top: 3px; padding: 3px 6px; border-left: 3px solid #aaa; background: #f5f5f5; color: #555; font-size: 9px; font-style: normal; font-weight: 800; text-transform: uppercase; }
.shipment-piece-cards em[data-production-tone="pronta"] { border-left-color: #137549; color: #137549; background: #effaf4; }
.shipment-piece-cards em[data-production-tone="nao_informado"] { border-left-color: #555; }

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

.shipment-shopify-actions {
  width: 100%;
  flex-direction: column;
  gap: 6px;
}

.shipment-shopify-actions > button {
  justify-content: center;
}

@media (max-width: 760px) {
  .priority-period-row, .priorities-lead { align-items: stretch; flex-direction: column; }
  .priority-periods { overflow-x: auto; }
  .priority-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .priority-metrics article { border-bottom: 1px solid #e5e5e5; }
  .priority-board { grid-template-columns: 1fr; }
  .shipments-toolbar,
  .shipment-card > header,
  .shipment-card > footer { align-items: stretch; flex-direction: column; }
  .shipments-toolbar > .shipments-toolbar-actions { align-items: stretch; flex-direction: column; }
  .shipments-toolbar .search-box { width: 100%; }
}
.pz-piece-status-trigger {
  cursor: pointer;
  user-select: none;
}

.pz-piece-status-trigger::after {
  content: "▾";
  margin-left: 2px;
  font-size: 9px;
  opacity: .8;
}

.pz-piece-status-trigger:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

.production-legacy-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 24px;
  border-bottom: 1px solid #dedede;
}
.production-manual-selection { display: flex; flex: 1; min-width: 210px; flex-direction: column; gap: 2px; }
.production-manual-selection b { font-size: 13px; }
.production-manual-selection small { color: #666666; font-size: 11px; }

/* J&T fiscal data belongs to the shipment attempt, never to global checkout rules. */
.shipment-jt-document { margin: 16px 0; padding: 16px; border: 1px solid #555; border-radius: 8px; color: #eee; }
.shipment-jt-document legend { padding: 0 6px; font-weight: 700; }
.shipment-jt-document p { color: #bbb; font-size: 12px; line-height: 1.5; }
.shipment-jt-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.shipment-jt-fields label { display: grid; gap: 6px; color: #ccc; font-size: 12px; }
.shipment-jt-fields .jt-key { grid-column: 1 / -1; }
.shipment-jt-fields input, .shipment-jt-fields select { width: 100%; min-width: 0; min-height: 40px; padding: 8px; border: 1px solid #666; border-radius: 4px; background: #181818; color: #fff; font: inherit; }
@media (max-width: 600px) { .shipment-jt-fields { grid-template-columns: 1fr; } .shipment-options { grid-template-columns: 1fr; } }

#shipmentJtDocument > .shipment-dce-confirm { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0 0; color: #ddd; font-size: 12px; line-height: 1.5; }
#shipmentJtDocument > .shipment-dce-confirm input[type="checkbox"] { flex: 0 0 18px; width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--accent, #eeff55); }

#shipmentJtDocument .shipment-dce-confirm { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0; color: #ddd; font-size: 12px; line-height: 1.5; }
#shipmentJtDocument .shipment-dce-confirm input[type="checkbox"] { flex: 0 0 18px; width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--accent, #eeff55); }
.shipment-jt-dce-items > label { display: grid; grid-template-columns: 1fr minmax(130px, 200px); gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid #333; }
.shipment-jt-dce-items b, .shipment-jt-dce-items small { display: block; color: #eee; font-size: 12px; line-height: 1.5; }
.shipment-jt-dce-items small { color: #aaa; }
.shipment-jt-dce-items input { display: block; width: 100%; min-height: 40px; padding: 8px; background: #181818; color: #fff; border: 1px solid #666; border-radius: 4px; font: inherit; }
@media (max-width: 600px) { .shipment-jt-dce-items > label { grid-template-columns: 1fr; } }

.jt-declaration-history { grid-column: 1 / -1; font-size: 0.8rem; }
.jt-declaration-history summary { cursor: pointer; }
.jt-declaration-history code { display: block; overflow-wrap: anywhere; margin: 0.5rem 0; }
