.customer-table-wrap {
  max-width: 1040px;
  border-color: #dedee2;
  border-radius: 10px;
}
.customer-count {
  white-space: nowrap;
  font-size: 10px;
}
.customer-count strong,
.customer-count small {
  display: block;
  text-align: center;
  font-size: 10px;
}
.customer-form {
  grid-template-columns: 1fr 1fr;
}
.customer-form > label:has([name='name']),
.customer-form > label:has([name='address']),
.customer-form > .form-footer,
.customer-form > .customer-paste,
.customer-form > .customer-form-help,
.customer-form > .same-calling {
  grid-column: 1/-1;
}
.customer-dialog {
  width: min(640px, calc(100vw - 24px));
}
.customer-paste {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #f8fafc;
}
.customer-paste summary {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.customer-paste summary::before {
  content: '›';
  font-size: 16px;
}
.customer-paste[open] summary::before {
  transform: rotate(90deg);
}
.customer-paste summary .icon {
  width: 15px;
  vertical-align: middle;
  margin-right: 6px;
}
.customer-paste textarea {
  width: 100%;
  margin: 10px 0 5px;
}
.customer-form-help {
  margin: 0;
  font-size: 11px;
}
.invoice-preview-dialog {
  width: min(844px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  background: #e9eef5;
}
.invoice-preview-dialog > .modal-head {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  padding: 0;
}
.invoice-preview-dialog > .modal-head button {
  display: none;
}
.invoice-preview-dialog > .modal-body {
  padding: 14px 18px 12px;
}
.invoice-preview-tools {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
}
.invoice-preview-tools label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  margin-right: auto;
}
.invoice-preview-tools select {
  padding: 5px 8px;
  min-height: 32px;
  width: auto;
}
.invoice-preview-tools button:last-child {
  font-size: 22px;
  padding: 0 8px;
}
.invoice-paper-scroll {
  max-height: calc(100dvh - 160px);
  overflow: auto;
  padding: 1px;
}
.invoice-paper {
  width: 100%;
  display: block;
  max-width: 760px;
  margin: auto;
  background: white;
  box-shadow: 0 2px 5px #0002;
}
.invoice-preview-footer {
  font-size: 11px;
  color: #596577;
  padding-top: 10px;
  text-align: center;
}
.customer-form > .same-calling {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}
.customer-form > .same-calling input {
  width: 14px;
  min-height: 14px;
}
.customer-table td:first-child button.customer-credit-line {
  font-size: 10px;
  min-height: 20px;
  padding: 2px 5px;
  color: #087b72;
  background: #eef9f5;
  border-color: #bfddd6;
  margin-top: 4px;
}
@media (max-width: 760px) {
  .customer-form {
    grid-template-columns: 1fr;
  }
  .customer-table .whatsapp-link {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
  }
}

/* Order overview uses the approved full-page two-column arrangement. */
.order-detail-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.order-detail-banner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid #e0e3e7;
  border-left: 3px solid #75879b;
  border-radius: 10px;
  padding: 16px;
  background: #fff;
  margin-bottom: 12px;
}
.order-detail-banner small {
  font-size: 10px;
  font-weight: 650;
  display: block;
}
.order-detail-banner h1 {
  font-size: 22px;
  margin: 6px 0 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-transform: capitalize;
}
.order-detail-banner p {
  font-size: 11px;
  color: #657184;
  margin: 0;
  line-height: 1.7;
}
.order-detail-banner > div:last-child {
  text-align: right;
}
.order-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(270px, 1fr);
  gap: 12px;
  align-items: start;
}
.order-detail-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.order-detail-card {
  padding: 14px;
  background: #fff;
  border: 1px solid #dfe3e8;
  border-radius: 9px;
  min-width: 0;
}
.order-detail-card h2 {
  font-size: 14px;
  margin: 0 0 10px;
  color: #293e55;
}
.order-detail-code {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  background: #f5f7fa;
  border: 1px solid #dfe5ec;
  border-radius: 5px;
  padding: 9px 11px;
  margin-bottom: 12px;
  font-size: 10px;
  color: #40576f;
}
.order-detail-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.order-detail-field.wide {
  grid-column: 1/-1;
}
.order-detail-field > span {
  display: block;
  font-size: 10px;
  color: #758194;
  margin-bottom: 5px;
}
.order-detail-field > div {
  border: 1px solid #dce1e7;
  background: #fafbfc;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.5;
  min-height: 35px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.order-detail-items article {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #eaedf0;
}
.order-detail-items article:last-child {
  border: 0;
}
.order-detail-items article > div:not(.product-thumb) {
  min-width: 0;
  flex: 1;
}
.order-detail-items strong {
  font-size: 12px;
  line-height: 1.5;
  display: block;
}
.order-detail-items small,
.order-payment-history small {
  display: block;
  font-size: 10px;
  color: #758194;
  margin-top: 5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.order-detail-items b,
.order-payment-history b {
  font-size: 12px;
  white-space: nowrap;
}
.order-payment-summary dl {
  margin: 0 0 14px;
}
.order-payment-summary dl > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  font-size: 11px;
}
.order-payment-summary dt {
  color: #67758a;
}
.order-payment-summary dd {
  margin: 0;
  text-align: right;
  line-height: 1.5;
}
.order-payment-summary .summary-total {
  border-top: 1px solid #dfe4eb;
  font-size: 13px;
  font-weight: 700;
}
.order-detail-actions {
  display: grid;
  gap: 6px;
}
.order-payment-history article {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e5e8ed;
  padding: 10px 0;
}
.order-payment-history article:last-child {
  border: 0;
}
.order-payment-history strong {
  font-size: 12px;
}
.order-detail-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}
.order-detail-timeline li {
  padding: 0 0 16px 14px;
  border-left: 2px solid #dce3ec;
  position: relative;
}
.order-detail-timeline li:before {
  content: '';
  position: absolute;
  left: -5px;
  top: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6d829b;
}
.order-detail-timeline strong {
  display: block;
  font-size: 11px;
  line-height: 1.5;
}
.order-detail-timeline small {
  display: block;
  font-size: 10px;
  color: #7d8899;
  margin-top: 5px;
}
@media (max-width: 760px) {
  .order-detail-layout {
    display: flex;
    flex-direction: column;
  }
  .order-payment-summary {
    order: -1;
    width: 100%;
  }
  .order-detail-main {
    width: 100%;
  }
  .order-detail-banner {
    padding: 12px;
    gap: 10px;
  }
  .order-detail-banner h1 {
    font-size: 19px;
  }
  .order-detail-banner > div:last-child {
    max-width: 110px;
  }
  .order-detail-card {
    padding: 12px;
  }
  .order-detail-items b {
    font-size: 11px;
  }
}
.customer-table {
  min-width: 800px;
  table-layout: fixed;
}
.customer-table th {
  background: #fafafa;
  text-transform: none;
  letter-spacing: 0;
  color: #48494d;
  font-size: 12px;
  padding: 9px 12px;
}
.customer-table td {
  padding: 9px 12px;
}
.customer-table th:nth-child(1) {
  width: 22%;
}
.customer-table th:nth-child(2) {
  width: 13%;
}
.customer-table th:nth-child(3) {
  width: 32%;
}
.customer-table th:nth-child(4) {
  width: 21%;
}
.customer-table th:nth-child(5) {
  width: 12%;
}
/* Keep the approved tablet/mobile scroll layout. Desktop extra space belongs
   to customer identity and address, not wider buttons or taller rows. */
@media (min-width: 1201px) {
  .customer-table-wrap {
    max-width: none;
    width: 100%;
  }
  .customer-table th:nth-child(1) {
    width: 30%;
  }
  .customer-table th:nth-child(2) {
    width: 120px;
  }
  .customer-table th:nth-child(3) {
    width: auto;
  }
  .customer-table th:nth-child(4) {
    width: 200px;
  }
  .customer-table th:nth-child(5) {
    width: 110px;
  }
}
.customer-name {
  font-size: 12px;
  font-weight: 700;
}
.whatsapp-link {
  color: #008d91;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: 11px;
  line-height: 20px;
}
.city-badge {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  color: #2167a9;
  background: #f0f6ff;
  border: 1px solid #d6e4fa;
  border-radius: 5px;
  font-size: 11px;
  padding: 3px 6px;
  white-space: nowrap;
}
.customer-address {
  color: #718096;
  font-size: 11px;
  line-height: 1.5;
}
.row-actions {
  gap: 6px;
  flex-wrap: nowrap;
}
.row-actions .new-order {
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid #138569;
  border-radius: 9px;
  background: #159570;
  color: #fff;
  font-size: 11px;
  box-shadow: 0 2px 5px #146b5518;
}
.row-icon-button {
  height: 36px;
  width: 36px;
  min-width: 36px;
  border: 1px solid #d7e2ee;
  background: #fff;
  border-radius: 9px;
  color: #607791;
  padding: 8px;
}
.customer-code {
  font-size: 10px;
  padding: 4px 6px;
  border: 1px solid #dedee3;
  background: #fafafa;
  border-radius: 5px;
  white-space: nowrap;
}
.page-customers > .toolbar > .search-field {
  max-width: 360px;
}
.page-customers > .toolbar > .primary {
  margin-left: auto;
}
.orders-table {
  min-width: 900px;
}
.orders-table th {
  font-size: 9px;
  padding: 8px 10px;
}
.orders-table td {
  padding: 8px 10px;
}
.orders-table th:first-child {
  width: 32px;
}
.orders-table th:nth-child(2) {
  width: 12%;
}
.orders-table th:nth-child(3) {
  width: 22%;
}
.orders-table th:nth-child(4),
.orders-table td:nth-child(4) {
  width: 96px;
  min-width: 96px;
}
.orders-table th:nth-child(5) {
  width: 13%;
}
.order-code {
  display: grid;
  gap: 2px;
  font-size: 10px;
  margin-top: 7px;
  color: #56667b;
}
.order-code small {
  font-size: 8px;
  color: #6b7d94;
}
.business-label {
  display: block;
  font-size: 8px;
  line-height: 1.35;
  text-transform: uppercase;
  color: #8a96a5;
}
.orders-table p {
  margin: 2px 0;
  font-size: 10px;
}
.orders-table .awb {
  display: block;
  font-size: 9px;
  line-height: 1.25;
  margin-top: 1px;
  color: #946f1b;
  overflow-wrap: anywhere;
}
.orders-reference-code {
  display: block;
  margin-top: 1px;
  color: #728095;
  font-size: 8px;
  font-weight: 650;
  line-height: 1.25;
}
.orders-customer-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 5px;
  min-width: 0;
}
.orders-customer-code {
  flex: none;
  border: 1px solid #dfe4ea;
  border-radius: 4px;
  color: #65758a;
  background: #fafbfc;
  padding: 1px 4px;
  font-size: 9px;
  font-weight: 650;
  line-height: 1.35;
  white-space: nowrap;
}
.order-total {
  display: grid;
  justify-items: start;
  gap: 3px;
}
.order-total > strong {
  font-size: 12px;
}
.orders-item-count {
  width: 32px;
  min-width: 32px;
  height: 32px;
  margin-inline: auto;
  padding: 6px;
  border-radius: 50%;
  color: #6283ac;
  background: #f3f8ff;
  border: 1px solid #d5e2f4;
  display: grid;
  place-items: center;
}
.orders-item-count .icon {
  width: 14px;
  height: 14px;
}
.page-orders > .toolbar > .search-field {
  max-width: 440px;
}
.orders-table .order-actions-trigger {
  min-width: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d3dce8;
  background: #fff;
  border-radius: 5px;
  cursor: pointer;
  padding: 7px 12px;
  font-size: 10px;
}
.floating-action-popover {
  position: fixed;
  z-index: 60;
  display: grid;
  gap: 3px;
  min-width: 120px;
  max-width: calc(100vw - 16px);
  max-height: calc(100dvh - 16px);
  overflow: auto;
  padding: 4px;
  border: 1px solid #d9e0e8;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 6px 16px #1b2a3d18;
}
.floating-action-popover button {
  width: 100%;
}
.lead-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 12px;
}
.lead-stat {
  border: 1px solid #e1e3e6;
  border-radius: 7px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  background: #fff;
  min-width: 130px;
}
.lead-stat-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  background: #f2f3f5;
  border-radius: 6px;
  flex: none;
  color: #737d89;
}
.lead-stat > div > span {
  display: block;
  font-size: 8px;
  font-weight: 650;
  text-transform: uppercase;
  color: #74777e;
  letter-spacing: 0.4px;
}
.lead-stat strong {
  font-size: 15px;
  display: block;
  margin-top: 4px;
}
.lead-filters {
  display: grid;
  grid-template-columns: 2.4fr 1fr 1.5fr 1.1fr;
  gap: 8px;
  padding: 9px;
  border: 1px solid #e1e3e6;
  border-radius: 9px;
  margin-bottom: 10px;
  background: #fff;
}
.lead-filters label {
  min-width: 0;
}
.lead-filters label > span {
  font-size: 9px;
  font-weight: 650;
  text-transform: uppercase;
  color: #60646a;
  display: block;
  margin-bottom: 4px;
}
.lead-filters input,
.lead-filters select {
  width: 100%;
  height: 34px;
  font-size: 11px;
}
.lead-table-heading,
.lead-row {
  display: grid;
  /* Customer details stay compact. Give the order-items area the usable
     breathing room so product cards do not get visually compressed. */
  grid-template-columns: 80px minmax(175px, 0.25fr) minmax(490px, 1fr) 96px 72px;
  min-width: 970px;
  gap: 10px;
}
.lead-table-heading {
  padding: 9px 10px;
  background: #f0f4f9;
  font-size: 9px;
  font-weight: 650;
  text-transform: uppercase;
  border: 1px solid #dfe3e9;
  border-radius: 7px 7px 0 0;
  color: #697b92;
}
.lead-row {
  padding: 8px 10px;
  border: 1px solid #e0e3e8;
  border-radius: 7px;
  margin-bottom: 10px;
  background: #f6f7f9;
  align-items: start;
}
.lead-row.live-lead {
  background: #f5f2fb;
  border-left: 3px solid #9181a7;
}
.lead-order-id label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.lead-order-id small {
  display: block;
  font-size: 9px;
  line-height: 1.35;
  color: #767b84;
  margin: 3px 0 0 20px;
}
.lead-customer {
  font-size: 11px;
  line-height: 1.35;
  align-self: start;
  padding-top: 1px;
}
.lead-customer > strong {
  display: block;
  margin-bottom: 2px;
}
.lead-customer > small {
  display: block;
  font-size: 9px;
  color: #666c74;
  margin-top: 2px;
}
.lead-customer .platform-handle {
  display: block;
  padding: 1px 0;
  min-height: 0;
  border: 0;
  background: transparent;
  color: #52678c;
  font-size: 10px;
  text-align: left;
  overflow-wrap: anywhere;
}
.lead-whatsapp {
  display: block;
  font-size: 9px;
  color: #177557;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.lead-address {
  display: -webkit-box;
  line-height: 1.3;
  overflow-wrap: anywhere;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.lead-customer-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.lead-customer-tags span {
  font-size: 8px;
  background: white;
  border: 1px solid #dcdfe5;
  border-radius: 4px;
  padding: 2px 5px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.lead-items {
  min-width: 0;
}
.lead-add-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #dce0e6;
  border-radius: 5px;
  padding: 4px 8px;
  margin-bottom: 8px;
  color: #616975;
}
.lead-add-item input {
  border: 0;
  min-width: 0;
  flex: 1;
  font-size: 10px;
  background: transparent;
  min-height: 26px;
  padding: 3px;
}
.lead-items-scroll {
  display: grid;
  gap: 7px;
  overflow: visible;
  max-width: 100%;
  scrollbar-width: thin;
}
.lead-item {
  display: grid;
  grid-template-columns: 34px minmax(90px, 1fr) 48px 40px 26px 70px 26px;
  align-items: center;
  gap: 7px;
  min-height: 68px;
  padding: 10px 9px;
  background: white;
  border: 1px solid #e0e3e7;
  border-radius: 6px;
  min-width: 0;
}
.lead-item-tool {
  min-width: 24px;
  min-height: 28px;
  padding: 3px;
  border: 0;
  background: transparent;
}
.lead-item.lead-item-readonly {
  grid-template-columns: 34px minmax(90px, 1fr) 48px 40px 70px;
}
.lead-item-tool:last-child {
  margin-left: 5px;
}
.lead-item-dialog {
  width: min(430px, calc(100vw - 24px));
}
.lead-item-dialog .form-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.lead-product-results:empty {
  display: none;
}
.lead-product-results {
  margin-bottom: 8px;
  border: 1px solid #dddfe4;
  background: #fff;
  border-radius: 5px;
  padding: 5px;
}
.lead-product-choice {
  display: grid;
  grid-template-columns: 32px minmax(90px, 1fr) auto auto;
  gap: 6px;
  align-items: center;
  padding: 4px;
  border-bottom: 1px solid #eee;
  font-size: 10px;
}
.lead-product-choice .product-thumb {
  width: 30px;
  height: 34px;
  min-width: 30px;
}
.lead-product-choice small {
  display: block;
  font-size: 9px;
  color: #666;
}
.lead-product-choice button {
  padding: 4px 8px;
  min-height: 28px;
  font-size: 10px;
}
.lead-item .product-thumb {
  width: 32px;
  height: 40px;
  min-width: 32px;
}
.lead-item-info > strong {
  display: block;
  font-size: 10px;
  line-height: 1.5;
}
.lead-item-info small {
  display: block;
  font-size: 8px;
  color: #80858f;
  line-height: 1.5;
}
.lead-item-tags {
  display: inline-block;
  font-size: 7px;
  background: #f0f2f5;
  border-radius: 3px;
  padding: 2px 4px;
  margin: 4px 0;
  text-transform: uppercase;
}
.lead-item label > span {
  font-size: 8px;
  display: block;
  color: #777e89;
  margin-bottom: 3px;
}
.lead-item input {
  width: 100%;
  height: 29px;
  min-height: 29px;
  border: 1px solid #dce1e7;
  border-radius: 4px;
  background: #fafbfc;
  padding: 5px;
  font-size: 10px;
}
.lead-line-amount {
  text-align: right;
}
.lead-line-amount small {
  display: block;
  font-size: 7px;
  color: #80858f;
}
.lead-line-amount strong {
  display: block;
  font-size: 9px;
  margin-top: 5px;
}
.lead-totals {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.lead-totals > span {
  font-size: 8px;
  color: #747b86;
}
.lead-totals > strong {
  font-size: 13px;
  margin-bottom: 7px;
  white-space: nowrap;
}
.lead-totals .lead-profit {
  color: #237559;
  font-size: 12px;
  display: grid;
  gap: 2px;
  margin-bottom: 0;
}
.lead-totals .lead-profit small {
  display: block;
  width: 100%;
  margin-left: 0;
  text-align: center;
  color: inherit;
  font-size: 9px;
  font-weight: 650;
}
.lead-actions {
  align-self: start;
  min-width: 0;
  box-sizing: border-box;
  width: 100%;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d3dce8;
  background: #fff;
  border-radius: 5px;
  cursor: pointer;
  padding: 6px 8px;
  font-size: 10px;
}
.lead-action-stack {
  display: grid;
  gap: 6px;
}
.lead-action-stack .lead-action {
  width: 100%;
}
.lead-action {
  border: 1px solid #dadee4;
  border-radius: 5px;
  min-height: 29px;
  padding: 6px;
  font-size: 9px;
  color: #323943;
  background: #fff;
}
.lead-action.invoice {
  background: #252b34;
  color: #fff;
  border-color: #252b34;
}
.lead-action.submit {
  color: white;
  background: #1c875d;
  border-color: #1c875d;
  text-transform: uppercase;
}
.lead-action.cancel {
  color: #b9444c;
  border-color: #efd7da;
}
.lead-action.remarks {
  background: #f7f7fa;
}
@media (min-width: 761px) and (max-width: 1200px) {
  .lead-table-heading,
  .lead-row {
    grid-template-columns: 70px 140px minmax(420px, 1fr) 90px 65px;
    gap: 8px;
  }
}
/* Approved mobile Sales Lead remains one horizontally scrollable list. */
.lead-board {
  overflow: auto;
  scrollbar-width: thin;
}
.lead-canceled {
  flex: 1;
  min-width: 100px;
  background: #fff7f8;
  color: #b74353;
  border-color: #f0d5da;
  opacity: 1;
}
.canceled-banner {
  justify-content: space-between;
}
.canceled-banner > div {
  display: grid;
  gap: 2px;
}
.canceled-banner small {
  color: #7d6970;
  font-size: 9px;
}
.canceled-banner button {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 10px;
}
.canceled-lead-filters {
  grid-template-columns: minmax(180px, 2fr) minmax(130px, 1fr) minmax(150px, 1fr);
}
.lead-history-board {
  overflow: auto;
  scrollbar-width: thin;
}
.lead-canceled-heading,
.lead-canceled-row {
  display: grid;
  grid-template-columns: 90px minmax(150px, 0.8fr) minmax(410px, 2.4fr) 100px;
  gap: 10px;
  min-width: 800px;
}
.lead-canceled-heading {
  padding: 8px 10px;
  border: 1px solid #dfe3e9;
  border-radius: 7px 7px 0 0;
  background: #f0f4f9;
  color: #697b92;
  font-size: 9px;
  font-weight: 650;
  text-transform: uppercase;
}
.lead-canceled-row {
  align-items: start;
  margin-bottom: 7px;
  padding: 9px 10px;
  border: 1px solid #ead9dc;
  border-left: 3px solid #c9636c;
  border-radius: 0 0 7px 7px;
  background: #fffafb;
}
.lead-canceled-invoice > div {
  display: flex;
  align-items: center;
  gap: 5px;
}
.lead-canceled-invoice > div > span {
  display: grid;
  width: 15px;
  height: 15px;
  place-items: center;
  border-radius: 50%;
  background: #f3dce0;
  color: #a33d48;
  font-size: 11px;
  font-weight: 800;
}
.lead-canceled-invoice small,
.lead-canceled-customer small {
  display: block;
  margin-top: 3px;
  color: #777c85;
  font-size: 8px;
  line-height: 1.35;
}
.lead-canceled-customer > strong {
  display: block;
  font-size: 11px;
}
.lead-canceled-products {
  display: grid;
  gap: 6px;
}
.lead-canceled-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: start;
  gap: 7px;
  padding-bottom: 6px;
  border-bottom: 1px solid #efe5e7;
}
.lead-canceled-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.lead-canceled-item .product-thumb {
  width: 32px;
  height: 38px;
  min-width: 32px;
}
.lead-canceled-item > div:nth-child(2) {
  min-width: 0;
}
.lead-canceled-item strong,
.lead-canceled-item small,
.lead-canceled-item b {
  display: block;
}
.lead-canceled-item > div:nth-child(2) > strong {
  font-size: 10px;
  line-height: 1.35;
}
.lead-canceled-item small {
  margin-top: 2px;
  color: #747a84;
  font-size: 8px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.lead-canceled-item b {
  margin-top: 3px;
  color: #994852;
  font-size: 8px;
  line-height: 1.35;
}
.lead-canceled-item .lead-cancel-reason {
  color: #994852;
}
.lead-canceled-item .lead-cancel-note {
  color: #647081;
}
.lead-canceled-amount {
  padding-top: 2px;
  color: #29333f;
  font-size: 10px;
  white-space: nowrap;
}
.lead-canceled-total {
  display: grid;
  justify-items: start;
  gap: 3px;
}
.lead-canceled-total span {
  color: #747b86;
  font-size: 8px;
}
.lead-canceled-total strong {
  font-size: 12px;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .lead-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }
  .lead-stat {
    min-width: 0;
    padding: 10px;
    gap: 0;
  }
  .lead-stat-icon {
    display: none;
  }
  .lead-stat strong {
    font-size: 12px;
    white-space: nowrap;
  }
  .lead-canceled {
    min-width: 0;
    font-size: 10px;
  }
  .canceled-banner {
    align-items: flex-start;
  }
  .canceled-banner button {
    flex: none;
  }
  .canceled-lead-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .canceled-lead-filters > label:first-child {
    grid-column: 1/-1;
  }
  .lead-canceled-heading,
  .lead-canceled-row {
    min-width: 800px;
    width: 800px;
  }
  .lead-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .lead-filters > label:first-child {
    grid-column: 1/-1;
  }
  .lead-filters input,
  .lead-filters select {
    height: 34px;
    min-height: 34px;
    font-size: 11px;
    padding: 5px;
  }
  .lead-row,
  .lead-table-heading {
    min-width: 944px;
    width: 944px;
    grid-template-columns: 84px 132px 420px 92px 72px;
    gap: 7px;
    padding: 8px;
  }
  .lead-row {
    padding: 8px;
  }
  .lead-table-heading {
    display: grid;
  }
  .lead-item {
    min-width: 0;
  }
  .lead-customer > strong {
    font-size: 11px;
  }
  .lead-item input {
    min-height: 36px;
  }
  .lead-action {
    min-height: 36px;
    font-size: 10px;
  }
  .customer-table .row-actions .new-order,
  .row-icon-button {
    min-height: 40px;
  }
  .customer-table .row-icon-button {
    width: 40px;
    min-width: 40px;
  }
}
.mobile-business {
  display: none;
}
@media (max-width: 760px) {
  .page-orders > .business-chips {
    display: none;
  }
  .mobile-business {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0;
    padding: 8px;
    background: #fff;
    color: #6b7480;
    font-size: 10px;
  }
  .mobile-business select {
    flex: 1;
    font-size: 12px;
  }
  .page-orders > .toolbar > .search-field {
    flex-basis: 100%;
    max-width: none;
    order: -1;
  }
  .page-orders > .toolbar > button {
    padding: 6px 8px;
    font-size: 10px;
  }
  .page-orders > .toolbar > button:last-child .refresh-label {
    display: none;
  }
}
.customer-name-button {
  border: 0;
  background: transparent;
  padding: 0;
  min-height: 0;
  text-align: left;
  color: inherit;
  font-weight: 700;
}
.customer-name-button:hover {
  text-decoration: underline;
}
.customer-credit-line {
  display: block;
  width: fit-content;
  margin-top: 3px;
  padding: 2px 6px;
  min-height: 0;
  border: 1px solid #bee6d1;
  background: #eaf8f1;
  color: #086e4d;
  font-size: 10px;
  line-height: 1.4;
}
.customer-credit-reserved {
  display: block;
  margin-top: 2px;
  padding: 2px 0;
  min-height: 0;
  border: 0;
  background: transparent;
  color: #7a5c21;
  font-size: 10px;
}
dialog.customer-profile {
  width: min(640px, calc(100vw - 24px));
}
.customer-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 8px 0 16px;
}
.customer-profile-grid > div:last-child {
  grid-column: 1/-1;
}
.customer-profile-grid dt {
  font-size: 11px;
  color: #636363;
  margin-bottom: 4px;
}
.customer-profile-grid dd {
  margin: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.customer-credit-section h3 {
  margin: 0;
  font-size: 13px;
}
.customer-credit-section > .row {
  flex-wrap: wrap;
}
.credit-note {
  border: 1px solid var(--line, #e0e5ec);
  border-radius: 8px;
  margin: 8px 0;
  overflow: hidden;
}
.credit-note > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 12px;
}
.credit-note small,
.credit-events small {
  display: block;
  color: #666;
  font-size: 10px;
  margin-top: 3px;
}
.credit-note-details {
  padding: 0 12px 10px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.credit-note-details > p {
  margin: 4px 0 10px;
}
.credit-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 8px 0;
}
.credit-amounts strong {
  display: block;
  font-size: 12px;
}
.credit-edit-dialog {
  width: min(460px, calc(100vw - 24px));
}
.customer-detected {
  font-size: 11px;
  overflow-wrap: anywhere;
}
.customer-detected p {
  margin: 5px 0;
}
.form-error {
  color: #aa2525;
  font-size: 12px;
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .customer-credit-line {
    min-height: 30px;
    padding: 5px 6px;
  }
  .customer-credit-reserved {
    min-height: 28px;
  }
  .credit-note > summary {
    flex-wrap: wrap;
  }
}
@media (max-width: 420px) {
  .customer-profile-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.order-bulk-bar {
  position: fixed;
  z-index: 25;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #d5d9df;
  border-radius: 10px;
  padding: 8px 12px;
  background: #fff;
  box-shadow: 0 4px 24px #1113;
  max-width: calc(100vw - 24px);
  white-space: nowrap;
  font-size: 12px;
}
.order-bulk-bar[hidden],
.submission-notice[hidden] {
  display: none;
}
.order-bulk-bar .actions > div {
  top: auto;
  bottom: calc(100% + 6px);
  right: 0;
  min-width: 175px;
}
.orders-table tr.selected {
  box-shadow: inset 3px 0 #222;
  background: #f1f4f7;
}
.urgent-order,
.orders-table tr.urgent-order td {
  background: #fff0d9;
  border-color: #efb660;
}
.urgent-label {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  margin-top: 3px;
  border-radius: 50%;
  background: #cc760b;
  color: #fff;
  font-weight: 800;
  line-height: 1;
  font-size: 10px;
}
.submission-notice {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 7px 10px;
  margin-bottom: 9px;
  border: 1px solid #b8dfcd;
  border-radius: 7px;
  background: #f0faf5;
  font-size: 12px;
}
.orders-table .customer-name {
  font-weight: 650;
  color: inherit;
  font-size: 11px;
  line-height: 1.25;
}
@media (max-width: 700px) {
  .order-bulk-bar {
    bottom: 10px;
    gap: 7px;
    padding: 7px 9px;
    font-size: 11px;
  }
  .order-bulk-bar button,
  .order-bulk-bar summary {
    font-size: 11px;
  }
  .submission-notice {
    font-size: 11px;
    flex-wrap: wrap;
  }
}
.receive-entry {
  padding: 10px;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
}
.receive-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  font-size: 11px;
  margin: 8px 0 10px;
  color: #596577;
}
.receive-facts strong {
  color: #182738;
}
#erp-print-root {
  display: none;
}
.orders-excel-preview {
  width: min(920px, calc(100vw - 24px));
}
.orders-excel-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.orders-excel-stat {
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #dce3ed;
  border-radius: 8px;
  min-width: 0;
}
.orders-excel-stat small {
  display: block;
  text-transform: uppercase;
  font-size: 9px;
  color: #657589;
  margin-bottom: 7px;
}
.orders-excel-stat strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}
.orders-excel-stat.match {
  background: #eef9f3;
  border-color: #b8decd;
  color: #08795a;
}
.orders-excel-warning {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid #efcf97;
  border-radius: 8px;
  background: #fff9ed;
  font-size: 12px;
}
.orders-excel-warning p {
  margin: 5px 0;
}
.orders-excel-warning button {
  white-space: nowrap;
}
.orders-excel-preview table {
  min-width: 620px;
}
.orders-excel-preview .form-actions {
  justify-content: flex-end;
}
@media (max-width: 600px) {
  .orders-excel-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .orders-excel-warning {
    align-items: flex-start;
    flex-direction: column;
  }
  .orders-excel-stat {
    padding: 10px;
  }
  .orders-excel-stat strong {
    font-size: 12px;
  }
}
.courier-documents {
  width: min(1200px, calc(100vw - 28px));
  max-width: 1200px;
}
.courier-documents .modal-body {
  padding: 14px;
}
.courier-feedback:empty {
  display: none;
}
.courier-feedback {
  font-size: 12px;
  margin: 8px 0;
}
.courier-documents .primary {
  background: #148758;
  border-color: #148758;
}
.courier-documents .courier-receiving-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.courier-receiving-stats .orders-excel-stat:last-child {
  border-color: #b2dbca;
  background: #f0faf5;
  color: #087446;
}
.courier-review-list {
  border: 1px solid #e8cda3;
  background: #fffaf2;
  padding: 10px;
  border-radius: 10px;
  margin-top: 12px;
}
.courier-review-list h3 {
  font-size: 12px;
  margin: 0 0 8px;
}
.courier-review-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: white;
  border: 1px solid #ece1d0;
  border-radius: 6px;
  padding: 8px;
  margin-top: 5px;
}
.courier-review-list small {
  display: block;
  margin-top: 3px;
  font-size: 10px;
}
.courier-upload-controls {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.courier-upload-controls label {
  display: grid;
  gap: 4px;
  min-width: 200px;
  flex: 1;
  font-size: 11px;
}
.courier-file-list {
  display: grid;
  gap: 6px;
  margin: 8px 0 12px;
}
.courier-file-list > div {
  background: var(--soft, #f7f8fa);
  padding: 8px 10px;
  border: 1px solid var(--line, #dfe3e8);
  border-radius: 8px;
}
.courier-file-list a {
  margin-right: 10px;
  overflow-wrap: anywhere;
}
.courier-documents table {
  min-width: 930px;
  font-size: 11px;
}
.courier-documents th,
.courier-documents td {
  padding: 9px 10px;
}
.courier-documents td:first-child {
  width: 30px;
}
.courier-documents .badge {
  white-space: normal;
  min-width: 0;
}
.courier-reason {
  margin: 4px 0;
  max-width: 260px;
  color: #8a5700;
  font-size: 10px;
}
.courier-amount-checks {
  display: grid;
  gap: 4px;
  white-space: nowrap;
  font-size: 10px;
}
.courier-archive-files {
  display: grid;
  gap: 5px;
}
.courier-documents .form-actions {
  flex-wrap: wrap;
}
.courier-documents .form-actions > span {
  align-self: center;
  font-size: 11px;
}
.courier-documents .table-wrap {
  margin-top: 12px;
}
@media (max-width: 600px) {
  .courier-documents .courier-receiving-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .courier-documents {
    width: calc(100vw - 16px);
  }
  .courier-documents .modal-body {
    padding: 10px;
  }
  .courier-documents .form-actions button {
    white-space: normal;
  }
  .courier-upload-controls label {
    flex-basis: 100%;
    min-width: 0;
  }
  .courier-documents > .modal-head h2 {
    font-size: 16px;
  }
}
@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }
  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    width: 210mm;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  body > *:not(#erp-print-root),
  dialog {
    display: none !important;
  }
  dialog::backdrop {
    display: none !important;
  }
  #erp-print-root {
    display: block !important;
  }
  #erp-print-root .invoice-print-page {
    width: 210mm;
    height: 297mm;
    break-after: page;
    page-break-after: always;
    overflow: hidden;
  }
  #erp-print-root .invoice-print-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }
  #erp-print-root img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: top center;
  }
}

/* Hidden customer fields do not leave empty columns or fixed-width gaps. */
.customer-table-limited {
  min-width: 560px;
}
.customer-table-limited.customer-table-readonly {
  min-width: 360px;
}
.customer-table-limited th[data-column='Customer name'] {
  width: auto;
}
.customer-table-limited th[data-column='Actions'] {
  width: 200px;
}
.customer-table th[data-column='Customer code'] {
  width: 110px;
}
.customer-table-readonly th[data-column='Address'] {
  width: auto;
}
.customer-calling {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}
.customer-history-entry {
  border-top: 1px solid var(--border);
  padding: 8px 0;
}
.customer-history-entry small {
  display: block;
  color: var(--muted);
}
.customer-history-entry p {
  margin: 4px 0;
  overflow-wrap: anywhere;
}

.payment-fields {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
  display: grid;
  gap: 12px;
}
.payment-lookup {
  display: flex;
  gap: 8px;
}
.payment-lookup input {
  min-width: 0;
  flex: 1;
}
.payment-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.payment-method-card {
  display: flex !important;
  align-items: center;
  gap: 8px;
  flex: 1 1 130px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.payment-method-card:has(input:checked) {
  border-color: #111;
  background: #f4f4f5;
}
.payment-method-card input {
  width: auto;
  min-height: 0;
}
.payment-method-card img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.payment-order-summary:empty {
  display: none;
}
.payment-order-summary .amount-grid {
  margin-top: 10px;
}
.payment-order-summary .amount-grid > div {
  display: grid;
  gap: 4px;
}

/* A long synthetic or imported city must stay inside its fixed table cell.
   The complete value remains available through the City cell title. */
@media (max-width: 760px) {
  .customer-table th:nth-child(2),
  .customer-table td:nth-child(2) {
    width: 112px;
    max-width: 112px;
    overflow: hidden;
  }
  .customer-table .city-badge {
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
  }
  .customer-table .customer-address {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
  }
}
