/* ====================================================================
   components.css — externalized component styles (non-PO Upload)
   --------------------------------------------------------------------
   All styles below were previously inline <style scoped> blocks in
   individual Vue components. They have been consolidated here and
   class names prefixed per-area for global-scope collision safety.
   See plan: review-the-ui-components-playful-raven.md
   ==================================================================== */


/* ===================================================
   proof-table cluster — prefix: proof-
   =================================================== */

/* ========== ProofPage ========== */
.proof-proof-main-card {
  margin-top: 0;
}

.proof-proof-main-card .box {
  padding: 0;
  overflow: hidden;
}

.proof-proof-layout {
  display: flex;
  height: calc(100vh - 14rem);
  min-height: 500px;
}

.proof-proof-layout__left {
  flex: 0 0 22rem;
  border-right: 1px solid #eaeaea;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.proof-proof-layout__center {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.proof-proof-layout__right {
  flex: 0 0 20rem;
  border-left: 1px solid #eaeaea;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.proof-proof-layout__right-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Responsive */
@media (max-width: 1200px) {
  .proof-proof-layout {
    height: auto;
    min-height: auto;
    flex-direction: column;
  }

  .proof-proof-layout__left {
    flex: none;
    border-right: none;
    border-bottom: 1px solid #eaeaea;
    max-height: 20rem;
    overflow-y: auto;
  }

  .proof-proof-layout__center {
    flex: none;
    min-height: 400px;
    position: relative;
  }

  .proof-proof-layout__right {
    flex: none;
    border-left: none;
    border-top: 1px solid #eaeaea;
  }
}

/* ========== ProofItemSpecs ========== */
.proof-proof-item-specs {
  border-bottom: 1px solid #eaeaea;
}

.proof-proof-item-specs__header {
  padding: 0.75rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.proof-proof-item-specs__header:hover {
  background: #fafafa;
}

.proof-proof-item-specs__header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.proof-proof-item-specs__title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #363636;
  letter-spacing: 0.04em;
  margin: 0;
}

.proof-proof-item-specs__body {
  padding: 0 1rem 0.75rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 1rem;
}

.proof-proof-item-specs__row {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.proof-proof-item-specs__label {
  font-size: 0.65rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.proof-proof-item-specs__value {
  font-size: 0.75rem;
  color: #363636;
  word-break: break-word;
}

/* ========== ProofItemList ========== */
.proof-proof-item-list {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.proof-proof-item-list__header {
  padding: 1rem;
  border-bottom: 1px solid #eaeaea;
}

.proof-proof-item-list__items {
  flex: 1;
  overflow-y: auto;
}

.proof-proof-item-list__loading {
  position: relative;
  min-height: 200px;
}

.proof-proof-item-list__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.proof-proof-item-row {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background-color 0.15s ease;
  min-height: var(--cp-touch-min);
}

.proof-proof-item-row:hover {
  background-color: #f5f8ff;
}

.proof-proof-item-row:focus {
  outline: 2px solid #3273dc;
  outline-offset: -2px;
}

.proof-proof-item-row--selected {
  background-color: rgba(50, 115, 220, 0.08);
}

.proof-proof-item-row__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  gap: 0.5rem;
}

.proof-proof-item-row__main {
  display: flex;
  align-items: center;
  min-width: 0;
}

.proof-proof-item-row__code {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proof-proof-item-row__end {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.proof-proof-item-row__desc {
  font-size: 0.7rem;
  color: #888;
  margin-top: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Mobile: ensure single-column list with adequate touch targets ── */
@media (max-width: 767px) {
  .proof-proof-item-list {
    width: 100%;
  }

  .proof-proof-item-row {
    min-height: var(--cp-touch-min);
  }

  .proof-proof-item-row__content {
    flex-wrap: wrap;
    gap: var(--cp-space-xs);
  }
}

/* ========== ProofContacts ========== */
.proof-proof-contacts {
  border-bottom: 1px solid #eaeaea;
}

.proof-proof-contacts__header {
  padding: 0.75rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.proof-proof-contacts__header:hover {
  background: #fafafa;
}

.proof-proof-contacts__header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.proof-proof-contacts__title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #363636;
  letter-spacing: 0.04em;
  margin: 0;
}

.proof-proof-contacts__body {
  padding: 0 1rem 0.75rem;
}

.proof-proof-contacts__item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0;
  min-height: 1.75rem;
}

.proof-proof-contacts__avatar {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: #2952cc;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}

.proof-proof-contacts__name {
  font-size: 0.75rem;
  font-weight: 600;
  color: #363636;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.proof-proof-contacts__role {
  font-size: 0.7rem;
  color: #888;
  white-space: nowrap;
  flex-shrink: 0;
}

.proof-proof-contacts__email-icon {
  flex-shrink: 0;
  margin-left: auto;
  color: #2952cc;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 3px;
  transition: background 0.15s;
}

.proof-proof-contacts__email-icon:hover {
  background: #f0f4ff;
}

/* ── Mobile: adequate touch targets for contact rows (≤767px) ──────── */
@media (max-width: 767px) {
  .proof-proof-contacts__item {
    min-height: var(--cp-touch-min);
  }

  .proof-proof-contacts__email-icon {
    width: var(--cp-touch-min);
    height: var(--cp-touch-min);
  }
}

/* ========== ProofHeader ========== */
.proof-proof-header {
  background: #fafafa;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #e0e0e0;
}

.proof-proof-header__row {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.proof-proof-header__section {
  min-width: 0;
}

.proof-proof-header__section--status {
  flex: 1;
}

.proof-proof-header__section--actions {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.proof-proof-header__top {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.proof-proof-header__icon {
  font-size: 1rem;
  color: #666;
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.proof-proof-header__label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  margin-bottom: 0.1rem;
  white-space: nowrap;
}

.proof-proof-header__value {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1a1a1a;
  line-height: 1.2;
}

.proof-proof-header__sub {
  font-size: 0.72rem;
  color: #999;
  margin-top: 0.1rem;
}

.proof-proof-header__statuses {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  margin-top: 0.15rem;
}

.proof-proof-status-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  white-space: nowrap;
}

.proof-proof-status-badge__count {
  font-weight: 800;
  font-size: 1rem;
  color: #1a1a1a;
}

.proof-proof-status-badge__label {
  font-size: 0.78rem;
  font-weight: 500;
  color: #555;
}

/* ── Mobile: stack sections vertically (≤767px) ───────────────────── */
@media (max-width: 767px) {
  .proof-proof-header__row {
    flex-direction: column;
    gap: var(--cp-space-md);
  }

  .proof-proof-header__section--actions {
    margin-left: 0;
    width: 100%;
  }

  .proof-proof-header__section--actions .button {
    width: 100%;
    min-height: var(--cp-touch-min);
    justify-content: center;
  }

  .proof-proof-header__statuses {
    gap: var(--cp-space-md);
    flex-wrap: wrap;
  }
}

/* ========== ProofProjectsList ========== */
/* Progress bar */
.proof-progress-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.proof-progress-bar {
  flex: 1;
  height: 8px;
  background: #ededed;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
}

.proof-progress-bar__approved {
  background: #48c774;
  height: 100%;
}

.proof-progress-bar__rejected {
  background: #f14668;
  height: 100%;
}

.proof-progress-text {
  font-size: 0.75rem;
  color: #7a7a7a;
  white-space: nowrap;
}

/* Table clickable rows */
.proof-projects-table tbody tr.is-clickable {
  cursor: pointer;
}

.proof-projects-table tbody tr.is-clickable:hover {
  background-color: #fafafa;
}

/* Sortable headers */
.proof-projects-table th.is-clickable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.proof-projects-table th.is-clickable:hover {
  color: #3273dc;
}

/* Filter icon in column headers */
.proof-header-filter-icon {
  cursor: pointer;
  opacity: 0.4;
  font-size: 0.65rem;
  margin-left: 2px;
}

.proof-header-filter-icon:hover,
.proof-header-filter-icon.has-text-info {
  opacity: 1;
}

/* Active filters bar */
.proof-active-filters {
  background: #f5f5f5;
  border-bottom: 1px solid #e8e8e8;
}

.proof-active-filters .tags {
  gap: var(--cp-space-xs) var(--cp-space-sm);
}

/* ── Mobile card layout for proof projects table (≤767px) ──────────── */
@media (max-width: 767px) {
  .proof-projects-table.has-mobile-cards thead {
    display: none;
  }

  .proof-projects-table.has-mobile-cards tr {
    display: block;
    box-shadow:
      0 2px 3px rgba(10, 10, 10, 0.1),
      0 0 0 1px rgba(10, 10, 10, 0.1);
    position: relative;
    margin: 0.25em;
  }

  .proof-projects-table.has-mobile-cards tr:not(:last-child) {
    margin-bottom: var(--cp-space-md);
  }

  .proof-projects-table.has-mobile-cards td {
    border: 0;
    display: flex;
    width: auto;
    justify-content: flex-end;
    text-align: right;
    border-bottom: 1px solid #f5f9fb;
    min-height: var(--cp-touch-min);
    align-items: center;
  }

  .proof-projects-table.has-mobile-cards td:last-child {
    border-bottom: 0;
  }

  .proof-projects-table.has-mobile-cards td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    margin-right: auto;
    padding-right: 0.5em;
    text-align: left;
  }

  /* Hide the chevron cell on mobile — navigation is via row click */
  .proof-projects-table.has-mobile-cards td.proof-proof-projects-chevron-cell {
    display: none;
  }

  /* Make progress bar left-aligned in card mode */
  .proof-projects-table.has-mobile-cards td .proof-progress-bar-wrapper {
    justify-content: flex-end;
    width: 100%;
    max-width: 180px;
  }
}

/* ========== ApproveAllModal ========== */
/* Warning banner — compact inline style */
.proof-approve-all-warning {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fffbeb;
  border: 1px solid #f5d67b;
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  color: #946c00;
}

.proof-approve-all-warning__icon {
  color: #d4a017;
  flex-shrink: 0;
}

/* Item list */
.proof-approve-all-items {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #eaeaea;
  border-radius: 4px;
  background: #fafafa;
}

.proof-approve-all-items__row {
  padding: 0.35rem 0.65rem;
  display: flex;
  align-items: center;
  font-size: 0.8rem;
}

.proof-approve-all-items__row:nth-child(even) {
  background: #f5f5f5;
}

.proof-approve-all-items__row:not(:last-child) {
  border-bottom: 1px solid #efefef;
}

.proof-approve-all-items__code {
  font-weight: 600;
  color: #363636;
  white-space: nowrap;
}

.proof-approve-all-items__desc {
  color: #888;
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.proof-approve-all-items__status-icon {
  flex-shrink: 0;
  margin-right: 0.4rem;
  font-size: 0.75rem;
}

.proof-approve-all-items__error {
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}

/* Confirm checkbox */
.proof-approve-all-confirm {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

/* ── Summary state ──────────────────────────────────────────────── */
.proof-approve-all-summary-wrap {
  width: 100%;
}

.proof-approve-all-summary__header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.proof-approve-all-summary__header--complete {
  background: #effaf5;
  border: 1px solid #b8e6d0;
}
.proof-approve-all-summary__header--partial {
  background: #fffbeb;
  border: 1px solid #f5d67b;
}
.proof-approve-all-summary__header--cancelled {
  background: #eff5fb;
  border: 1px solid #9bc1e0;
}

.proof-approve-all-summary__icon {
  flex-shrink: 0;
  font-size: 1.1rem;
}
.proof-approve-all-summary__header--complete .proof-approve-all-summary__icon {
  color: #48c78e;
}
.proof-approve-all-summary__header--partial .proof-approve-all-summary__icon {
  color: #d4a017;
}
.proof-approve-all-summary__header--cancelled .proof-approve-all-summary__icon {
  color: #3e8ed0;
}

.proof-approve-all-summary__text {
  min-width: 0;
}

.proof-approve-all-summary__title {
  font-weight: 700;
  font-size: 0.8rem;
  color: #363636;
  line-height: 1.3;
}

.proof-approve-all-summary__message {
  font-size: 0.75rem;
  color: #666;
  margin-top: 0.1rem;
  line-height: 1.4;
}

/* ========== ProofDecisionPanel ========== */
.proof-proof-decision-panel {
  display: flex;
  flex-direction: column;
}

.proof-proof-decision-panel--empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

.proof-proof-decision-panel__status {
  padding: 1rem;
  border-bottom: 1px solid #eaeaea;
}

.proof-proof-decision-panel__actions {
  padding: 1rem;
  border-bottom: 1px solid #eaeaea;
}

.proof-proof-decision-panel__btn {
  flex: 1;
}

.proof-proof-decision-panel__form {
  padding: 1rem;
  border-bottom: 1px solid #eaeaea;
}

.proof-proof-decision-panel__history-header {
  padding: 0.75rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.proof-proof-decision-panel__history-header:hover {
  background: #fafafa;
}

.proof-proof-decision-panel__history-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #363636;
  letter-spacing: 0.04em;
  margin: 0;
}

.proof-proof-decision-panel__history-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.proof-proof-decision-panel__timeline {
  padding: 0.5rem 1rem 0.75rem;
}

/* Compact timeline rows */
.proof-proof-timeline-row {
  padding: 0.3rem 0;
}

.proof-proof-timeline-row:not(:last-child) {
  border-bottom: 1px solid #f5f5f5;
}

.proof-proof-timeline-row__main {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  line-height: 1.4;
  min-width: 0;
  flex-wrap: wrap;
}

.proof-proof-timeline-row__icon {
  flex-shrink: 0;
  font-size: 0.7rem;
}

.proof-proof-timeline-row__status {
  flex-shrink: 0;
  font-size: 0.75rem;
}

.proof-proof-timeline-row__separator {
  color: #ccc;
  flex-shrink: 0;
}

.proof-proof-timeline-row__time {
  color: #888;
  font-size: 0.7rem;
  flex-shrink: 0;
  cursor: default;
}

.proof-proof-timeline-row__user {
  color: #555;
  font-size: 0.7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.proof-proof-timeline-row__version {
  flex-shrink: 0;
  font-size: 0.6rem !important;
  padding: 0 0.35em;
  height: 1.25em;
  margin-left: auto;
}

.proof-proof-timeline-row__comment {
  font-size: 0.7rem;
  color: #555;
  padding: 0.15rem 0 0.15rem 1.4rem;
  border-left: 2px solid #dbdbdb;
  margin-left: 0.45rem;
  margin-top: 0.1rem;
  line-height: 1.4;
  word-break: break-word;
}

.proof-proof-timeline-toggle {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: #2952cc;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.4rem 0 0.1rem;
  cursor: pointer;
  text-align: left;
}

.proof-proof-timeline-toggle:hover {
  text-decoration: underline;
}

.proof-proof-action-row {
  gap: 0.5rem;
}

/* ── Mobile: vertically stacked, touch-friendly actions (≤767px) ──── */
@media (max-width: 767px) {
  .proof-proof-decision-panel__actions .proof-proof-action-row,
  .proof-proof-decision-panel__form .proof-proof-action-row {
    flex-direction: column;
    gap: var(--cp-space-sm);
  }

  .proof-proof-decision-panel__btn,
  .proof-proof-decision-panel__actions .button,
  .proof-proof-decision-panel__form .button {
    width: 100%;
    min-height: var(--cp-touch-min);
    justify-content: center;
  }
}

/* ========== ProofViewer ========== */
.proof-proof-viewer {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
}

/* ─── Unified top panel: meta + actions ─────────────────────────── */
.proof-proof-viewer__top-panel {
  background: #fafafa;
  border-bottom: 1px solid #e0e0e0;
}

.proof-proof-viewer__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.proof-proof-viewer__meta-fields {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}

.proof-proof-viewer__meta-field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.proof-proof-viewer__meta-label {
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #999;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.proof-proof-viewer__meta-icon {
  font-size: 0.5rem;
  color: #bbb;
}

.proof-proof-viewer__meta-value {
  font-size: 0.82rem;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
}

.proof-proof-viewer__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.proof-proof-viewer__desc {
  padding: 0.3rem 1rem 0.45rem;
  border-top: 1px solid #efefef;
}

.proof-proof-viewer__desc-value {
  font-size: 0.78rem;
  color: #555;
  margin-left: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  max-width: calc(100% - 6rem);
  vertical-align: middle;
}

.proof-proof-viewer__page-strip {
  border-bottom: 1px solid #eaeaea;
  background: #f5f5f5;
  overflow: hidden;
}

.proof-proof-viewer__page-strip-inner {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.proof-proof-viewer__page-thumb {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 4px;
  padding: 2px;
  transition: border-color 0.15s ease;
}

.proof-proof-viewer__page-thumb:hover {
  border-color: #b5b5b5;
}

.proof-proof-viewer__page-thumb:focus {
  outline: 2px solid #3273dc;
  outline-offset: 1px;
}

.proof-proof-viewer__page-thumb--active {
  border-color: #3273dc;
}

.proof-proof-viewer__page-thumb-img {
  width: 56px;
  height: 72px;
  object-fit: cover;
  border-radius: 2px;
  background: #fff;
}

.proof-proof-viewer__page-thumb-placeholder {
  width: 56px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8e8e8;
  border-radius: 2px;
}

.proof-proof-viewer__page-label {
  font-size: 0.65rem;
  color: #666;
  margin-top: 2px;
}

.proof-proof-viewer__artwork-error {
  padding: 0.25rem 1rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.proof-proof-viewer__content {
  flex: 1;
  position: relative;
  min-height: 400px;
  overflow: hidden;
}

/* Prev / Next navigation arrows */
.proof-proof-viewer__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  color: #363636;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.15s ease;
  pointer-events: auto;
}

.proof-proof-viewer__content:hover .proof-proof-viewer__nav,
.proof-proof-viewer__nav:focus-visible {
  opacity: 1;
}

.proof-proof-viewer__nav:hover {
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.22);
}

.proof-proof-viewer__nav:focus-visible {
  outline: 2px solid #3273dc;
  outline-offset: 2px;
}

.proof-proof-viewer__nav--prev {
  left: 0.75rem;
}

.proof-proof-viewer__nav--next {
  right: 0.75rem;
}

/* Page indicator pill */
.proof-proof-viewer__page-indicator {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.proof-proof-viewer__content:hover .proof-proof-viewer__page-indicator {
  opacity: 1;
}

.proof-proof-viewer__empty,
.proof-proof-viewer__loading,
.proof-proof-viewer__error {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9f9f9;
}

.proof-proof-viewer__zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-right: 0.5rem;
  padding-right: 0.5rem;
  border-right: 1px solid #dbdbdb;
}

.proof-proof-viewer__zoom-controls .button.is-active {
  background: #3273dc;
  color: #fff;
  border-color: #3273dc;
}

.proof-proof-viewer__zoom-label {
  font-size: 0.75rem;
  min-width: 3rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.proof-proof-viewer__pdf {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: auto;
  background: #f0f0f0;
  cursor: grab;
}

.proof-proof-viewer__pdf--grabbing {
  cursor: grabbing;
  user-select: none;
}

.proof-proof-viewer__image-spacer {
  min-width: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.proof-proof-viewer__image {
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.proof-proof-viewer__page-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.6);
  z-index: 5;
}

/* ── Mobile overrides (≤767px) ─────────────────────────────────────── */
@media (max-width: 767px) {
  /* Viewer fills full viewport height on mobile */
  .proof-proof-viewer {
    height: 100vh; /* fallback */
    height: 100dvh;
  }

  /* Compact metadata: hide secondary meta labels to save vertical space */
  .proof-proof-viewer__meta {
    padding: 0.35rem var(--cp-space-md);
    gap: var(--cp-space-sm);
  }

  .proof-proof-viewer__meta-fields {
    gap: var(--cp-space-md);
    flex-wrap: wrap;
  }

  /* Move the action buttons (zoom + open-in-tab) to a fixed bottom bar */
  .proof-proof-viewer__actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--cp-z-sticky);
    background: #fff;
    border-top: 1px solid #e0e0e0;
    padding: var(--cp-space-sm) var(--cp-space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--cp-space-sm);
    flex-wrap: wrap;
    /* Ensure buttons meet minimum touch target */
    min-height: var(--cp-touch-min);
  }

  /* Add bottom padding to the content area so the fixed bar doesn't cover it */
  .proof-proof-viewer__content {
    padding-bottom: calc(var(--cp-touch-min) + var(--cp-space-md));
    min-height: 0;
  }

  /* Collapse / hide the thumbnail strip to save space */
  .proof-proof-viewer__page-strip {
    display: none;
  }

  /* Ensure action buttons have adequate touch targets */
  .proof-proof-viewer__actions .button {
    min-height: var(--cp-touch-min);
    min-width: var(--cp-touch-min);
  }

  /* Page nav arrows: larger touch targets on mobile */
  .proof-proof-viewer__nav {
    opacity: 1; /* always visible on mobile (no hover) */
    width: var(--cp-touch-min);
    height: var(--cp-touch-min);
  }

  /* Always show page indicator on mobile */
  .proof-proof-viewer__page-indicator {
    opacity: 1;
  }
}

/* ===================================================
   order-table cluster — prefix: order-
   =================================================== */

/* ========== FilterForm ========== */
.order-footer-note {
  font-size: 0.75rem;
  color: #9a9a9a;
  margin-top: 0.35rem;
  padding-left: 0.25rem;
}

.order-button-row {
  margin-bottom: 1.25rem;
  gap: 10px;
  margin-left: auto;
  grid-column: -2;
}

@media (min-width: 768px) {
  .order-filter-form {
    display: flex;
    align-items: flex-end;
    gap: var(--cp-space-sm);
  }

  .order-filter-form > .field.is-fullwidth {
    flex: 1 1 auto;
    margin-bottom: 0;
  }

  .order-filter-form > .order-button-row {
    flex: 0 0 auto;
    margin-left: 0;
    margin-bottom: 0;
  }
}

@media (max-width: 767px) {
  .order-filter-form {
    display: flex;
    flex-direction: column;
    gap: var(--cp-space-sm);
  }

  .order-filter-form .field.is-fullwidth {
    width: 100%;
  }

  .order-filter-form .field.is-fullwidth .input {
    width: 100%;
  }

  .order-button-row {
    margin-left: 0;
    flex-direction: column;
    width: 100%;
  }

  .order-filter-form > .field.is-align-self-flex-end .control {
    width: 100%;
  }

  .order-filter-form > .field.is-align-self-flex-end button {
    width: 100%;
    min-height: var(--cp-touch-min);
  }
}

/* ========== OrderDetailsModal ========== */
.order-info.tabs {
  margin-bottom: 0;
}

.order-details-heading {
  text-transform: uppercase;
  font-weight: 700 !important;
}

.tab-content.box {
  background-color: #f5f5f5;
  padding: 0;
}

/* ========== OrderTable ========== */
.order-cf-table table.table {
  width: 100%;
}

.order-cf-table tr.detail thead th {
  border-bottom: 2px solid #dbdbdb !important;
}

.order-active-filters {
  border-bottom: 1px solid #f0f0f0;
  padding: 8px 16px;
}

.order-active-filters .tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cp-space-xs) var(--cp-space-sm);
}

@media (min-width: 1024px) {
  .order-cf-table .table.has-mobile-cards td:last-child,
  .order-cf-table .table.has-mobile-cards th:last-child {
    padding-left: var(--cp-space-sm);
    padding-right: var(--cp-space-sm);
  }
}

/* Tablet: horizontal scroll so table doesn't clip (768–1279px) */
@media (max-width: 1279px) {
  .order-cf-table .cf-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Mobile: card layout (≤767px) */
@media (max-width: 767px) {
  /* Hide header row */
  .order-cf-table .table.has-mobile-cards thead {
    display: none;
  }

  /* Each data row becomes a card */
  .order-cf-table .table.has-mobile-cards tbody tr.is-expandable {
    display: block;
    box-shadow: 0 2px 3px rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.1);
    margin: 0.25em 0.25em var(--cp-space-md);
    border-radius: 4px;
    overflow: hidden;
  }

  /* Each cell is a label/value row */
  .order-cf-table .table.has-mobile-cards tbody tr.is-expandable > td {
    display: flex;
    justify-content: flex-end;
    text-align: right;
    border: 0;
    border-bottom: 1px solid #f5f9fb;
    min-height: var(--cp-touch-min);
    align-items: center;
    padding: 0.5em 0.75em;
    width: auto;
  }

  .order-cf-table .table.has-mobile-cards tbody tr.is-expandable > td:last-child {
    border-bottom: 0;
  }

  /* Label prefix for named cells */
  .order-cf-table .table.has-mobile-cards tbody tr.is-expandable > td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    margin-right: auto;
    padding-right: 0.5em;
    text-align: left;
    flex-shrink: 0;
  }

  /* Hide expand-button cell (no mobileHeader → no data-label attr) */
  .order-cf-table .table.has-mobile-cards tbody tr.is-expandable > td:not([data-label]):first-child {
    display: none;
  }

  /* Reorder button cell (no mobileHeader, last) — full-width button */
  .order-cf-table .table.has-mobile-cards tbody tr.is-expandable > td:not([data-label]):last-child {
    justify-content: center;
  }

  .order-cf-table .table.has-mobile-cards tbody tr.is-expandable > td:not([data-label]):last-child button {
    width: 100%;
    min-height: var(--cp-touch-min);
  }

  /* Expanded detail row */
  .order-cf-table .table.has-mobile-cards tbody tr.detail {
    display: block;
    margin: -0.5em 0.25em var(--cp-space-md);
    box-shadow: 0 2px 3px rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.1);
  }

  .order-cf-table .table.has-mobile-cards tbody tr.detail > td {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    text-align: left;
    min-height: 0;
  }
}

/* ========== OrderStats ========== */
@media (max-width: 1023px) {
  .order-stats-outer-columns > .order-stats-outer-col {
    width: 100%;
    flex: none;
  }
}

/* ===================================================
   product-table cluster — prefix: product-
   =================================================== */

/* ========== FilterForm ========== */
.product-footer-note {
  font-size: 0.75rem;
  color: #9a9a9a;
  margin-top: 0.35rem;
  padding-left: 0.25rem;
}

.product-cp-buttons-row {
  margin-bottom: 1.25rem;
  margin-left: auto;
  gap: 10px;
  flex-wrap: wrap;
  row-gap: var(--cp-space-sm);
}

@media (min-width: 768px) {
  .product-filter-form {
    display: flex;
    align-items: flex-end;
    gap: var(--cp-space-sm);
  }

  .product-filter-form > .field.is-fullwidth {
    flex: 1 1 auto;
    margin-bottom: 0;
  }

  .product-filter-form > .product-cp-buttons-row {
    flex: 0 0 auto;
    margin-left: 0;
    margin-bottom: 0;
  }

  .product-cp-add-to-cart-control button {
    min-width: 200px;
    white-space: nowrap;
  }
}

@media (max-width: 767px) {
  .product-filter-form {
    display: flex;
    flex-direction: column;
    gap: var(--cp-space-sm);
  }

  .product-cp-buttons-row {
    margin-left: 0;
    flex-direction: column;
    width: 100%;
  }

  .product-cp-buttons-row .control {
    flex: 1 1 calc(50% - 5px);
  }

  .product-cp-add-to-cart-control {
    flex: 1 1 100%;
  }

  .product-cp-buttons-row .control button {
    min-height: var(--cp-touch-min);
    width: 100%;
  }
}

/* ========== ProductDetailsModal ========== */
@media (max-width: 767px) {
  .tabs.order-info ul {
    width: 100%;
  }

  .tabs.order-info li {
    flex: 1 1 0;
  }

  .tabs.order-info li a {
    justify-content: center;
    min-height: var(--cp-touch-min);
  }
}

/* ========== ProductTable ========== */
.product-active-filters {
  border-bottom: 1px solid #f0f0f0;
  padding: 8px 16px;
}

.product-active-filters .tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cp-space-xs) var(--cp-space-sm);
}

@media (max-width: 767px) {
  .product-table-card .delete.is-small {
    min-width: 32px;
    min-height: 32px;
  }
}

/* ===================================================
   Shared primitives
   =================================================== */

/* ========== BaseModal (prefix: modal-) ========== */

/* Full-screen modal on mobile (≤767px) */
.modal-modal-full-screen-mobile {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh;  /* fallback for browsers without dvh support */
  height: 100dvh;
  z-index: var(--cp-z-modal);
  border-radius: 0 !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  animation: modal-slide-up-modal 0.28s cubic-bezier(0.32, 0.72, 0, 1) both;
}

.modal-modal-full-screen-mobile .modal-card-head {
  flex-shrink: 0;
  border-radius: 0 !important;
}

.modal-modal-full-screen-mobile .modal-card-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-modal-full-screen-mobile .modal-card-foot {
  flex-shrink: 0;
  border-radius: 0 !important;
}

@keyframes modal-slide-up-modal {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal-modal-full-screen-mobile {
    animation: none;
  }
}

/* ========== FilterPopover (prefix: popover-) ========== */

/* ── Mobile bottom-sheet ─────────────────────────────────────────── */
.popover-fp-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: calc(var(--cp-z-sheet) - 1);
}

.popover-fp-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  z-index: var(--cp-z-sheet);
  background: #fff;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.18);
  max-height: 80dvh;
  max-height: 80vh; /* fallback */
  max-height: 80dvh;
  display: flex;
  flex-direction: column;
  animation: popover-fp-slide-up 0.26s cubic-bezier(0.32, 0.72, 0, 1) both;
}

.popover-fp-sheet .popover-filter-popover-content {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
}

/* Drag-handle pill */
.popover-fp-sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: #d0d0d0;
  margin: 10px auto 4px;
  flex-shrink: 0;
}

@keyframes popover-fp-slide-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .popover-fp-sheet {
    animation: none;
  }
}

/* ========== TablePagination (prefix: pagination-) ========== */
/* All overrides target Bulma utility classes (.level, .level-left, .level-right,
   .level-item, .is-flex, .pagination) which we cannot rename. To preserve the
   original scoped behaviour we ancestor-scope every rule under the wrapper class
   `.pagination-table-pagination` (added to TablePagination.vue's root element). */

@media (max-width: 600px) {
  .pagination-table-pagination.level.box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--cp-space-sm);
  }

  .pagination-table-pagination .level-left {
    text-align: center;
    justify-content: center;
    width: 100%;
  }

  .pagination-table-pagination .level-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: var(--cp-space-sm);
  }

  .pagination-table-pagination .level-right > .level-item {
    width: 100%;
    justify-content: center;
  }

  .pagination-table-pagination .level-right .level-item .is-flex {
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--cp-space-sm);
  }

  .pagination-table-pagination .level-right .level-item .pagination {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--cp-space-sm);
  }
}

/* ========== PageShell (prefix: shell-) ========== */

.shell-page-shell {
  margin: 0 auto;
  min-height: 0;
  overflow-x: hidden;
  padding-left: max(var(--cp-page-padding-mobile), env(safe-area-inset-left));
  padding-right: max(var(--cp-page-padding-mobile), env(safe-area-inset-right));
  padding-bottom: env(safe-area-inset-bottom);
}

.shell-page-shell--no-padding {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

@media (min-width: 768px) {
  .shell-page-shell {
    padding-left: max(var(--cp-page-padding-tablet), env(safe-area-inset-left));
    padding-right: max(var(--cp-page-padding-tablet), env(safe-area-inset-right));
  }

  .shell-page-shell--no-padding {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

@media (min-width: 1024px) {
  .shell-page-shell {
    padding-left: max(var(--cp-page-padding-desktop), env(safe-area-inset-left));
    padding-right: max(var(--cp-page-padding-desktop), env(safe-area-inset-right));
  }

  .shell-page-shell--no-padding {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* ========== SkeletonWrapper (prefix: skeleton-) ========== */

.skeleton-loader-spinner {
  width: 48px;
  height: 48px;
  border: 5px solid #999;
  border-bottom-color: transparent;
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: skeleton-rotation 1s linear infinite;
  position: absolute;
  left: 50%;
  top: 50%;
  margin-top: -24px;
  margin-left: -24px;
}

@keyframes skeleton-rotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ========== ExportButton scoped (prefix: export-) ========== */

@media (max-width: 600px) {
  .export-customisable-container {
    width: 100%;
    justify-content: stretch;
  }

  .export-customisable-container button {
    width: 100%;
  }
}

/* ========== ExportButton — Radix Tooltip portal (UNPREFIXED — do not modify) ========== */

.TooltipContent {
  border-radius: 4px;
  padding: 10px 15px;
  font-size: 15px;
  line-height: 1;
  color: black;
  background-color: white;
  box-shadow:
    hsl(206 22% 7% / 35%) 0px 10px 38px -10px,
    hsl(206 22% 7% / 20%) 0px 10px 20px -15px;
  user-select: none;
  animation-duration: 400ms;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}
.TooltipContent[data-state='delayed-open'][data-side='top'] {
  animation-name: slideDownAndFade;
}
.TooltipContent[data-state='delayed-open'][data-side='right'] {
  animation-name: slideLeftAndFade;
}
.TooltipContent[data-state='delayed-open'][data-side='bottom'] {
  animation-name: slideUpAndFade;
}
.TooltipContent[data-state='delayed-open'][data-side='left'] {
  animation-name: slideRightAndFade;
}

.TooltipArrow {
  fill: white;
}

@keyframes slideUpAndFade {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideRightAndFade {
  from {
    opacity: 0;
    transform: translateX(-2px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideDownAndFade {
  from {
    opacity: 0;
    transform: translateY(-2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideLeftAndFade {
  from {
    opacity: 0;
    transform: translateX(2px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ─── PO Upload Design Tokens ─────────────────────────────────────────── */
:root {
  /* Colors — alias skin vars, fallback for dev */
  --po-primary:        var(--skin-primary,        #002E47);
  --po-primary-hover:  var(--skin-primary-dark,   #004080);
  --po-heading:        #1a2b4a;
  --po-accent:         #3357a0;
  --po-text-primary:   #2e2e2e;
  --po-text-secondary: #64748b;
  --po-text-muted:     #6b7280;   /* replaces #8896ab AND #94a3b8 */
  --po-text-body:      #475569;
  --po-border:         #e2e8f0;
  --po-border-mid:     #c5cee0;
  --po-surface:        #f8fafc;
  --po-surface-subtle: #f1f5f9;
  --po-success:        #16a34a;
  --po-danger:         #ef4444;
  --po-radius-btn:     4px;       /* was 10px — aligns with Products page */
  --po-font:           var(--skin-font-family, Raleway, 'Segoe UI', system-ui, sans-serif);
}
/* ─────────────────────────────────────────────────────────────────────── */

/* ============================================================
   PO Upload Feature — Consolidated Styles
   All classes use the `po-` prefix to avoid collisions.
   ============================================================ */

/* -------------------------------------------------------
   Design Tokens (used across all components)
   ------------------------------------------------------- */
/* Primary:  var(--po-primary) (buttons, focus rings)
   Accent:   #3b5998 (links, labels, accents)
   Heading:  var(--po-heading)
   Body:     #374151 / var(--po-text-body)
   Muted:    var(--po-text-secondary) / #8896ab / #94a3b8
   Border:   var(--po-border) / var(--po-surface-subtle)
   Surface:  var(--po-surface) / #fafbfe / #fafbff
   Success:  var(--po-success) / #22c55e / #dcfce7
   Warning:  #d97706 / #fcd88e / #fef3c7
   Danger:   #dc2626 / var(--po-danger) / #fee2e2
   Info:     #1e40af / #2563eb / #bfdbfe / #eff6ff         */


/* -------------------------------------------------------
   1. UploadEntry (wrapper — owns header, quota badge, tabs shell)
   ------------------------------------------------------- */
.po-upload-wrapper {
  max-width: 680px;
  margin: 0 auto;
  padding: 4rem 0 2rem;
  min-height: calc(100vh - 200px);
  min-height: calc(100dvh - 200px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.po-upload-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.75rem;
}

.po-upload-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--po-heading);
  margin: 0 0 0.25rem 0;
}

.po-upload-subtitle {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
}

.po-quota-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: #f0f4ff;
  border: 1px solid #d0daf0;
  border-radius: 20px;
  font-size: 0.8rem;
  color: #3b5998;
  white-space: nowrap;
}

.po-quota-badge--loading {
  padding: 0.4rem 0.7rem;
}

/* Drop zone */
.po-dropzone {
  border: 2px dashed #c5cee0;
  border-radius: 12px;
  padding: 3.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  background: #fafbff;
  position: relative;
}

.po-dropzone:hover {
  border-color: #3b5998;
  background: #f0f4ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 51, 102, 0.08);
}

.po-dropzone.is-dragging {
  border-color: var(--po-primary);
  background: #e8eeff;
  border-style: solid;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 51, 102, 0.12);
}

.po-dropzone.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.po-dropzone-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  background: linear-gradient(135deg, #e8eeff 0%, #d0daf0 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #3b5998;
  transition: all 0.25s ease;
}

.po-dropzone:hover .po-dropzone-icon {
  background: linear-gradient(135deg, #d0daf0 0%, #b8c5e8 100%);
  transform: scale(1.05);
}

.po-dropzone-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--po-heading);
  margin-bottom: 0.35rem;
}

.po-dropzone-hint {
  font-size: 0.85rem;
  color: var(--po-text-muted);
}

.po-dropzone-link {
  color: #3b5998;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* File card */
.po-file-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid var(--po-border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s;
}

.po-file-card:hover {
  border-color: #c5cee0;
}

.po-file-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.po-file-icon {
  width: 42px;
  height: 42px;
  background: #fff0f0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: #dc3545;
}

.po-file-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--po-heading);
  margin: 0;
}

.po-file-size {
  font-size: 0.8rem;
  color: var(--po-text-muted);
  margin: 0.1rem 0 0;
}

.po-file-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.po-btn-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--po-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.15s;
}

.po-btn-icon:hover {
  background: #fee2e2;
  color: #dc3545;
}


/* -------------------------------------------------------
   2. ProcessingProgress
   ------------------------------------------------------- */
.po-processing-wrapper {
  max-width: 520px;
  margin: 0 auto;
  padding: 4rem 0 2rem;
}

.po-processing-card {
  background: #fff;
  border: 1px solid var(--po-border);
  border-radius: 16px;
  padding: 2.25rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.po-processing-header {
  margin-bottom: 2rem;
}

.po-processing-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--po-heading);
  margin: 0 0 0.5rem;
}

.po-processing-filename {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.85rem;
  color: var(--po-text-secondary);
  line-height: 1.4;
  min-width: 0;
}

.po-processing-filename-icon {
  color: var(--po-text-body);
  font-size: 0.95rem;
  flex-shrink: 0;
}

.po-processing-filename-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Steps */
.po-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 2rem;
  position: relative;
}

.po-step {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-radius: 10px;
  transition: background 0.3s;
  position: relative;
}

.po-step.is-active {
  background: #f0f4ff;
}

.po-step.is-done {
  background: #f0fdf4;
}

.po-step-connector {
  position: absolute;
  left: 2.3rem;
  top: -0.5rem;
  width: 2px;
  height: 0.5rem;
  background: var(--po-border);
  transition: background 0.3s;
}

.po-step-connector.is-done {
  background: #22c55e;
}

.po-step-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.po-step.is-pending .po-step-icon {
  background: var(--po-surface-subtle);
  color: var(--po-text-muted);
}

.po-step.is-active .po-step-icon {
  background: var(--po-primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(0, 51, 102, 0.15);
}

.po-step.is-done .po-step-icon {
  background: #22c55e;
  color: #fff;
}

.po-step.is-error .po-step-icon {
  background: var(--po-danger);
  color: #fff;
}

.po-step-label {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
  transition: color 0.3s;
}

.po-step.is-pending .po-step-label { color: var(--po-text-muted); }
.po-step.is-active .po-step-label  { color: var(--po-heading); }
.po-step.is-done .po-step-label    { color: var(--po-success); }
.po-step.is-error .po-step-label   { color: var(--po-danger); }

.po-step-hint {
  font-size: 0.8rem;
  color: var(--po-text-muted);
  margin: 0.15rem 0 0;
}


/* -------------------------------------------------------
   3. CartConfirmation
   ------------------------------------------------------- */
.po-confirm-wrapper {
  max-width: 460px;
  margin: 0 auto;
  padding: 5rem 0 2rem;
}

.po-confirm-card {
  background: #fff;
  border: 1px solid var(--po-border);
  border-radius: 16px;
  padding: 3rem 2.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.po-confirm-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--po-success);
}

.po-confirm-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--po-heading);
  margin: 0 0 0.5rem;
}

.po-confirm-text {
  font-size: 0.95rem;
  color: var(--po-text-secondary);
  margin: 0 0 0.25rem;
}

.po-confirm-subtext {
  font-size: 0.8rem;
  color: var(--po-text-muted);
  margin: 0 0 1rem;
}

.po-confirm-adjusted-notice {
  font-size: 0.8rem;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  margin: 0 0 1.5rem;
  text-align: left;
}

.po-confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}


/* -------------------------------------------------------
   4. AddressCard
   ------------------------------------------------------- */
.po-address-card {
  background: #fff;
  border: 1px solid var(--po-border);
  border-radius: 10px;
  padding: 1.15rem;
  height: 100%;
}

.po-address-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #3b5998;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--po-surface-subtle);
}

.po-address-body {
  font-size: 0.85rem;
  color: #374151;
  line-height: 1.5;
}

.po-address-body p {
  margin: 0;
}

.po-address-name {
  font-weight: 600;
  color: var(--po-heading);
}

.po-address-muted {
  color: var(--po-text-muted);
}


/* -------------------------------------------------------
   5. LineItemsTable
   ------------------------------------------------------- */
.po-table-wrapper {
  background: #fff;
  border: 0.125em solid transparent;
  border-radius: 4px;
  overflow-x: auto;
  overflow-y: hidden;
}

.po-table-title-bar {
  padding: 0.5em 0.75em;
  border-bottom: 1px solid #dbdbdb;
}

.po-table-title {
  font-size: 1rem;
  font-weight: 600;
  color: #2E2E2E;
}

/* Specificity bumped via .po-table-wrapper so the 12-track grid wins over
   any skin CSS that targets .po-table-row / .po-table-header with !important. */
.po-table-wrapper .po-table-header {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 80px 44px 100px 120px 90px 110px 80px 80px 100px 70px 120px !important;
  min-width: 1400px;
  gap: 0.75rem;
  padding: 0.5em 0.75em;
  border-bottom: 2px solid #dbdbdb;
  font-size: 1rem;
  font-weight: 600;
  color: #2E2E2E;
}

.po-table-wrapper .po-table-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 80px 44px 100px 120px 90px 110px 80px 80px 100px 70px 120px !important;
  min-width: 1400px;
  gap: 0.75rem;
  padding: 0.5em 0.75em;
  border-bottom: 1px solid #dbdbdb;
  align-items: center;
  font-size: 1rem;
}

.po-table-row.is-not-found {
  background: #fef2f2;
  border-left: 3px solid var(--po-danger);
}

.po-table-row.is-not-found:hover {
  background: #fee2e2;
}

.po-table-row.is-ineligible {
  opacity: 0.65;
}


/* Description */
.po-item-desc {
  font-size: 1rem;
  color: #2E2E2E;
  margin: 0 0 0.3rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.po-item-desc-po-original {
  font-size: 0.75rem;
  color: #888;
  margin: 0.1rem 0 0.3rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Info icon button — matches Products table Info cell visually */
.po-info-btn {
  background: none;
  border: none;
  padding: 0.5rem;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.po-match-actions {
  margin-top: 0.5rem;
}

.po-match-actions:empty {
  display: none;
}

.po-match-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.po-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
}

.po-badge i {
  font-size: 0.6rem;
}

.po-badge-success {
  background: #dcfce7;
  color: #15803d;
}

.po-badge-warning {
  background: #fef3c7;
  color: #b45309;
}

.po-badge-danger {
  background: #fee2e2;
  color: #dc2626;
}

.po-badge-info {
  background: #e0f2fe;
  color: #0369a1;
}

.po-badge-code {
  font-size: 0.75rem;
  color: #7a7a7a;
}

.po-badge-confidence-exact  { background: #dcfce7; color: #15803d; }
.po-badge-confidence-high   { background: #e0f2fe; color: #0369a1; }
.po-badge-confidence-medium { background: #fef3c7; color: #b45309; }
.po-badge-confidence-low    { background: #fee2e2; color: #dc2626; }

.po-badge-no-match {
  background: #f1f5f9;
  color: #64748b;
}

/* ── Confidence pill ────────────────────────────────────── */
.po-conf-pill {
  cursor: help;
  outline: none;
}

.po-conf-pill:focus-visible {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, .5);
}

/* Tooltip rendered via Teleport to body — escapes .po-table-wrapper overflow clipping.
   Positioned with position:fixed + JS-computed top/left from getBoundingClientRect().
   transform shifts it above the anchor: translateY(-100%) moves it up by its own height,
   then -6px adds gap between pill and tooltip. */
.po-conf-tooltip-portal {
  position: fixed;
  transform: translateY(calc(-100% - 6px));
  z-index: 9000;
  min-width: 280px;
  max-width: 360px;
  padding: 10px 12px;
  background: #1f2937;
  color: #f9fafb;
  border-radius: 6px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, .18);
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
  display: grid;
  gap: 4px;
}

.po-conf-tooltip__title   { font-weight: 600; font-size: 13px; }
.po-conf-tooltip__reason  { color: #d1d5db; font-style: italic; }
.po-conf-tooltip__matched { color: #93c5fd; font-size: 11px; word-break: break-all; }
.po-conf-tooltip__diff    { display: flex; gap: 4px; }
.po-conf-tooltip__diff strong { color: #9ca3af; font-weight: 500; min-width: 78px; }
.po-conf-tooltip__diff em     { color: #f9fafb; font-style: normal; }

/* Empty-state UX for not_found + no candidates */
.po-empty-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 0.5rem 0;
}

.po-empty-illustration {
  font-size: 1.4rem;
  color: #9ca3af;
}

.po-empty-text {
  font-size: 0.8rem;
  color: #6b7280;
  margin: 0;
}

.po-btn-search-primary {
  margin-top: 0.1rem;
}

/* Product */
.po-product-name {
  font-size: 1rem;
  color: #2E2E2E;
}

.po-select-wrapper {
  position: relative;
}

.po-select {
  width: 100%;
  min-width: 200px;
  padding: 0.4rem 0.6rem;
  border: 1px solid #dbdbdb;
  border-radius: 4px;
  font-size: 1rem;
  color: #2E2E2E;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s;
}

.po-select:hover  { border-color: #b5b5b5; }
.po-select:focus  { border-color: #2E2E2E; outline: none; box-shadow: 0 0 0 2px rgba(46, 46, 46, 0.1); }

.po-btn-search {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid #dbdbdb;
  border-radius: 4px;
  background: #fff;
  color: #CA0606;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.po-btn-search:hover {
  background: #fff5f5;
  border-color: #CA0606;
}

/* Quantity */
.po-qty-input {
  width: 80px;
  padding: 0.375em 0.5em;
  border: 1px solid #dbdbdb;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 400;
  text-align: center;
  color: #2E2E2E;
  transition: border-color 0.15s;
  -moz-appearance: textfield;
}

.po-qty-input::-webkit-outer-spin-button,
.po-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.po-qty-input:focus {
  border-color: #2E2E2E;
  outline: none;
  box-shadow: 0 0 0 2px rgba(46, 46, 46, 0.1);
}

/* Price */
.po-price {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: #2E2E2E;
}

.po-tier-link {
  display: inline-block;
  background: none;
  border: none;
  padding: 0;
  font-size: 0.75rem;
  color: #CA0606;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.po-tier-link:hover { color: #be0606; }

/* Muted text — used in product detail cells */
.po-muted-text {
  font-size: 1rem;
  color: #7a7a7a;
}

/* Actions */
.po-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}

.po-cart-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  background: #f5f5f5;
  border: 1px solid #dbdbdb;
  border-radius: 4px;
  color: #2E2E2E;
  justify-content: flex-end;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.po-cart-badge i { font-size: 0.7rem; }

.po-cart-badge-text {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}

.po-cart-badge-qty {
  font-size: 0.875rem;
  font-weight: 600;
}

.po-cart-badge-label {
  font-size: 0.65rem;
  color: #6b6b6b;
  text-transform: lowercase;
}

.po-action-btn {
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #7a7a7a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all 0.15s;
}

.po-action-btn:hover {
  background: transparent;
  border-color: #dbdbdb;
  color: #2E2E2E;
}

.po-action-delete:hover {
  background: #fff5f5;
  border-color: #fca5a5;
  color: var(--po-danger);
}


/* -------------------------------------------------------
   6. LineItemExpandedRow
   ------------------------------------------------------- */
.po-expanded-row {
  padding: 0 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #fafbfe;
  border-bottom: 1px solid var(--po-border);
}

.po-expanded-section {
  background: #fff;
  border: 1px solid var(--po-border);
  border-radius: 8px;
  padding: 0.85rem;
}

.po-expanded-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--po-text-muted);
  letter-spacing: 0.08em;
  margin: 0 0 0.6rem;
}

.po-tiers-grid {
  display: flex;
  gap: 0.5rem;
}

.po-tier-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--po-border);
  background: var(--po-surface);
  transition: all 0.15s;
}

.po-tier-card.is-active {
  background: #eff6ff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.15);
}

.po-tier-range {
  font-size: 0.75rem;
  color: var(--po-text-secondary);
  font-weight: 500;
}

.po-tier-card.is-active .po-tier-range {
  color: #1d4ed8;
}

.po-tier-price {
  font-size: 0.85rem;
  font-weight: 700;
  color: #2E2E2E;
}

.po-tier-card.is-active .po-tier-price {
  color: #1d4ed8;
}

.po-notes-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.po-note-text {
  font-size: 0.8rem;
  color: var(--po-text-body);
  margin: 0;
  line-height: 1.5;
}

.po-delivery-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--po-text-secondary);
  padding: 0.5rem 0.85rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
}

.po-delivery-info i {
  font-size: 0.75rem;
  color: var(--po-success);
}


/* -------------------------------------------------------
   7. POReviewView
   ------------------------------------------------------- */
.po-review-layout {
  display: flex;
  min-height: calc(100vh - 120px);
  min-height: calc(100dvh - 120px);
}

.po-review-main {
  flex: 1;
  min-width: 0;
  padding: 1.75rem;
}

/* Header */
.po-review-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--po-border);
}

.po-header-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--po-heading);
  margin: 0 0 0.25rem;
  letter-spacing: -0.01em;
}

.po-header-meta {
  font-size: 0.8rem;
  color: var(--po-text-muted);
  margin: 0;
}

.po-match-summary {
  display: flex;
  gap: 1rem;
}

.po-match-stat {
  text-align: center;
  padding: 0.35rem 0.85rem;
  background: var(--po-surface);
  border: 1px solid var(--po-border);
  border-radius: 8px;
}

.po-stat-number {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
}

.po-stat-success { color: var(--po-success); }
.po-stat-warning { color: #d97706; }
.po-stat-danger  { color: #dc2626; }

.po-stat-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--po-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Addresses grid */
.po-address-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.po-address-grid--single {
  grid-template-columns: 1fr;
}

/* Section spacing */
.po-section {
  margin-bottom: 1.5rem;
}

/* Info box */
.po-info-box {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  background: #f0f4ff;
  border: 1px solid #d0daf0;
  border-radius: 10px;
  margin-bottom: 1.5rem;
}

.po-info-icon {
  color: #3b5998;
  font-size: 0.9rem;
  margin-top: 1px;
}

.po-info-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--po-heading);
  margin: 0 0 0.2rem;
}

.po-info-text {
  font-size: 0.8rem;
  color: var(--po-text-secondary);
  margin: 0;
}

/* Review actions */
.po-review-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 0 1.5rem;
  border-top: 1px solid var(--po-border);
  margin-top: 0.5rem;
}

.po-btn-add-to-cart {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  background: var(--po-primary);
  color: #fff;
  border: none;
  border-radius: var(--po-radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.po-btn-add-to-cart:hover {
  background: var(--po-primary-hover);
  box-shadow: 0 2px 8px rgba(0, 51, 102, 0.25);
}

.po-btn-add-to-cart:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* Resize handle */
.po-resize-handle {
  width: 8px;
  cursor: col-resize;
  background: var(--po-surface-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  height: 100dvh;
}

.po-resize-handle:hover {
  background: var(--po-border);
}

/* Drag-active: freeze text selection + kill iframe pointer capture so
   pointermove keeps streaming to the window handler. */
body.po-resizing { user-select: none; cursor: col-resize; }
body.po-resizing .po-pdf-iframe { pointer-events: none; }

.po-resize-handle:focus-visible {
  outline: 2px solid var(--po-accent, #2563eb);
  outline-offset: -2px;
}

.po-resize-grip {
  color: var(--po-text-muted);
  font-size: 0.55rem;
}

/* PDF panel */
.po-pdf-panel {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--po-border);
  background: #fafbfe;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
}

.po-pdf-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--po-border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--po-heading);
}

.po-pdf-header-label {
  flex: 1;
}

/* Unified icon-button for panel header (download, expand, close) */
.po-pdf-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--po-text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
  font-size: 0.8rem;
  padding: 0;
}

.po-pdf-action-btn:hover {
  background: var(--po-border);
  color: var(--po-heading);
}

/* Preview toggle toolbar */
.po-review-toolbar {
  display: flex;
  justify-content: flex-end;
  min-height: 2rem;
  margin-bottom: 0.5rem;
}

.po-preview-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--po-border);
  border-radius: 6px;
  background: var(--po-surface-subtle);
  color: var(--po-text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.po-preview-toggle-btn:hover {
  background: var(--po-border);
  color: var(--po-text-primary);
}

/* Fullscreen PDF overlay */
.po-pdf-fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
}

.po-pdf-fullscreen-inner {
  position: relative;
  width: 90vw;
  height: 90vh;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.po-pdf-fullscreen-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 1;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.po-pdf-fullscreen-close:hover {
  background: rgba(0, 0, 0, 0.75);
}

.po-pdf-fullscreen-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.po-pdf-icon {
  color: #dc3545;
}

.po-pdf-iframe-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.po-pdf-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafbfe;
  z-index: 1;
}

.po-pdf-spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--po-border);
  border-top-color: var(--po-accent, #2563eb);
  border-radius: 50%;
  animation: po-spin 0.7s linear infinite;
}

.po-pdf-spinner--lg {
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.75rem;
}

@keyframes po-spin {
  to { transform: rotate(360deg); }
}

.po-pdf-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.po-pdf-placeholder-content {
  text-align: center;
  color: #9fadc0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.po-pdf-placeholder-content i {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.4;
}

.po-pdf-placeholder-content p {
  margin: 0;
  font-size: 0.8rem;
  color: #6b7280;
}

.po-pdf-placeholder-hint {
  font-size: 0.75rem !important;
  color: var(--po-accent, #2563eb) !important;
  margin-top: 0.5rem !important;
  text-decoration: none;
}

.po-pdf-placeholder-hint:hover {
  text-decoration: underline;
}

.po-pdf-refresh-btn {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--po-accent, #2563eb);
  background: none;
  border: 1px solid var(--po-accent, #2563eb);
  border-radius: 4px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.po-pdf-refresh-btn:hover {
  background: var(--po-accent, #2563eb);
  color: #fff;
}

/* Shifted up 40px to clip Chrome's native PDF viewer toolbar.
   The wrap's overflow:hidden keeps the toolbar out of view. */
.po-pdf-iframe {
  position: absolute;
  top: -40px;
  left: 0;
  width: 100%;
  height: calc(100% + 40px);
  border: none;
  display: block;
}

.po-file-text-preview {
  flex: 1;
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.72rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-y: auto;
  color: var(--po-text);
  background: transparent;
  font-family: 'Courier New', Courier, monospace;
}

.po-eml-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.po-eml-headers {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--po-border);
  background: #f4f6fb;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex-shrink: 0;
}

.po-eml-header-row {
  display: flex;
  gap: 0.4rem;
  font-size: 0.72rem;
  line-height: 1.4;
  overflow: hidden;
}

.po-eml-header-label {
  font-weight: 600;
  color: var(--po-heading);
  flex-shrink: 0;
  min-width: 3.5rem;
}

.po-eml-body {
  font-size: 0.72rem;
}


/* -------------------------------------------------------
   8. BuyerDetailsCollapsible
   ------------------------------------------------------- */
.po-buyer-wrapper {
  margin-bottom: 1.5rem;
}

.po-buyer-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  padding: 0.5rem 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #3b5998;
  cursor: pointer;
  transition: color 0.15s;
}

.po-buyer-toggle:hover {
  color: var(--po-primary);
}

.po-toggle-icon {
  font-size: 0.65rem;
  width: 16px;
  text-align: center;
  transition: transform 0.2s;
}

.po-buyer-panels {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.po-buyer-empty {
  font-size: 0.875rem;
  color: var(--po-text-muted);
  font-style: italic;
  padding: 0.5rem 0.25rem;
  margin: 0;
}

.po-buyer-card {
  background: #fff;
  border: 1px solid var(--po-border);
  border-radius: 10px;
  padding: 1rem 1.15rem;
}

.po-buyer-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #3b5998;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.6rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--po-surface-subtle);
}

.po-buyer-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--po-heading);
  margin: 0 0 0.25rem;
}

.po-buyer-muted {
  font-size: 0.8rem;
  color: var(--po-text-secondary);
  margin: 0.15rem 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.po-buyer-muted i {
  font-size: 0.65rem;
  color: var(--po-text-muted);
  width: 14px;
  text-align: center;
}

.po-note-item {
  font-size: 0.8rem;
  color: var(--po-text-body);
  margin: 0;
  line-height: 1.5;
  padding: 0.35rem 0.6rem;
  background: var(--po-surface);
  border-radius: 6px;
}

.po-terms-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.po-terms-list li {
  font-size: 0.8rem;
  color: var(--po-text-body);
  line-height: 1.6;
  padding-left: 1rem;
  position: relative;
}

.po-terms-list li::before {
  content: '\2022';
  position: absolute;
  left: 0;
  color: var(--po-text-muted);
  font-weight: bold;
}


/* -------------------------------------------------------
   9. SessionWarningModal
   ------------------------------------------------------- */
.po-warning-body {
  text-align: center;
  padding: 0.5rem 0;
}

.po-warning-icon-wrapper {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: #d97706;
}

.po-warning-text {
  font-size: 0.9rem;
  color: var(--po-text-body);
  line-height: 1.6;
  margin: 0 0 0.75rem;
}

.po-warning-question {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--po-heading);
  margin: 0;
}

.po-warning-actions {
  display: flex;
  gap: 0.65rem;
  width: 100%;
  justify-content: flex-end;
}

.po-btn-continue {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  background: var(--po-primary);
  color: #fff;
  border: none;
  border-radius: var(--po-radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.po-btn-continue:hover {
  background: var(--po-primary-hover);
  box-shadow: 0 2px 8px rgba(0, 51, 102, 0.25);
}


/* -------------------------------------------------------
   10. Shared / Reusable
   ------------------------------------------------------- */

/* Alerts — used by FileUploadZone, ProcessingProgress, POReviewView */
.po-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.po-alert i {
  margin-top: 2px;
  font-size: 0.9rem;
}

.po-alert p {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  opacity: 0.85;
}

.po-alert-icon {
  margin-top: 2px;
  font-size: 0.85rem;
}

.po-alert-content p {
  margin: 0 0 0.15rem;
}

.po-alert-warning {
  background: #fffbeb;
  border: 1px solid #fcd88e;
  color: #92600a;
}

.po-alert-error {
  background: #fff5f5;
  border: 1px solid #fca5a5;
  color: #b91c1c;
}

.po-alert-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.po-alert-multiline {
  white-space: pre-line;
}

/* Buttons — shared across components */
.po-btn-primary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  background: var(--po-primary);
  color: #fff;
  border: none;
  border-radius: var(--po-radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.po-btn-primary:hover {
  background: var(--po-primary-hover);
  box-shadow: 0 2px 8px rgba(0, 51, 102, 0.25);
}

.po-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.po-btn-outline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: #fff;
  color: var(--po-heading);
  border: 1px solid var(--po-border);
  border-radius: var(--po-radius-btn);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.po-btn-outline:hover {
  background: #f8f9fa;
  border-color: #c5cee0;
}

.po-btn-cancel {
  padding: 0.65rem 1.5rem;
  background: #fff;
  border: 1px solid var(--po-border);
  border-radius: var(--po-radius-btn);
  font-size: 1rem;
  font-weight: 500;
  color: var(--po-text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.po-btn-cancel:hover:not(:disabled) {
  background: #f8f9fa;
  border-color: #c5cee0;
  color: var(--po-heading);
}

.po-btn-cancel:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.po-btn-full {
  width: 100%;
  justify-content: center;
}

/* Utility — text alignment helpers scoped to po tables */
.po-table-header .has-text-centered,
.po-table-row .has-text-centered { text-align: center; }

.po-table-header .has-text-right,
.po-table-row .has-text-right { text-align: right; }


/* -------------------------------------------------------
   11. UI/UX Refinements
   ------------------------------------------------------- */

/* Upload page title — use production font if available */
.po-upload-title,
.po-header-title,
.po-confirm-title,
.po-processing-header h3 {
  font-family: var(--po-font);
}

/* Subtle card elevation for address cards */
.po-address-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.2s;
}

.po-address-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Improved match stat cards — slight elevation */
.po-match-stat {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  min-width: 72px;
}

/* Softer table row dividers — each .po-table-row is wrapped in a v-if div,
   so :last-child matches every row. Target only the last wrapper instead. */
.po-table-wrapper > div:last-child > .po-table-row {
  border-bottom: none;
}

/* Smooth expand/collapse animation hint */
.po-expanded-row {
  animation: po-slide-down 0.2s ease-out;
}

@keyframes po-slide-down {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Review actions sticky bar for long pages */
.po-review-actions {
  position: sticky;
  bottom: 0;
  background: #fff;
  z-index: var(--cp-z-sticky, 30);
  padding: 1rem 0 1.25rem;
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--po-border);
}

/* Slightly larger action buttons for better tap targets */
.po-action-btn {
  width: 32px;
  height: 32px;
  min-width: 44px;
  min-height: 44px;
}

/* Cart badge subtle pulse on first render */
.po-cart-badge {
  animation: po-badge-appear 0.3s ease-out;
}

@keyframes po-badge-appear {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Dropzone — better visual affordance */
.po-dropzone {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Processing card — centered with card elevation */
.po-processing-card {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

/* Confirmation card — elevated feel */
.po-confirm-card {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

/* File card — subtle animation on appear */
.po-file-card {
  animation: po-slide-up 0.25s ease-out;
}

@keyframes po-slide-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .po-slide-down,
  .po-slide-up,
  .po-badge-appear,
  [class*="po-"] {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Warning modal — backdrop should be more visible */
.po-warning-body {
  padding: 0.75rem 0.5rem;
}

/* Better focus states for accessibility */
.po-btn-primary:focus-visible,
.po-btn-outline:focus-visible,
.po-btn-cancel:focus-visible,
.po-btn-add-to-cart:focus-visible,
.po-btn-continue:focus-visible,
.po-btn-search:focus-visible {
  outline: 2px solid var(--po-primary);
  outline-offset: 2px;
}

/* Consistent button font family */
.po-btn-primary,
.po-btn-outline,
.po-btn-cancel,
.po-btn-add-to-cart,
.po-btn-continue,
.po-btn-search,
.po-btn-icon,
.po-action-btn {
  font-family: inherit;
}


/* Responsive: tablet ≤768px.
   Also stacks the review layout to single column — desktop sidebar panel
   and resize handle are hidden; the mobile inline preview section
   (scoped in POReviewView.vue) takes over. */
@media (max-width: 768px) {
  /* Review layout: single column, sidebar hidden */
  .po-review-layout {
    flex-direction: column;
    min-height: auto;
  }
  .po-pdf-panel,
  .po-resize-handle {
    display: none !important;
  }

  .po-address-grid {
    grid-template-columns: 1fr;
  }

  .po-upload-header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .po-review-header {
    flex-direction: column;
    gap: 1rem;
  }

  .po-match-summary {
    justify-content: flex-start;
  }

  /* Clearance for sticky action bar (stacked: ~130px tall).
     Safe-area handled by bar's own padding — not doubled here. */
  .po-review-main {
    padding-bottom: 130px;
  }

  /* Wrapper and section padding */
  .po-upload-wrapper,
  .po-upload-wrapper > .po-processing-card,
  .po-upload-wrapper > .po-confirm-card {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .po-upload-section {
    padding: 1.5rem 1rem;
  }

  /* Table: 5 visible cols — desc, thumb, qty, price, actions */
  .po-table-wrapper .po-table-header,
  .po-table-wrapper .po-table-row {
    min-width: unset !important;
    grid-template-columns: 1fr 56px 80px 100px 90px !important;
    gap: 0.5rem;
  }

  /* Restore thumbnail (2) */
  .po-table-row > div:nth-child(2),
  .po-table-header > span:nth-child(2) {
    display: block !important;
  }

  /* Hide: info (3), item (4), custref (5), sizes (8,9), shipped (10), plant (11) */
  .po-table-row > div:nth-child(3),
  .po-table-header > span:nth-child(3),
  .po-table-row > div:nth-child(4),
  .po-table-header > span:nth-child(4),
  .po-table-row > div:nth-child(5),
  .po-table-header > span:nth-child(5),
  .po-table-row > div:nth-child(8),
  .po-table-header > span:nth-child(8),
  .po-table-row > div:nth-child(9),
  .po-table-header > span:nth-child(9),
  .po-table-row > div:nth-child(10),
  .po-table-header > span:nth-child(10),
  .po-table-row > div:nth-child(11),
  .po-table-header > span:nth-child(11) {
    display: none !important;
  }

  /* Thumbnail image: constrain Bulma's forced 64px to the 56px column */
  .po-table-row > div:nth-child(2) .image.is-64x64 {
    width: 56px !important;
    height: 56px !important;
    overflow: hidden;
  }

  /* Kill <select> overflow */
  .po-select {
    min-width: 0;
    width: 100%;
  }

  /* Tap targets ≥44px */
  .po-buyer-toggle,
  .po-preview-toggle-btn {
    min-height: 44px;
    padding: 0.75rem 0;
  }
  .po-preview-toggle-btn {
    padding: 0.5rem 0.75rem;
  }

  /* iOS zoom prevention: inputs must be ≥16px */
  .po-qty-input,
  .po-select {
    font-size: 16px;
  }

  /* Stack sticky action bar — full width, primary on top (column-reverse) */
  .po-review-actions {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 0.5rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  }
  .po-review-actions > .po-btn-cancel,
  .po-review-actions > .po-btn-add-to-cart {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  /* Stack warning-modal action buttons */
  .po-warning-actions {
    flex-direction: column-reverse;
    gap: 0.5rem;
  }
  .po-warning-actions > button {
    width: 100%;
    min-height: 44px;
  }
}

/* Modal scroll on all screens */
.modal-card {
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  display: flex;
  flex-direction: column;
}
.modal-card-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
}

/* Phone ≤430px — full card layout */
@media (max-width: 430px) {
  .po-upload-wrapper {
    padding: 1rem;
  }
  .po-dropzone {
    padding: 1.5rem 1rem;
  }

  /* Hide table header — labels come from ::before on cells */
  .po-table-wrapper .po-table-header {
    display: none !important;
  }

  /* Row → card with two-column grid (thumb | content) */
  .po-table-wrapper .po-table-row {
    display: grid !important;
    grid-template-columns: 56px 1fr !important;
    grid-auto-rows: auto;
    gap: 0.5rem 0.75rem;
    min-width: 0 !important;
    padding: 0.875rem !important;
    border-radius: 10px;
    margin-bottom: 0.625rem;
    border: 1px solid var(--po-border);
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  }

  /* Show all visible cells, reset any inherited display:none */
  .po-table-row > div {
    display: block !important;
    width: auto;
  }

  /* Thumbnail: left column, spans desc + info rows */
  .po-table-row > div:nth-child(2) {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
  }

  /* Description + badges: right column, row 1 */
  .po-table-row > div:nth-child(1) {
    grid-column: 2;
    grid-row: 1;
  }
  .po-item-desc {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    cursor: pointer;
  }
  .po-item-desc.is-expanded {
    -webkit-line-clamp: unset;
    overflow: visible;
  }

  /* Info button: right column, row 2 — col 3 in 12-col layout */
  .po-table-row > div:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
    margin-top: -0.25rem;
  }

  /* Qty: full width with label — col 6 in 12-col layout */
  .po-table-row > div:nth-child(6) {
    grid-column: 1 / -1;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 0;
    border-top: 1px solid var(--po-border);
  }
  .po-table-row > div:nth-child(6)::before {
    content: "Qty";
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--po-text-muted);
  }

  /* Price: full width with label — col 7 in 12-col layout */
  .po-table-row > div:nth-child(7) {
    grid-column: 1 / -1;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 0;
    border-top: 1px solid var(--po-border);
    text-align: left;
  }
  .po-table-row > div:nth-child(7)::before {
    content: "Price";
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--po-text-muted);
  }

  /* Actions: full width — col 12 in 12-col layout */
  .po-table-row > div:nth-child(12) {
    grid-column: 1 / -1;
    display: flex !important;
    gap: 0.5rem;
    margin-top: 0.25rem;
  }
  .po-table-row > div:nth-child(12) .po-action-btn {
    flex: 1;
    min-height: 44px;
    border-radius: 6px;
  }

  /* Hide secondary cells: item (4), custref (5), sizes (8,9), shipped (10), plant (11) */
  .po-table-row > div:nth-child(4),
  .po-table-row > div:nth-child(5),
  .po-table-row > div:nth-child(8),
  .po-table-row > div:nth-child(9),
  .po-table-row > div:nth-child(10),
  .po-table-row > div:nth-child(11) {
    display: none !important;
  }

  /* Info button: 768px rule hides nth-child(3) with higher specificity — restore it here
     with matching specificity so the later rule wins in the cascade. */
  .po-table-row > div:nth-child(3) {
    display: block !important;
    grid-column: 2;
    grid-row: 2;
    margin-top: -0.25rem;
  }

  /* Thumbnail: constrain image to column, compact View Art link */
  .po-table-row > div:nth-child(2) .image.is-64x64 {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    overflow: hidden;
  }
  .po-table-row > div:nth-child(2) .image.is-64x64 img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
  }
  .po-table-row > div:nth-child(2) .cp-view-art {
    min-height: 44px !important;
    padding: 0 !important;
    font-size: 0.75rem !important;
    display: flex !important;
    align-items: center;
    white-space: nowrap;
    width: 100%;
  }

  /* Modals: full-bleed on phone — scoped to PO upload containers so
     other pages' modals (Orders detail, Products info) are unaffected. */
  .po-upload-wrapper .modal-card,
  .po-review-layout .modal-card {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }

  /* Quantity input: ensure minimum touch target (44px) on phone.
     The QuantityBox renders a plain <input>, no +/- buttons. */
  .po-qty-input,
  .input.quantity {
    min-height: var(--cp-touch-min, 44px);
    min-width: var(--cp-touch-min, 44px);
  }

  /* Buttons: ensure 44px touch target on phone */
  .po-btn-primary,
  .po-btn-outline,
  .po-btn-cancel,
  .po-btn-add-to-cart {
    min-height: var(--cp-touch-min, 44px);
  }
}

/* Step 13: focus-visible on interactive elements */
.po-action-btn:focus-visible,
.po-btn-icon:focus-visible,
.po-info-btn:focus-visible,
.po-tier-link:focus-visible {
  outline: 2px solid var(--po-primary);
  outline-offset: 2px;
}

.po-select:focus-visible,
.po-qty-input:focus-visible {
  outline: 2px solid var(--po-primary);
  outline-offset: 1px;
}

/* Step 14: Dropzone active state for touch feedback */
.po-dropzone:active {
  border-color: var(--po-primary);
  background: #e8eeff;
  transition: background 0.1s ease, border-color 0.1s ease;
}

/* -------------------------------------------------------
   Upload Entry — tabs shell
   ------------------------------------------------------- */
.po-upload-shell {
  border: 1px solid var(--po-border);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

/* Tab bar */
.po-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--po-border);
  padding: 0 1rem;
  background: var(--po-surface);
}

.po-tabs nav.tabs {
  border-bottom: none;
  margin-bottom: 0;
  flex: 1;
}

.po-tabs nav.tabs ul {
  border-bottom: none;
}

.po-tabs nav.tabs li {
  min-height: var(--cp-touch-min, 44px);
  display: flex;
  align-items: center;
}

.po-tabs nav.tabs li a {
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.75rem 1rem;
  min-height: var(--cp-touch-min, 44px);
  font-size: 0.9rem;
  color: var(--po-text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.po-tabs nav.tabs li a:hover {
  color: var(--po-accent);
  border-bottom-color: var(--po-accent);
  background: transparent;
}

.po-tabs nav.tabs li.is-active a {
  color: var(--po-accent);
  border-bottom-color: var(--po-accent);
  background: transparent;
  font-weight: 600;
}

.po-tabs nav.tabs li.is-disabled a {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}

.po-tab-hint {
  font-size: 0.8rem;
  color: var(--po-text-muted);
  white-space: nowrap;
  padding-left: 0.5rem;
  flex-shrink: 0;
}

/* Tab panels */
.po-tab-panel {
  padding: 1.5rem;
}

/* -------------------------------------------------------
   Paste Text Zone
   ------------------------------------------------------- */
.po-paste-textarea {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  padding: 0.85rem 1rem;
  font-family: ui-monospace, 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--po-text-primary);
  background: var(--po-surface);
  border: 2px dashed #c5cee0;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  box-sizing: border-box;
}

.po-paste-textarea:focus {
  border-color: var(--po-accent);
  background: #fff;
  border-style: solid;
}

.po-paste-textarea::placeholder {
  color: var(--po-text-muted);
}

.po-paste-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--po-text-muted);
  min-height: 1.4rem;
}

.po-paste-meta.is-over {
  color: var(--po-danger);
  font-weight: 600;
}

.po-paste-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* -------------------------------------------------------
   CartConfirmation — mobile sticky action bar (≤767px)
   ------------------------------------------------------- */
@media (max-width: 767px) {
  .po-confirm-card {
    padding-bottom: 140px;
  }

  .po-confirm-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--cp-z-sticky, 30);
    background: #fff;
    border-top: 1px solid var(--po-border, #e2e8f0);
    padding: 0.75rem 1rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    gap: 0.5rem;
  }
}

/* -------------------------------------------------------
   POReviewView — mobile preview modal
   ------------------------------------------------------- */
.po-mobile-preview-section {
  display: none;
}

.po-mobile-preview-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 1rem;
  background: var(--po-surface-subtle, #f1f5f9);
  border: 1px solid var(--po-border, #e2e8f0);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--po-heading, #1a2b4a);
  cursor: pointer;
  text-align: left;
  min-height: var(--cp-touch-min, 44px);
  transition: background 0.15s;
}

.po-mobile-preview-toggle:hover {
  background: var(--po-border, #e2e8f0);
}

.po-mobile-preview-chevron {
  margin-left: auto;
  font-size: 0.75rem;
}

.po-mobile-preview-modal {
  display: none;
}

.po-mobile-text-preview {
  height: 100%;
  overflow-y: auto;
  padding: 1rem;
  margin: 0;
}

@media (max-width: 768px) {
  .po-mobile-preview-section {
    display: block;
    margin-bottom: 1.5rem;
  }

  .po-mobile-preview-modal {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.65);
    align-items: stretch;
    justify-content: stretch;
  }

  .po-mobile-preview-modal-inner {
    display: flex;
    flex-direction: column;
    background: #fff;
    width: 100%;
    height: 100%;
    max-height: 100dvh;
    overflow: hidden;
  }

  .po-mobile-preview-modal-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.75rem;
    min-height: 52px;
    border-bottom: 1px solid var(--po-border, #e2e8f0);
    background: var(--po-surface-subtle, #f8fafc);
    flex-shrink: 0;
  }

  .po-mobile-preview-modal-title {
    flex: 1;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--po-heading, #1a2b4a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .po-mobile-preview-modal-body {
    flex: 1;
    overflow: hidden;
    position: relative;
    min-height: 0;
  }

  .po-mobile-pdf-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
  }

  .po-mobile-modal-pdf-iframe {
    position: absolute;
    top: -40px;
    left: 0;
    width: 100%;
    height: calc(100% + 40px);
    border: none;
    display: block;
  }
}
