/* Operational layout layered on the white/orange product theme. */
:root { --ux-space: 18px; }
body { font-size: 14px; }
main { padding: 28px 28px 40px; }
.shell { grid-template-columns: 228px minmax(0, 1fr); }
.sidebar { padding: 25px 14px 20px; gap: 26px; }
.nav { gap: 23px; }
.nav button { min-height: 44px; font-size: 14px; padding: 10px 12px; }
.nav-group-label { font-size: 12px; letter-spacing: .5px; }
.nav .pill, .sidebar-note { font-size: 12px; }
.sidebar-note { line-height: 1.75; }
.topbar:has(.page-heading) { margin-bottom: 18px; gap: 14px 22px; }
.page-heading h1 { font-size: 30px; line-height: 1.3; }
.eyebrow { font-size: 12px; letter-spacing: .7px; margin-bottom: 6px; }
.page-description { font-size: 14px; line-height: 1.65; margin-top: 7px; }
.page-tools { padding-top: 0; gap: 8px; }
.page-tools .button, .page-aux-actions>summary { min-height: 40px; font-size: 13px; }
.date-picker, .context-bar, .module-context { font-size: 13px; }
.context-bar, .module-context { padding: 11px 14px; margin-bottom: 18px; }
.context-main strong { font-size: 13px; }
.context-bar .saved-state, .context-bar .pill { font-size: 12px; }
.panel+.panel { margin-top: 18px; }
.panel-head { padding: 17px 19px; gap: 14px; }
.panel-head h2 { font-size: 17px; }
.panel-head small, .metric-foot, .footer, .hint, td small { font-size: 12px; line-height: 1.65; }
.panel-body { padding: 19px; }
.button { font-size: 14px; }
.button.small { min-height: 36px; font-size: 13px; }
table { font-size: 14px; }
th { font-size: 12px; }
.table-toolbar { padding: 15px 19px; }
.settings-section-heading p, .permission-role-card p, .permission-role-card li { font-size: 13px; }

/* Compact figures do not displace the orders the dispatcher came to maintain. */
.orders-compact-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin: 0 0 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.orders-compact-summary>div { min-width: 0; padding: 15px 19px; border-right: 1px solid var(--line-soft); }
.orders-compact-summary>div:last-child { border-right: 0; }
.orders-compact-summary dt { margin: 0 0 5px; color: var(--muted); font-size: 13px; }
.orders-compact-summary dd { margin: 0; font-size: 25px; font-weight: 750; line-height: 1.3; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.orders-compact-summary dd small { font-size: 12px; margin-left: 7px; color: var(--muted); font-weight: 400; }
.orders-panel>.panel-head { align-items: center; }
.orders-actions { gap: 8px; align-items: flex-start; width: auto; }
.orders-actions>.button { min-height: 42px; }
.orders-more-actions { min-width: 0; }
.orders-more-actions>summary, .order-row-more>summary, .manual-stop-more>summary { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 6px 11px; border: 1px solid #dfe3e7; border-radius: 9px; background: #fff; color: #4c5865; font-size: 13px; line-height: 1.6; cursor: pointer; list-style: none; user-select: none; }
.orders-more-actions>summary { min-height: 42px; padding: 9px 13px; }
.orders-more-actions>summary::-webkit-details-marker, .order-row-more>summary::-webkit-details-marker, .manual-stop-more>summary::-webkit-details-marker { display: none; }
.orders-more-actions[open]>summary, .order-row-more[open]>summary, .manual-stop-more[open]>summary { color: var(--accent); border-color: #e3bba7; background: #fff5ee; }
.orders-more-actions>summary:hover, .order-row-more>summary:hover, .manual-stop-more>summary:hover { background: #f5f7f9; }
.orders-more-actions>div { display: grid; gap: 7px; max-width: 250px; padding: 10px 0 0; }
.orders-more-actions>div .button { margin: 0; justify-content: flex-start; white-space: normal; }
.orders-more-actions>div .hint { margin: 0; max-width: 250px; }
.orders-filter-section { background: #fafbfc; border-bottom: 1px solid var(--line); }
.orders-panel .order-queue-tabs { padding: 13px 19px 0; border-bottom: 0; background: transparent; gap: 7px; }
.order-queue-tab { font-size: 13px; min-height: 38px; padding: 8px 12px; }
.order-queue-tab span { min-width: 16px; font-weight: 650; }
.orders-panel .order-queue-filters { padding: 13px 19px; gap: 10px 16px; align-items: center; border-bottom: 0; }
.orders-search { flex: 1 1 280px; min-width: 180px; }
.orders-panel .orders-search #search { width: 100%; max-width: 420px; min-height: 42px; font-size: 14px; background: #fff; }
.order-area-filter { font-size: 13px; gap: 9px; }
.order-area-filter select { max-width: 200px; min-height: 42px; font-size: 13px; background: #fff; }
.orders-result-count { margin-left: auto; white-space: nowrap; }
.orders-table { min-width: 960px; width: 100%; white-space: normal; }
.orders-panel .orders-table th { padding: 12px 16px; background: #f7f8fa; }
.orders-panel .orders-table td { padding: 16px; vertical-align: top; line-height: 1.6; }
.orders-table th:nth-child(1) { width: 24%; }
.orders-table th:nth-child(2) { width: 15%; }
.orders-table th:nth-child(3) { width: 25%; }
.orders-table th:nth-child(4) { width: 12%; }
.orders-table th:nth-child(5) { width: 13%; }
.orders-table th:nth-child(6) { width: 11%; }
.orders-panel .orders-table td:first-child { min-width: 190px; max-width: 310px; }
.order-customer-name { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.order-customer-name strong { font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.order-customer-name .pill { padding: 2px 6px; font-size: 12px; }
.order-customer-cell small { white-space: normal; overflow-wrap: anywhere; }
.order-address-cell { min-width: 200px; max-width: 350px; }
.order-full-address { display: block; font-size: 14px; line-height: 1.7; color: #394451; overflow-wrap: anywhere; white-space: normal; }
.orders-table .order-queue-assignment { font-size: 13px; min-width: 0; }
.orders-table .order-queue-assignment small { margin-top: 2px; }
.orders-table .order-queue-status { font-size: 12px; }
.order-window-cell>span { white-space: nowrap; font-variant-numeric: tabular-nums; }
.order-location-pending { font-size: 12px; font-weight: 600; }
.order-actions-cell { min-width: 118px; }
.order-row-actions { display: grid; justify-items: stretch; gap: 7px; min-width: 82px; }
.order-row-actions>.button { width: 100%; white-space: nowrap; }
.order-row-more-content { display: grid; gap: 6px; padding: 8px 0 0; }
.order-row-more-content .button { justify-content: flex-start; width: 100%; text-align: left; line-height: 1.55; white-space: normal; padding: 8px 9px; }
/* More actions expand within their own row, including the final table row. */
.order-row-more[open] { min-width: 128px; }
.orders-field-notes { padding: 13px 19px; }
.orders-field-notes>summary { font-size: 13px; padding: 2px 0; }
.orders-field-notes .hint { margin-top: 10px; max-width: 1100px; }
.orders-empty-actions { justify-content: center; width: 100%; margin-top: 18px; }
.order-queue-empty { padding: 40px 18px; }
.order-queue-empty strong { font-size: 17px; }
.order-queue-empty .hint { font-size: 14px; }

/* The assignment workspace prioritizes selection, driver loads and stop order. */
.manual-dispatch { gap: 16px; }
.manual-workspace-toolbar { padding: 17px 19px; gap: 12px 20px; border-radius: 14px; }
.manual-workflow-steps { font-size: 13px; gap: 14px; }
.manual-workflow-steps li>span { width: 25px; height: 25px; font-size: 12px; }
.manual-workspace-toolbar .manual-workspace-caption { width: 100%; margin: 0; font-size: 13px; line-height: 1.7; }
.manual-workspace-actions { gap: 8px; }
.manual-stats { gap: 10px; }
.manual-stats>div { padding: 13px 17px; gap: 10px; border-radius: 12px; }
.manual-stats strong { font-size: 25px; }
.manual-stats span { font-size: 13px; }
.manual-pending-stat { border-color: #edc8b6; }
.manual-layout { grid-template-columns: minmax(310px,.86fr) minmax(370px,1.14fr); gap: 18px; }
.manual-layout.is-complete { grid-template-columns: 1fr; }
.manual-layout.is-complete .manual-assigned { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.manual-pending { min-width: 0; }
.manual-pending .panel-head { padding: 17px 18px; }
.manual-pending .panel-head small { font-size: 13px; }
.manual-search { padding: 14px 17px; gap: 10px; background: #fbfcfd; }
.manual-search>input { font-size: 14px; min-height: 42px; background: #fff; }
.manual-search label { font-size: 13px; line-height: 1.7; }
.manual-selection-bar { display: flex; gap: 10px 14px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 12px 17px; background: #fff6f0; border-bottom: 1px solid #f0d9ca; color: #664530; font-size: 13px; }
.manual-selection-bar>span { flex: 1 1 105px; }
.manual-selection-bar small { display: block; font-size: 12px; margin-top: 3px; }
.manual-selection-bar .actions { width: auto; gap: 6px; }
.manual-selection-bar .button { min-height: 39px; padding: 8px 11px; font-size: 13px; }
.manual-order-list { max-height: min(640px,calc(100dvh - 285px)); }
.manual-order { padding: 16px 17px; gap: 12px; }
.manual-order>div { flex: 1; min-width: 0; }
.manual-order:focus-within { box-shadow: inset 3px 0 0 var(--accent); background: #fff8f3; }
.manual-order-heading { display: flex; gap: 6px 9px; align-items: baseline; flex-wrap: wrap; }
.manual-order-heading strong { font-size: 15px; line-height: 1.65; }
.manual-order-heading small { font-size: 12px; margin: 0; }
.manual-order-heading .pill { font-size: 12px; padding: 2px 6px; }
.manual-order .manual-address, .manual-stops .manual-address { margin: 7px 0 9px; font-size: 14px; line-height: 1.65; color: #425364; }
.manual-order-facts { display: flex; gap: 5px 13px; flex-wrap: wrap; font-size: 13px; color: #576370; line-height: 1.7; }
.manual-order-facts b { font-weight: 600; color: #2b3743; }
.manual-contact-line, .manual-coordinate-state { font-size: 12px; line-height: 1.65; margin-top: 6px; }
.manual-coordinate-state.is-pending { color: var(--amber); font-weight: 600; }
.manual-assigned { gap: 15px; min-width: 0; }
.manual-assigned-heading { min-height: 34px; padding: 0 2px 3px; }
.manual-assigned-heading h2 { font-size: 17px; }
.manual-assigned-heading .hint { font-size: 13px; }
.manual-route-heading { padding: 17px 18px 8px; }
.manual-route-heading h3 { font-size: 19px; }
.manual-route-heading p { font-size: 13px; line-height: 1.6; }
.manual-route-tools { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:8px; }
.manual-route-tools .button { white-space:nowrap; }
.manual-stop-wait { color:var(--muted); font-size:12px; margin-top:4px; line-height:1.7; }
.manual-pickup-tail { border-top:1px solid var(--line); padding:16px 18px; background:var(--panel); font-size:13px; }
.manual-pickup-tail>strong { color:var(--ink); }
.manual-pickup-tail ol { margin:10px 0 0; padding-left:20px; }
.manual-pickup-tail li { padding:6px 0 10px; overflow-wrap:anywhere; }
.manual-pickup-tail small { display:block; color:var(--muted); margin-top:4px; }
.manual-pickup-tail .suggested-stop-time { margin-top:4px; }
.route-order-metrics,.route-order-comparison { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:16px 0; }
.route-order-metrics>div,.route-order-comparison>section { border:1px solid var(--line); border-radius:12px; padding:15px; min-width:0; }
.route-order-metrics small { display:block; color:var(--muted); margin-bottom:8px; }
.route-order-metrics strong { font-size:17px; font-variant-numeric:tabular-nums; }
.route-order-comparison h3 { font-size:14px; margin:0 0 12px; }
.route-order-sequence { margin:0; padding-left:23px; }
.route-order-sequence li { padding:6px 0; overflow-wrap:anywhere; }
.route-order-sequence small { display:block; color:var(--muted); font-size:12px; }
@media(max-width:600px) { .route-order-metrics,.route-order-comparison { grid-template-columns:1fr; } .manual-route-tools { max-width:160px; } }
.manual-load { padding: 7px 18px 13px; font-size: 13px; flex-wrap: wrap; }
.manual-load b { font-size: 15px; }
.manual-capacity-meter { margin: 0 18px 14px; font-size: 12px; }
.manual-stops li { padding: 16px 18px; gap: 11px; }
.manual-sequence { width: 27px; height: 27px; font-size: 12px; margin-top: 2px; }
.manual-stop-content { flex: 1; min-width: 0; }
.manual-stop-actions { align-items: flex-start; gap: 7px; margin-top: 12px; }
.manual-stop-actions .button { min-height: 36px; font-size: 13px; padding: 6px 10px; }
.manual-reorder-actions { display: flex; gap: 5px; }
.manual-stop-more>div { display: grid; padding-top: 7px; }
.manual-stop-more>div .button { color: #a83543; border-color: #eccbd1; }
.manual-readiness { padding: 13px 17px; border: 1px solid #ecd8b1; border-radius: 12px; background: #fff9ec; color: #72511b; }
.manual-readiness.is-ready { border-color: #cde2d6; background: #f3faf6; color: #255f47; }
.manual-readiness-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.manual-readiness-heading strong { font-size: 14px; }
.manual-readiness p, .manual-readiness li { font-size: 13px; line-height: 1.7; }
.manual-readiness p { margin: 7px 0 0; }
.manual-readiness ul { padding-left: 20px; margin: 8px 0 0; }
.manual-estimate-summary { padding: 14px 17px; font-size: 13px; }
.manual-estimate-metrics small, .manual-help, .manual-help summary { font-size: 12px; }
.manual-estimate-empty { margin: 0; font-size: 13px; line-height: 1.7; padding: 0 2px; }
.manual-scope { padding: 12px 16px; }
.manual-scope>summary { font-size: 13px; }
.manual-unassigned-reasons { padding: 13px 17px; font-size: 13px; line-height: 1.7; }
.manual-unassigned-reasons ul { margin: 7px 0 0; padding-left: 18px; }
.manual-complete>summary { min-height: 50px; }
.manual-complete>summary::after { font-size: 12px; }

/* Keep the assignable orders in the first screen; reference detail follows them. */
.manual-dispatch { gap: 12px; }
.manual-workspace-toolbar { min-height: 72px; padding: 13px 18px; gap: 10px 18px; }
.manual-workspace-toolbar>.manual-workspace-actions { width: auto; }
.manual-stats>div { padding: 10px 16px; }
.manual-stats strong { font-size: 24px; }
.manual-readiness { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px 16px; padding: 10px 14px; }
.manual-readiness-heading { justify-content: flex-start; gap: 10px; flex-shrink: 0; }
.manual-readiness>p { flex: 1 1 270px; margin: 1px 0 0; }
.manual-readiness>ul { flex: 1 1 270px; margin: 1px 0 0; padding-left: 18px; }
.manual-readiness li+li { margin-top: 3px; }
.manual-estimate-empty { padding: 0 2px; }
.manual-suggestion-alerts { padding: 10px 14px; border: 1px solid #ecd8b1; border-radius: 11px; background: #fff9ec; color: #72511b; font-size: 13px; line-height: 1.7; }
.manual-suggestion-issues { display: flex; gap: 8px 14px; flex-wrap: wrap; }
.manual-suggestion-issues>strong { flex-shrink: 0; font-size: 13px; }
.manual-suggestion-issues>ul { flex: 1 1 250px; margin: 0; padding-left: 18px; }
.manual-suggestion-alerts>.suggestion-warnings { padding-left: 18px; margin: 0; }
.manual-suggestion-issues+.suggestion-warnings { margin-top: 7px; }
.manual-estimate-summary { scroll-margin-top: 18px; }

@media (min-width:1600px) {
  .shell { grid-template-columns: 240px minmax(0,1fr); }
  main { padding-left: 36px; padding-right: 36px; }
}
@media (min-width:1191px) {
  .manual-pending:not(.manual-complete) { position: sticky; top: 18px; }
}
@media (max-width:1190px) and (min-width:761px) {
  .shell { grid-template-columns: 202px minmax(0,1fr); }
  main { padding: 25px 22px 38px; }
  .sidebar { padding-left: 11px; padding-right: 11px; }
  .nav button { font-size: 13px; }
  .manual-layout { grid-template-columns: 1fr; }
  .manual-layout.is-complete .manual-assigned { grid-template-columns: 1fr; }
  .manual-order-list { max-height: 520px; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width:760px) {
  .shell { display: block; }
  .sidebar { padding: 16px; gap: 13px; }
  .navigation-toggle { min-height: 42px; font-size: 13px; }
  .nav button { font-size: 13px; min-height: 44px; }
  main { padding: 22px 15px 34px; }
  .topbar:has(.page-heading) { margin-bottom: 16px; gap: 13px; }
  .page-heading h1 { font-size: 27px; }
  .page-description { font-size: 13px; }
  .eyebrow { font-size: 12px; }
  .page-tools .button, .page-aux-actions>summary { min-height: 42px; font-size: 13px; }
  .context-bar, .module-context { padding: 11px 12px; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
  .context-bar .saved-state { font-size: 12px; margin-left: 0; }
  .orders-compact-summary { grid-template-columns: repeat(2,minmax(0,1fr)); margin-bottom: 16px; }
  .orders-compact-summary>div { padding: 13px 16px; }
  .orders-compact-summary>div:nth-child(2) { border-right: 0; }
  .orders-compact-summary>div:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .orders-compact-summary dd { font-size: 23px; }
  .orders-panel>.panel-head { padding: 17px 15px; }
  .orders-actions { width: 100%; align-items: flex-start; }
  .orders-actions>.button { flex: 1 1 auto; min-height: 44px; padding: 10px 12px; }
  .orders-actions>.orders-more-actions>summary { min-height: 44px; }
  .orders-more-actions[open] { flex: 1 1 100%; }
  .orders-more-actions[open]>summary { justify-content: flex-start; }
  .orders-more-actions>div { max-width: none; }
  .orders-panel .order-queue-tabs { padding: 12px 14px 0; gap: 6px; }
  .order-queue-tab { min-height: 40px; font-size: 12px; padding: 8px 10px; }
  .orders-panel .order-queue-filters { padding: 13px 14px; gap: 10px; }
  .orders-search { flex-basis: 100%; min-width: 0; }
  .orders-panel .orders-search #search { max-width: none; min-height: 44px; }
  .order-area-filter { flex: 1 1 170px; width: auto; min-width: 0; font-size: 13px; }
  .order-area-filter select { min-height: 44px; min-width: 0; }
  .orders-result-count { margin-left: 0; flex-basis: 100%; }
  .orders-table-wrap { overflow: visible; }
  .orders-table { display: block; min-width: 0; width: 100%; }
  .orders-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .orders-table tbody { display: grid; gap: 0; }
  .orders-table tr { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; padding: 18px 15px; border-bottom: 1px solid var(--line); }
  .orders-table tr:last-child { border-bottom: 0; }
  .orders-panel .orders-table td { display: block; padding: 0; border: 0; min-width: 0; max-width: none; font-size: 14px; overflow-wrap: anywhere; }
  .orders-panel .orders-table td:first-child { min-width: 0; max-width: none; }
  .orders-table td::before { content: attr(data-label); display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; line-height: 1.5; }
  .orders-table .order-customer-cell, .orders-table .order-address-cell, .orders-table .order-actions-cell { grid-column: 1/-1; }
  .orders-table .order-customer-cell { order: -3; }
  .orders-table .order-address-cell { order: -2; }
  .orders-table .order-customer-cell::before, .orders-table .order-actions-cell::before { display: none; }
  .order-customer-name strong { font-size: 16px; }
  .order-address-cell .order-full-address { font-size: 14px; }
  .order-row-actions { display: flex; gap: 8px; width: 100%; align-items: flex-start; }
  .order-row-actions>.button, .order-row-more { flex: 1 1 0; min-width: 0; }
  .order-row-actions>.button, .order-row-more>summary { min-height: 44px; font-size: 14px; }
  .order-row-more[open] { min-width: 0; }
  .order-row-more-content .button { min-height: 44px; font-size: 13px; }
  .orders-table .order-empty-row { display: block; }
  .orders-table .order-empty-row td::before { display: none; }
  .orders-table .order-empty-row .order-queue-empty { padding: 26px 0; }
  .orders-empty-actions .button { width: 100%; min-height: 44px; }
  .manual-workspace-toolbar { padding: 14px 15px; gap: 12px; }
  .manual-workflow-steps { gap: 9px; font-size: 12px; }
  .manual-workspace-toolbar .manual-workspace-caption { font-size: 13px; }
  .manual-workspace-toolbar>.manual-workspace-actions { width: 100%; }
  .manual-workspace-actions .button { flex: 1; min-height: 44px; }
  .manual-stats>div { padding: 11px 14px; }
  .manual-stats span { font-size: 13px; }
  .manual-layout, .manual-layout.is-complete .manual-assigned { grid-template-columns: 1fr; }
  .manual-order-list { max-height: none; overflow: visible; }
  .manual-search { padding: 14px 15px; }
  .manual-search>input { min-height: 44px; }
  .manual-search label { min-height: 32px; }
  .manual-selection-bar { padding: 12px 15px; }
  .manual-selection-bar .actions { width: 100%; }
  .manual-selection-bar .button { flex: 1; min-height: 44px; font-size: 13px; }
  .manual-order, .manual-stops li { padding: 16px 15px; }
  .manual-order-heading strong { font-size: 15px; }
  .manual-order-facts { display: grid; gap: 3px; font-size: 13px; }
  .manual-route-heading { padding: 16px 15px 9px; }
  .manual-load { padding-left: 15px; padding-right: 15px; gap: 9px; }
  .manual-stop-actions { gap: 8px; }
  .manual-stop-actions .button, .manual-stop-more>summary { min-height: 42px; font-size: 13px; }
  .manual-reorder-actions { width: 100%; }
  .manual-reorder-actions .button { flex: 1; }
  .manual-stop-more { flex: 1; min-width: 0; }
  .manual-stop-actions>.button { flex: 1; }
  .manual-stop-more>div .button { min-height: 44px; white-space: normal; }
  .manual-complete>summary { flex-wrap: wrap; gap: 8px; }
  .manual-complete>summary::after { width: 100%; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width:430px) {
  main { padding-left: 13px; padding-right: 13px; }
  .page-tools .date-picker { flex-basis: 100%; }
  .page-tools .button { flex-grow: 1; }
  .context-main, .context-main strong { min-width: 0; overflow-wrap: anywhere; }
  .orders-table tr { gap: 13px 10px; padding-left: 14px; padding-right: 14px; }
  .manual-workflow-steps { gap: 7px; }
  .manual-workflow-steps li { gap: 5px; }
  .manual-workflow-steps li>span { width: 22px; height: 22px; }
  .manual-readiness { padding: 12px 14px; }
}
