/* PERFECT BUD – Ofertownik + mapa handlowca (test). */
.pb-q-tabs,
.pb-q-actions,
.pb-q-card-actions,
.pb-q-search,
.pb-q-map-head,
.pb-q-site-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  justify-content: space-between;
}
.pb-q-tabs {
  justify-content: flex-start;
  margin-bottom: 16px;
}
.pb-q-builder {
  margin-bottom: 18px;
}
.pb-q-heading h3 {
  margin: 0;
}
.pb-q-builder h4 {
  margin: 22px 0 10px;
}
.pb-q-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.pb-q-fields label,
.pb-q-form > label,
.pb-q-line label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-weight: 600;
  font-size: 12px;
}
.pb-q-fields input,
.pb-q-fields select,
.pb-q-line input,
.pb-q-line select,
.pb-q-form textarea,
.pb-q-search input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid #d9e1e7;
  border-radius: 7px;
  color: #132640;
  background: white;
  font: inherit;
}
.pb-q-checkbox {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
}
.pb-q-checkbox input {
  width: auto;
}
.pb-q-search {
  justify-content: flex-start;
}
.pb-q-search input {
  flex: 1;
}
.pb-q-search-results {
  max-height: 220px;
  overflow: auto;
  border: 1px solid #e1e8ef;
  border-radius: 8px;
  margin: 10px 0;
}
.pb-q-search-row {
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  background: white;
  border-bottom: 1px solid #eef2f6;
  cursor: pointer;
  color: #0e2840;
}
.pb-q-search-row:hover {
  background: #edf8f7;
}
.pb-q-search-row strong {
  flex: 1;
}
.pb-q-search-row small {
  color: #5f6f81;
}
.pb-q-search-row span {
  color: #007979;
}
.pb-q-line {
  display: grid;
  grid-template-columns: minmax(160px, 2fr) repeat(4, minmax(85px, 0.8fr)) minmax(185px, 1.4fr);
  align-items: start;
  gap: 10px;
  background: #f7fafb;
  border: 1px solid #e0e9ee;
  border-radius: 10px;
  padding: 11px;
  margin: 9px 0;
}
.pb-q-line-name small,
.pb-q-line-price small,
.pb-q-card small,
.pb-q-site-row small {
  display: block;
  font-size: 11px;
  color: #616f7c;
  margin-top: 5px;
}
.pb-q-line-price strong {
  display: block;
  margin: 6px 0;
}
.pb-q-estimate {
  border-top: 1px solid #e2e8ee;
  margin-top: 18px;
  padding: 14px;
  background: #eff9f8;
  border-radius: 10px;
}
.pb-q-card {
  border-left: 6px solid #aeb8c1;
  padding: 15px 16px;
  margin: 10px 0;
  border-radius: 8px;
  background: #f5f8fb;
  display: grid;
  grid-template-columns: minmax(260px, 2fr) minmax(120px, 1fr) auto;
  align-items: center;
  gap: 14px;
}
.pb-q-card .pb-q-state {
  display: inline-flex;
  margin-top: 7px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #eff4f7;
  font-size: 12px;
}
.pb-q-pending {
  border-left-color: #efb342;
  background: #fff9e9;
}
.pb-q-approved {
  border-left-color: #8dca9b;
  background: #f0fbf2;
}
.pb-q-customer-accepted {
  border-left-color: #008d48;
  background: #eaf9ee;
}
.pb-q-rejected {
  border-left-color: #e05d55;
  background: #fff0ef;
}
.pb-q-waiting {
  border-left-color: #eac342;
  background: #fff9e3;
}
.pb-q-done {
  border-left-color: #6077a5;
  background: #eef2ff;
}
.pb-q-draft {
  border-left-color: #a6b3c1;
  background: #f4f7fa;
}
.pb-q-detail-table {
  max-width: 100%;
  overflow: auto;
}
.pb-q-detail-table table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}
.pb-q-detail-table th,
.pb-q-detail-table td {
  padding: 8px;
  border-bottom: 1px solid #e2e6ee;
  text-align: left;
}
.pb-q-detail-table small {
  display: block;
  color: #6c6c7c;
}
.pb-q-site-row {
  padding: 12px 0;
  border-bottom: 1px solid #e8edf1;
}
.pb-q-pick-list {
  max-height: 250px;
  overflow: auto;
  padding: 8px;
  border: 1px solid #e2e9ee;
  border-radius: 7px;
  margin: 12px 0;
}
.pb-q-pick-list label {
  display: block;
  padding: 6px;
}
.pb-q-pick-list input {
  margin-right: 8px;
}
.pb-q-map-head {
  align-items: flex-start;
  margin-bottom: 9px;
}
.pb-q-map-head h3 {
  margin: 0;
}
@media (max-width: 1250px) {
  .pb-q-line {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .pb-q-line-name,
  .pb-q-line-price {
    grid-column: span 3;
  }
}
@media (max-width: 700px) {
  .pb-q-fields,
  .pb-q-line,
  .pb-q-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .pb-q-line-name,
  .pb-q-line-price {
    grid-column: auto;
  }
  .pb-q-card {
    gap: 8px;
  }
  .pb-q-map-head {
    display: block;
  }
  .pb-q-search {
    display: block;
  }
  .pb-q-search input {
    width: 100%;
    margin-bottom: 8px;
  }
}

.pb-q-search-address {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 8px 0;
}
.pb-q-search-address input {
  flex: 1;
  min-width: 0;
  padding: 11px;
  border-radius: 7px;
  border: 1px solid #d6e0e8;
}
.pb-q-search-results.hidden {
  display: none;
}

/* v0.15.1 – zdjęcia i wybór magazynu podczas dodawania produktu */
.pb-q-search-row {
  justify-content: flex-start;
  min-height: 58px;
}
.pb-q-search-row .pb-q-search-name {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pb-q-search-row .pb-q-search-name strong {
  flex: none;
}
.pb-q-search-photo,
.pb-q-search-no-photo {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 5px;
  background: #f7f9fa;
  border: 1px solid #e1e7ed;
}
.pb-q-search-no-photo {
  display: grid;
  place-items: center;
  color: #5e6f80;
}
.pb-q-preview-label {
  white-space: nowrap;
  font-size: 12px;
}
.pb-q-product-preview-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
}
.pb-q-preview-photo {
  border: 1px solid #e0e7ee;
  border-radius: 10px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  padding: 8px;
  cursor: zoom-in;
}
.pb-q-preview-photo img {
  width: 100%;
  height: 125px;
  object-fit: contain;
}
.pb-q-preview-photo small {
  font-size: 12px;
  color: #007979;
}
.pb-q-preview-no-photo {
  border: 1px dashed #ccd5dd;
  padding: 18px;
  text-align: center;
  border-radius: 10px;
  color: #606f7c;
  font-size: 12px;
}
.pb-q-preview-warehouses {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.pb-q-preview-warehouse {
  border: 1px solid #e1e9ef;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pb-q-preview-warehouse.is-best {
  border-color: #7acba2;
  background: #f0fbf5;
}
.pb-q-preview-warehouse-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pb-q-preview-warehouse-head span {
  font-size: 10px;
  color: #137b48;
}
.pb-q-preview-warehouse-price {
  font-size: 15px;
  font-weight: 800;
}
.pb-q-preview-warehouse p {
  margin: 0;
}
.pb-q-source-btn {
  margin-top: auto;
  white-space: normal;
}
.pb-q-line-photo {
  display: block;
  padding: 0;
  border: 1px solid #e0e5ea;
  border-radius: 6px;
  background: #fff;
  float: left;
  margin-right: 9px;
  cursor: zoom-in;
}
.pb-q-line-photo img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  display: block;
}
@media (max-width: 800px) {
  .pb-q-preview-warehouses {
    grid-template-columns: 1fr;
  }
  .pb-q-product-preview-top {
    grid-template-columns: 1fr;
  }
  .pb-q-preview-photo {
    max-width: 220px;
  }
  .pb-q-preview-label {
    white-space: normal;
    text-align: right;
  }
}

/* v0.15.2: liczniki dokumentów do obsługi */
.pb-doc-new-count {
  border-radius: 6px;
  background: #b91c1c;
  color: white;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 800;
  margin-left: 4px;
  white-space: nowrap;
}

.pb-quote-inbox {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-left: 4px solid #e9b247;
  margin-bottom: 12px;
}

.pb-attention-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 640px;
  background: #152b41;
  color: #fff;
  border: 2px solid #f0c15b;
  box-shadow: 0 10px 30px #0f244450;
  padding: 13px 14px;
  border-radius: 10px;
}
.pb-attention-alert span {
  flex: 1;
  font-weight: 700;
  line-height: 1.35;
}
.pb-attention-alert button {
  border: 1px solid #fff6;
  color: white;
  background: #ffffff18;
  cursor: pointer;
  border-radius: 7px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 700;
}
.pb-attention-alert button:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* v0.15.3 – oferta: szukanie od pierwszej litery, wybór płatności, zysk wewnętrzny */
.pb-q-payment-other.hidden {
  display: none;
}
.pb-q-payment-other {
  display: block;
  margin-top: 6px;
}
.pb-q-payment-other input {
  width: 100%;
  box-sizing: border-box;
}
.pb-q-search-count {
  padding: 8px 12px;
  margin: 0;
  border-bottom: 1px solid #e5eef0;
  background: #f6faf9;
}
.pb-q-profit {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}
.pb-q-profit > div {
  padding: 10px 12px;
  border: 1px solid #c5e7df;
  border-radius: 7px;
  background: #fff;
}
.pb-q-profit span {
  display: block;
  font-size: 12px;
  color: #536b6d;
  margin-bottom: 5px;
}
.pb-q-profit strong {
  display: block;
  font-size: 20px;
  font-weight: 800;
  color: #087d6f;
}
.pb-q-profit strong.pb-q-loss {
  color: #ba3838;
}
.pb-q-revenue {
  border-top: 1px solid #d5e8e4;
  padding: 10px 0 0;
  font-size: 13px;
}
@media (max-width: 650px) {
  .pb-q-profit {
    grid-template-columns: 1fr;
  }
}

/* v0.15.6 – dwukierunkowe przeliczanie marży i ręcznej ceny sprzedaży */
.pb-q-line {
  grid-template-columns: minmax(160px, 1.8fr) repeat(5, minmax(85px, 0.85fr)) minmax(170px, 1.3fr);
}
.pb-q-sale-edit input {
  border: 2px solid #00998d !important;
  background: #f3fffb !important;
  font-weight: 750 !important;
  text-align: right;
}
.pb-q-sale-edit small {
  display: block;
  font-weight: 400;
  font-size: 10px;
  color: #51736d;
  line-height: 1.3;
}
.pb-q-sale-edit:focus-within input {
  outline: 3px solid var(--pb-focus);
  outline-offset: 1px;
}
@media (max-width: 1370px) {
  .pb-q-line {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .pb-q-line-name,
  .pb-q-line-price {
    grid-column: span 3;
  }
}
@media (max-width: 700px) {
  .pb-q-line {
    grid-template-columns: 1fr;
  }
  .pb-q-line-name,
  .pb-q-line-price {
    grid-column: auto;
  }
}

/* v0.15.7 - stany ofert wymagajacych dzialania */
.pb-quote-inbox {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  border-left: 5px solid #eab308;
  background: #fffbeb;
}
.pb-quote-inbox strong {
  color: #172b42;
  min-width: 220px;
}
.pb-quote-inbox span {
  color: #435568;
  flex: 1;
  min-width: 220px;
  font-size: 13px;
}
.pb-quote-inbox-approval {
  border-left-color: #d97706;
  background: #fff7ed;
}
.pb-quote-inbox-send {
  border-left-color: #0f8f84;
  background: #effcf9;
}
.pb-quote-inbox-info {
  border-left-color: #64748b;
  background: #f1f5f9;
}
.pb-q-unsent-warning {
  display: block;
  color: #94580c;
  margin-top: 7px;
  font-weight: 600;
}
.pb-q-unsent-box {
  padding: 10px 13px;
  margin: 12px 0;
  border: 1px solid #e9c46a;
  background: #fff8e2;
  color: #704b0b;
  border-radius: 8px;
}

/* v0.15.9: czytelny planer bez nakładającej się historii tras */
.pb-route-map-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  padding: 12px 14px;
  margin: 10px 0;
  background: #f2f8f8;
  border: 1px solid #d6e9e7;
  border-radius: 10px;
}
.pb-route-map-controls label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 180px;
  font-weight: 600;
  font-size: 12px;
  color: #24394c;
}
.pb-route-map-controls input,
.pb-route-map-controls select {
  background: #fff;
  border: 1px solid #cfdce3;
  border-radius: 7px;
  padding: 9px 10px;
  max-width: 390px;
  min-height: 38px;
  color: #19354c;
}
.pb-route-map-controls p {
  flex-basis: 100%;
  margin: 0;
}
.pb-route-history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0 16px;
}
.pb-sales-unrealized {
  border-left: 4px solid #d8a532;
}
@media (max-width: 700px) {
  .pb-route-map-controls {
    display: grid;
  }
  .pb-route-map-controls select {
    width: 100%;
  }
}

/* v0.16.5 – zapisane adresy załadunku WZ oraz pełnego transportu */
.pb-pickup-places {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  padding: 11px 12px;
  border: 1px solid #cbe5e1;
  border-radius: 10px;
  background: #f3faf9;
}
.pb-pickup-places > strong {
  font-size: 13px;
  color: #17354a;
}
.pb-pickup-places > small {
  font-size: 11px;
  color: #5c6f83;
  line-height: 1.4;
}
.pb-pickup-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pb-pickup-button {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid #cbd8e2;
  border-radius: 8px;
  background: #fff;
  color: #233d54;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.pb-pickup-button:hover {
  background: #e7f7f4;
  border-color: #009e94;
}
.pb-pickup-button.selected {
  background: #d4f3ed;
  border-color: #009e94;
  color: #05685e;
}
.pb-pickup-button:focus-visible {
  outline: 3px solid var(--pb-focus);
  outline-offset: 2px;
}
@media (max-width: 600px) {
  .pb-pickup-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .pb-pickup-button {
    white-space: normal;
    text-align: left;
  }
}

/* ===== Handlowiec i oferty – UX 2026-11 =====
   Karty na telefonie zamiast szerokich tabel, dwie etykiety stanu oferty, następny krok,
   pulpit „na dziś”, kolejność wizyt, wynik wyszukiwania produktów, puste stany z akcją. */

/* Wyszukiwarki z etykietą (klienci, oferty) */
.pb-search-field {
  display: grid;
  gap: 6px;
  margin: 14px 0 6px;
  max-width: 460px;
}
.pb-search-field > label {
  font-size: 12px;
  font-weight: 700;
  color: #3d5369;
}
.pb-search-field .search-wrap {
  max-width: none;
}
.pb-search-field .input-search {
  max-width: none;
  min-width: 0;
  width: 100%;
  min-height: 44px;
  font-size: 14px;
  border-color: #cdd6df;
}
.pb-search-field .search-wrap:before {
  top: 7px;
}

/* Pusty stan z jedną adekwatną akcją */
.pb-empty-inline {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 18px;
  margin: 10px 0;
  border: 1px dashed #cdd6df;
  border-radius: 10px;
  background: #fafcfd;
  color: #3d5369;
}
.pb-empty-inline strong {
  color: #1d3349;
}

.pb-table-scroll {
  overflow-x: auto;
}
.pb-cust-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Klienci – karty (telefon) */
.pb-cust-cards,
.pb-mileage-cards {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.pb-cust-card,
.pb-mileage-card {
  border: 1px solid #e2e8ee;
  border-radius: 12px;
  padding: 14px;
  background: #fff;
  min-width: 0;
}
.pb-cust-card.is-own {
  border-left: 4px solid #0e8f87;
}
.pb-cust-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.pb-cust-name {
  font-size: 15px;
  line-height: 1.35;
  color: #132640;
  overflow-wrap: anywhere;
  min-width: 0;
}
.pb-cust-owner {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  color: #4b5d70;
  background: #eef3f6;
  border-radius: 999px;
  padding: 4px 9px;
}
.pb-cust-card.is-own .pb-cust-owner {
  color: #0a6d67;
  background: #e3f5f3;
}
.pb-cust-meta {
  margin: 6px 0 0;
  font-size: 13px;
  color: #5b6d80;
  overflow-wrap: anywhere;
}
.pb-cust-owner-select {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}
.pb-cust-owner-select select {
  min-height: 40px;
}
.pb-cust-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.pb-cust-actions .btn,
.pb-cust-more > summary {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pb-cust-more > summary {
  list-style: none;
  cursor: pointer;
}
.pb-cust-more > summary::-webkit-details-marker {
  display: none;
}
.pb-cust-more > summary::after {
  content: ' ▾';
  margin-left: 4px;
}
.pb-cust-more[open] {
  flex-basis: 100%;
}
.pb-cust-more[open] > summary::after {
  content: ' ▴';
}
.pb-cust-more-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eef2f6;
}
.pb-cust-nophone {
  padding: 0 4px;
}

/* Przebiegi – karty (telefon) */
.pb-mileage-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.pb-mileage-km {
  font-weight: 800;
  color: #0a6d67;
}
.pb-mileage-card p {
  margin: 6px 0 2px;
  overflow-wrap: anywhere;
}
.pb-mileage-card small {
  display: block;
  color: #5b6d80;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

/* Oferty – filtry */
.pb-q-tabs .btn[aria-pressed='true'] {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.pb-q-count {
  display: inline-block;
  min-width: 18px;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #c2410c;
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
}
.pb-q-more-filters {
  margin: -6px 0 6px;
}
.pb-q-more-filters > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #3d5369;
  padding: 8px 0;
  min-height: 32px;
}
.pb-q-more-active {
  color: #0a6d67;
}
.pb-q-tabs-more {
  margin: 4px 0 8px;
}

/* Oferty – karta: etap handlowy, akceptacja wewnętrzna, następny krok */
.pb-q-card {
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr) auto;
  align-items: start;
}
.pb-q-card-main,
.pb-q-next {
  min-width: 0;
}
.pb-q-card-title {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 10px;
}
.pb-q-card-net {
  font-weight: 700;
  color: #1d3349;
}
.pb-q-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 9px 0 0;
}
.pb-q-badge {
  border: 1px solid #dde4ea;
  border-left-width: 4px;
  border-radius: 7px;
  padding: 4px 8px;
  background: #fff;
  min-width: 0;
}
.pb-q-badge dt {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #66788a;
}
.pb-q-badge dd {
  margin: 1px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: #1d3349;
}
.pb-q-stage-draft,
.pb-q-approval-none {
  border-left-color: #aeb8c1;
}
.pb-q-stage-waiting {
  border-left-color: #4b83d6;
}
.pb-q-stage-accepted,
.pb-q-stage-done,
.pb-q-approval-approved {
  border-left-color: #2f9b5f;
}
.pb-q-stage-rejected,
.pb-q-approval-rejected {
  border-left-color: #c0392b;
}
.pb-q-approval-required,
.pb-q-approval-pending {
  border-left-color: #e09b1a;
}
.pb-q-next {
  background: #fff;
  border: 1px solid #e2e8ee;
  border-radius: 8px;
  padding: 9px 11px;
}
.pb-q-next-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #66788a;
}
.pb-q-next p {
  margin: 3px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: #1d3349;
}
.pb-q-next-action {
  border-color: #efb342;
  background: #fffaf0;
}
.pb-q-next .btn {
  min-height: 40px;
}
.pb-q-detail .pb-q-next {
  margin: 10px 0 12px;
}
.pb-q-card-actions {
  justify-content: flex-end;
}

/* Pulpit handlowca – praca na dziś, statystyki niżej i zwarte */
.pb-today-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.pb-today-grid > .panel {
  margin: 0;
}
.pb-today-block h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
}
.pb-today-count {
  font-size: 12px;
  min-width: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef3f6;
  color: #3d5369;
  text-align: center;
}
.pb-today-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}
.pb-today-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid #eef2f6;
}
.pb-today-list li:last-child {
  border-bottom: 0;
}
.pb-today-list li > div:first-child {
  min-width: 0;
  flex: 1 1 180px;
}
.pb-today-list strong {
  display: block;
  overflow-wrap: anywhere;
}
.pb-today-list small {
  display: block;
  color: #5b6d80;
  margin-top: 2px;
}
.pb-today-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pb-late {
  display: inline-block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 700;
  color: #b42318;
}
.pb-sales-quick h3 {
  margin-top: 0;
}
.pb-sales-stats {
  margin-top: 14px;
}
.pb-sales-stats .stat-card {
  min-height: 0;
  padding: 12px 14px;
}
.pb-sales-stats .stat-value {
  font-size: 22px;
}
.pb-sales-stats .stat-icon {
  display: none;
}

/* Planer tras – przełącznik widoku (telefon) i kolejność wizyt */
.pb-view-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.pb-view-switch .btn {
  min-height: 44px;
}
.pb-route-order-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pb-route-order-head h3 {
  margin: 0;
}
.pb-route-order-head label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}
.pb-route-order-trip {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eef2f6;
}
.pb-route-order-title {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
}
.pb-route-stops {
  counter-reset: stop;
  list-style: none;
  margin: 10px 0;
  padding: 0;
}
.pb-route-stops li {
  counter-increment: stop;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.pb-route-stops li::before {
  content: counter(stop);
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #226fc5;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}
.pb-route-stops li > div {
  flex: 1;
  min-width: 0;
}
.pb-route-stops small {
  display: block;
  color: #5b6d80;
  overflow-wrap: anywhere;
}
.pb-route-stops .pb-route-nogps {
  color: #a15c07;
}
.pb-route-order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Produkty – podstawowy wynik i dostępność */
.pb-stock-unknown {
  color: #5b6d80 !important;
  font-style: italic;
}
.pb-stock-zero {
  color: #b42318 !important;
}
.pb-stock-ok {
  color: #1c7c4f !important;
}
.pb-stock-order {
  color: #a15c07 !important;
}
.pb-prod-row-actions .btn,
.pb-prod-row .pb-prod-row-actions .pb-prod-open {
  min-height: 40px;
  font-size: 13px;
  font-weight: 750;
}
.pb-prod-row .pb-prod-open {
  border-color: #cdd6df;
  background: #fff;
  color: #1d3349;
}
.pb-prod-row .pb-prod-open:hover {
  background: #f2f6f8;
}
.pb-prod-row .pb-prod-meta {
  font-size: 12px;
  color: #4f5d6b;
}
.pb-prod-noresults .btn {
  margin-top: 6px;
}
.pb-prod-admin {
  margin-top: 26px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 13px;
  background: #fafafa;
}
.pb-prod-admin-head h3 {
  margin: 0 0 2px;
}
.pb-prod-admin .pb-dup-toolbar {
  margin: 12px 0 4px;
}

@media (max-width: 700px) {
  .pb-cust-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pb-cust-actions > *,
  .pb-cust-more > summary {
    width: 100%;
    box-sizing: border-box;
  }
  .pb-cust-more[open] {
    grid-column: 1 / -1;
  }
  .pb-cust-more[open] > summary {
    width: calc(50% - 4px);
  }
  .pb-cust-nophone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 1px dashed #d5dde4;
    border-radius: 8px;
  }
  .pb-q-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .pb-q-card-actions {
    justify-content: flex-start;
  }
  .pb-q-card-actions .btn,
  .pb-q-tabs .btn {
    min-height: 40px;
  }
  .pb-q-badges {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .pb-q-next .btn {
    width: 100%;
  }
  .pb-search-field {
    max-width: none;
  }
  .pb-today-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .pb-today-actions .btn {
    min-height: 40px;
  }
  .pb-sales-quick .pb-sales-links {
    grid-template-columns: 1fr 1fr;
  }
  .pb-prod-row-actions {
    grid-column: 1/-1;
    flex-direction: row;
  }
  .pb-prod-row-actions .btn-primary,
  .pb-prod-row .pb-prod-row-actions .pb-prod-open {
    flex: 1 1 0;
    width: auto;
    min-height: 44px;
    font-size: 13px;
    font-weight: 750;
  }
  .pb-prod-row-actions .pb-prod-remove {
    flex-basis: 100%;
  }
}
.client-table a[href^='tel:'] {
  white-space: nowrap;
}

/* Dostępność: pola wyboru w planerze tras min. 24 × 24 px (WCAG 2.5.8). */
.pb-q-pick-list input[type='checkbox'],
#pb-sales-self-route input[type='checkbox'] {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}
