/*
 * Harbour Staff Portal — action theme and UI polish
 * Loaded: every /staff screen, always last (after all page stylesheets).
 * Section 1: three-colour action buttons. Section 2: shared UI consistency pass.
 */

/* ==========================================================================
   1. Action buttons
   ========================================================================== */

/*
 * Harbour Staff Portal — three-colour action system
 * v2.14.29
 *
 * Amber-orange = commit / create / save / approve / advance / confirm
 * Teal   = utility / search / open / edit / upload / download / restore
 * Red    = destructive / cancel order / delete / return for changes
 *
 * This stylesheet is intentionally enqueued after every staff-page stylesheet.
 * Disclosure controls, tabs and segmented switches stay neutral because they
 * navigate/reveal UI rather than perform a business action.
 */

.hcr {
  --staff-action-primary: #B45A00;
  --staff-action-primary-hover: #964A00;
  --staff-action-secondary: #246B62;
  --staff-action-secondary-hover: #205F57;
  --staff-action-danger: #B42318;
  --staff-action-danger-hover: #8F1D14;
}

/* Shared action geometry. Default staff action = teal utility. */

.hcr .hcr-button,
.hcr .hcr-reset-button,
.hcr .hcr-history-toggle,
.hcr .hcr-risk-view-all {
  background: var(--staff-action-secondary)!important;
  border-color: var(--staff-action-secondary)!important;
  color: #fff!important;
  -webkit-text-fill-color: #fff!important;
  box-shadow: none!important;
  text-decoration: none!important;
}

.hcr .hcr-button:hover,
.hcr .hcr-button:focus,
.hcr .hcr-reset-button:hover,
.hcr .hcr-reset-button:focus,
.hcr .hcr-history-toggle:hover,
.hcr .hcr-history-toggle:focus,
.hcr .hcr-risk-view-all:hover,
.hcr .hcr-risk-view-all:focus {
  background: var(--staff-action-secondary-hover)!important;
  border-color: var(--staff-action-secondary-hover)!important;
  color: #fff!important;
  -webkit-text-fill-color: #fff!important;
  box-shadow: 0 3px 9px rgba(31,91,82,.16)!important;
  transform: none!important;
}

/* Orange — commits data or moves the workflow forward. */

.hcr .hcr-primary-button,
.hcr button.hcr-primary-button,
.hcr a.hcr-primary-button,
.hcr .hcr-button-confirm,
.hcr button.hcr-button-confirm,
.hcr a.hcr-button-confirm {
  background: var(--staff-action-primary)!important;
  border-color: var(--staff-action-primary)!important;
  color: #fff!important;
  -webkit-text-fill-color: #fff!important;
  box-shadow: none!important;
}

.hcr .hcr-primary-button:hover,
.hcr .hcr-primary-button:focus,
.hcr .hcr-button-confirm:hover,
.hcr .hcr-button-confirm:focus {
  background: var(--staff-action-primary-hover)!important;
  border-color: var(--staff-action-primary-hover)!important;
  color: #fff!important;
  -webkit-text-fill-color: #fff!important;
  box-shadow: 0 3px 9px rgba(150,74,0,.18)!important;
}

/* Teal — explicit utility aliases, including legacy buttons. */

.hcr .hcr-secondary-button,
.hcr .hcr-button-download,
.hcr .hcr-track-action,
.hcr .hcr-restore-order-button,
.hcr .hcr-render-order-edit,
.hcr .hcr-render-order-use,
.hcr .hcr-render-reset,
.hcr .hcr-render-condition-add,
.hcr .hcr-render-closest-button,
.hcr .hcr-security-back,
.hcr .hcr-export-button,
.hcr .hcr-show-completed {
  background: var(--staff-action-secondary)!important;
  border-color: var(--staff-action-secondary)!important;
  color: #fff!important;
  -webkit-text-fill-color: #fff!important;
  box-shadow: none!important;
}

.hcr .hcr-secondary-button:hover,
.hcr .hcr-secondary-button:focus,
.hcr .hcr-button-download:hover,
.hcr .hcr-button-download:focus,
.hcr .hcr-track-action:hover,
.hcr .hcr-track-action:focus,
.hcr .hcr-restore-order-button:hover,
.hcr .hcr-restore-order-button:focus,
.hcr .hcr-render-order-edit:hover,
.hcr .hcr-render-order-edit:focus,
.hcr .hcr-render-order-use:hover,
.hcr .hcr-render-order-use:focus,
.hcr .hcr-render-reset:hover,
.hcr .hcr-render-reset:focus,
.hcr .hcr-render-condition-add:hover,
.hcr .hcr-render-condition-add:focus,
.hcr .hcr-render-closest-button:hover,
.hcr .hcr-render-closest-button:focus,
.hcr .hcr-security-back:hover,
.hcr .hcr-security-back:focus,
.hcr .hcr-export-button:hover,
.hcr .hcr-export-button:focus,
.hcr .hcr-show-completed:hover,
.hcr .hcr-show-completed:focus {
  background: var(--staff-action-secondary-hover)!important;
  border-color: var(--staff-action-secondary-hover)!important;
  color: #fff!important;
  -webkit-text-fill-color: #fff!important;
  box-shadow: 0 3px 9px rgba(31,91,82,.16)!important;
}

/* Override page-specific legacy colours that used orange for utility controls. */

.hcr .hcr-show-completed[aria-expanded="false"],
.hcr .hcr-show-completed[aria-expanded="true"],
.hcr .hcr-render-search-bar>.hcr-render-closest-button,
.hcr .hcr-render-condition-actions .hcr-render-condition-add {
  background: var(--staff-action-secondary)!important;
  border-color: var(--staff-action-secondary)!important;
  color: #fff!important;
  -webkit-text-fill-color: #fff!important;
}

.hcr .hcr-show-completed[aria-expanded="false"]:hover,
.hcr .hcr-show-completed[aria-expanded="false"]:focus,
.hcr .hcr-show-completed[aria-expanded="true"]:hover,
.hcr .hcr-show-completed[aria-expanded="true"]:focus,
.hcr .hcr-render-search-bar>.hcr-render-closest-button:hover,
.hcr .hcr-render-search-bar>.hcr-render-closest-button:focus,
.hcr .hcr-render-condition-actions .hcr-render-condition-add:hover,
.hcr .hcr-render-condition-actions .hcr-render-condition-add:focus {
  background: var(--staff-action-secondary-hover)!important;
  border-color: var(--staff-action-secondary-hover)!important;
  color: #fff!important;
}

/* Red — destructive, cancellation, delete and send-back actions. */

.hcr .hcr-danger-button,
.hcr button.hcr-danger-button,
.hcr a.hcr-danger-button,
.hcr .hcr-cancel-order-button,
.hcr .hcr-delete-attachment {
  background: var(--staff-action-danger)!important;
  border-color: var(--staff-action-danger)!important;
  color: #fff!important;
  -webkit-text-fill-color: #fff!important;
  box-shadow: none!important;
}

.hcr .hcr-danger-button:hover,
.hcr .hcr-danger-button:focus,
.hcr .hcr-cancel-order-button:hover,
.hcr .hcr-cancel-order-button:focus,
.hcr .hcr-delete-attachment:hover,
.hcr .hcr-delete-attachment:focus {
  background: var(--staff-action-danger-hover)!important;
  border-color: var(--staff-action-danger-hover)!important;
  color: #fff!important;
  -webkit-text-fill-color: #fff!important;
  box-shadow: 0 3px 9px rgba(143,29,20,.18)!important;
}

/* Small destructive icon control in 3D Finder. */

.hcr .hcr-render-condition-remove:not(:disabled) {
  background: var(--staff-action-danger)!important;
  border-color: var(--staff-action-danger)!important;
  color: #fff!important;
}

.hcr .hcr-render-condition-remove:hover:not(:disabled),
.hcr .hcr-render-condition-remove:focus:not(:disabled) {
  background: var(--staff-action-danger-hover)!important;
  border-color: var(--staff-action-danger-hover)!important;
  color: #fff!important;
}

/* Compact utility links keep their existing footprint. */

.hcr .hcr-history-toggle {
  min-height: 30px!important;
  height: 30px!important;
  padding: 0 10px!important;
  border-radius: 7px!important;
  font-size: 10.5px!important;
  font-weight: 750!important;
}

.hcr .hcr-history-toggle.is-muted {
  background: var(--staff-action-secondary)!important;
  border-color: var(--staff-action-secondary)!important;
  color: #fff!important;
}

.hcr .hcr-risk-view-all {
  min-height: 34px!important;
  padding: 7px 11px!important;
  border-radius: 8px!important;
}

/* Standard Order header + New stays a primary action. */

.hcr .hcr-tabs a.hcr-context-tab.hcr-new-action {
  background: var(--staff-action-primary)!important;
  border-color: var(--staff-action-primary)!important;
  color: #fff!important;
}

.hcr .hcr-tabs a.hcr-context-tab.hcr-new-action:hover,
.hcr .hcr-tabs a.hcr-context-tab.hcr-new-action.is-context-active {
  background: var(--staff-action-primary-hover)!important;
  border-color: var(--staff-action-primary-hover)!important;
  color: #fff!important;
}

/* Accessible focus rings follow the same semantic colour. */

.hcr .hcr-primary-button:focus-visible,
.hcr .hcr-button-confirm:focus-visible {
  outline: 3px solid rgba(180,90,0,.24)!important;
  outline-offset: 2px;
}

.hcr .hcr-button:focus-visible,
.hcr .hcr-secondary-button:focus-visible,
.hcr .hcr-reset-button:focus-visible,
.hcr .hcr-history-toggle:focus-visible,
.hcr .hcr-risk-view-all:focus-visible {
  outline: 3px solid rgba(36,107,98,.22)!important;
  outline-offset: 2px;
}

.hcr .hcr-danger-button:focus-visible,
.hcr .hcr-cancel-order-button:focus-visible,
.hcr .hcr-delete-attachment:focus-visible,
.hcr .hcr-render-condition-remove:focus-visible {
  outline: 3px solid rgba(180,35,24,.24)!important;
  outline-offset: 2px;
}

/* v2.14.28 — specificity guards for page-level legacy rules */

body .hcr .hcr-order-actions button.hcr-button.hcr-cancel-order-button,
body .hcr .hcr-order-actions .hcr-cancel-order-button {
  background: var(--staff-action-danger)!important;
  border-color: var(--staff-action-danger)!important;
  color: #fff!important;
  -webkit-text-fill-color: #fff!important;
}

body .hcr .hcr-order-actions button.hcr-button.hcr-cancel-order-button:hover,
body .hcr .hcr-order-actions button.hcr-button.hcr-cancel-order-button:focus,
body .hcr .hcr-order-actions .hcr-cancel-order-button:hover,
body .hcr .hcr-order-actions .hcr-cancel-order-button:focus {
  background: var(--staff-action-danger-hover)!important;
  border-color: var(--staff-action-danger-hover)!important;
  color: #fff!important;
}

.hcr .hcr-dashboard-v241 .hcr-button.hcr-export-button,
.hcr-dashboard-v241 .hcr-button.hcr-export-button {
  background: var(--staff-action-secondary)!important;
  border-color: var(--staff-action-secondary)!important;
  color: #fff!important;
}

.hcr .hcr-dashboard-v241 .hcr-button.hcr-export-button:hover,
.hcr-dashboard-v241 .hcr-button.hcr-export-button:hover {
  background: var(--staff-action-secondary-hover)!important;
  border-color: var(--staff-action-secondary-hover)!important;
  color: #fff!important;
}

.hcr .hcr-render-search-bar>.hcr-render-closest-button,
.hcr .hcr-lazy-panel>summary .hcr-lazy-show-button {
  background: var(--staff-action-secondary)!important;
  border-color: var(--staff-action-secondary)!important;
  color: #fff!important;
}

.hcr .hcr-render-search-bar>.hcr-render-closest-button:hover,
.hcr .hcr-render-search-bar>.hcr-render-closest-button:focus,
.hcr .hcr-lazy-panel>summary:hover .hcr-lazy-show-button {
  background: var(--staff-action-secondary-hover)!important;
  border-color: var(--staff-action-secondary-hover)!important;
  color: #fff!important;
}

/* v2.14.29 — action hierarchy: primary solid, utility solid/outline, display controls neutral */

.hcr {
  --staff-action-secondary-soft: #F3F8F6;
  --staff-action-secondary-soft-hover: #E6F1ED;
  --staff-action-secondary-border: #8EAEA5;
  --staff-action-neutral: #5F6D68;
  --staff-action-neutral-border: #C7D1CD;
  --staff-action-neutral-hover: #F2F5F4;
}

/* Teal outline = secondary download/export utility. */

.hcr .hcr-secondary-outline-button,
.hcr a.hcr-secondary-outline-button,
.hcr button.hcr-secondary-outline-button,
.hcr .hcr-button.hcr-button-download,
.hcr .hcr-button.hcr-export-button.hcr-secondary-outline-button,
.hcr .hcr-dashboard-v241 .hcr-button.hcr-export-button.hcr-secondary-outline-button,
.hcr-dashboard-v241 .hcr-button.hcr-export-button.hcr-secondary-outline-button {
  background: var(--staff-action-secondary-soft)!important;
  border: 1px solid var(--staff-action-secondary-border)!important;
  color: var(--staff-action-secondary-hover)!important;
  -webkit-text-fill-color: var(--staff-action-secondary-hover)!important;
  box-shadow: none!important;
}

.hcr .hcr-secondary-outline-button:hover,
.hcr .hcr-secondary-outline-button:focus,
.hcr .hcr-button.hcr-button-download:hover,
.hcr .hcr-button.hcr-button-download:focus,
.hcr .hcr-button.hcr-export-button.hcr-secondary-outline-button:hover,
.hcr .hcr-button.hcr-export-button.hcr-secondary-outline-button:focus,
.hcr .hcr-dashboard-v241 .hcr-button.hcr-export-button.hcr-secondary-outline-button:hover,
.hcr .hcr-dashboard-v241 .hcr-button.hcr-export-button.hcr-secondary-outline-button:focus,
.hcr-dashboard-v241 .hcr-button.hcr-export-button.hcr-secondary-outline-button:hover,
.hcr-dashboard-v241 .hcr-button.hcr-export-button.hcr-secondary-outline-button:focus {
  background: var(--staff-action-secondary-soft-hover)!important;
  border-color: var(--staff-action-secondary)!important;
  color: var(--staff-action-secondary-hover)!important;
  -webkit-text-fill-color: var(--staff-action-secondary-hover)!important;
  box-shadow: 0 2px 7px rgba(31,91,82,.08)!important;
}

/* Neutral outline = reset/back-to-view/display controls. */

.hcr .hcr-neutral-outline-button,
.hcr a.hcr-neutral-outline-button,
.hcr button.hcr-neutral-outline-button,
.hcr .hcr-reset-button.hcr-neutral-outline-button,
.hcr .hcr-history-toggle.hcr-neutral-outline-button,
.hcr .hcr-history-toggle.hcr-neutral-outline-button.is-muted {
  background: #fff!important;
  border: 1px solid var(--staff-action-neutral-border)!important;
  color: var(--staff-action-neutral)!important;
  -webkit-text-fill-color: var(--staff-action-neutral)!important;
  box-shadow: none!important;
}

.hcr .hcr-neutral-outline-button:hover,
.hcr .hcr-neutral-outline-button:focus,
.hcr .hcr-reset-button.hcr-neutral-outline-button:hover,
.hcr .hcr-reset-button.hcr-neutral-outline-button:focus,
.hcr .hcr-history-toggle.hcr-neutral-outline-button:hover,
.hcr .hcr-history-toggle.hcr-neutral-outline-button:focus,
.hcr .hcr-history-toggle.hcr-neutral-outline-button.is-muted:hover,
.hcr .hcr-history-toggle.hcr-neutral-outline-button.is-muted:focus {
  background: var(--staff-action-neutral-hover)!important;
  border-color: #9EACA6!important;
  color: #43534D!important;
  -webkit-text-fill-color: #43534D!important;
  box-shadow: none!important;
}

/* Track is the dominant next action on Open Records and order lists. */

.hcr .hcr-button.hcr-track-action,
.hcr a.hcr-button.hcr-track-action,
.hcr .hcr-button.hcr-primary-button.hcr-track-action {
  background: var(--staff-action-primary)!important;
  border-color: var(--staff-action-primary)!important;
  color: #fff!important;
  -webkit-text-fill-color: #fff!important;
  box-shadow: none!important;
}

.hcr .hcr-button.hcr-track-action:hover,
.hcr .hcr-button.hcr-track-action:focus,
.hcr a.hcr-button.hcr-track-action:hover,
.hcr a.hcr-button.hcr-track-action:focus {
  background: var(--staff-action-primary-hover)!important;
  border-color: var(--staff-action-primary-hover)!important;
  color: #fff!important;
  -webkit-text-fill-color: #fff!important;
  box-shadow: 0 3px 9px rgba(150,74,0,.18)!important;
}

/* Focus rings for the two outline levels. */

.hcr .hcr-secondary-outline-button:focus-visible,
.hcr .hcr-button.hcr-button-download:focus-visible {
  outline: 3px solid rgba(36,107,98,.16)!important;
  outline-offset: 2px;
}

.hcr .hcr-neutral-outline-button:focus-visible {
  outline: 3px solid rgba(95,109,104,.14)!important;
  outline-offset: 2px;
}

/* ==========================================================================
   2. UI polish
   ========================================================================== */

/* Harbour Order System 2.14.50 — scoped staff UI consistency pass.
 * Loaded after page-specific CSS and the existing three-colour action theme.
 * Visual-only: no workflow, stage, data or permission changes.
 */

.hcr {
  --hcr-ui-control: 44px;
  --hcr-ui-radius: 9px;
  --hcr-ui-line: #d9e4dd;
  --hcr-ui-focus: rgba(36,107,98,.20);
}

.hcr :is(button,select,input,textarea,a,summary) {
  font-family: inherit;
}

.hcr :is(button,a,summary,input,select,textarea):focus-visible {
  outline: 2px solid #246b62;
  outline-offset: 2px;
}

.hcr :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea) {
  max-width: 100%;
  box-sizing: border-box;
}

.hcr textarea {
  min-width: 0;
  max-width: 100%;
  line-height: 1.5;
  resize: vertical;
  border-radius: var(--hcr-ui-radius);
}

.hcr :is(input,select,textarea):disabled {
  opacity: .65;
  cursor: not-allowed;
}

.hcr :is(.hcr-standard-card,.hcr-standard-renderings,.hcr-standard-attachments,.hcr-standard-progress,.hcr-order-card) {
  min-width: 0;
}

.hcr :is(.hcr-standard-section-head,.hcr-order-card-head) {
  gap: 12px;
}

.hcr :is(.hcr-standard-section-head,.hcr-order-card-head) h3 {
  line-height: 1.3;
}

.hcr :is(.hcr-standard-section-head,.hcr-order-card-head) p {
  line-height: 1.5;
}

/* Keep stage choices compact and counts visibly secondary to the label. */

.hcr .hcr-order-quick-filters {
  gap: 8px;
  align-items: center;
}

.hcr .hcr-order-quick {
  gap: 8px;
  min-height: 40px;
  line-height: 1.2;
  text-decoration: none;
}

.hcr .hcr-order-quick strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.56);
  font-size: 11px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.hcr .hcr-order-quick.is-active strong {
  background: rgba(255,255,255,.19);
  color: inherit;
}

/* Inputs and action buttons share one baseline across Custom and Standard filters. */

.hcr .hcr-filters :is(input[type="search"],input[type="date"],select) {
  height: 44px;
  min-height: 44px;
}

.hcr .hcr-filters .hcr-filter-actions {
  gap: 8px;
  white-space: nowrap;
}

.hcr .hcr-filters .hcr-order-advanced summary {
  min-height: 44px;
}

.hcr .hcr-filters .hcr-order-advanced[open] {
  z-index: 35;
}

.hcr .hcr-filters .hcr-filter-range {
  box-sizing: border-box;
}

/* Table scanability: quiet dividers, consistent vertical alignment, visible scrollbar. */

.hcr .hcr-table-wrap {
  max-width: 100%;
  scrollbar-width: thin;
  scrollbar-color: #c2d1c9 transparent;
}

.hcr .hcr-table th {
  line-height: 1.35;
  vertical-align: middle;
}

.hcr .hcr-table td {
  line-height: 1.5;
  vertical-align: middle;
}

.hcr .hcr-table tbody tr:focus-within td {
  background: #f0f7f3;
}

.hcr .hcr-table .hcr-record {
  line-height: 1.4;
}

.hcr :is(.hcr-status,.hcr-standard-status,.hcr-standard-render-badge) {
  line-height: 1.3;
}

.hcr :is(.hcr-standard-file-row,.hcr-standard-feedback-item) {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* 3D review: one clear decision row, with the revision form below it. */

.hcr .hcr-3d-review-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hcr .hcr-3d-review-actions > form {
  margin: 0;
}

.hcr .hcr-3d-review-actions > button,
.hcr .hcr-3d-review-actions > .hcr-3d-confirm-form > .hcr-button {
  min-height: 44px;
}

.hcr .hcr-3d-change-panel {
  clear: both;
  max-width: 100%;
  border-radius: var(--hcr-ui-radius);
}

.hcr .hcr-3d-change-panel[hidden] {
  display: none!important;
}

.hcr .hcr-3d-change-panel textarea {
  min-height: 100px;
}

.hcr .hcr-3d-change-panel-actions {
  flex-wrap: wrap;
}

.hcr .hcr-standard-feedback-item p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Keep click targets usable without changing existing action colours. */

.hcr .hcr-3d-review-actions :is(button,.hcr-button),
.hcr .hcr-3d-change-panel-actions :is(button,.hcr-button) {
  border-radius: var(--hcr-ui-radius);
}

@media (max-width:760px) {
  .hcr .hcr-order-quick-filters {
    gap: 6px;
    padding: 9px;
  }
  .hcr .hcr-order-quick {
    min-height: 38px;
  }
  .hcr .hcr-filters .hcr-filter-actions {
    width: 100%;
  }
  .hcr .hcr-filters .hcr-order-advanced[open] {
    z-index: 10;
  }
  .hcr .hcr-3d-review-actions {
    align-items: stretch;
  }
  .hcr .hcr-3d-review-actions > button,
  .hcr .hcr-3d-review-actions > .hcr-3d-confirm-form {
    flex: 1 1 180px;
    min-width: 0;
  }
  .hcr .hcr-3d-review-actions > .hcr-3d-confirm-form > .hcr-button {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width:480px) {
  .hcr .hcr-3d-change-panel-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .hcr .hcr-3d-change-panel-actions > * {
    min-width: 0;
    width: 100%;
  }
  .hcr .hcr-table-wrap {
    border-radius: 9px;
  }
}

@media (prefers-reduced-motion:reduce) {
  .hcr :is(button,a,input,select,textarea) {
    transition: none!important;
  }
}

/* v2.14.53 — role-specific Standard Order work inbox and Open Records shortcut */

.hcr .hcr-standard-quick-filters {
  gap: 8px;
}

.hcr .hcr-order-quick[data-stage="delivered"] {
  --stage-bg: #eaf2ed;
  --stage-border: #c4d9cb;
  --stage-ink: #366a4a;
  --stage-solid: #397451;
}

.hcr .hcr-standard-next-action {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 7px;
  background: #fff1e8;
  color: #88502f;
  font-weight: 650;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
}

@media (max-width:760px) {
  .hcr .hcr-standard-next-action {
    white-space: normal;
  }
}

.hcr .hcr-standard-action-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 13px;
  margin: 0 0 14px;
  border: 1px solid #efcfb6;
  border-radius: 9px;
  background: #fff8f2;
  color: #86512f;
}

.hcr .hcr-standard-action-notice strong {
  font-size: 12px;
  font-weight: 750;
}

.hcr .hcr-standard-action-notice span {
  font-size: 13px;
  font-weight: 650;
}

.hcr .hcr-view-locked .hcr-standard-next-action {
  white-space: normal;
  max-width: 220px;
}

/* v2.14.56 — lifecycle + role/status filters in one Search-card bottom row.
   Desktop stays on one line; narrower screens scroll status chips rather than
   wrapping into a second row. This affects only Custom/Standard order lists. */

.hcr .hcr-order-search-panel {
  box-sizing: border-box;
  margin: 0 0 14px;
  padding: 12px 13px 11px;
  border: 1px solid #dce7e1;
  border-radius: 12px;
  background: #fff;
  min-width: 0;
}

.hcr .hcr-order-search-panel > form.hcr-filters {
  margin: 0!important;
  padding: 0 0 13px!important;
  border: 0!important;
  box-shadow: none!important;
  background: transparent!important;
  border-radius: 0!important;
}

.hcr .hcr-order-search-panel .hcr-order-nav-row {
  display: grid;
  grid-template-columns: max-content minmax(0,1fr);
  align-items: center;
  gap: clamp(22px,4vw,72px);
  min-width: 0;
  border-top: 1px solid #e8eee9;
  padding-top: 12px;
}

.hcr .hcr-order-lifecycle {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-wrap: nowrap;
  min-width: 0;
}

.hcr .hcr-order-lifecycle-link {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 6px 13px;
  border-radius: 8px;
  border: 1px solid #bed2c8;
  background: #f2f7f4;
  color: #2d6055!important;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none!important;
}

.hcr .hcr-order-lifecycle-link strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 23px;
  padding: 0 6px;
  box-sizing: border-box;
  border-radius: 99px;
  background: rgba(49,107,92,.10);
  font-size: 11px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.hcr .hcr-order-lifecycle-link.is-active {
  background: #386e64;
  border-color: #386e64;
  color: #fff!important;
}

.hcr .hcr-order-lifecycle-link.is-active strong {
  background: rgba(255,255,255,.2);
  color: #fff;
}

.hcr .hcr-order-lifecycle-link:hover {
  border-color: #397c6d;
}

.hcr .hcr-order-status-shelf {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: #b7c8c0 transparent;
}

.hcr .hcr-order-search-panel .hcr-order-quick-filters.hcr-order-inline-status {
  display: flex!important;
  justify-content: flex-end;
  flex-wrap: nowrap!important;
  width: max-content;
  min-width: 100%;
  gap: 7px;
  box-sizing: border-box;
  margin: 0!important;
  padding: 0!important;
  border: 0!important;
  border-radius: 0!important;
  box-shadow: none!important;
  background: transparent!important;
}

.hcr .hcr-order-search-panel .hcr-order-quick {
  min-height: 40px;
  flex: none;
}

@media (max-width:960px) {
  .hcr .hcr-order-search-panel .hcr-order-nav-row {
    gap: 20px;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  .hcr .hcr-order-status-shelf {
    overflow: visible;
  }
  .hcr .hcr-order-search-panel .hcr-order-quick-filters.hcr-order-inline-status {
    min-width: 0;
  }
}

@media (max-width:620px) {
  .hcr .hcr-order-search-panel {
    padding: 10px;
  }
  .hcr .hcr-order-search-panel .hcr-order-nav-row {
    gap: 18px;
    padding-top: 10px;
  }
  .hcr .hcr-order-lifecycle-link {
    height: 38px;
    padding: 6px 10px;
    font-size: 11px;
  }
  .hcr .hcr-order-search-panel .hcr-order-quick {
    min-height: 38px;
    font-size: 11px;
  }
}

/* v2.14.58 — semantic, grouped colours for order lifecycle and Open Records.
   Scoped to order search navigation; does not alter action button colours or
   the search form grid introduced in v2.14.57. */

.hcr .hcr-order-lifecycle-link[data-bucket="open"] {
  --lifecycle-bg: #e8f4f2;
  --lifecycle-border: #bdd9d3;
  --lifecycle-ink: #2c665c;
  --lifecycle-solid: #357467;
}

.hcr .hcr-order-lifecycle-link[data-bucket="locked"] {
  --lifecycle-bg: #fff4e1;
  --lifecycle-border: #ebd6ab;
  --lifecycle-ink: #865b20;
  --lifecycle-solid: #987028;
}

.hcr .hcr-order-lifecycle-link[data-bucket="production"] {
  --lifecycle-bg: #eaf1fc;
  --lifecycle-border: #c3d4ee;
  --lifecycle-ink: #315f93;
  --lifecycle-solid: #366ca6;
}

.hcr .hcr-order-lifecycle-link[data-bucket="delivered"] {
  --lifecycle-bg: #e9f5e9;
  --lifecycle-border: #c7dec7;
  --lifecycle-ink: #346a42;
  --lifecycle-solid: #3f7c50;
}

.hcr .hcr-order-search-panel .hcr-order-lifecycle-link[data-bucket] {
  background: var(--lifecycle-bg);
  border-color: var(--lifecycle-border);
  color: var(--lifecycle-ink)!important;
}

.hcr .hcr-order-search-panel .hcr-order-lifecycle-link[data-bucket]:hover {
  border-color: var(--lifecycle-solid);
  box-shadow: inset 0 0 0 1px var(--lifecycle-solid);
}

.hcr .hcr-order-search-panel .hcr-order-lifecycle-link[data-bucket].is-active {
  background: var(--lifecycle-solid);
  border-color: var(--lifecycle-solid);
  color: #fff!important;
}

.hcr .hcr-order-search-panel .hcr-order-lifecycle-link[data-bucket]:focus-visible {
  outline: 2px solid var(--lifecycle-solid);
  outline-offset: 2px;
}

.hcr .hcr-order-search-panel .hcr-order-lifecycle-link[data-bucket] strong {
  background: rgba(17,56,48,.09);
  color: inherit;
}

.hcr .hcr-order-search-panel .hcr-order-lifecycle-link[data-bucket].is-active strong {
  background: rgba(255,255,255,.20);
  color: #fff;
}

/* Open Records: individual status chips, no nested frames or group wrappers. */

.hcr .hcr-custom-nav-row .hcr-order-quick[data-stage="new"] {
  --stage-bg: #f3eafd;
  --stage-border: #dac6f1;
  --stage-ink: #713d93;
  --stage-solid: #783da1;
}

.hcr .hcr-custom-nav-row .hcr-order-quick[data-stage="following"] {
  --stage-bg: #dff6f3;
  --stage-border: #a9dcd5;
  --stage-ink: #146960;
  --stage-solid: #187669;
}

.hcr .hcr-custom-nav-row .hcr-order-quick[data-stage="unconverted"] {
  --stage-bg: #ffe8e3;
  --stage-border: #eabcb2;
  --stage-ink: #945047;
  --stage-solid: #ad574c;
}

.hcr .hcr-custom-nav-row .hcr-order-quick[data-stage="ready_to_lock"] {
  --stage-bg: #e5f4e5;
  --stage-border: #bedbbf;
  --stage-ink: #326c43;
  --stage-solid: #3f7c50;
}

/* v2.14.61 — shared Search control group. Old Custom/Standard grid selectors
   were removed from the shared PHP component instead of being overwritten.
   Filters/Search/Reset now live in one grid cell, so they cannot collide even
   when legacy theme styles declare other grid columns. */

.hcr .hcr-order-search-panel > form.hcr-filters.hcr-unified-order-filters {
  --hcr-search-action-width: 100px;
  --hcr-search-control-height: 44px;
  display: grid!important;
  grid-template-columns: minmax(0,1fr) minmax(155px,260px) max-content!important;
  grid-auto-flow: row!important;
  gap: 12px!important;
  align-items: end!important;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 0!important;
  padding: 0 0 12px!important;
  border: 0!important;
  background: transparent!important;
  box-shadow: none!important;
}

.hcr .hcr-order-search-panel form.hcr-unified-order-filters.hcr-no-store {
  grid-template-columns: minmax(0,1fr) max-content!important;
}

.hcr .hcr-order-search-panel form.hcr-unified-order-filters > .hcr-filter-query,
.hcr .hcr-order-search-panel form.hcr-unified-order-filters > .hcr-filter-store,
.hcr .hcr-order-search-panel form.hcr-unified-order-filters > .hcr-search-controls {
  min-width: 0;
  grid-column: auto!important;
  grid-row: auto!important;
  align-self: end!important;
  margin: 0!important;
}

.hcr .hcr-order-search-panel form.hcr-unified-order-filters > label > span {
  display: block;
  margin: 0 0 6px!important;
  min-height: 14px;
  font-size: 11px;
  line-height: 14px;
  font-weight: 750;
}

.hcr .hcr-order-search-panel form.hcr-unified-order-filters :is(input[type="search"],select) {
  box-sizing: border-box;
  width: 100%;
  height: var(--hcr-search-control-height)!important;
  min-height: var(--hcr-search-control-height)!important;
  margin: 0!important;
}

.hcr .hcr-order-search-panel form.hcr-unified-order-filters .hcr-search-controls {
  display: grid!important;
  grid-template-columns: repeat(3,var(--hcr-search-action-width))!important;
  align-items: end!important;
  justify-content: end;
  column-gap: 10px!important;
  width: max-content;
  max-width: 100%;
  min-height: var(--hcr-search-control-height);
}

.hcr .hcr-order-search-panel form.hcr-unified-order-filters .hcr-search-controls > .hcr-order-advanced {
  grid-column: auto!important;
  grid-row: auto!important;
  box-sizing: border-box!important;
  position: relative;
  z-index: 12;
  width: var(--hcr-search-action-width)!important;
  min-width: 0!important;
  max-width: 100%!important;
  margin: 0!important;
}

.hcr .hcr-order-search-panel form.hcr-unified-order-filters .hcr-search-controls > .hcr-filter-actions {
  grid-column: 2/4!important;
  grid-row: 1!important;
  display: flex!important;
  flex-wrap: nowrap!important;
  gap: 10px!important;
  grid-template-columns: none!important;
  align-items: center!important;
  justify-content: stretch!important;
  width: auto!important;
  min-width: 0!important;
  margin: 0!important;
  padding: 0!important;
}

.hcr .hcr-order-search-panel form.hcr-unified-order-filters .hcr-search-controls .hcr-order-advanced summary,
.hcr .hcr-order-search-panel form.hcr-unified-order-filters .hcr-search-controls .hcr-filter-actions > :is(button,a) {
  box-sizing: border-box!important;
  display: inline-flex!important;
  align-items: center!important;
  justify-content: center!important;
  width: var(--hcr-search-action-width)!important;
  min-width: 0!important;
  max-width: 100%!important;
  height: var(--hcr-search-control-height)!important;
  min-height: var(--hcr-search-control-height)!important;
  max-height: var(--hcr-search-control-height)!important;
  padding: 0 10px!important;
  margin: 0!important;
  border-radius: 8px!important;
  font-size: 12px!important;
  line-height: 1.2!important;
  font-weight: 750!important;
  text-align: center!important;
  white-space: nowrap!important;
  flex: none!important;
  transform: none!important;
}

@media (max-width:980px) {
  .hcr .hcr-order-search-panel > form.hcr-filters.hcr-unified-order-filters.hcr-has-store {
    grid-template-columns: minmax(0,1fr) minmax(155px,240px)!important;
  }
  .hcr .hcr-order-search-panel > form.hcr-filters.hcr-unified-order-filters.hcr-no-store {
    grid-template-columns: minmax(0,1fr)!important;
  }
  .hcr .hcr-order-search-panel form.hcr-unified-order-filters > .hcr-search-controls {
    grid-column: 1/-1!important;
    width: max-content;
    justify-self: start;
  }
}

@media (max-width:620px) {
  .hcr .hcr-order-search-panel > form.hcr-filters.hcr-unified-order-filters {
    grid-template-columns: minmax(0,1fr)!important;
  }
  .hcr .hcr-order-search-panel form.hcr-unified-order-filters > :is(.hcr-filter-query,.hcr-filter-store,.hcr-search-controls) {
    grid-column: 1/-1!important;
  }
  .hcr .hcr-order-search-panel form.hcr-unified-order-filters > .hcr-search-controls {
    width: 100%!important;
    grid-template-columns: repeat(3,minmax(0,1fr))!important;
    justify-self: stretch;
    column-gap: 8px!important;
  }
  .hcr .hcr-order-search-panel form.hcr-unified-order-filters .hcr-search-controls > .hcr-order-advanced {
    width: 100%!important;
  }
  .hcr .hcr-order-search-panel form.hcr-unified-order-filters .hcr-search-controls > .hcr-filter-actions {
    gap: 8px!important;
  }
  .hcr .hcr-order-search-panel form.hcr-unified-order-filters .hcr-search-controls .hcr-order-advanced summary {
    width: 100%!important;
  }
  .hcr .hcr-order-search-panel form.hcr-unified-order-filters .hcr-search-controls .hcr-filter-actions > :is(button,a) {
    width: calc(50% - 4px)!important;
    flex: 1 1 0!important;
  }
}

/* v2.14.66 — preserve the original compact ! 3D pending status badge.
   Only highlight the surrounding order row / 3D review card for store and
   admin views. Never enlarge the badge or append an extra Review 3D label. */

.hcr .hcr-table tbody tr.hcr-store-3d-pending-row td {
  background: #ffedcf;
}

.hcr .hcr-table tbody tr.hcr-store-3d-pending-row td:first-child {
  border-left: 3px solid #c76e19;
}

.hcr .hcr-table tbody tr.hcr-store-3d-pending-row:hover td {
  background: #ffe2b9;
}

.hcr .hcr-step-card.hcr-store-3d-pending-card,
.hcr .hcr-standard-renderings.hcr-store-3d-pending-card {
  border: 1px solid #e5b67d;
  border-left: 4px solid #cb7624;
  background: #fffdf9;
  box-shadow: 0 4px 16px rgba(164,92,23,.07);
}

