/* Shared compact rows: local scrolling keeps the page and mobile navigation in bounds. */
.ff-planned{--ff-color:#9a5900;--ff-bg:#fff4dc}.ff-in_transit{--ff-color:#195da5;--ff-bg:#eaf3ff}.ff-partial{--ff-color:#6143a7;--ff-bg:#f2edff}.ff-unscheduled{--ff-color:#52677c;--ff-bg:#edf2f8}.ff-overdue{--ff-color:#b42318;--ff-bg:#fff0ee}.ff-delivered{--ff-color:#146341;--ff-bg:#e8f6ed}.ff-failed{--ff-color:#9b2363;--ff-bg:#fcecf5}.ff-cancelled{--ff-color:#586272;--ff-bg:#eef0f3}
.ff-legend{display:flex;flex-wrap:wrap;gap:6px 16px;list-style:none;padding:8px 0;margin:0;font-size:var(--text-caption);color:var(--muted)}.ff-legend li{display:flex;align-items:center;gap:6px}.ff-legend li::before{content:'';width:10px;height:10px;border-radius:3px;background:var(--ff-color);flex:none}.ff-badge{display:inline-block;border-radius:5px;padding:3px 7px;color:var(--ff-color);background:var(--ff-bg);font-size:var(--text-caption);font-weight:600;white-space:nowrap}
#view-order-products .op-table-wrap,#deliveries-table,#deliveries-product-lines{overflow:auto;max-width:100%;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
#view-order-products .ff-table,#view-deliveries .ff-table{display:table;width:100%;table-layout:fixed;min-width:1150px}
#view-order-products .ff-table thead,#view-deliveries .ff-table thead{display:table-header-group}#view-order-products .ff-table tbody,#view-deliveries .ff-table tbody{display:table-row-group}
#view-order-products .ff-table tr,#view-deliveries .ff-table tr{display:table-row;padding:0;line-height:1.3}
#view-order-products .ff-table :is(th,td),#view-deliveries .ff-table :is(th,td){display:table-cell;vertical-align:middle;padding:5px 10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-bottom:1px solid var(--line);font-size:var(--text-small)}
#view-order-products .ff-table td::before,#view-deliveries .ff-table td::before{content:none}
.ff-cell{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:34px}
#view-order-products .ff-cell :is(small,a,button,strong),#view-deliveries .ff-cell :is(small,a,button,strong){display:inline;white-space:nowrap;overflow-wrap:normal;float:none;vertical-align:middle}
.ff-cell small::before{content:' · '}.ff-cell small{margin:0}.ff-cell .btn{min-height:34px;line-height:1.3;padding:5px 7px;margin:0 3px 0 0;max-width:100%;overflow:hidden;text-overflow:ellipsis}.ff-cell .op-product-name{padding:5px 0;max-width:calc(100% - 35px)}
#view-order-products .ff-cell img{float:none;display:inline-block;width:24px;height:24px;vertical-align:middle;margin:0 6px 0 0}.ff-cell progress{display:none}
.ff-table .ff-row>td:first-child{box-shadow:inset 4px 0 var(--ff-color)}.ff-table .ff-row:hover>td{background:var(--ff-bg)}

#view-deliveries .ff-table{min-width:1350px}#deliveries-table .ff-table th:nth-child(1){width:110px}#deliveries-table .ff-table th:nth-child(2){width:150px}#deliveries-table .ff-table th:nth-child(3){width:25%}#deliveries-table .ff-table th:nth-child(4){width:20%}#deliveries-table .ff-table th:nth-child(5){width:120px}#deliveries-table .ff-table th:nth-child(6){width:90px}#deliveries-table .ff-table th:last-child{width:500px}
#deliveries-product-lines .ff-table{min-width:1600px}#deliveries-product-lines .ff-table th:first-child{width:270px}#deliveries-product-lines .ff-table th:nth-child(5){width:270px}#deliveries-product-lines .ff-table th:nth-child(6){width:150px}#deliveries-product-lines .ff-table th:nth-child(7){width:150px}
#view-deliveries .ff-cell .delivery-product-labels{display:inline;white-space:nowrap}#view-deliveries .ff-cell .delivery-slip-links{display:inline-flex;vertical-align:middle;gap:3px}.ff-cell .ship-photos{display:inline-flex;vertical-align:middle}.ff-cell .ship-photos img{width:24px;height:24px}
/* One event = one line in month/week/day and the selected-day agenda. */
#view-deliveries .dc-event{display:block;min-height:32px;padding:5px 7px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:var(--ff-bg);color:var(--ff-color);border-color:var(--ff-color)}#view-deliveries .dc-event :is(strong,small){display:inline;white-space:nowrap;overflow-wrap:normal}#view-deliveries .dc-event small::before{content:' · '}
@media(max-width:850px){.ff-cell{line-height:44px}.ff-cell .btn{min-height:44px}#view-order-products .ff-table :is(th,td),#view-deliveries .ff-table :is(th,td){padding:2px 8px}#view-order-products .ff-table th:first-child,#view-order-products .ff-table td:first-child,#deliveries-product-lines .ff-table th:first-child,#deliveries-product-lines .ff-table td:first-child{position:sticky;left:0;z-index:1;background:var(--surface,#fff)}#view-order-products .ff-table td:first-child{width:220px}#view-deliveries .dc-agenda .dc-event,#view-deliveries .dc-view-day .dc-event{min-height:44px}#view-deliveries .dc-grid:not(.dc-view-day) .dc-event small{display:none}.ff-legend{gap:6px 12px}}
/* Reserve real space for actions; truncation must never hide a working button. */
#view-order-products .ff-table{min-width:1250px}#view-order-products .ff-table th:nth-child(1){width:20%}#view-order-products .ff-table th:nth-child(2){width:15%}#view-order-products .ff-table th:nth-child(3){width:280px}#view-order-products .ff-table th:nth-child(4){width:14%}#view-order-products .ff-table th:nth-child(5){width:8%}#view-order-products .ff-table th:nth-child(6){width:12%}#view-order-products .ff-table th:nth-child(7){width:8%}#view-order-products .ff-table th:last-child{width:175px}
.ff-table :is(.op-actions,.actions-col)>.ff-cell{display:flex;gap:4px;align-items:center;overflow:visible}.ff-table :is(.op-actions,.actions-col)>.ff-cell .btn{flex:none;max-width:none}
@media(max-width:850px){#view-order-products .ff-table th:first-child,#deliveries-product-lines .ff-table th:first-child{width:180px}}
/* Reserve the controls' space while the existing API fills counts and results. */
#view-order-products .op-stats{min-height:105px}.op-feedback{min-height:18px}#deliveries-legend{min-height:36px}
@media(max-width:850px){#view-order-products .op-stats{min-height:118px}.op-feedback{min-height:36px}#deliveries-legend{min-height:56px}}
/* Product cells contain only thumbnail + name; SKU stays in search and details. */
#view-order-products .ff-product>.ff-cell,#view-deliveries .ff-product>.ff-cell{display:flex;align-items:center;gap:8px;height:40px}#view-order-products .ff-product .ff-cell img{flex:0 0 24px;margin:0}#view-order-products .ff-product .ff-cell .op-product-name,#view-deliveries .ff-product .ff-cell .btn{flex:1;min-width:0;max-width:none;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}
@media(max-width:850px){#view-order-products .ff-product>.ff-cell,#view-deliveries .ff-product>.ff-cell{height:50px}}
