/* Salesmen Stock — independent from Customers */
.salesmen-stock-panel,
.salesmen-detail-panel {
  overflow: hidden;
  border: 1px solid #dce3ea;
  background: radial-gradient(circle at 100% 0, rgba(230, 0, 0, .045), transparent 34%), #fff;
}

.salesmen-page-head,
.salesmen-detail-head {
  align-items: flex-start;
  gap: 22px;
  padding: 22px 24px;
  border-bottom: 1px solid #e4e9ee;
  background: linear-gradient(135deg, #fff 0%, #f8fafc 68%, #fff3f3 100%);
}

.salesmen-page-head h2,
.salesmen-detail-head h2 {
  margin-bottom: 4px;
  font-size: clamp(22px, 2vw, 30px);
}

.salesmen-page-head .section-subtitle,
.salesmen-detail-head .section-subtitle,
.salesmen-modal-card .section-subtitle,
.salesmen-wide-modal-card .section-subtitle,
.salesmen-sale-modal-card .section-subtitle {
  margin: 0;
  color: #667085;
  font-size: 13px;
}

.salesmen-page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.salesmen-page-actions button {
  min-height: 42px;
  white-space: nowrap;
}

.salesmen-page-actions .salesmen-give-button {
  border: 1px solid #075e58 !important;
  background: linear-gradient(135deg, #0f766e, #075e58) !important;
  color: #fff !important;
  box-shadow: 0 9px 20px rgba(15, 118, 110, .22) !important;
}

.salesmen-page-actions .salesmen-payment-button {
  border: 1px solid #1748a3 !important;
  background: linear-gradient(135deg, #2563eb, #1748a3) !important;
  color: #fff !important;
  box-shadow: 0 9px 20px rgba(37, 99, 235, .22) !important;
}

.salesmen-page-actions .salesmen-sale-button {
  border-color: #c30000 !important;
  background: linear-gradient(135deg, #e60000, #b70000) !important;
  color: #fff !important;
  box-shadow: 0 9px 20px rgba(193, 0, 0, .18);
}

.salesmen-page-actions .salesmen-add-button {
  border: 1px solid #b70000 !important;
  background: linear-gradient(135deg, #e60000, #b70000) !important;
  color: #fff !important;
}

.salesmen-page-actions button > span,
.salesmen-page-actions button > svg,
.salesmen-page-actions button > i,
.salesmen-page-actions button * {
  color: inherit !important;
  stroke: currentColor !important;
  opacity: 1 !important;
}

.salesmen-page-actions button:hover {
  color: #fff !important;
  filter: brightness(1.1);
}

.salesmen-page-actions button:disabled {
  border-color: #94a3b8 !important;
  background: #dbe3ec !important;
  color: #334155 !important;
  box-shadow: none !important;
  opacity: 1 !important;
}

.salesmen-total-grid,
.salesmen-detail-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 20px;
  background: #f7f9fb;
}

.salesmen-detail-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.salesmen-total-card {
  position: relative;
  min-width: 0;
  min-height: 126px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid #dfe5eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(17, 24, 39, .055);
}

.salesmen-total-card::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -35px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(37, 99, 235, .06);
}

.salesmen-total-card span {
  position: relative;
  z-index: 1;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.salesmen-total-card strong {
  position: relative;
  z-index: 1;
  color: #17202a;
  font-size: clamp(20px, 2vw, 29px);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.salesmen-total-card small {
  position: relative;
  z-index: 1;
  color: #87909d;
  font-size: 11px;
}

.salesmen-total-card.total-salesmen { border-top: 4px solid #2563eb; }
.salesmen-total-card.total-qty { border-top: 4px solid #7c3aed; }
.salesmen-total-card.total-stock-value { border-top: 4px solid #0f766e; }
.salesmen-total-card.total-dues {
  border-top: 4px solid #e60000;
  background: linear-gradient(145deg, #fff, #fff4f4);
}
.salesmen-total-card.total-on-us {
  border-top: 4px solid #d18b00;
  background: linear-gradient(145deg, #fff, #fff9eb);
}

.salesmen-list-toolbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  border-top: 1px solid #e4e9ee;
  border-bottom: 1px solid #e4e9ee;
  background: #fff;
}

.salesmen-list-toolbar > div {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.salesmen-list-toolbar strong { font-size: 17px; }
.salesmen-list-toolbar span { color: #75808e; font-size: 12px; }
.salesmen-list-toolbar .inline-search { width: min(330px, 100%); }

.salesmen-main-table th {
  padding-top: 14px;
  padding-bottom: 14px;
  background: #f1f4f7;
  color: #344054;
  font-size: 11px;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.salesmen-main-table td {
  padding-top: 14px;
  padding-bottom: 14px;
  vertical-align: middle;
}

.salesman-name-link {
  color: #111827 !important;
  font-size: 15px;
  font-weight: 800 !important;
}

.table-secondary {
  display: block;
  margin-top: 4px;
  color: #8a94a3;
  font-size: 11px;
}

.due-amount { color: #c10000; font-weight: 800; }
.on-us-amount { color: #9a6700; font-weight: 800; }

.salesman-source-tag {
  display: inline-flex;
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fff0f0;
  color: #c00000;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.salesman-detail-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.salesman-detail-title-wrap > .mini-button { flex: 0 0 auto; margin-top: 1px; }
.salesman-held-section,
.salesman-history-section { padding: 0 20px 20px; }
.salesman-history-section { padding-top: 4px; }

.section-row-title {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-row-title h3 { margin: 0; font-size: 16px; }
.section-row-title span { color: #7b8490; font-size: 12px; }

.salesman-held-table th,
.salesman-history-table th {
  background: #f4f6f8;
  color: #475467;
  font-size: 11px;
  white-space: nowrap;
}

.salesman-history-wrap { max-height: 530px; }

.salesman-running-balance {
  min-width: 112px;
  color: #111827;
  font-weight: 800 !important;
  white-space: normal;
}

.salesman-running-balance.balance-due { color: #b42318; }
.salesman-running-balance.balance-credit { color: #9a6700; }
.salesman-running-balance.balance-clear { color: #067647; }

.salesman-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2f6;
  color: #475467;
  font-size: 10px;
  font-weight: 800;
}

.salesman-status.cash,
.salesman-status.received,
.salesman-status.completed { background: #e9f8f1; color: #067647; }
.salesman-status.due { background: #fff0f0; color: #c30000; }
.salesman-status.held { background: #eef4ff; color: #245db7; }

.salesmen-modal-card { width: min(560px, calc(100vw - 28px)); }
.salesmen-wide-modal-card {
  width: min(1120px, calc(100vw - 28px));
  max-height: min(90vh, 900px);
  overflow-y: auto;
}
.salesmen-sale-modal-card {
  width: min(980px, calc(100vw - 28px));
  max-height: min(90vh, 880px);
  overflow-y: auto;
}

.salesmen-form-grid { display: grid; gap: 12px; }
.salesmen-form-grid.two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.salesmen-form-grid.three-column { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.salesmen-form-grid.four-column { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.salesman-product-lines {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #dde4eb;
  border-radius: 10px;
  background: #f8fafc;
}

.salesman-product-line-head,
.salesman-product-line {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) minmax(90px, .65fr) minmax(105px, .7fr) minmax(150px, 1fr) minmax(95px, .55fr) 42px;
  align-items: end;
  gap: 9px;
}

.salesman-product-line-head {
  padding: 0 4px;
  color: #667085;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.salesman-product-line {
  padding: 10px;
  border: 1px solid #e0e5eb;
  border-radius: 8px;
  background: #fff;
}

.salesman-product-line label { gap: 4px; }
.salesman-product-line.stock-warning { border-color: #e60000; background: #fff7f7; }
.mobile-line-label { display: none; }
.add-another-product { justify-self: start; }

.salesman-money-grid {
  padding: 12px;
  border: 1px solid #f0caca;
  border-radius: 9px;
  background: #fff8f8;
}

.salesman-exchange-rate-label { color: #b60000 !important; font-weight: 800 !important; }
.salesman-exchange-rate-label input {
  border-color: #e60000 !important;
  background: #fff !important;
  color: #111 !important;
}

.salesman-calculation-note {
  margin: 0;
  padding: 10px 12px;
  border-left: 4px solid #e60000;
  border-radius: 5px;
  background: #fff4f4;
  color: #6b3333;
  font-size: 12px;
  line-height: 1.5;
}

.danger-mini,
.danger-action { color: #c00000 !important; }

@media (max-width: 1180px) {
  .salesmen-total-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .salesmen-detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .salesmen-page-head,
  .salesmen-detail-head { flex-direction: column; }
  .salesmen-page-actions { justify-content: flex-start; }
}

@media (max-width: 760px) {
  .salesmen-page-head,
  .salesmen-detail-head { padding: 17px 15px; }
  .salesmen-page-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }
  .salesmen-page-actions button { width: 100%; }
  .salesmen-total-grid,
  .salesmen-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    padding: 12px;
  }
  .salesmen-total-card { min-height: 110px; padding: 13px; }
  .salesmen-total-card strong { font-size: 18px; }
  .salesmen-list-toolbar {
    align-items: stretch;
    flex-direction: column;
    padding: 12px 14px;
  }
  .salesmen-list-toolbar > div { justify-content: space-between; }
  .salesmen-list-toolbar .inline-search { width: 100%; }
  .salesmen-form-grid.two-column,
  .salesmen-form-grid.three-column,
  .salesmen-form-grid.four-column { grid-template-columns: 1fr; }
  .salesman-product-line-head { display: none; }
  .salesman-product-line {
    grid-template-columns: 1fr 1fr;
    align-items: end;
  }
  .salesman-product-line label:first-of-type,
  .salesman-product-line label:nth-of-type(4) { grid-column: 1 / -1; }
  .mobile-line-label { display: inline; color: #667085; font-size: 10px; }
  .salesman-held-section,
  .salesman-history-section { padding-right: 12px; padding-left: 12px; }
}

@media (max-width: 430px) {
  .salesmen-total-grid,
  .salesmen-detail-grid { grid-template-columns: 1fr; }
  .salesman-product-line { grid-template-columns: 1fr; }
  .salesman-product-line label { grid-column: 1 !important; }
}
