.order-list-wrap {width:100%;margin-top:20px;border:1px solid var(--border);border-radius:14px;overflow:auto;background:var(--theme-paper,#fff)}
.order-table {width:100%;border-collapse:collapse;font-size:14px;line-height:1.4}
.order-table th,.order-table td {padding:15px 12px;border-bottom:1px solid var(--border);vertical-align:top;text-align:left}
.order-table th {font-size:12px;font-weight:650;background:var(--theme-page,#f6f7f4);color:var(--muted)}
.order-table .order-overdue-band th {padding:8px 12px;color:var(--theme-text,#293e34);background:var(--theme-soft,#edf3ee)}
.order-table tbody tr:last-child td {border-bottom:0}
.order-table tbody tr:hover {background:var(--theme-page,#f6f7f4)}
.order-table td small,.order-cell-title span,.order-cell-status>strong {display:block;margin-top:5px}
.order-table td small {font-size:12px;color:var(--muted)}
.order-cell-title {min-width:180px;max-width:280px;overflow-wrap:anywhere}
.order-cell-title strong {color:var(--dark)}
.order-cell-status {min-width:150px;max-width:210px}
.order-cell-money {font-variant-numeric:tabular-nums;white-space:nowrap}
.order-cell-money.has-balance {font-weight:650}
.order-cell-date {white-space:nowrap;font-variant-numeric:tabular-nums}
.order-table .order-sort-heading {display:flex;gap:6px;align-items:center;border:0;border-radius:0;background:none;box-shadow:none;padding:0;color:inherit;font:inherit;text-align:left;min-height:36px}
.order-sort-heading:hover,.order-sort-heading:focus-visible {color:var(--green);text-decoration:underline}
.order-table .order-sort-heading {box-shadow:none!important;background:none!important}
.order-indicators {display:flex;flex-wrap:wrap;gap:5px;margin-top:8px}
.order-indicator {display:inline-block;border:1px solid var(--border);border-radius:5px;padding:3px 6px;font-size:11px;color:var(--muted);background:var(--theme-page,#f6f7f4)}
.order-indicator.done {border-color:var(--green);color:var(--dark)}
.order-indicator.pending {border-color:#b58b36;color:var(--theme-text,#293e34)}
.order-cell-actions button {font-size:13px;padding:8px 10px;min-height:38px}
.order-row-actions {margin-top:10px;font-size:12px}
.order-row-actions summary {cursor:pointer;color:var(--muted)}
.order-row-actions button {display:block;margin-top:6px;white-space:normal}
.order-dealer {font-weight:600}
.order-view-extras {margin:12px 0;font-size:14px}
.order-view-extras summary {cursor:pointer;color:var(--muted)}
.order-view-extras select {max-width:320px;margin-top:8px}
.order-view-help {font-size:13px;line-height:1.5;color:var(--muted);max-width:900px}
.order-sort-controls {display:flex;flex-wrap:wrap;gap:12px;margin-top:12px}
.order-sort-controls>div {flex:1 1 180px;max-width:300px}
@media screen and (min-width:761px) {
 .order-list-wrap[data-pin-header] thead {position:relative;z-index:2;transform:translateY(var(--order-header-shift,0px))}
 .order-list-wrap[data-header-pinned] thead {box-shadow:0 1px 0 var(--border),0 4px 8px var(--theme-shadow,#244f3b14)}
}
@media(max-width:760px) {
 .order-list-wrap {border:0;overflow:visible;background:transparent}
 .order-table,.order-table tbody {display:block;width:100%}
 .order-table .order-overdue-band,.order-table .order-overdue-band th {display:block}
 .order-table thead {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 .order-table .order-table-row {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0 12px;padding:16px;margin-bottom:12px;border:1px solid var(--border);border-radius:12px;background:var(--theme-paper,#fff)}
 .order-table td {display:block;padding:10px 0;border:0;min-width:0;max-width:none;white-space:normal;overflow-wrap:anywhere}
 .order-table td[data-label]::before {content:attr(data-label);display:block;font-size:11px;color:var(--muted);margin-bottom:5px}
 .order-table .order-cell-title,.order-table .order-cell-status,.order-table .order-cell-actions {grid-column:1/-1}
 .order-table .order-cell-title::before {display:none}
 .order-cell-actions {display:flex!important;align-items:center;gap:18px}
 .order-row-actions {margin:0}
 .order-sort-controls>div {max-width:none}
}

/* Manager queue: a single compact filter bar; sorting lives in the table header. */
#queue-filters.manager-request-filters {
  grid-template-columns: minmax(210px,1.5fr) max-content minmax(105px,.7fr) minmax(180px,1.4fr) auto;
  gap: 8px 10px;
  align-items: end;
  padding: 10px;
  margin: 12px 0 8px;
}
#queue-filters.manager-request-filters:has(#queue-shipment) {
  grid-template-columns: minmax(210px,1.5fr) max-content minmax(105px,.7fr) minmax(125px,.9fr) minmax(160px,1.2fr) auto;
}
#queue-filters :is(label,.queue-filter-label) {display:block;font-size:12px;line-height:1.3;margin:0 0 5px;color:var(--muted)}
#queue-filters :is(input:not([type="hidden"]),select) {min-height:38px;height:38px;padding-block:7px;font-size:13px}
#queue-filters .queue-search-field {grid-column:auto}
#queue-filters .dealer-picker-control > button {min-height:36px;height:36px}
#queue-filters #queue-dealer-picker > label {color:var(--theme-accent,var(--green,#376e52));font-weight:700}
#queue-filters #queue-dealer-search {border-color:var(--theme-accent,var(--green,#376e52));font-weight:600}
#queue-filters #queue-dealer-search::placeholder {color:var(--theme-text,#183b35);opacity:1;font-weight:500}
#queue-filters .queue-kind-buttons {display:flex;gap:5px}
#queue-filters [data-queue-kind] {display:flex;align-items:center;gap:4px;min-height:38px;padding:7px 10px;font-size:13px;white-space:nowrap;margin:0}
#queue-filters [data-queue-kind][aria-pressed="true"] {background:var(--green,#376e52);border-color:var(--green,#376e52);color:#fff}
#queue-filters [data-queue-kind][aria-pressed="false"] .queue-kind-check {visibility:hidden}
#queue-filters #queue-reset {min-height:32px;min-width:0;margin:0 0 3px;padding:5px 8px;font-size:12px;justify-self:center;grid-column:auto;white-space:nowrap}
.queue-secondary-controls {display:flex;flex-wrap:wrap;align-items:start;gap:4px 18px;margin:4px 0 8px}
.queue-secondary-controls :is(.order-view-extras,.queue-view-help) {margin:0;font-size:12px;color:var(--muted)}
.queue-view-help summary {cursor:pointer}
.queue-view-help[open] {flex-basis:100%}
.queue-view-help .order-view-help {margin:8px 0}
#main:has(#queue-filters[data-shipment-active]) .queue-secondary-controls {display:none}
#queue-focus-filters {gap:6px;margin-block:8px}
#queue-focus-filters button {min-height:36px;padding:6px 10px;font-size:13px}
#queue-summary {margin-block:6px;font-size:12px}
#queue .order-list-wrap {margin-top:10px}
@media (max-width:1149px) {
  #queue-filters.manager-request-filters,
  #queue-filters.manager-request-filters:has(#queue-shipment) {grid-template-columns:repeat(4,minmax(0,1fr))}
  #queue-filters .queue-kind-field {grid-column:span 2}
  #queue-filters #queue-dealer-slot,
  #queue-filters .queue-search-field {grid-column:span 2}
  #queue-filters #queue-reset {grid-column:1/-1;justify-self:center;margin:0}
}

/* One original dealer picker remains usable below navigation while the queue scrolls. */
#queue-filters #queue-dealer-picker[data-queue-pinned] {
  position:fixed;top:var(--queue-dealer-top);left:var(--queue-dealer-left);width:var(--queue-dealer-width);
  z-index:20;box-sizing:border-box;display:flex;align-items:center;gap:10px;
  padding:6px 10px;border:1px solid var(--border);border-radius:10px;
  background:var(--theme-paper,#fff);box-shadow:0 3px 10px var(--theme-shadow,#244f3b14);
}
#queue-filters #queue-dealer-picker[data-queue-pinned] > label {margin:0;flex:0 0 auto}
#queue-filters #queue-dealer-picker[data-queue-pinned] .dealer-picker-control {flex:1;min-width:0;max-width:380px}
#queue-filters #queue-dealer-picker[data-queue-pinned] .dealer-picker-panel {right:auto;width:min(100%,450px);box-sizing:border-box}
#queue-filters #queue-dealer-picker[data-queue-pinned] [role="listbox"] {max-height:var(--queue-dealer-list-height,280px)}
@media print {
  #queue-filters #queue-dealer-picker[data-queue-pinned] {display:none}
}
@media (max-width:760px) {
  #queue-filters.manager-request-filters,
  #queue-filters.manager-request-filters:has(#queue-shipment) {grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:10px}
  #queue-filters .queue-kind-field {grid-column:1/-1}
  #queue-filters .queue-kind-buttons > button {flex:1;justify-content:center;min-height:40px}
  #queue-filters :is(input:not([type="hidden"]),select) {min-height:40px;height:40px;font-size:14px}
  #queue-filters #queue-reset {min-height:36px}
  /* Expose the same two header buttons above mobile cards, without duplicate controls. */
  .order-list-wrap[data-pin-header] .order-table thead {position:static;display:block;width:auto;height:auto;overflow:visible;clip-path:none;margin-bottom:8px}
  .order-list-wrap[data-pin-header] .order-table thead tr {display:flex;gap:8px}
  .order-list-wrap[data-pin-header] .order-table thead th {display:none}
  .order-list-wrap[data-pin-header] .order-table thead th:has([data-order-sort]) {display:block;flex:1;padding:5px 8px;border:1px solid var(--border);border-radius:8px;background:var(--theme-paper,#fff)}
  .order-list-wrap[data-pin-header] .order-sort-heading {width:100%;min-height:36px;justify-content:space-between}
}
