#orders .admin-orders-data-table .logistics-track-btn {
  box-sizing: border-box;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-width: 42px;
  /* 220px column - 14px cell padding - three 22px icons - three 3px gaps. */
  max-width: calc(100% - 75px);
  height: 22px;
  min-height: 22px;
  max-height: 22px;
  padding: 0 6px;
  overflow: hidden;
  color: #50647f;
  font-size: 9px;
  font-weight: 750;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid #cdd9e9;
  border-radius: 6px;
  background: #f5f8fc;
}

#orders .admin-orders-data-table .logistics-track-btn:hover { border-color: #7194cb; background: #eaf2ff; }
#orders .admin-orders-data-table .logistics-track-btn[data-tone="info"] { color: #2364b3; border-color: #bdd2f0; background: #edf5ff; }
#orders .admin-orders-data-table .logistics-track-btn[data-tone="success"] { color: #247451; border-color: #bfe2d0; background: #edf9f3; }
#orders .admin-orders-data-table .logistics-track-btn[data-tone="warning"] { color: #95640d; border-color: #ead39e; background: #fff8e8; }
#orders .admin-orders-data-table .logistics-track-btn[data-tone="danger"] { color: #b63e49; border-color: #efc4c8; background: #fff1f2; }
#orders .admin-orders-data-table .logistics-track-btn:focus-visible { outline: 2px solid rgba(48, 105, 190, .28); outline-offset: 1px; }

.logistics-package-peekover {
  position: fixed;
  z-index: 83;
  box-sizing: border-box;
  width: min(320px, calc(100vw - 24px));
  overflow: hidden;
  border: 1px solid #ccd9ea;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(28, 50, 82, .2);
}
.logistics-package-peekover.hidden { display: none; }
.logistics-package-peek-head { display: flex; align-items: center; justify-content: space-between; min-height: 36px; padding: 0 11px; border-bottom: 1px solid #e7edf5; background: #f7faff; }
.logistics-package-peek-head strong { color: #203652; font-size: 11px; }
.logistics-package-peek-head span { color: #6c7d94; font-size: 10px; }
.logistics-package-peek-list { max-height: 280px; overflow: auto; overscroll-behavior: contain; padding: 5px; }
.logistics-package-peek-row { display: grid; grid-template-columns: 20px 38px minmax(0, 1fr) auto 24px; align-items: center; gap: 4px; min-height: 42px; padding: 5px; border-bottom: 1px solid #edf1f6; }
.logistics-package-peek-row:last-child { border-bottom: 0; }
.logistics-package-peek-index { display: grid; width: 19px; height: 19px; place-items: center; color: #57708e; font-size: 9px; border-radius: 6px; background: #edf3fa; }
.logistics-package-peek-company { overflow: hidden; padding: 3px 4px; color: #315f9f; font-size: 9px; font-weight: 750; text-align: center; text-overflow: ellipsis; white-space: nowrap; border-radius: 8px; background: #edf4ff; }
.logistics-package-peek-row > strong { min-width: 0; color: #20334f; font: 650 10px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.logistics-package-peek-state { max-width: 66px; overflow: hidden; padding: 3px 5px; color: #597089; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; border-radius: 8px; background: #f0f4f8; }
.logistics-package-peek-state[data-tone="info"] { color: #2364b3; background: #edf5ff; }
.logistics-package-peek-state[data-tone="success"] { color: #247451; background: #edf9f3; }
.logistics-package-peek-state[data-tone="warning"] { color: #95640d; background: #fff7e5; }
.logistics-package-peek-state[data-tone="danger"] { color: #b63e49; background: #fff0f1; }
.logistics-package-peek-copy { display: inline-flex; align-items: center; justify-content: center; width: 24px; min-width: 24px; height: 24px; padding: 0; color: #3c6599; border: 1px solid #cfdbeb; border-radius: 6px; background: #fff; }
.logistics-package-peek-copy:hover { border-color: #7ea4d6; background: #edf5ff; }
.logistics-package-peek-copy svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

#logisticsNumbersModal { z-index: 80; }
.logistics-numbers-modal-panel { width: min(920px, 92vw); max-height: 86vh; }
.logistics-numbers-list { display: grid; gap: 8px; max-height: min(354px, calc(86vh - 92px)); padding: 14px; overflow: auto; overscroll-behavior: contain; }
.logistics-number-row {
  display: block;
  min-width: 0;
  padding: 10px;
  border: 1px solid #dce5f1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(28, 55, 91, .06);
}
.logistics-package-summary { display: grid; grid-template-columns: 26px auto minmax(150px, 1fr) auto auto 30px; align-items: center; gap: 8px; min-width: 0; }
.logistics-number-index { display: grid; width: 26px; height: 26px; place-items: center; color: #fff; font-size: 11px; font-weight: 800; border-radius: 8px; background: #2f68bd; }
.logistics-number-company { padding: 4px 8px; color: #3c5f91; font-size: 11px; font-weight: 800; border-radius: 999px; background: #edf4ff; }
.logistics-package-summary > strong { min-width: 0; overflow: hidden; color: #1a2c47; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.logistics-package-state { max-width: 92px; overflow: hidden; padding: 4px 7px; color: #317153; font-size: 10px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; border-radius: 999px; background: #edf8f2; }
.logistics-package-state[data-tone="warning"] { color: #95640d; background: #fff8e8; }
.logistics-package-state[data-tone="danger"] { color: #c53f48; background: #fff0f0; }
.logistics-package-toggle { min-width: 62px; height: 28px; padding: 0 9px; color: #285eaa; border-color: #bfd0ea; background: #f4f8ff; }
.logistics-package-toggle span { display: inline-block; margin-left: 2px; transition: transform .15s ease; }
.logistics-package-toggle[aria-expanded="true"] span { transform: rotate(180deg); }
.logistics-package-copy { display: inline-flex; align-items: center; justify-content: center; width: 28px; min-width: 28px; height: 28px; padding: 0; color: #40658f; }
.logistics-package-copy svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.logistics-package-details { display: grid; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #e8edf4; }
.logistics-package-details.hidden { display: none; }
.logistics-subscription-state { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 9px 11px; border-radius: 9px; background: #f4f8fd; }
.logistics-subscription-state b { color: #317153; font-size: 12px; }
.logistics-subscription-state small { min-width: 0; overflow: hidden; color: #7b8798; text-overflow: ellipsis; white-space: nowrap; }
.logistics-subscription-state[data-status="failed"],
.logistics-subscription-state[data-status="needs_carrier"] { background: #fff8e8; }
.logistics-subscription-state[data-status="failed"] b,
.logistics-subscription-state[data-status="needs_carrier"] b { color: #95640d; }
.logistics-subscription-state .ghost { margin-left: auto; }
.logistics-carrier-fix { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 8px; padding: 10px; border: 1px solid #f0d4aa; border-radius: 9px; background: #fff9ef; }
.logistics-package-manage-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.logistics-package-manage-actions button { min-height: 29px; padding: 4px 10px; font-size: 10px; }
.logistics-package-manage-form { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto; align-items: end; gap: 8px; padding: 10px; border: 1px solid #cddcf0; border-radius: 10px; background: #f7faff; }
.logistics-package-manage-form.hidden { display: none; }
.logistics-package-manage-form > strong { grid-column: 1 / -1; color: #244b80; font-size: 12px; }
.logistics-package-manage-form label { display: grid; gap: 5px; min-width: 0; color: #5e6f85; font-size: 10px; }
.logistics-package-manage-form input { box-sizing: border-box; width: 100%; height: 34px; min-width: 0; padding: 0 9px; color: #1d2f49; border: 1px solid #c7d5e8; border-radius: 8px; background: #fff; outline: none; }
.logistics-package-manage-form input:focus { border-color: #4d83d0; box-shadow: 0 0 0 3px rgba(49, 105, 185, .12); }
.logistics-package-manage-form input:disabled { color: #718096; background: #eef3f8; }
.logistics-package-manage-form > div { display: flex; gap: 7px; }
.logistics-package-manage-form > div button { min-width: 72px; height: 34px; padding: 0 9px; }
.logistics-track-detail { grid-column: 1 / -1; padding: 12px; border: 1px solid #e4e9f0; border-radius: 9px; background: #fafbfd; }
.logistics-track-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.logistics-track-head b { color: #243b5d; }
.logistics-track-head small { color: #8995a5; }
.logistics-track-detail ol { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.logistics-track-detail li { display: grid; grid-template-columns: 125px minmax(0, 1fr); gap: 12px; color: #526177; font-size: 12px; }
.logistics-track-detail time { color: #8793a5; }

#addLogisticsPackagesModal {
  position: fixed;
  z-index: 84;
  box-sizing: border-box;
  width: min(410px, calc(100vw - 24px));
  max-height: min(420px, calc(100vh - 24px));
  overflow: hidden;
  border: 1px solid #c8d6e8;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(24, 46, 79, .24);
}
#addLogisticsPackagesModal.hidden { display: none; }
.add-logistics-packages-panel { display: flex; width: 100%; max-width: none; max-height: inherit; margin: 0; overflow: hidden; flex-direction: column; border: 0; border-radius: inherit; box-shadow: none; }
.add-logistics-packages-panel > .modal-bar,
.add-logistics-packages-actions { flex: 0 0 auto; }
.add-logistics-packages-panel > .modal-bar { min-height: 48px; padding: 8px 12px; }
.add-logistics-packages-panel > .modal-bar strong { font-size: 13px; }
.add-logistics-packages-panel > .modal-bar small { max-width: 280px; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.add-logistics-packages-panel > .modal-bar button { min-width: 50px; height: 28px; padding: 0 8px; }
.add-logistics-packages-body { flex: 1 1 auto; display: grid; gap: 7px; min-height: 0; padding: 10px 12px 8px; overflow: auto; overscroll-behavior: contain; }
.add-logistics-input-field { display: grid; gap: 7px; color: #33445e; font-size: 12px; font-weight: 750; }
.add-logistics-input-field textarea { box-sizing: border-box; width: 100%; min-height: 76px; max-height: 96px; padding: 8px 10px; resize: none; color: #1d2f49; font: 500 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; border: 1px solid #cdd9e9; border-radius: 9px; background: #fbfdff; outline: none; }
.add-logistics-input-field textarea:focus { border-color: #4d83d0; box-shadow: 0 0 0 3px rgba(49, 105, 185, .12); background: #fff; }
.add-logistics-packages-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.add-logistics-packages-stats > span { display: inline-flex; align-items: baseline; gap: 4px; height: 24px; padding: 0 8px; color: #58708e; font-size: 10px; line-height: 24px; border-radius: 12px; background: #eef5ff; }
.add-logistics-packages-stats b { color: #1768c5; font-size: 11px; }
.add-logistics-packages-stats .warn { color: #9c6815; background: #fff5dc; }
.add-logistics-packages-stats .warn b { color: #b87506; }
.add-logistics-packages-stats .danger { color: #a94545; background: #fff0f0; }
.add-logistics-packages-stats .danger b { color: #c33d45; }
.add-logistics-packages-hint { color: #748198; font-size: 9px; line-height: 1.4; }
.add-logistics-packages-preview { min-height: 48px; max-height: 118px; overflow: auto; overscroll-behavior: contain; border: 1px solid #e0e7f0; border-radius: 9px; background: #fff; }
.add-logistics-packages-preview > .empty { padding: 16px; color: #9aa6b7; font-size: 10px; text-align: center; }
.add-logistics-preview-row { display: grid; grid-template-columns: 22px minmax(120px, 1fr) 48px 74px; align-items: center; gap: 5px; min-height: 32px; padding: 4px 7px; border-bottom: 1px solid #edf0f5; }
.add-logistics-preview-row:last-child { border-bottom: 0; }
.add-logistics-preview-row > strong { min-width: 0; overflow: hidden; color: #263650; font: 650 10px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.add-logistics-preview-row > b { color: #27714f; font-size: 10px; text-align: right; }
.add-logistics-preview-row[data-state="duplicate"] > b { color: #a56b0a; }
.add-logistics-preview-row[data-state="invalid"] > b,
.add-logistics-preview-row[data-state="overflow"] > b { color: #c53f48; }
.add-logistics-preview-row[data-state="invalid"],
.add-logistics-preview-row[data-state="overflow"] { background: #fff8f8; }
.add-logistics-preview-index { display: grid; width: 22px; height: 22px; place-items: center; color: #56708f; font-size: 9px; border-radius: 6px; background: #edf3fa; }
.add-logistics-preview-company { overflow: hidden; padding: 3px 6px; color: #3c5f91; font-size: 10px; text-align: center; text-overflow: ellipsis; white-space: nowrap; border-radius: 999px; background: #edf4ff; }
.add-logistics-packages-error { padding: 7px 9px; color: #b73942; font-size: 9px; line-height: 1.4; border: 1px solid #f0c8cc; border-radius: 8px; background: #fff2f3; }
.add-logistics-packages-error.hidden { display: none; }
.add-logistics-packages-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px 10px; border-top: 1px solid #e8edf4; }
.add-logistics-packages-actions > span { color: #8a96a8; font-size: 8px; }
.add-logistics-packages-actions > div { display: flex; gap: 8px; }
.add-logistics-packages-actions button { min-width: 72px; height: 30px; padding: 0 9px; font-size: 10px; }

@media (max-width: 640px) {
  .logistics-package-summary { grid-template-columns: 26px auto minmax(0, 1fr) 30px; }
  .logistics-package-state { grid-column: 2 / 4; grid-row: 2; width: max-content; }
  .logistics-package-toggle { grid-column: 4; grid-row: 2; min-width: 58px; transform: translateX(-30px); }
  .logistics-carrier-fix { grid-template-columns: 1fr; }
  .logistics-package-manage-form { grid-template-columns: 1fr; }
  .logistics-package-manage-form > div { justify-content: flex-end; }
  .logistics-track-detail li { grid-template-columns: 1fr; gap: 2px; }
  .add-logistics-preview-row { grid-template-columns: 24px minmax(0, 1fr) 62px; }
  .add-logistics-preview-row > b { grid-column: 2 / 4; text-align: left; }
  .add-logistics-packages-actions > span { display: none; }
  .add-logistics-packages-actions > div { width: 100%; justify-content: flex-end; }
}
