.wb-fulfillment-navigation[hidden],.wb-fulfillment-tab[hidden],
.dbw-navigation[hidden],
.dbw-new-view[hidden],
.dbw-loading-view[hidden] {
  display: none !important;
}

.dbw-loading-view {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}

.dbw-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 12px 16px;
}

.dbw-picking-actions[hidden] { display: none !important; }
.dbw-navigation-actions,.dbw-picking-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dbw-navigation-actions { justify-content: flex-end; }
.dbw-picking-actions .button-link { padding: 10px 12px; white-space: nowrap; }
.dbw-picking-actions .button-link[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
@media (max-width: 900px) {
  .dbw-navigation { flex-wrap: wrap; }
  .dbw-navigation-actions { justify-content: flex-start; }
}

.dbw-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dbw-tabs button.active,
.dbw-tabs button[aria-selected="true"] {
  background: #2762e8;
  color: #fff;
  box-shadow: 0 0 0 2px #173f9e inset, 0 2px 6px #2762e84d;
}

.dbw-new-view .section-title {
  align-items: center;
}

.dbw-new-view .section-title input {
  min-width: 360px;
}

.dbw-orders-table {
  width: 100%;
  border-collapse: collapse;
}

.dbw-orders-table th,
.dbw-orders-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.dbw-orders-table small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.dbw-loading-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.dbw-loading-indicator::before {
  width: 16px;
  height: 16px;
  content: '';
  border: 2px solid #cbd5e1;
  border-top-color: #2762e8;
  border-radius: 50%;
  animation: dbw-loading-spin 0.8s linear infinite;
}

@keyframes dbw-loading-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .supply-selection-controls {
    grid-template-columns: 1fr;
  }

  .workspace-supply-bar {
    align-items: flex-start;
    flex-direction: column;
  }
}

main > .card,
main > .stats {
  margin-bottom: 10px;
}

.fbs-new-orders-panel[hidden] { display: none !important; }
.fbs-order-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 16px; }
.fbs-order-filters label { display: grid; gap: 5px; flex: 1 1 130px; min-width: 0; color: #70758a; font-size: 12px; font-weight: 600; }
.fbs-order-filters select { width: 100%; min-height: 40px; border: 1px solid #cfd8e6; border-radius: 8px; padding: 8px 10px; background: #fff; color: #161823; font: inherit; font-size: 14px; }
.fbs-order-filters > button { min-height: 40px; }
.fbs-order-filters label[hidden] { display: none; }
.fbs-presets-control { flex: 1 1 170px; min-width: 0; display: grid; gap: 5px; }
.fbs-presets-label { color: #70758a; font-size: 12px; font-weight: 600; }
.fbs-preset-menu { position: relative; min-width: 0; }
.fbs-preset-menu > summary { box-sizing: border-box; min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid #cfd8e6; border-radius: 8px; background: #fff; color: #161823; cursor: pointer; list-style: none; font-size: 14px; }
.fbs-preset-menu > summary::-webkit-details-marker { display: none; }
.fbs-preset-menu > summary:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
[data-fbs-preset-caption] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fbs-preset-popup { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; box-sizing: border-box; width: min(320px, calc(100vw - 40px)); max-height: min(380px, 55vh); overflow-y: auto; padding: 6px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; box-shadow: 0 12px 32px #17233b26; }
.fbs-preset-row { display: flex; align-items: center; gap: 4px; border-radius: 7px; }
.fbs-preset-row:hover, .fbs-preset-row.is-selected { background: #eef2ff; }
.fbs-preset-apply { flex: 1; min-width: 0; padding: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; background: transparent; color: #24324b; font-weight: 500; }
.fbs-preset-apply:hover { background: transparent; }
.fbs-preset-remove { flex: 0 0 30px; width: 30px; height: 30px; padding: 0; background: transparent; color: #7b879b; font-size: 20px; }
.fbs-preset-remove:hover { background: #fee2e2; color: #b91c1c; }
.fbs-presets-empty { padding: 12px; color: #77849b; font-size: 13px; }
.fbs-save-menu { flex: 0 0 auto; }
.fbs-save-menu > summary { background: #eaf0f9; border-color: transparent; color: #30415f; font-weight: 600; white-space: nowrap; }
.fbs-preset-save-popup { left: auto; right: 0; padding: 14px; }
.fbs-preset-save-popup label { display: grid; gap: 6px; }
.fbs-preset-save-popup input { box-sizing: border-box; width: 100%; min-height: 40px; margin-bottom: 10px; padding: 8px 10px; border: 1px solid #cfd8e6; border-radius: 8px; font-size: 14px; }
.fbs-preset-save-popup > button { width: 100%; }
.fbs-preset-save-popup .muted { display: block; margin-top: 9px; font-size: 12px; line-height: 1.4; }
.fbs-order-filters input[type="date"] { min-height: 40px; box-sizing: border-box; width: 100%; border: 1px solid #cfd8e6; border-radius: 8px; padding: 8px 10px; background: #fff; color: #161823; font: inherit; font-size: 14px; }
[data-fbs-date-error] { color: #dc2626; }
.fbs-new-orders-meta {
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 0;
  min-height: 34px;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}
#fbsAddSupplyDialog, #createWbSupplyDialog { width: min(560px,90vw); }
#fbsAddSupplyForm label, #createWbSupplyForm label { display: grid; gap: 6px; }
.fbs-new-orders-table-wrap {
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}
.fbs-new-orders-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
}
.fbs-new-orders-table th {
  padding: 13px 16px;
  color: #70758a;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  background: #fff;
}
.fbs-new-orders-table th:nth-child(1) { width: 42px; }
.fbs-new-orders-table th:nth-child(2) { width: 16%; }
.fbs-new-orders-table th:nth-child(3) { width: 39%; }
.fbs-new-orders-table th:nth-child(4) { width: 12%; }
.fbs-new-orders-table th:nth-child(5) { width: 16%; }
.fbs-new-orders-table th:nth-child(6) { width: 17%; }
.fbs-new-orders-table th button { background: transparent; color: inherit; padding: 0; border: 0; font: inherit; text-align: left; box-shadow: none; }
.fbs-new-orders-table th[aria-sort="ascending"] button::after { content: ' ↑'; color: #9333ea; }
.fbs-new-orders-table th[aria-sort="descending"] button::after { content: ' ↓'; color: #9333ea; }
.fbs-new-orders-table input[type="checkbox"] { width: 19px; height: 19px; accent-color: #9333ea; cursor: pointer; }
.fbs-new-orders-table tbody tr.fbs-order-selected { background: #f0e7ff; }
.fbs-b2b-tag { margin-left: 5px; cursor: help; }
.fbs-new-orders-table td {
  height: 82px;
  padding: 12px 16px;
  border-top: 1px solid #eceef3;
  vertical-align: middle;
}
.fbs-new-orders-table tbody tr:nth-child(odd) { background: #f8f8fb; }
.fbs-new-orders-table strong { color: #161823; }
.fbs-new-orders-table small {
  display: block;
  margin-top: 4px;
  color: #7b8093;
}
.fbs-order-number strong,.fbs-order-price strong { font-size: 16px; }
.fbs-order-product { display: flex; align-items: center; gap: 12px; }
.fbs-order-product > div { min-width: 0; }
.fbs-order-product > div > strong { font-size: 15px; line-height: 1.25; }
.fbs-order-photo {
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: linear-gradient(145deg,#f5f3ff,#e9e7f2);
  color: #8b5cf6;
  font-size: 22px;
  font-weight: 800;
}
.fbs-order-tag {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #eeeef3;
  color: #70758a;
  font-size: 10px;
  font-weight: 700;
}
.fbs-shipment-note { color: #ee7a55 !important; }
.fbs-shipment-overdue strong,.fbs-shipment-overdue-note { color: #dc2626 !important; }
[data-fbs-selection-hint] { flex-basis: 100%; color: #b45309; font-size: 12px; line-height: 1.5; }

#supplyAssemblyPanel { overflow-x: auto; }
.wb-assembly-table { min-width: 1850px; table-layout: fixed; }
.wb-assembly-table thead th { background: #fff; color: #777b8d; font-size: 12px; white-space: nowrap; text-transform: none; }
.wb-assembly-table td { padding: 18px 12px; vertical-align: middle; }
.wb-assembly-table td { overflow-wrap: anywhere; }
.wb-assembly-table th { position: relative; white-space: normal !important; }
.wb-assembly-table [hidden] { display: none !important; }
.assembly-column-resizer { position: absolute; right: -4px; top: 0; bottom: 0; width: 9px; cursor: col-resize; touch-action: none; z-index: 4; }
.assembly-column-resizer:hover,.assembly-column-resizer:focus { background: #9333ea55; }
.assembly-column-settings { padding: 10px 12px; background: #fff; }
.assembly-column-settings summary { cursor: pointer; font-weight: 700; }
[data-assembly-column-options] { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
[data-assembly-column-options] label { display: flex; align-items: center; gap: 5px; }
.column-settings-dropdown { position: fixed; inset: auto; margin: 0; width: min(284px,calc(100vw - 16px)); padding: 10px; border: 1px solid #e1e7ef; border-radius: 12px; background: #fff; box-shadow: 0 12px 40px #17203326; overflow-y: auto; z-index: 1100; color: #263244; }
.column-settings-dropdown::backdrop { background: transparent; }
.column-settings-dropdown [data-assembly-column-options] { display: flex; flex-direction: column; gap: 2px; margin: 0 0 10px; }
.column-settings-dropdown [data-assembly-column-options] label { padding: 8px 10px; border-radius: 7px; font-size: 13px; cursor: pointer; }
.column-settings-dropdown [data-assembly-column-options] label:hover { background: #f3f6fc; }
.column-settings-dropdown input[type="checkbox"] { width: 16px; height: 16px; flex: 0 0 auto; accent-color: #5277e7; }
.column-settings-dropdown [data-assembly-columns-reset] { width: 100%; font-size: 12px; padding: 10px; border-top: 1px solid #e8edf4; }
.column-menu-toggle { padding: 8px 12px; font-size: 12px; border: 1px solid #e1e7ef; }
.supply-column-option { display: flex; align-items: center; gap: 4px; }
.column-settings-dropdown [data-assembly-column-options] .supply-column-option label { flex: 1; min-width: 0; margin: 0; }
.configurable-supply-table { table-layout: fixed; }
.configurable-supply-table th { position: relative; white-space: normal !important; }
.configurable-supply-table td { overflow-wrap: anywhere; }
.configurable-supply-table .row-actions,
.wb-assembly-table .row-actions { flex-wrap: wrap; min-width: 0; max-width: 100%; }
.configurable-supply-table .row-actions > button,
.wb-assembly-table .row-actions > button { flex: 0 1 auto; min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.configurable-supply-table [hidden] { display: none !important; }
#supplyDeliveryPanel,#supplyArchivePanel { overflow-x: auto; }
.configurable-supply-table.fbs-new-orders-table th { width: auto; }
.wb-assembly-table input[type="checkbox"] { width: 19px; height: 19px; accent-color: #9333ea; cursor: pointer; }
.wb-assembly-table .assembly-supply-row:nth-child(even) { background: #fafafe; }
.wb-assembly-table .assembly-supply-row.selected,.wb-assembly-table .assembly-supply-row.assembly-checked { background: #e9e1fc; }
.wb-assembly-table small { display: block; margin-top: 4px; color: #778299; }
.wb-assembly-table .supply-record-warnings { margin-top: 8px; white-space: normal; }
.assembly-stage { display: inline-block; padding: 6px 9px; border-radius: 6px; color: #6266e8; background: #e7eaff; font-size: 12px; font-weight: 700; }
.wb-fulfillment-navigation {
  display: flex; align-items: stretch; gap: 24px; padding: 0 4px;
  margin: 0 0 20px; overflow-x: auto; border-bottom: 1px solid #e8e9ef;
}
button.wb-fulfillment-tab {
  flex: 0 0 auto; position: relative; padding: 14px 0; border: 0;
  border-radius: 0; background: transparent; color: #7b7a8d;
  font-size: 16px; font-weight: 600; line-height: 1.4; white-space: nowrap;
}
button.wb-fulfillment-tab:hover { background: transparent; color: #202231; }
button.wb-fulfillment-tab.active { color: #202231; background: transparent; }
button.wb-fulfillment-tab.active::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px; background: #a13bff;
}
button.wb-fulfillment-tab:focus-visible { outline: 2px solid #a13bff; outline-offset: -2px; }
body.supply-selection-mode .wb-fulfillment-navigation { width: min(1180px,100%); margin: 20px auto 0; }
body.supply-selection-mode .wb-fulfillment-navigation:not([hidden]) ~ .supply-selection-view { margin-top: 12px; }
