/* Order Labels pilot: compact, sober operations UI.
 * Behaviour continues to be owned by the existing Order Labels modules; this
 * file owns the page presentation so the pilot can evolve without legacy CSS.
 */

.order-labels-pilot {
  color-scheme: inherit;
  --ol-blue: #2868e8;
  --ol-accent: #3476f3;
  --ol-blue-soft: light-dark(#edf3ff, #14243d);
  --ol-border: light-dark(#d8dfe9, #2b384c);
  --ol-border-strong: light-dark(#c8d2e1, #3d4d64);
  --ol-canvas: light-dark(#eef2f7, #0b111a);
  --ol-panel: light-dark(#ffffff, #111a27);
  --ol-subtle: light-dark(#f7f9fc, #0e1722);
  --ol-text: light-dark(#172033, #eef3fb);
  --ol-muted: light-dark(#5f6b7f, #9aa7ba);
  --ol-success: light-dark(#16734c, #68d6a4);
  --ol-warning: light-dark(#9a5a00, #f2bc61);
  --ol-danger: light-dark(#a1281f, #ff9a92);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ol-text);
  background: var(--ol-canvas);
}

.order-labels-pilot .order-labels-page-head {
  align-items: flex-start;
  margin-bottom: 14px;
}

.order-labels-eyebrow {
  margin-bottom: 5px;
  color: var(--ol-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.order-labels-pilot .ops-page-head h1,
.order-labels-pilot .ops-page-head h2 {
  margin-bottom: 3px;
  color: var(--ol-text);
  font-size: clamp(24px, 2vw, 31px);
  letter-spacing: -.035em;
}

.order-labels-pilot .ops-page-subtitle {
  color: var(--ol-muted);
}

.order-labels-live-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  color: var(--ol-muted);
  font-size: 12px;
  font-weight: 650;
}

.order-labels-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ol-success);
  box-shadow: 0 0 0 3px rgba(22, 121, 75, .1);
}

.order-labels-pilot .ops-page-actions {
  align-items: center;
}

.order-labels-audio-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.order-labels-audio-toggle[aria-pressed="true"] {
  border-color: #84adff;
  background: var(--ol-blue-soft);
  color: #1849a9;
}

.order-labels-pilot .action {
  min-height: 34px;
  border-radius: 7px;
  box-shadow: none;
  font-weight: 750;
}

.order-labels-pilot .action:not(.secondary):not(.warn):not(.success) {
  background: var(--ol-blue);
}

.order-labels-pilot .action.secondary {
  border: 1px solid var(--ol-border-strong);
  background: var(--ol-panel);
  color: var(--ol-text);
}

.order-labels-pilot .ol-actions button.action.secondary {
  border: 1px solid var(--ol-border-strong);
  background: var(--ol-panel);
  color: var(--ol-text);
}

.order-labels-pilot .action.warn {
  background: #fff7ed;
  color: var(--ol-warning);
  border: 1px solid #fed7aa;
}

.order-labels-pilot .ol-actions button.action.warn {
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #854a0e;
}

.order-labels-pilot .action.success {
  background: var(--ol-success);
}

.order-labels-command-surface {
  border: 1px solid var(--ol-border);
  border-radius: 11px;
  background: var(--ol-panel);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .035);
  overflow: hidden;
}

.order-labels-control-strip {
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin: 0;
  padding: 12px;
  border-bottom: 1px solid var(--ol-border);
  background: var(--ol-subtle);
}

.order-labels-control-group,
.order-labels-search-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.order-labels-control-label {
  color: #475467;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .025em;
}

.order-labels-pilot input,
.order-labels-pilot select {
  border-color: var(--ol-border-strong);
  border-radius: 7px;
  background: var(--ol-panel);
  color: var(--ol-text);
}

.order-labels-pilot input:focus,
.order-labels-pilot select:focus,
.order-labels-pilot .ol-edit-cell:focus {
  border-color: var(--ol-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
  outline: none;
}

.order-labels-pilot .ol-dispatch-nav {
  display: grid;
  grid-template-columns: 34px minmax(150px, auto) 34px;
  align-items: center;
  gap: 5px;
}

.order-labels-pilot .ops-calendar-control input[type="date"] {
  min-height: 34px;
  font-variant-numeric: tabular-nums;
  color-scheme: inherit;
}

.order-labels-pilot .ol-dispatch-nav .nav-btn {
  height: 34px;
  min-width: 34px;
  border: 1px solid var(--ol-border-strong);
  border-radius: 7px;
  background: var(--ol-panel);
  color: #344054;
  cursor: pointer;
  font-weight: 800;
}

.order-labels-pilot .ol-dispatch-nav .nav-btn:hover {
  border-color: #98a2b3;
  background: #f2f4f7;
}

.order-labels-search-field input {
  width: 100%;
  min-width: 0;
}

.order-labels-pilot .ol-archive-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  color: #475467;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.order-labels-pilot .ol-archive-filter input {
  width: 15px;
  height: 15px;
}

.order-labels-context-row {
  display: grid;
  grid-template-columns: minmax(320px, .85fr) minmax(390px, 1.15fr);
  gap: 12px;
  align-items: stretch;
  padding: 12px;
}

.order-labels-pilot .ol-routing-details {
  margin: 0;
  border: 1px solid var(--ol-border);
  border-radius: 9px;
  background: var(--ol-subtle);
  padding: 10px 11px;
}

.order-labels-pilot .ol-routing-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ol-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  list-style: none;
}

.order-labels-pilot .ol-routing-details > summary::-webkit-details-marker {
  display: none;
}

.order-labels-pilot .ol-routing-details > summary strong {
  color: var(--ol-text);
  font-size: 12px;
  text-align: right;
}

.order-labels-routing-copy {
  margin: 9px 0;
  color: var(--ol-muted);
  font-size: 12px;
  line-height: 1.45;
}

.order-labels-routing-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.order-labels-routing-controls label {
  display: grid;
  gap: 5px;
  color: #475467;
  font-size: 11px;
  font-weight: 800;
}

.order-labels-pilot .order-labels-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.order-labels-pilot .orders-kpi {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--ol-border);
  border-radius: 9px;
  background: var(--ol-panel);
  padding: 10px 11px;
  color: var(--ol-muted);
  font-size: 11px;
  font-weight: 750;
}

.order-labels-pilot .orders-kpi strong {
  margin-top: 4px;
  overflow: hidden;
  color: var(--ol-text);
  font-size: 18px;
  letter-spacing: -.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-labels-provider-bar,
.order-labels-manifest-controls {
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 10px 12px;
  border-top: 1px solid var(--ol-border);
  background: #fcfcfd;
}

.order-labels-provider-bar {
  display: flex;
  justify-content: space-between;
}

.order-labels-provider-bar > div,
.order-labels-manifest-copy {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 180px;
}

.order-labels-provider-bar span,
.order-labels-manifest-copy span {
  color: var(--ol-muted);
  font-size: 12px;
}

.order-labels-pilot .order-labels-manifest-controls {
  display: flex;
  flex-wrap: wrap;
}

.order-labels-pilot .order-labels-manifest-controls input {
  min-width: 180px;
}

.order-labels-recovery {
  margin-top: 10px;
  max-width: 720px;
  border: 1px solid #fed7aa;
  border-left: 3px solid #f79009;
  border-radius: 8px;
  background: #fffaeb;
  padding: 10px 11px;
  color: #7a2e0e;
  font-size: 12px;
  line-height: 1.45;
}

.order-labels-recovery-actions {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
  margin-top: 8px;
}

.order-labels-error-detail {
  margin-top: 12px;
  border: 1px solid #fecdca;
  border-radius: 9px;
  background: #fffbfa;
  color: var(--ol-danger);
}

.order-labels-error-detail > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
}

.order-labels-error-detail > summary::-webkit-details-marker {
  display: none;
}

.order-labels-error-detail > summary span:last-child {
  color: #b54708;
  font-size: 11px;
  font-weight: 700;
}

.order-labels-error-detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: end;
  padding: 0 11px 11px;
}

.order-labels-error-detail pre {
  min-width: 0;
  max-height: 180px;
  margin: 0;
  overflow: auto;
  border: 1px solid #fecdca;
  border-radius: 7px;
  background: #fff;
  padding: 8px;
  color: #7a271a;
  font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.order-labels-queue-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 8px;
}

.order-labels-queue-head h2,
.order-labels-queue-head h3 {
  margin: 0 0 3px;
  color: var(--ol-text);
  font-size: 15px;
  letter-spacing: -.01em;
}

.order-labels-queue-head span {
  color: var(--ol-muted);
  font-size: 12px;
}

.order-labels-pilot .ol-board {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 0;
}

.order-labels-pilot .ol-card {
  overflow: visible;
  border: 1px solid var(--ol-border);
  border-radius: 10px;
  background: var(--ol-panel);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .025);
}

.order-labels-pilot .ol-head {
  display: grid;
  grid-template-columns: 26px minmax(230px, 1fr) minmax(105px, auto) auto;
  gap: 9px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid transparent;
  background: var(--ol-panel);
}

.order-labels-pilot .ol-card.open .ol-head {
  border-bottom-color: var(--ol-border);
  background: var(--ol-subtle);
}

.order-labels-pilot .ol-head-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.order-labels-pilot .ol-live-row,
.order-labels-pilot .ol-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.order-labels-pilot .ol-live-row {
  flex-wrap: wrap;
}

.order-labels-pilot .ol-order-identity {
  overflow: hidden;
  color: var(--ol-text);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-labels-pilot .ol-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--ol-border);
  padding-bottom: 10px;
}

.order-labels-pilot .ol-actions button.action {
  min-height: 30px;
  flex: 0 0 auto;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 11px;
}

.order-labels-pilot .ol-actions select {
  min-width: 185px;
  height: 30px;
  flex: 0 0 auto;
  padding: 4px 7px;
  font-size: 11px;
}

.order-labels-pilot .ol-actions button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.order-labels-pilot .ol-parcel-field {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  color: var(--ol-muted);
  font-size: 11px;
  font-weight: 750;
}

.order-labels-pilot .ol-parcel-field input {
  width: 52px;
  height: 30px;
  padding: 4px 6px;
}

.order-labels-pilot .ol-live-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid var(--ol-border-strong);
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--ol-panel);
  color: #475467;
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.order-labels-pilot .ol-live-chip.primary {
  border-color: #98a2b3;
  color: var(--ol-text);
  font-size: 11px;
}

.order-labels-pilot .ol-live-chip.delivery {
  border-color: #b2ccff;
  background: var(--ol-blue-soft);
  color: #1849a9;
}

.order-labels-pilot .ol-live-chip.payment,
.order-labels-pilot .ol-live-chip.warn {
  border-color: #fedf89;
  background: #fffaeb;
  color: #93370d;
}

.order-labels-pilot .ol-live-chip.payment.is-success {
  border-color: #86caa8;
  background: #ecfdf5;
  color: #166534;
}

.order-labels-pilot .ol-live-meta {
  overflow: hidden;
  max-width: 100%;
  color: var(--ol-muted);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-labels-pilot .ol-live-toggle {
  display: inline-block;
  margin-left: 1px;
  color: #98a2b3;
  font-size: 10px;
  line-height: 1;
  transition: transform 140ms ease;
}

.order-labels-pilot .ol-card.open .ol-live-toggle {
  transform: rotate(90deg);
}

.order-labels-pilot .ol-details {
  padding: 12px;
  background: var(--ol-panel);
}


.order-labels-pilot .table-wrap {
  border-color: var(--ol-border);
  border-radius: 8px;
}

.order-labels-pilot .ol-labels-edit th {
  background: var(--ol-subtle);
  color: #475467;
  font-size: 10px;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.order-labels-pilot .ol-label-row-column {
  width: 90px;
}

.order-labels-pilot .ol-label-name-column {
  width: 260px;
}

.order-labels-pilot .ol-labels-edit td .ol-edit-cell {
  width: 100%;
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 7px;
  background: transparent;
  outline: none;
  white-space: pre-wrap;
  word-break: break-word;
}

.order-labels-pilot .ol-labels-edit td .ol-edit-cell:hover {
  border-color: var(--ol-border);
  background: var(--ol-subtle);
}

.order-labels-pilot .ol-mini {
  color: var(--ol-muted);
  font-size: 11px;
}

.order-labels-pilot .ol-detail-note {
  margin-top: 8px;
}

.order-labels-pilot .ol-detail-section-heading {
  margin-top: 10px;
}

.order-labels-pilot .ol-extra-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 64px minmax(180px, 1.4fr) auto;
  gap: 6px;
  margin-top: 8px;
}

.order-labels-pilot .ol-extra-list {
  margin-top: 8px;
  border: 1px solid var(--ol-border);
  border-radius: 8px;
  background: var(--ol-panel);
}

.order-labels-pilot .ol-extra-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border-bottom: 1px solid var(--ol-border);
}

.order-labels-pilot .ol-extra-item:last-child {
  border-bottom: 0;
}

.order-labels-pilot .ol-address-box {
  border: 1px solid var(--ol-border);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--ol-subtle);
}

.order-labels-pilot .ol-address-box.compact {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.order-labels-pilot .ol-address-line {
  margin: 0;
  line-height: 1.4;
  word-break: break-word;
}

.order-labels-pilot .ol-empty {
  border: 1px dashed var(--ol-border-strong);
  border-radius: 9px;
  padding: 22px;
  background: var(--ol-subtle);
  color: var(--ol-muted);
  text-align: center;
}

.order-labels-pilot .ol-warning {
  margin-top: 4px;
  color: var(--ol-warning);
  font-size: 11px;
}

@media (max-width: 1260px) {
  .order-labels-pilot .ol-head {
    grid-template-columns: 26px minmax(0, 1fr) minmax(105px, auto);
  }

  .order-labels-pilot .ol-row-primary-actions {
    grid-column: 2 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .order-labels-control-strip,
  .order-labels-context-row {
    grid-template-columns: 1fr;
  }

  .order-labels-pilot .order-labels-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .order-labels-pilot .ol-dispatch-detail-grid {
    grid-template-columns: 1fr;
  }

  .order-labels-pilot .ol-detail-main {
    border-right: 0;
    border-bottom: 1px solid var(--ol-border);
  }
}

@media (max-width: 660px) {
  .order-labels-pilot .order-labels-page-head,
  .order-labels-pilot .ops-page-actions,
  .order-labels-recovery-actions,
  .order-labels-error-detail-body,
  .order-labels-routing-controls,
  .order-labels-pilot .ol-extra-row {
    grid-template-columns: 1fr;
  }

  .order-labels-pilot .ops-page-actions {
    display: grid;
    width: 100%;
  }

  .order-labels-queue-head,
  .order-labels-selection-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .order-labels-queue-tools,
  .order-labels-selection-bar > div {
    justify-content: flex-start;
  }

  .order-labels-pilot .ol-head {
    grid-template-columns: 26px minmax(0, 1fr);
    padding: 9px 7px;
  }

  .order-labels-pilot .ol-row-label-state,
  .order-labels-pilot .ol-row-primary-actions {
    grid-column: 2;
    justify-self: stretch;
  }

  .order-labels-pilot .ol-dispatch-date-summary {
    grid-template-columns: 1fr;
  }

  .order-labels-pilot .ol-actions button.action,
  .order-labels-pilot .ol-actions select,
  .order-labels-pilot .ol-parcel-field input {
    min-height: 38px;
  }

  .order-labels-pilot .order-labels-kpi-grid {
    grid-template-columns: 1fr;
  }

  .order-labels-pilot .ol-dispatch-nav {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
  }

  .order-labels-provider-bar,
  .order-labels-pilot .order-labels-manifest-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .order-labels-pilot .order-labels-manifest-controls > *,
  .order-labels-pilot .order-labels-provider-bar button,
  .order-labels-pilot .ol-extra-row > * {
    width: 100%;
  }
}

/* Compact dispatch tools: all secondary controls are opt-in, theme-aware. */
.order-labels-pilot .ol-dispatch-tools { border-top: 1px solid var(--ol-border); }
.order-labels-pilot .ol-dispatch-tools > summary { cursor: pointer; padding: 9px 14px; font-weight: 650; color: var(--ol-text); }
.order-labels-pilot .ol-dispatch-tools-body { padding: 8px 14px; }
.order-labels-pilot .ol-dispatch-tools-body .ol-printer-readiness { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.order-labels-pilot .ol-dispatch-tools-body p { margin: 8px 0; font-size: 12px; color: var(--ol-muted); }
.order-labels-pilot .order-labels-provider-bar,
.order-labels-pilot .order-labels-manifest-controls { background: var(--ol-panel); color: var(--ol-text); padding: 8px 0; }
.order-labels-pilot .order-labels-provider-bar.hidden,
.order-labels-pilot .order-labels-manifest-controls.hidden { display: none; }
.order-labels-pilot .order-labels-command-surface > .ol-dispatch-breakdown { margin: 0; border: 0; border-top: 1px solid var(--ol-border); border-radius: 0; box-shadow: none; }
.order-labels-pilot .order-labels-command-surface > .ol-dispatch-breakdown > summary { justify-content: start; gap: 7px; padding: 9px 14px; }
.order-labels-pilot #ol-breakdown-total { margin-left: auto; color: var(--ol-muted); font-size: 12px; }
.order-labels-pilot .ol-preparation-table { width: 100%; border-collapse: collapse; }
.order-labels-pilot .ol-preparation-table th,
.order-labels-pilot .ol-preparation-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--ol-border); }
.order-labels-pilot .ol-preparation-table th:last-child,
.order-labels-pilot .ol-preparation-table td:last-child { text-align: right; width: 90px; font-weight: 700; }
.order-labels-pilot .ol-preparation-table small { display: block; color: var(--ol-muted); }

.order-labels-pilot .ol-preparation-table th { background: var(--ol-subtle); color: var(--ol-muted); }
.order-labels-pilot #ol-fulfill-printed { background: light-dark(#16734c, #1b654e); color: #fff; border-color: light-dark(#16734c, #68d6a4); }
.order-labels-pilot .order-labels-control-label,
.order-labels-pilot .ol-archive-filter { color: var(--ol-muted); }
