html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html,
body,
.wrapper {
  min-height: 100%;
  background-color: #f4f6f9 !important;
}

html {
  position: relative;
}

/* Enhanced Search Styles */
.search-dropdown {
  position: relative;
  display: inline-block;
  width: 100%;
}

.search-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1050;
  background-color: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  max-height: 400px;
  overflow-y: auto;
  display: none;
}

.search-dropdown-menu.show {
  display: block;
}

.search-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  color: #212529;
  text-decoration: none;
  border-bottom: 1px solid #f8f9fa;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out;
}

.search-dropdown-item:hover,
.search-dropdown-item:focus {
  background-color: #f8f9fa;
  color: #212529;
  text-decoration: none;
}

.search-dropdown-item:last-child {
  border-bottom: none;
}

.search-dropdown-item .search-item-icon {
  width: 20px;
  text-align: center;
  margin-right: 0.5rem;
  color: #6c757d;
}

.search-dropdown-item .search-item-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.search-dropdown-item .search-item-description {
  font-size: 0.875rem;
  color: #6c757d;
  margin-bottom: 0;
}

.search-dropdown-item .search-item-category {
  font-size: 0.75rem;
  color: #6c757d;
  margin-top: 0.25rem;
}

.search-dropdown-header {
  padding: 0.5rem 1rem;
  margin-bottom: 0;
  font-size: 0.875rem;
  color: #6c757d;
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  font-weight: 600;
}

.search-dropdown-footer {
  padding: 0.5rem 1rem;
  text-align: center;
  background-color: #f8f9fa;
  border-top: 1px solid #dee2e6;
}

.search-dropdown-footer a {
  color: #007bff;
  text-decoration: none;
  font-size: 0.875rem;
}

.search-dropdown-footer a:hover {
  text-decoration: underline;
}

.search-loading {
  text-align: center;
  padding: 1rem;
  color: #6c757d;
}

.search-no-results {
  text-align: center;
  padding: 1rem;
  color: #6c757d;
  font-style: italic;
}

.search-suggestion {
  display: flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-bottom: 1px solid #f8f9fa;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out;
}

.search-suggestion:hover {
  background-color: #f8f9fa;
}

.search-suggestion:last-child {
  border-bottom: none;
}

.search-suggestion-icon {
  width: 16px;
  text-align: center;
  margin-right: 0.5rem;
  color: #6c757d;
  font-size: 0.875rem;
}

.search-suggestion-text {
  flex: 1;
  font-size: 0.875rem;
  color: #495057;
}

.search-suggestion-type {
  font-size: 0.75rem;
  color: #6c757d;
  margin-left: 0.5rem;
}

/* Search Results Styles */
.search-result-item {
  transition: box-shadow 0.15s ease-in-out;
}

.search-result-item:hover {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.search-result-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f9fa;
  border-radius: 0.25rem;
  margin-right: 0.75rem;
  color: #6c757d;
}

.search-result-content {
  flex: 1;
}

.search-result-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: #212529;
}

.search-result-description {
  color: #6c757d;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
}

.search-result-meta {
  font-size: 0.75rem;
  color: #6c757d;
}

.search-result-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

/* Search Categories */
.search-categories {
  margin-bottom: 1rem;
}

.search-category-btn {
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Responsive Search */
@media (max-width: 768px) {
  .search-dropdown-menu {
    position: fixed;
    top: auto;
    left: 15px;
    right: 15px;
    max-height: 50vh;
  }

  .search-result-content {
    margin-bottom: 0.5rem;
  }

  .search-result-badges {
    align-items: flex-start;
  }
}

/* Page Structure Styles */
.page-breadcrumb {
  display: flex;
  justify-content: flex-end;
}

.courier-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  align-items: center;
  max-width: 100%;
}

.courier-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.45rem;
  border-radius: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  white-space: nowrap;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.courier-chip.courier-more {
  background: #475467;
  max-width: none;
}

.courier-chip .shipment-status-icon {
  font-size: 0.78rem;
}

.courier-inpost {
  background: #ffcc00;
  color: #1a1a1a;
}

.courier-poczta {
  background: #c8102e;
}

.courier-green {
  background: #2e7d32;
}

.courier-ups {
  background: #351c15;
}

.courier-pickup {
  background: #00897b;
}

.courier-other {
  background: #546e7a;
}

th.col-dof {
  width: 56px;
}

.hive-edit-save-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
}

.order-details-page form > .card {
  border: 1px solid #e6eaf0;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  overflow: visible;
  margin-bottom: 1rem;
}

.hive-combo {
  position: relative;
}

.hive-combo-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0;
  pointer-events: none;
}

.hive-combo-toggle {
  text-align: left;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23667085' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hive-combo-toggle.is-placeholder {
  color: #667085;
}

.hive-combo-menu {
  display: none;
  position: absolute;
  z-index: 1080;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 280px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e6eaf0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
}

.hive-combo.is-open .hive-combo-menu {
  display: block;
}

.hive-combo-option {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  color: #101828;
  cursor: pointer;
}

.hive-combo-option:hover,
.hive-combo-option:focus {
  background: #f5f8fc;
  outline: none;
}

.hive-combo-option.is-selected {
  background: #eef2f6;
  font-weight: 600;
}

.order-details-page form > .card > .card-header {
  background: #fff !important;
  color: #101828 !important;
  border-bottom: 1px solid #eef2f6;
}

.order-details-page form > .card > .card-header .card-title {
  color: #101828;
  font-size: 0.95rem;
  font-weight: 650;
}

.orders-page .hive-edit-save-bar {
  position: relative;
  bottom: auto;
  border: 1px solid #e6eaf0;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  margin-top: 1.25rem;
  margin-bottom: 1.5rem;
}

.order-create-notes {
  min-height: calc(1.5em + 0.75rem + 2px);
  resize: vertical;
}

.order-create-flags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 1.75rem;
  padding-top: 0.15rem;
}

.order-address-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  min-height: 2rem;
  margin-bottom: 0.85rem;
}

.order-address-heading .form-check {
  margin-top: 0;
}

#billingAddressFields[hidden] {
  display: none !important;
}

.packing-workbench .packing-count-card {
  max-width: 320px;
}

.packing-heading {
  font-size: 1.6rem;
}

.packing-item-name {
  font-weight: 600;
  color: #101828;
}

.packing-items-table td {
  vertical-align: middle;
}

.packing-items-table thead th {
  white-space: nowrap;
  font-weight: 650;
  color: #344054;
}

.packing-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  font-size: 0.9rem;
  color: #6c757d;
  margin-top: 0.35rem;
}

.packing-item--partial {
  background: #fff8e8;
}

.packing-item--done {
  background: #f1f8f4;
}

.packing-item--done .packing-item-name {
  color: #667085;
  opacity: 0.75;
}

.packing-pack-dialog {
  max-width: 520px;
}

.packing-pack-header {
  padding: 0.55rem 0.85rem;
}

.packing-pack-header .modal-title {
  font-size: 1.05rem;
  margin: 0;
}

.packing-pack-body {
  padding: 0.55rem 0.75rem 0.35rem;
}

.packing-pack-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.packing-pack-tabs .nav-link {
  padding: 0.35rem 0.75rem;
  font-size: 0.88rem;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}

.packing-pack-rows {
  max-height: min(58vh, 28rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.pack-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #eef1f4;
}

.pack-line:last-child {
  border-bottom: 0;
}

.pack-line-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.82rem;
  line-height: 1.25;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pack-line-ctrl {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 auto;
}

.pack-line-max {
  color: #6c757d;
  font-size: 0.78rem;
  min-width: 1.6rem;
  text-align: right;
}

.packing-now-qty {
  width: 3.25rem;
  max-width: 3.25rem;
  height: 38px;
  padding: 0.2rem 0.3rem;
  text-align: center;
  font-weight: 700;
}

.packing-now-all {
  min-width: 2.6rem;
  height: 38px;
  padding: 0 0.4rem;
  font-size: 0.75rem;
  line-height: 1;
}

.packing-pack-field label,
.packing-pack-dims label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6c757d;
  margin-bottom: 0.15rem;
}

.packing-pack-field .form-control,
.packing-pack-dims .form-control {
  height: 38px;
  padding: 0.25rem 0.45rem;
}

.packing-pack-dims {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}

.packing-pack-dims label {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.packing-pack-footer {
  padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom));
  gap: 0.4rem;
}

.packing-pack-footer .btn {
  min-height: 42px;
  flex: 1;
}

.packing-shipment-items {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.86rem;
}

.packing-item-qty {
  font-weight: inherit;
  font-size: inherit;
  line-height: inherit;
  color: #c2410c;
  display: inline;
  margin: 0;
  padding: 0;
}

.packing-items-table td.text-center,
.packing-list-page td[data-label="Spakowano"],
.packing-list-page td[data-label="Do spakowania"] {
  font-variant-numeric: tabular-nums;
}

.packing-status-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.packing-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.packing-phone a {
  font-weight: 600;
}

.packing-shipment-card {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  background: #fff;
}

.packing-shipment-card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.packing-shipment-packed {
  font-size: 0.82rem;
  color: #6c757d;
  margin-top: 0.35rem;
}

.packing-shipment-actions {
  margin-top: 0.6rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.packing-sh-btn {
  min-height: 38px;
  min-width: 38px;
  padding: 0.35rem 0.5rem;
}

.packing-sh-btns .packing-sh-btn {
  min-height: 38px;
  min-width: 38px;
}

.packing-pack-btn {
  white-space: nowrap;
}

.orders-page .packing-pack-btn {
  min-height: auto;
  padding: 0.2rem 0.55rem;
  font-size: 0.8rem;
}

.packing-details {
  padding-bottom: 1rem;
}

.packing-details .card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.packing-details .card-header .card-tools {
  margin-left: auto;
  float: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

.packing-details .packing-status-actions .btn {
  white-space: nowrap;
}

@media (max-width: 767.98px) {
  .packing-heading {
    font-size: 1.3rem;
  }

  .packing-workbench .packing-count-card {
    max-width: none;
  }

  .packing-workbench.page-shell {
    padding-left: 0;
    padding-right: 0;
  }

  .packing-workbench .packing-list-card > .card-body {
    padding: 0.85rem;
    overflow-x: visible;
  }

  .packing-table-wrap thead {
    display: none;
  }

  .packing-table-wrap table.dataTable,
  .packing-table-wrap tbody,
  .packing-table-wrap td {
    display: block;
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
  }

  .packing-table-wrap tr {
    display: block;
    width: auto !important;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid #d8dee8;
    border-radius: 12px;
    margin: 0 0 0.85rem;
    padding: 0.85rem 0.9rem;
    box-shadow: none;
  }

  .packing-table-wrap tbody tr:nth-child(odd) {
    background: #eef1f4 !important;
  }

  .packing-table-wrap tbody tr:nth-child(even) {
    background: #ffffff !important;
  }

  .packing-table-wrap td {
    border: 0 !important;
    padding: 0.28rem 0;
    display: flex !important;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.6rem;
    text-align: left !important;
    overflow-wrap: anywhere;
  }

  .packing-table-wrap td::before {
    content: attr(data-label);
    float: none;
    flex: 0 1 auto;
    font-weight: 650;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #667085;
    max-width: 70%;
    text-align: left;
    padding-right: 0;
  }

  .packing-table-wrap td.packing-actions {
    padding-top: 0.7rem;
    text-align: left;
  }

  .packing-table-wrap td.packing-actions::before {
    display: none;
  }

  .packing-pack-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: auto;
    min-height: 44px;
    padding: 0 0.95rem;
  }

  .packing-details .packing-title-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
  }

  .packing-details .packing-title-actions .btn {
    flex: 1 1 0;
    width: auto;
    min-height: 44px;
  }

  .packing-details .packing-status-actions .btn {
    width: auto;
    min-height: 44px;
  }

  .packing-shipment-modal {
    margin: 0;
    max-width: none;
    min-height: 100%;
    height: 100%;
  }

  .packing-pack-dialog .modal-content {
    min-height: 100vh;
    min-height: 100dvh;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }

  .packing-pack-body {
    flex: 1 1 auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .packing-pack-body .tab-content,
  .packing-pack-body .tab-pane.show {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .packing-pack-rows {
    max-height: none;
    flex: 1 1 auto;
  }

  .packing-now-qty,
  .packing-now-all {
    height: 44px;
  }

  .packing-now-qty {
    width: 3.5rem;
    max-width: 3.5rem;
    font-size: 1.05rem;
  }

  .packing-list-page .orders-chips {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.4rem;
    padding-bottom: 0.25rem;
  }

  .packing-list-page .orders-chip {
    flex: 0 0 auto;
  }

  .packing-list-page .dataTables_wrapper .dataTables_length,
  .packing-list-page .dataTables_wrapper .dataTables_filter {
    display: none;
  }

  .packing-list-page .dataTables_wrapper .dataTables_info,
  .packing-list-page .dataTables_wrapper .dataTables_paginate {
    float: none;
    width: 100%;
    text-align: center;
    padding-top: 0.5rem;
  }

  .packing-list-page .dataTables_wrapper .dataTables_paginate .paginate_button {
    min-height: 40px;
    min-width: 40px;
  }

  .packing-list-page .packing-table-wrap td[data-label="Numer"],
  .packing-table-wrap td.hive-card-title {
    display: block !important;
    text-align: left !important;
    font-size: 1.02rem;
    padding-bottom: 0.45rem;
  }

  .packing-list-page .packing-table-wrap td[data-label="Numer"]::before {
    display: none;
  }

  .packing-list-page .packing-table-wrap td[data-label="Dostawa"] {
    text-align: left;
  }

  .packing-details .orders-hero-actions {
    width: 100%;
  }

  .packing-details .card-header {
    position: sticky;
    top: 0;
    z-index: 6;
    background: #fff;
    flex-wrap: wrap;
  }

  .packing-details .card-header .card-title {
    width: 100%;
  }

  .packing-details .card-header .card-tools {
    width: 100%;
    margin-left: 0;
    justify-content: stretch;
  }

  .packing-details .order-details-main {
    display: flex;
    flex-direction: column;
  }

  .packing-details .order-details-main > .col-lg-4 {
    order: -1;
  }

  .packing-details .packing-delivery-body .row {
    display: block;
  }

  .packing-details .packing-delivery-body dt,
  .packing-details .packing-delivery-body dd {
    max-width: 100%;
    flex: none;
    width: 100%;
    padding: 0;
  }

  .packing-details .packing-delivery-body dt {
    margin-top: 0.55rem;
    font-size: 0.75rem;
    color: #6c757d;
  }

  .packing-details .packing-delivery-body dt:first-child {
    margin-top: 0;
  }

  .packing-details .packing-delivery-body dd {
    margin-bottom: 0;
  }

  .packing-items-table-wrap td[data-label="Produkt"],
  .packing-items-table-wrap td.packing-item-name {
    display: block !important;
    text-align: left !important;
    font-size: 0.95rem;
    padding-bottom: 0.5rem;
  }

  .packing-items-table-wrap td[data-label="Produkt"]::before,
  .packing-items-table-wrap td.packing-item-name::before {
    display: none;
  }

  .packing-items-table-wrap td[data-label="Lp."] {
    display: none;
  }

  .packing-phone a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 1.05rem;
  }

  .packing-list-page .packing-table-wrap.table-responsive,
  .packing-details .packing-table-wrap.table-responsive {
    overflow: visible !important;
  }

  .packing-list-page .packing-list-card-body {
    overflow-x: visible;
    padding: 0.75rem 0.85rem;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .packing-workbench .packing-count-card {
    max-width: 100%;
  }

  .packing-status-actions .btn {
    min-height: 44px;
  }
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body.login-page {
  margin-bottom: 0;
}

.navbar-global-search {
  max-width: 600px;
  min-width: 0;
  position: relative;
}

.navbar-global-search .form-control-navbar {
  min-width: 0;
}

@media (max-width: 767.98px) {
  .wrapper,
  .content-wrapper,
  .content .container-fluid {
    overflow-x: hidden;
    max-width: 100%;
  }

  .content-wrapper {
    padding-bottom: 1.5rem;
  }

  .content .container-fluid {
    padding-left: 8px;
    padding-right: 8px;
  }

  .navbar-global-search {
    max-width: none;
    margin-left: 0.25rem !important;
    margin-right: 0.25rem;
  }

  .navbar-global-search .form-control-navbar {
    font-size: 16px;
    height: 34px;
    padding: 0.25rem 0.6rem;
  }

  .main-header .navbar-nav .nav-link {
    padding: 0.35rem 0.45rem;
  }

  .main-footer {
    font-size: 0.8rem;
    padding: 0.6rem 0.75rem;
  }

  .card-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
  }

  .card-tools,
  .btn-group,
  .btn-toolbar {
    flex-wrap: wrap;
    width: 100%;
  }

  .orders-table-actions,
  .orders-page .card-header .card-tools {
    width: 100%;
    justify-content: flex-end;
  }

  .dataTables_wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter {
    float: none !important;
    text-align: left !important;
    margin-bottom: 0.5rem;
  }

  .dataTables_wrapper .dataTables_filter input {
    width: 100% !important;
    margin-left: 0 !important;
    margin-top: 0.35rem;
    font-size: 16px;
  }

  table.dataTable {
    width: 100% !important;
  }

  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0.75rem;
  }

  h1, .content-header h1, .packing-heading {
    font-size: 1.35rem;
    line-height: 1.25;
    word-break: break-word;
  }

  .breadcrumb {
    flex-wrap: wrap;
    font-size: 0.8rem;
  }

  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }

  .select2-container {
    width: 100% !important;
  }

  img, svg, video, canvas, iframe {
    max-width: 100%;
    height: auto;
  }
}

.hive-bom-title {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  justify-content: space-between;
  align-items: flex-start;
}

.hive-bom-title-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.hive-bom-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.75rem;
  padding: 0.85rem 1rem;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
}

.hive-bom-summary strong {
  margin-left: 0.35rem;
}

.hive-bom-add {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}

.hive-bom-add-product {
  flex: 1 1 16rem;
  min-width: 0;
}

.hive-bom-add-qty {
  width: 5.5rem;
}

.hive-bom-add-btn {
  min-height: 38px;
}

.hive-bom-stack-hint {
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6c757d;
  padding: 0.4rem 0.75rem;
  background: #f8f9fa;
}

.hive-bom-stack {
  display: flex;
  flex-direction: column-reverse;
  border-top: 1px solid #e9ecef;
  border-bottom: 1px solid #e9ecef;
}

.hive-bom-list {
  border-top: 1px solid #e9ecef;
}

.hive-bom-pos {
  flex: 0 0 2rem;
  font-weight: 700;
  color: #6c757d;
  font-variant-numeric: tabular-nums;
}

.hive-bom-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e9ecef;
  background: #fff;
}

.hive-bom-stack .hive-bom-row:last-child {
  border-bottom: none;
}

.hive-bom-row-main {
  display: flex;
  flex: 1 1 12rem;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
}

.hive-bom-name {
  font-weight: 600;
}

.hive-bom-meta {
  color: #6c757d;
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
}

.hive-bom-line-value {
  white-space: nowrap;
  font-weight: 600;
}

.hive-bom-row-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hive-bom-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hive-bom-stepper .btn {
  min-width: 2.4rem;
  min-height: 2.4rem;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
}

.hive-bom-qty {
  min-width: 1.75rem;
  text-align: center;
  font-weight: 700;
}

.hive-bom-remove .btn {
  min-width: 2.4rem;
  min-height: 2.4rem;
}

.hive-bom-move {
  display: inline-flex;
  gap: 0.25rem;
}

.hive-bom-move .btn {
  min-width: 2.4rem;
  min-height: 2.4rem;
  padding: 0;
}

.orders-hero,
.orders-page .orders-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.orders-hero-cta,
.orders-page .orders-hero-cta {
  border-radius: 10px;
  padding: 0.55rem 1rem;
  white-space: nowrap;
}

.orders-hero-actions,
.orders-page .orders-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.orders-page > .content-header {
  padding-top: 0;
  padding-bottom: 0.5rem;
}

.orders-page > .content-header .row > .col-sm-6:first-child {
  display: none;
}

.orders-kpi {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

/* Tile strips with a tile count other than four keep full-width tiles on desktop. */
@media (min-width: 1200px) {
  .orders-kpi--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .orders-kpi--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .orders-kpi--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .orders-kpi--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.orders-kpi-card {
  background: #fff;
  border: 1px solid #e6eaf0;
  border-radius: 14px;
  padding: 0.95rem 1.1rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.orders-kpi-card.is-warn {
  background: #fffbeb;
  border-color: #f6e2b3;
}

.orders-kpi-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #667085;
  margin-bottom: 0.25rem;
}

.orders-kpi-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  color: #101828;
  line-height: 1.2;
}

.orders-kpi-split {
  color: #98a2b3;
  font-weight: 500;
  margin: 0 0.15rem;
}

.orders-filters {
  background: #fff;
  border: 1px solid #e6eaf0;
  border-radius: 14px;
  padding: 1rem 1.1rem 1.15rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.orders-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.orders-search {
  position: relative;
  flex: 1 1 auto;
}

.orders-search i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #98a2b3;
}

.orders-search input {
  width: 100%;
  height: 40px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  padding: 0.4rem 0.9rem 0.4rem 2.2rem;
  background: #f8fafc;
}

.orders-search input:focus {
  outline: none;
  border-color: #2e90fa;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(46, 144, 250, 0.15);
}

.orders-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.orders-page #btnToggleActive {
  background: #fff;
  color: #101828;
  border: 1px solid #d0d5dd;
  font-weight: 600;
}

.orders-page #btnToggleActive:hover,
.orders-page #btnToggleActive:focus {
  background: #f2f4f7;
  color: #101828;
  border-color: #98a2b3;
}

.orders-page #btnToggleActive.is-showing-all {
  background: #101828;
  color: #fff;
  border-color: #101828;
}

.orders-page #btnToggleActive.is-showing-all:hover,
.orders-page #btnToggleActive.is-showing-all:focus {
  background: #344054;
  color: #fff;
  border-color: #344054;
}

.orders-filter-block + .orders-filter-block {
  margin-top: 0.85rem;
}

.orders-filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #475467;
  margin-bottom: 0.4rem;
}

.orders-filter-hint {
  font-size: 0.75rem;
  color: #98a2b3;
  margin-top: 0.35rem;
}

.orders-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.orders-chip {
  border: 1px solid #e4e7ec;
  background: #fff;
  color: #344054;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.8rem;
  line-height: 1.2;
  cursor: pointer;
}

.orders-chip:hover {
  border-color: #b2ddff;
  background: #f5fbff;
}

.orders-chip.is-active {
  background: #101828;
  border-color: #101828;
  color: #fff;
}

.badge.status-badge {
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
}

.orders-native-select {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.orders-secondary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem 0.85rem;
  margin-top: 1rem;
  padding-top: 0.95rem;
  border-top: 1px solid #eef2f6;
}

.orders-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0;
}

.orders-field span {
  font-size: 0.75rem;
  font-weight: 600;
  color: #475467;
}

.orders-check-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.orders-check-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.28rem 0.65rem;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  background: #fff;
  font-size: 0.8rem;
  font-weight: 500;
  color: #344054;
  cursor: pointer;
}

.orders-check-chip input {
  margin: 0;
}

.orders-check-chip span {
  font-size: 0.8rem;
  font-weight: 500;
  color: inherit;
}

.orders-check-chip:has(input:checked) {
  border-color: #1570ef;
  background: #eff8ff;
  color: #175cd3;
}

.orders-table-card {
  border: 1px solid #e6eaf0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.orders-table-header {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: nowrap;
  background: #fff;
  border-bottom: 1px solid #eef2f6;
  padding: 0.85rem 1.1rem;
}

.orders-table-header::after {
  display: none !important;
  content: none !important;
}

.orders-table-header .card-title,
.orders-table-header h5 {
  float: none;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  flex: 0 1 auto;
}

.orders-table-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  float: none;
}

.orders-page #ordersTable_wrapper .orders-table-footer {
  margin-top: 0.85rem;
  padding-top: 0.35rem;
}

.orders-page #ordersTable_wrapper .dataTables_length {
  padding-top: 0.15rem;
}

.orders-page #ordersTable_wrapper .dataTables_info {
  padding-top: 0.45rem;
}

.orders-page #ordersTable_wrapper .dataTables_paginate {
  text-align: right;
}

.orders-page table th.col-actions,
.orders-page table td.col-actions {
  text-align: right;
}

.orders-page #ordersTable thead th.col-actions {
  color: transparent !important;
  font-size: 0 !important;
  letter-spacing: 0 !important;
  user-select: none;
}
}

.orders-legend {
  background: #fff;
  border: 1px solid #e6eaf0;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  padding: 0.75rem 1.1rem;
}

.orders-legend summary {
  cursor: pointer;
  font-weight: 600;
  color: #344054;
}

.orders-legend-body {
  margin-top: 0.85rem;
}

.orders-chips-extra {
  display: contents;
}

.orders-chips-extra[hidden] {
  display: none;
}

.orders-chip-more {
  margin-top: 0.25rem;
}

.order-details-page .orders-hero {
  align-items: flex-start;
}

.order-details-page .orders-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
  max-width: none;
}

.order-details-page .orders-hero-actions .btn {
  white-space: nowrap;
}

.order-details-page .orders-kpi-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.45rem;
}

.order-details-page .orders-kpi-value {
  font-size: 1.15rem;
}

.order-details-page {
  --order-tile-gap: 1rem;
}

.order-details-page .orders-kpi {
  gap: var(--order-tile-gap);
}

.order-details-page .page-section--summary,
.order-details-page .page-section--filters,
.order-details-page .page-section--results,
.order-details-page .page-section--statistics,
.order-details-page .order-details-top-pair,
.order-details-page .page-section--items,
.order-details-page .page-section--manual-shipments,
.order-details-page .page-section--shipment-groups,
.order-details-page .page-section--notes,
.order-details-page .page-section--customer-history,
.order-details-page .order-details-main {
  margin-bottom: var(--order-tile-gap) !important;
}

.order-details-page .order-details-top-pair,
.order-details-page .order-details-main {
  margin-left: calc(var(--order-tile-gap) / -2);
  margin-right: calc(var(--order-tile-gap) / -2);
}

.order-details-page .order-details-top-pair > [class*="col-"],
.order-details-page .order-details-main > [class*="col-"] {
  padding-left: calc(var(--order-tile-gap) / 2);
  padding-right: calc(var(--order-tile-gap) / 2);
}

.order-details-page .page-section > .card,
.order-details-page .row > [class*="col-"] > .card {
  border: 1px solid #e6eaf0;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  overflow: hidden;
  margin-bottom: 0 !important;
}

.order-details-page .order-details-main > .col-lg-4 > .card:not(:last-child) {
  margin-bottom: var(--order-tile-gap) !important;
}

.order-details-page .page-section > .card > .card-header,
.order-details-page .row > [class*="col-"] > .card > .card-header {
  background: #fff !important;
  color: #101828 !important;
  border-bottom: 1px solid #eef2f6;
}

.order-details-page .page-section > .card > .card-header .card-title,
.order-details-page .row > [class*="col-"] > .card > .card-header .card-title {
  color: #101828;
  font-size: 0.95rem;
  font-weight: 650;
}

.order-details-page .page-section--availability .card-header.availability-has-shortage,
.order-details-page .page-section--availability .card-header.availability-has-shortage .card-title,
.order-details-page .page-section--availability .card-header.availability-has-shortage #availability-title,
.order-details-page .page-section--availability .card-header.availability-has-shortage i {
  color: #c1121f !important;
}

.order-details-page .page-section--notes .card-header.notes-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.75rem;
}

.order-details-page .notes-toolbar .card-title {
  float: none;
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
}

.order-details-page .notes-toolbar-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex: 0 0 auto;
}

.order-details-page .notes-toolbar-actions .btn-group,
.order-details-page .notes-toolbar-actions .btn {
  margin: 0;
}

.order-details-page .notes-toolbar-actions .btn-group .btn {
  margin: 0;
}

.order-details-page .note-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.order-details-page .timeline-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.orders-page table.table > thead > tr > th,
.order-details-page table.table > thead > tr > th {
  background: #f8fafc !important;
  color: #475467 !important;
  font-weight: 650;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  border-top: 0 !important;
  border-bottom: 1px solid #e6eaf0 !important;
  vertical-align: middle;
}

@media (min-width: 768px) {
  .orders-page #ordersTable.table > thead > tr > th,
  .orders-page #ordersTable.dataTable > thead > tr > th,
  .orders-page #ordersTable.dataTable thead th.sorting,
  .orders-page #ordersTable.dataTable thead th.sorting_asc,
  .orders-page #ordersTable.dataTable thead th.sorting_desc,
  .orders-page #ordersTable thead.table-light > tr > th {
    height: auto;
    min-height: 0;
    padding: 0.95rem 1rem;
    box-sizing: border-box;
    /* colours and type come from the shared table-header rule (section 7) */
    background: #f8fafc !important;
    color: #475467 !important;
    font-size: 0.75rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    border-top: 0 !important;
    border-bottom: 1px solid #e6eaf0 !important;
    white-space: nowrap;
    vertical-align: middle;
    box-shadow: none;
  }

  .orders-page #ordersTable.dataTable thead th.sorting:hover,
  .orders-page #ordersTable.dataTable thead th.sorting_asc:hover,
  .orders-page #ordersTable.dataTable thead th.sorting_desc:hover {
    background: #eef2f6 !important;
    color: #101828 !important;
  }
}

.orders-page .table-dark,
.orders-page .table-dark th,
.orders-page .table-dark td,
.order-details-page .table-dark,
.order-details-page .table-dark th,
.order-details-page .table-dark td {
  background-color: #f8fafc !important;
  color: #475467 !important;
  border-color: #e6eaf0 !important;
}

.order-details-page #orderItemsTable .btn-link,
.order-details-page #orderItemsTable .btn-link a {
  font-weight: 400 !important;
}

.order-details-page #orderItemsTable {
  width: 100%;
}

.order-details-page #orderItemsTable > thead > tr > th:nth-child(2),
.order-details-page #orderItemsTable > tbody > tr[data-item-id] > td:nth-child(2) {
  width: 100%;
}

.order-details-page #orderItemsTable > thead > tr > th:not(:nth-child(2)),
.order-details-page #orderItemsTable > tbody > tr[data-item-id] > td:not(:nth-child(2)) {
  width: 1%;
  white-space: nowrap;
}

.order-details-page #orderItemsTable > thead > tr > th:last-child,
.order-details-page #orderItemsTable > tbody > tr[data-item-id] > td.order-item-actions {
  text-align: right !important;
  padding-right: 0.4rem;
}

.order-details-page #orderItemsTable > tbody > tr[data-item-id] > td.order-item-actions .btn {
  margin-right: 0;
}

.order-details-page #orderItemsTable > tbody > tr[data-item-id] > td.order-item-actions .btn + .btn {
  margin-left: 0.25rem;
}

.order-details-page #orderItemsTable > tbody > tr[data-item-id] > td:nth-child(2) .btn-link {
  white-space: normal;
  text-align: left;
}

.order-details-page .order-item-meta {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.15rem;
  font-size: 0.8rem;
  white-space: nowrap;
}

.order-details-page .order-item-meta .btn-link {
  font-size: inherit;
  line-height: inherit;
  text-decoration: none;
}

.order-details-page.packing-details .packing-item-name {
  color: #101828;
  font-weight: 650;
  font-size: 0.92rem;
}

.orders-page .dataTables_filter {
  display: none;
}

@media (max-width: 1199.98px) {
  .orders-kpi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .orders-secondary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .hive-bom-add-btn {
    width: 100%;
    min-height: 44px;
  }

  .hive-bom-row-actions {
    width: 100%;
    justify-content: space-between;
  }

  .hive-bom-move .btn,
  .hive-bom-remove .btn {
    min-width: 44px;
    min-height: 44px;
  }
}

.content-wrapper,
.content .container-fluid {
  min-width: 0;
}

.summary-card .summary-value {
  font-size: clamp(1.4rem, 2vw, 2.1rem);
  line-height: 1.15;
  word-break: break-word;
}

.dataTables_wrapper {
  width: 100%;
}

@media (min-width: 768px) {
  body.sidebar-mini.sidebar-collapse .content-wrapper,
  body.sidebar-mini.sidebar-collapse .main-header,
  body.sidebar-mini.sidebar-collapse .main-footer {
    margin-left: 4.6rem !important;
  }
}

.help-tips {
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 0.65rem 1rem;
  background: #fff;
}
.help-tips > summary {
  cursor: pointer;
  font-weight: 600;
  color: #495057;
  outline: none;
}
.help-tips > summary:hover {
  color: #007bff;
}

.packing-workbench,
.packing-workbench .card,
.packing-workbench .dataTables_wrapper {
  width: 100%;
  max-width: 100%;
}

@media (max-width: 767.98px) {
  .content-wrapper,
  .content .container-fluid,
  .packing-workbench {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .content-wrapper:has(.packing-workbench) {
    padding-left: 8px;
    padding-right: 8px;
  }
}

.page-shell .card.summary-card {
  background: #fff !important;
  color: #101828 !important;
  border: 1px solid #e6eaf0;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.page-shell .card.summary-card .inner,
.page-shell .card.summary-card .inner h3,
.page-shell .card.summary-card h3,
.page-shell .card.summary-card .icon {
  color: #101828 !important;
}

.page-shell .card.summary-card .inner p,
.page-shell .card.summary-card p,
.page-shell .card.summary-card small,
.page-shell .card.summary-card .summary-label {
  color: #667085 !important;
}

.page-shell .card > .card-header.bg-primary,
.page-shell .card > .card-header.bg-success,
.page-shell .card > .card-header.bg-info,
.page-shell .card > .card-header.bg-warning,
.page-shell .card > .card-header.bg-danger {
  background: #fff !important;
  color: #101828 !important;
  border-bottom: 1px solid #eef2f6;
}

.page-shell .card > .card-header.bg-primary .card-title,
.page-shell .card > .card-header.bg-success .card-title,
.page-shell .card > .card-header.bg-info .card-title,
.page-shell .card > .card-header.bg-warning .card-title,
.page-shell .card > .card-header.bg-danger .card-title,
.page-shell .card > .card-header.bg-primary i,
.page-shell .card > .card-header.bg-success i,
.page-shell .card > .card-header.bg-info i,
.page-shell .card > .card-header.bg-warning i,
.page-shell .card > .card-header.bg-danger i {
  color: #101828 !important;
}

@media (min-width: 992px) {
  .page-shell.orders-page {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .packing-items-table td.text-center {
    vertical-align: middle;
  }
}

.fleet-trip-combo {
  position: relative;
}

.fleet-trip-results {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 30;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
}

.fleet-trip-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-bottom: 1px solid #f2f4f7;
  background: #fff;
  color: #101828;
  cursor: pointer;
}

.fleet-trip-option small {
  display: block;
  color: #667085;
  font-size: 0.75rem;
  margin-top: 0.1rem;
}

.fleet-trip-option:hover,
.fleet-trip-option.is-active {
  background: #f5f8ff;
}

.fleet-trip-empty {
  padding: 0.65rem 0.75rem;
  color: #667085;
  font-size: 0.82rem;
}

.swal2-popup .fleet-dispatch-form .form-group {
  margin-bottom: 0.75rem;
}

.order-trip-current {
  min-height: 2.5rem;
}

.order-trip-name {
  font-weight: 650;
  color: #101828;
  word-break: break-word;
}

.order-trip-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.assign-trip-table-wrap {
  max-height: 420px;
  overflow: auto;
  border: 1px solid #eef2f6;
  border-radius: 8px;
}

#assignTripTable .assign-trip-row {
  cursor: pointer;
}

#assignTripTable .assign-trip-row:hover {
  background: #f2f4f7;
}

/* Global Hive skin — same cards / titles as order details, on every page */
.content .page-section-heading,
.content .page-section-header h1,
.content .page-section-header .page-section-heading {
  font-size: 1.65rem;
  font-weight: 700;
  color: #101828;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.content .page-section-description,
.content .page-section-header p {
  color: #667085;
  margin-bottom: 0;
}

.content .card:not([class*="bg-"]):not(.small-box):not(.info-box) {
  border: 1px solid #e6eaf0;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.content .card > .card-header,
.content .card > .card-header.bg-primary,
.content .card > .card-header.bg-success,
.content .card > .card-header.bg-info,
.content .card > .card-header.bg-warning,
.content .card > .card-header.bg-danger,
.content .card > .card-header.bg-secondary,
.content .card > .card-header.bg-dark,
.content .card > .card-header.bg-teal,
.content .card > .card-header.bg-light,
.content .card-primary:not(.card-outline) > .card-header,
.content .card-success:not(.card-outline) > .card-header,
.content .card-info:not(.card-outline) > .card-header,
.content .card-warning:not(.card-outline) > .card-header,
.content .card-danger:not(.card-outline) > .card-header,
.content .card-secondary:not(.card-outline) > .card-header {
  background: #fff !important;
  color: #101828 !important;
  border-bottom: 1px solid #eef2f6;
}

.content .card > .card-header h1,
.content .card > .card-header h2,
.content .card > .card-header h3,
.content .card > .card-header h4,
.content .card > .card-header h5,
.content .card > .card-header h6,
.content .card > .card-header .card-title,
.content .card > .card-header .text-white {
  color: #101828 !important;
  font-size: 0.95rem;
  font-weight: 650;
}

.content .card > .card-header.bg-primary i,
.content .card-primary:not(.card-outline) > .card-header i {
  color: #2e90fa !important;
}

.content .card > .card-header.bg-success i,
.content .card-success:not(.card-outline) > .card-header i {
  color: #12b76a !important;
}

.content .card > .card-header.bg-info i,
.content .card-info:not(.card-outline) > .card-header i {
  color: #0ba5ec !important;
}

.content .card > .card-header.bg-warning i,
.content .card-warning:not(.card-outline) > .card-header i {
  color: #dc6803 !important;
}

.content .card > .card-header.bg-danger i,
.content .card-danger:not(.card-outline) > .card-header i,
.content .card.border-danger > .card-header i {
  color: #d92d20 !important;
}

.content .card > .card-header.bg-secondary i,
.content .card-secondary:not(.card-outline) > .card-header i {
  color: #667085 !important;
}

.content .form-control,
.content .custom-select,
.content .form-select {
  border-color: #d0d5dd;
  border-radius: 10px;
}

.content .input-group > .form-control,
.content .input-group > .custom-select,
.content .input-group > .form-select {
  border-radius: 0;
}

.content .input-group > .form-control:first-child,
.content .input-group > .custom-select:first-child,
.content .input-group > .form-select:first-child,
.content .input-group > .input-group-prepend:first-child > .input-group-text {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

.content .input-group > .form-control:last-child,
.content .input-group > .custom-select:last-child,
.content .input-group > .form-select:last-child,
.content .input-group > .input-group-append:last-child > .btn,
.content .input-group > .input-group-append:last-child > .input-group-text {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.content .form-control:focus,
.content .custom-select:focus,
.content .form-select:focus {
  border-color: #2e90fa;
  box-shadow: 0 0 0 0.2rem rgba(46, 144, 250, 0.12);
}

.order-details-page .card-body > .delivery-addr-check {
  margin: 0.9rem 0 0.15rem;
  padding: 0 0.15rem;
}
.order-details-page .delivery-mini-map {
  width: 100%;
  height: 240px;
  border-radius: 10px;
  margin: 0.55rem 0 0.15rem;
}
.entity-addr-check {
  margin-top: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
}
.entity-addr-check.is-ok { color: #1b7a4a; }
.entity-addr-check.is-warn { color: #b45309; }
.entity-addr-check.is-bad { color: #c1121f; }
.entity-addr-check ul {
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
  font-weight: 500;
}
.entity-addr-block {
  margin-top: 0.35rem;
}
.entity-mini-map {
  display: block;
  width: 100%;
  height: 180px;
  border: 0;
  border-radius: 10px;
  background: #e9ecef;
  margin-top: 0.55rem;
}

.entity-details-page .entity-mini-card {
  border: 1px solid #e6eaf0;
  border-radius: 12px;
  box-shadow: none;
  overflow: hidden;
}

.entity-details-page .entity-mini-card > .card-header {
  background: #fff !important;
  border-bottom: 1px solid #eef2f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
}

.entity-details-page .entity-mini-card > .card-header .card-title {
  font-size: 0.9rem;
  font-weight: 650;
  margin: 0;
  float: none;
}

.entity-details-page .entity-mini-card .btn-tool {
  color: #667085;
  padding: 0.15rem 0.35rem;
}

.entity-details-page .orders-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.entity-details-page .card-header.notes-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.75rem;
}

.entity-details-page .notes-toolbar .card-title {
  float: none;
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
}

.entity-details-page .notes-toolbar-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.entity-details-page .notes-toolbar-actions .btn,
.entity-details-page .notes-toolbar-actions .btn-group {
  margin: 0;
}

.entity-details-page .entity-section-search {
  width: 220px;
}

.entity-details-page .orders-table-header .card-tools {
  float: none;
  margin: 0;
}

.entity-details-page .page-section--metadata {
  margin-top: 1rem;
}

.entity-details-page .row > [class*="col-"] > .card {
  overflow: visible;
}

.entity-details-page .order-details-top-pair {
  align-items: flex-start;
}

.entity-details-page .entity-status-card {
  overflow: hidden;
}

.entity-details-page .entity-status-dl > dt,
.entity-details-page .entity-status-dl > dd {
  margin-bottom: 0.4rem;
  padding-top: 0.05rem;
  padding-bottom: 0.05rem;
  font-size: 0.9rem;
  line-height: 1.35;
}

.entity-details-page .entity-status-dl > dt {
  color: #667085;
  font-weight: 600;
}

.entity-details-page .entity-status-dl > dd:last-of-type {
  margin-bottom: 0;
}/* ==========================================================================
   Standard page template — applies to every view rendered inside _Layout.
   One gutter, one breadcrumb row, one title block, regardless of which
   wrapper markup (page-shell / container-fluid / AdminLTE .content) a view uses.
   ========================================================================== */

/* 1. One content gutter. Views that add their own container must not add a second one. */
@media (min-width: 768px) {
  .content-wrapper > .content {
    padding: 1rem 0.5rem 0;
  }

  .content-wrapper > .content > .page-shell {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .page-shell .page-shell,
  .page-shell .container-fluid,
  .page-shell > .container,
  .page-shell .content,
  .page-shell .content-header {
    padding-left: 0;
    padding-right: 0;
  }

  .page-shell .content {
    padding-top: 0;
    padding-bottom: 0;
  }

  .page-shell > .page-shell.mt-3,
  .page-shell > .orders-page.mt-3,
  .page-shell > .container-fluid.mt-3,
  .page-shell > .container-fluid.mt-4,
  .page-shell > .container.mt-4,
  .page-shell > .container-fluid.py-4 {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  /* Bootstrap containers inside dialogs keep their own gutter. */
  .page-shell .modal .container-fluid {
    padding-left: 7.5px;
    padding-right: 7.5px;
  }
}

/* A page-shell nested in the layout's page-shell never adds a second gutter (any width). */
.page-shell .page-shell {
  padding-left: 0;
  padding-right: 0;
}

/* 2. Breadcrumb row: right-aligned, no background, same spacing everywhere. */
.page-shell .breadcrumb {
  background: transparent;
  padding: 0;
  margin: 0 0 0.6rem;
  justify-content: flex-end;
  float: none !important;
  font-size: 0.9rem;
}

.page-shell .breadcrumb-item,
.page-shell .breadcrumb-item a,
.page-shell .breadcrumb-item .text-muted {
  color: #667085 !important;
}

.page-shell .breadcrumb-item a:hover {
  color: #007bff !important;
}

.page-shell .breadcrumb-item.active {
  color: #344054 !important;
}

.page-shell nav[aria-label="breadcrumb"] {
  margin-bottom: 0 !important;
}

/* 3. Title block: heading + description on the left, actions on the right. */
.page-shell h1 {
  font-size: 1.65rem;
  font-weight: 700;
  color: #101828;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 0.25rem;
}

.page-shell h1 > i:first-child {
  display: none;
}

.page-shell .page-section-header,
.page-shell .orders-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.page-shell .page-section--title {
  margin-bottom: 1rem !important;
}

.page-shell .page-section--title p {
  color: #667085 !important;
  margin: 0;
}

.page-shell .orders-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

/* 4. The breadcrumb row sits directly above the title. */
.page-shell .page-section.page-section--navigation {
  margin-bottom: 0 !important;
}

@media (max-width: 767.98px) {
  .page-shell h1 {
    font-size: 1.28rem;
    word-break: break-word;
  }

  .page-shell .breadcrumb {
    justify-content: flex-start;
    font-size: 0.8rem;
  }

  .page-shell .page-section-header,
  .page-shell .orders-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .page-shell .orders-hero-actions {
    justify-content: flex-start;
  }

  .page-shell .orders-hero-actions .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* 5. Sticky toasts (errors, warnings) must stay readable and closable. */
#toast-container > .toast {
  opacity: 1;
}

#toast-container > div {
  width: 22rem;
  max-width: calc(100vw - 1.5rem);
}

/* 6. Confirmation dialog buttons follow the app's button shape. */
.swal2-popup .swal2-actions .swal2-styled {
  border-radius: 10px;
  font-weight: 600;
}

/* 7. Table headers: one look for every table. Same values as the rule the order
      screens already use (.orders-page / .order-details-page), so those stay as they are. */
.page-shell table.table > thead > tr > th,
.swal2-popup table.table > thead > tr > th {
  background: #f8fafc !important;
  color: #475467 !important;
  font-weight: 650;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  border-top: 0 !important;
  border-bottom: 1px solid #e6eaf0 !important;
  vertical-align: middle;
}

/* Header colour classes (table-dark, thead-dark, bg-primary…) no longer tint the row itself. */
.page-shell table.table > thead,
.page-shell table.table > thead > tr {
  background: #f8fafc !important;
  color: #475467 !important;
}

.page-shell table.table > thead > tr > th a,
.page-shell table.table > thead > tr > th i {
  color: inherit !important;
}

/* Header height: every table gets the row height of the order list (desktop).
   The order details page keeps its own compact item tables. */
@media (min-width: 768px) {
  .content-wrapper > .content > .page-shell:not(:has(#orderItemsTable)) table.table > thead > tr > th {
    padding-top: 0.95rem;
    padding-bottom: 0.95rem;
    white-space: nowrap;
  }
}

/* ==========================================================================
   Tables fill their card (the Trips list is the reference): no gutter between
   the card edge and the table. Other content of the same card keeps its inset.
   The order details page is left as it is.
   ========================================================================== */
.content-wrapper > .content > .page-shell:not(:has(#orderItemsTable)) .card > .card-body:has(> .table-responsive, > table.table, > .dataTables_wrapper) {
  padding-left: 0;
  padding-right: 0;
}

.content-wrapper > .content > .page-shell:not(:has(#orderItemsTable)) .card > .card-body:has(> .table-responsive:first-child, > table.table:first-child, > .dataTables_wrapper:first-child) {
  padding-top: 0;
}

.content-wrapper > .content > .page-shell:not(:has(#orderItemsTable)) .card > .card-body:has(> .table-responsive:last-child, > table.table:last-child, > .dataTables_wrapper:last-child) {
  padding-bottom: 0;
}

.content-wrapper > .content > .page-shell:not(:has(#orderItemsTable)) .card > .card-body:has(> .table-responsive, > table.table, > .dataTables_wrapper) > :not(.table-responsive):not(table):not(.dataTables_wrapper):not(.position-absolute):not(.modal) {
  margin-left: 1.25rem;
  margin-right: 1.25rem;
}

.page-shell .card > .card-body > .table-responsive > table.table,
.page-shell .card > .card-body > table.table {
  margin-bottom: 0;
}

/* A table placed straight in the card body scrolls sideways instead of spilling out. */
.page-shell .card > .card-body:has(> table.table) {
  overflow-x: auto;
}

/* DataTables: the table row is flush, the controls above and below keep an inset. */
.page-shell .card .dataTables_wrapper > .row {
  margin-left: 0;
  margin-right: 0;
}

.page-shell .card .dataTables_wrapper > .row > [class*="col-"]:has(> table) {
  padding-left: 0;
  padding-right: 0;
}

.page-shell .card .dataTables_wrapper > .row:not(:has(table)) {
  padding: 0.6rem 0.75rem;
  align-items: center;
}

.page-shell .card .dataTables_wrapper .dataTables_info {
  padding-top: 0;
  color: #667085;
  font-size: 0.875rem;
}

.page-shell .card .dataTables_wrapper .dataTables_paginate .pagination {
  margin: 0;
}

/* Flush tables keep their text off the card edge: first and last cells get the card's inset. */
.content-wrapper > .content > .page-shell:not(:has(#orderItemsTable)) .card > .card-body > .table-responsive > table.table > * > tr > :first-child,
.content-wrapper > .content > .page-shell:not(:has(#orderItemsTable)) .card > .card-body > table.table > * > tr > :first-child,
.content-wrapper > .content > .page-shell:not(:has(#orderItemsTable)) .card .dataTables_wrapper table.table > * > tr > :first-child {
  padding-left: 1.25rem;
}

.content-wrapper > .content > .page-shell:not(:has(#orderItemsTable)) .card > .card-body > .table-responsive > table.table > * > tr > :last-child,
.content-wrapper > .content > .page-shell:not(:has(#orderItemsTable)) .card > .card-body > table.table > * > tr > :last-child,
.content-wrapper > .content > .page-shell:not(:has(#orderItemsTable)) .card .dataTables_wrapper table.table > * > tr > :last-child {
  padding-right: 1.25rem;
}

/* Pager of server-paginated lists: same line as the DataTables footer —
   "Pozycje od … do … z …" on the left, page links on the right. */
.page-shell .hive-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.6rem 1.25rem;
  margin: 0;
  background: #fff;
  color: #667085;
  font-size: 0.875rem;
}

.page-shell .hive-pager .text-muted,
.page-shell .hive-pager .dataTables_info {
  color: #667085 !important;
}

.page-shell .hive-pager .pagination {
  margin: 0;
}

.page-shell .hive-pager > nav {
  order: 3;
}

.page-shell .hive-pager > :has(select) {
  margin-left: auto;
}

/* Panels follow the Orders list: the header, body and footer share the card's rounded corners,
   every card has the same soft shadow, and header titles carry no icon. */
.page-shell .card > .card-header:first-child {
  border-top-left-radius: 13px;
  border-top-right-radius: 13px;
}

.page-shell .card > .card-body:last-child,
.page-shell .card > .card-footer:last-child,
.page-shell .card > .collapse:last-child > .card-body:last-child,
.page-shell .card > .collapse:last-child > .card-footer:last-child {
  border-bottom-left-radius: 13px;
  border-bottom-right-radius: 13px;
}

/* A table reaching the card edge would paint square corners over the rounded ones. */
.page-shell .card > .card-body:last-child:has(> .table-responsive, > table, > .dataTables_wrapper):not(:has(.dropdown-menu, .select2, .hive-combo)) {
  overflow: hidden;
}

.page-shell .card.shadow,
.page-shell .card.shadow-sm {
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04) !important;
}

.page-shell .card > .card-header :is(h2, h3, h4, h5, h6, .card-title) > i:first-child {
  display: none;
}

/* Tables: tags are pills like the status badge, and row actions are separate rounded buttons
   (as on the Employees list) instead of a joined button group. */
.page-shell table.table .badge {
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
  font-weight: 600;
}

.page-shell table.table td .btn-group {
  gap: 0.25rem;
}

.page-shell table.table td .btn-group > .btn,
.page-shell table.table td .btn-group > form > .btn {
  border-radius: 0.2rem !important;
  margin-left: 0 !important;
  flex: 0 0 auto;
}

/* #131: customer order history under the notes */
.page-section--customer-history .customer-history-summary dt {
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.page-section--customer-history .customer-history-summary dd {
  margin-bottom: 0.35rem;
}
.page-section--customer-history .customer-history-frame,
.page-section--customer-history .customer-history-kind {
  margin: 0 0.25rem 0.25rem 0;
  font-size: 0.85em;
}
.page-section--customer-history .customer-history-kind {
  border: 1px solid #dee2e6;
}

/* Logi API kurierów (#270) */
.carrier-api-log-url {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.carrier-api-log-body {
  max-height: 480px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 8px;
}
.carrier-api-logs-toggle {
  cursor: pointer;
}

/* e-Nadawca (Pocztex) #292: the selected folder keeps its date readable */
.e-nadawca-folder.active .text-muted {
    color: rgba(255, 255, 255, 0.85) !important;
}
