/* Tokeny kolorów i stanów (dostępność, WCAG 2.2 AA). Kontrast pilnuje test/frontend/contrast.test.js.
   Nowe style: kolory przez var(--pb-…), czerwień (danger) tylko dla błędu lub zagrożenia. */
:root {
  --pb-bg: #f5f7fa;
  --pb-surface: #ffffff;
  --pb-surface-alt: #f8fafc;
  --pb-text: #14263a;
  --pb-text-muted: #5c6b7d;
  --pb-border: #dfe6eb;
  --pb-border-strong: #7a8798;
  --pb-link: #0b6f7d;
  --pb-primary: #007f78;
  --pb-primary-hover: #006a64;
  --pb-on-primary: #ffffff;
  --pb-primary-text: #00736c;
  --pb-primary-soft: #e6f5f3;
  --pb-primary-border: #9fd6d0;
  --pb-success-text: #146c43;
  --pb-success-bg: #e7f6ee;
  --pb-success-border: #9ed4b6;
  --pb-success-strong: #157347;
  --pb-warning-text: #8a5300;
  --pb-warning-bg: #fff5e0;
  --pb-warning-border: #f0c36d;
  --pb-danger-text: #b4232f;
  --pb-danger-bg: #fff0f1;
  --pb-danger-border: #f3b6bd;
  --pb-danger-strong: #c42131;
  --pb-info-text: #1f5f9e;
  --pb-info-bg: #eaf3ff;
  --pb-info-border: #a9cbef;
  --pb-info-strong: #1f63b0;
  --pb-focus: #1b5fd1;
  --pb-focus-on-dark: #7cc4ff;
}
/* Jednolity, dobrze widoczny fokus z klawiatury dla wszystkich kontrolek, kart i przycisków. */
:focus-visible {
  outline: 3px solid var(--pb-focus);
  outline-offset: 2px;
}
.sidebar,
.pb-prod-hero,
.toast {
  --pb-focus: var(--pb-focus-on-dark);
}
.modal:focus,
[role='dialog']:focus {
  outline: none;
}
:root {
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: var(--pb-text);
  background: var(--pb-bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
a {
  color: var(--pb-link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.hidden {
  display: none !important;
}
.muted {
  color: var(--pb-text-muted);
}
.small {
  font-size: 12px;
}
.tiny {
  font-size: 11px;
}
.weight-600 {
  font-weight: 600;
}
.text-right {
  text-align: right;
}
.app-shell {
  min-height: 100vh;
  display: flex;
}
.sidebar {
  width: 258px;
  background: #11243b;
  color: #d8e3ed;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  padding: 27px 16px 16px;
  display: flex;
  flex-direction: column;
  z-index: 20;
  box-shadow: 4px 0 20px rgba(13, 31, 52, 0.07);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px;
  margin-bottom: 49px;
}
.brand-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--pb-primary);
  color: var(--pb-on-primary);
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -1px;
}
.brand strong {
  display: block;
  font-size: 16px;
  letter-spacing: 0.3px;
  color: white;
}
.brand small {
  display: block;
  color: #8fa4bc;
  letter-spacing: 2.1px;
  font-size: 9px;
  margin-top: 4px;
  font-weight: 700;
}
.sidebar-label {
  font-size: 10px;
  color: #8197ad;
  letter-spacing: 1.35px;
  margin: 0 12px 14px;
  font-weight: 700;
}
.navigation {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.nav-item {
  border: 0;
  background: none;
  color: #b4c5d7;
  border-radius: 9px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
  font-weight: 550;
  font-size: 13px;
}
.nav-item:hover {
  background: #203954;
  color: white;
}
.nav-item.active {
  color: #fff;
  background: #1f4962;
  box-shadow: inset 3px 0 #20c5bb;
}
.nav-item .nav-svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}
.sidebar-bottom {
  margin-top: auto;
}
.version-tag {
  color: #9cb2c7;
  font-size: 11px;
  padding: 14px 13px;
  border-bottom: 1px solid #31445b;
}
.online-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #32d1a8;
  margin-right: 5px;
}
.side-user {
  padding: 16px 8px 4px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.side-user strong {
  font-size: 12px;
  display: block;
  color: #fff;
}
.side-user span {
  font-size: 11px;
  color: #91a8bd;
}
.side-user button {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #afc3d4;
  font-size: 21px;
}
.user-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: #344b65;
  color: white;
  border-radius: 9px;
  font-weight: 800;
  font-size: 12px;
}
.main-wrapper {
  margin-left: 258px;
  width: calc(100% - 258px);
  min-height: 100vh;
}
.topbar {
  height: 90px;
  background: white;
  border-bottom: 1px solid #e9edf2;
  padding: 0 35px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 22px;
}
.eyebrow {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.5px;
  color: var(--pb-text-muted);
  margin-bottom: 5px;
}
.topbar h1 {
  font-size: 24px;
  letter-spacing: -0.65px;
  margin: 0;
  color: #15283d;
}
.top-date {
  font-size: 12px;
  color: var(--pb-text-muted);
}
.icon-button {
  border: 1px solid #e7ebf0;
  background: #fff;
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #61758b;
  font-size: 23px;
}
.icon-button:hover {
  background: #f4f6f8;
}
.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--pb-primary-soft);
  border: 1px solid var(--pb-primary-border);
  color: var(--pb-primary-text);
  border-radius: 11px;
  font-size: 12px;
  font-weight: 800;
}
.menu-toggle {
  display: none;
}
.content {
  max-width: 1560px;
  margin: 0 auto;
  padding: 29px 35px 70px;
}
.offline-banner {
  background: #fff3dd;
  color: #825000;
  padding: 11px 34px;
  font-size: 12px;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 24px;
}
.page-heading h2 {
  margin: 0 0 6px;
  font-size: 20px;
  letter-spacing: -0.3px;
}
.page-heading p {
  margin: 0;
  color: var(--pb-text-muted);
  font-size: 13px;
}
.heading-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.btn {
  border: 1px solid #dfe6eb;
  border-radius: 9px;
  background: white;
  color: #304b60;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: 0.12s;
  white-space: nowrap;
}
.btn:hover {
  background: #f1f6f8;
  text-decoration: none;
}
.btn-primary {
  background: var(--pb-primary);
  border-color: var(--pb-primary);
  color: var(--pb-on-primary);
  box-shadow: 0 3px 8px rgba(0, 127, 120, 0.14);
}
.btn-primary:hover {
  background: var(--pb-primary-hover);
}
.btn-dark {
  background: #1a3650;
  border-color: #1a3650;
  color: white;
}
.btn-dark:hover {
  background: #28455f;
}
.btn-plain {
  border: 0;
  background: transparent;
  color: var(--pb-primary-text);
  box-shadow: none;
}
.btn-danger {
  color: var(--pb-danger-text);
  border-color: var(--pb-danger-border);
  background: #fff;
}
.btn-sm {
  padding: 7px 10px;
  font-size: 11px;
  border-radius: 7px;
}
.btn-wide {
  width: 100%;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}
.stat-card {
  border: 1px solid #e9edf0;
  border-radius: 13px;
  padding: 21px 20px;
  background: white;
  min-height: 130px;
  box-shadow: 0 3px 10px rgba(23, 47, 70, 0.025);
}
.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 8px;
}
.stat-top .stat-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--pb-text-muted);
}
.stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--pb-primary-soft);
  color: var(--pb-primary-text);
  display: grid;
  place-items: center;
}
.stat-icon.blue {
  background: #eaf2ff;
  color: #416fa2;
}
.stat-icon.amber {
  background: #fff5e8;
  color: #97641b;
}
.stat-icon.purple {
  background: #f3efff;
  color: #7559c1;
}
.stat-value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-top: 10px;
}
.stat-foot {
  font-size: 11px;
  color: var(--pb-text-muted);
  margin-top: 3px;
}
.panel {
  border: 1px solid #e7edf1;
  background: white;
  border-radius: 13px;
  box-shadow: 0 3px 10px rgba(23, 47, 70, 0.025);
}
.panel-padding {
  padding: 21px;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 17px;
}
.panel-header h3 {
  font-size: 15px;
  margin: 0;
}
.panel-header p {
  font-size: 12px;
  color: #606e7c;
  margin: 5px 0 0;
}
.dashboard-cols {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 18px;
}
.empty {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 54px 20px;
  color: #616f81;
  gap: 10px;
}
.empty strong {
  color: #293e53;
}
.empty-visual {
  background: #eff6f5;
  color: #209a90;
  border-radius: 50%;
  height: 58px;
  width: 58px;
  font-size: 25px;
  display: grid;
  place-items: center;
}
.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f0f2f5;
  gap: 12px;
  padding: 14px 3px;
}
.list-row:last-child {
  border: 0;
}
.list-row strong {
  font-size: 12px;
}
.list-row small {
  display: block;
  color: #5f6f81;
  font-size: 11px;
  margin-top: 3px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  font-weight: 750;
  font-size: 10px;
  padding: 6px 9px;
  white-space: nowrap;
}
.pill::before {
  content: '';
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
}
.pill-new {
  color: var(--pb-warning-text);
  background: var(--pb-warning-bg);
}
.pill-in_progress {
  color: var(--pb-info-text);
  background: var(--pb-info-bg);
}
.pill-done {
  color: var(--pb-success-text);
  background: var(--pb-success-bg);
}
.tag {
  border: 1px solid #e5ecf1;
  color: #627386;
  background: #f8fafb;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 700;
}
.toolbar {
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.input-search,
.search-wrap > input {
  padding: 9px 12px 9px 33px;
  min-width: 225px;
  flex: 1;
  max-width: 390px;
  min-height: 40px;
  background: white;
  border: 1px solid var(--pb-border-strong);
  border-radius: 8px;
  font-size: 13px;
  color: var(--pb-text);
}
.input-search:focus,
.search-wrap > input:focus {
  border-color: var(--pb-primary);
}
.search-wrap {
  position: relative;
  display: flex;
  flex: 1;
  max-width: 390px;
}
.search-wrap:before {
  content: '⌕';
  position: absolute;
  left: 11px;
  top: 4px;
  color: #7b8c9c;
  font-size: 24px;
}
.select-compact {
  border: 1px solid var(--pb-border-strong);
  background: #fff;
  border-radius: 8px;
  color: #3d5369;
  padding: 9px 12px;
  font-size: 12px;
  min-width: 142px;
}
.view-switch {
  display: flex;
  gap: 2px;
  margin-left: auto;
  border: 1px solid #e3e8ee;
  border-radius: 9px;
  padding: 3px;
  background: #f8fafc;
}
.view-switch button {
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--pb-text-muted);
  font-size: 12px;
}
.view-switch button.active {
  background: white;
  box-shadow: 0 1px 5px #d9e0e8;
  color: #153a53;
}
.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.board-column {
  border: 1px solid #e6ebef;
  background: #f0f3f7;
  border-radius: 12px;
  min-height: 350px;
  padding: 12px;
}
.board-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 5px 14px;
}
.board-heading .board-count {
  margin-left: auto;
  font-size: 11px;
  color: #677687;
  background: #fff;
  border-radius: 8px;
  padding: 4px 9px;
}
.board-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d5a24d;
}
.board-dot.in_progress {
  background: #5293d4;
}
.board-dot.done {
  background: #42ae8b;
}
.transport-card {
  background: white;
  border: 1px solid #e7ecf0;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 11px;
  box-shadow: 0 3px 7px rgba(26, 48, 74, 0.025);
  overflow: hidden;
}
.transport-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  margin-bottom: 15px;
}
.transport-head strong {
  font-size: 13px;
  color: #1e364b;
}
.transport-date {
  font-size: 10px;
  color: #606e81;
  white-space: nowrap;
}
.route {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 15px;
}
.route-rail {
  width: 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 0;
}
.route-rail .point {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid #09a899;
  background: #fff;
  flex-shrink: 0;
}
.route-rail .point.last {
  background: #13aa9f;
}
.route-rail .rail {
  width: 1px;
  flex: 1;
  min-height: 26px;
  background: #a1d6d0;
}
.route-text {
  flex: 1;
  min-width: 0;
}
.route-text .route-caption {
  font-size: 9px;
  color: #606f7e;
  letter-spacing: 0.9px;
  font-weight: 750;
  margin-bottom: 4px;
}
.route-text .route-location {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.route-text .route-step + .route-step {
  margin-top: 12px;
}
.task-meta {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.task-meta span {
  font-size: 10px;
  color: #5e7184;
  border: 1px solid #eef0f3;
  background: #f9fbfc;
  border-radius: 6px;
  padding: 5px 7px;
}
.transport-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  border-top: 1px solid #eff1f4;
  padding-top: 13px;
  flex-wrap: wrap;
}
.card-links {
  display: flex;
  gap: 10px;
  font-size: 11px;
}
.subtle-link {
  border: 0;
  background: none;
  color: #24777f;
  padding: 3px 0;
  font-size: 11px;
  font-weight: 700;
}
.subtle-link:hover {
  text-decoration: underline;
}
.board-empty {
  text-align: center;
  font-size: 12px;
  color: #5d6e7e;
  padding: 45px 12px;
}
.task-list {
  display: grid;
  gap: 12px;
}
.task-list .transport-card {
  margin: 0;
}
.task-list .transport-card .route {
  margin-top: 6px;
}
.tasks-number {
  font-size: 12px;
  color: #5e6f81;
}
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field label {
  font-size: 12px;
  font-weight: 700;
  color: #52677b;
}
.field input,
.field select,
.field textarea {
  border: 1px solid var(--pb-border-strong);
  border-radius: 8px;
  padding: 11px 12px;
  background: white;
  font-size: 13px;
  color: #172e42;
  min-width: 0;
  width: 100%;
}
.field textarea {
  resize: vertical;
  min-height: 76px;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--pb-primary);
}
.field [aria-invalid='true'] {
  border-color: var(--pb-danger-text);
}
.field-error {
  color: var(--pb-danger-text);
  font-size: 12px;
  font-weight: 650;
  margin-top: 4px;
}
.field-help {
  font-size: 10px;
  color: #5e6e80;
}
.section-label {
  font-size: 10px;
  letter-spacing: 1px;
  color: #5e6f84;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 3px 0 0;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(9, 25, 41, 0.56);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow-y: auto;
}
.modal {
  background: white;
  border-radius: 15px;
  max-width: 750px;
  width: 100%;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: 0 24px 90px rgba(0, 12, 28, 0.25);
}
.modal.small-modal {
  max-width: 490px;
}
.modal-head {
  padding: 23px 26px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #edf0f3;
  gap: 15px;
}
.modal-head h3 {
  margin: 0;
  font-size: 19px;
}
.modal-head p {
  font-size: 12px;
  color: #5f6e7f;
  margin: 5px 0 0;
}
.modal-close {
  border: 0;
  background: #f3f6f8;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 22px;
  color: #526478;
}
.modal-body {
  padding: 22px 26px;
}
.modal-footer {
  padding: 17px 26px;
  border-top: 1px solid #edf0f3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.form-grid .full {
  grid-column: 1/-1;
}
.form-divider {
  grid-column: 1/-1;
  border: 0;
  border-top: 1px solid #edf0f3;
  margin: 6px 0 0;
}
.modal-warning {
  font-size: 12px;
  background: #fff7e7;
  border: 1px solid #f3dbaf;
  padding: 12px;
  border-radius: 8px;
  color: #95672e;
  line-height: 1.5;
}
.time-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(380px, 1.5fr);
  gap: 19px;
}
.time-clock {
  text-align: center;
  padding: 29px 18px;
}
.clock-illustration {
  width: 65px;
  height: 65px;
  background: #e5f5f2;
  border-radius: 18px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  color: #009688;
  font-size: 34px;
}
.time-clock h3 {
  font-size: 16px;
  margin: 0;
}
.clock-time {
  font-size: 32px;
  font-weight: 850;
  letter-spacing: -1px;
  margin: 14px 0 5px;
}
.timer-note {
  font-size: 12px;
  color: #5d6e80;
  margin-bottom: 20px;
}
.table-wrap {
  overflow: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.data-table th {
  font-size: 10px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--pb-text-muted);
  padding: 14px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e9edf0;
  white-space: nowrap;
}
.data-table td {
  padding: 13px 12px;
  font-size: 12px;
  border-bottom: 1px solid #edf1f4;
  vertical-align: middle;
}
.data-table tr:last-child td {
  border-bottom: 0;
}
.time-filter {
  min-width: 200px;
}
.hours-total {
  font-size: 12px;
  color: #506778;
  background: #edf6f5;
  border-radius: 7px;
  padding: 8px 10px;
  font-weight: 800;
}
.hours-small {
  font-size: 10px;
  color: #5e6e7d;
}
.timer-running {
  color: #007970;
}
.timer-running::before {
  content: '●';
  font-size: 11px;
  margin-right: 6px;
  animation: blink 1.5s infinite;
}
@keyframes blink {
  50% {
    opacity: 0.3;
  }
}
.chat-shell {
  height: min(680px, calc(100vh - 215px));
  min-height: 400px;
  display: grid;
  grid-template-columns: 250px 1fr;
  overflow: hidden;
}
.chat-contacts {
  border-right: 1px solid #e7edf2;
  padding: 15px;
}
.chat-contact {
  display: flex;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  gap: 12px;
  padding: 11px 10px;
  align-items: center;
  border-radius: 9px;
  color: #354a5d;
  font-size: 12px;
  font-weight: 650;
}
.chat-contact.active {
  background: #e6f6f4;
  color: #007b73;
}
.chat-contact:hover {
  background: #eef5f5;
}
.chat-bubble-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #d7e9ef;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: #236e7f;
  flex-shrink: 0;
}
.chat-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.chat-title {
  padding: 17px 20px;
  border-bottom: 1px solid #edf0f3;
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 750;
  font-size: 13px;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.chat-msg {
  align-self: flex-start;
  max-width: 80%;
  background: #f0f3f7;
  border-radius: 13px 13px 13px 3px;
  padding: 11px 14px;
  font-size: 12px;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.chat-msg.mine {
  align-self: flex-end;
  background: #e0f4f0;
  border-radius: 13px 13px 3px 13px;
}
.chat-msg .chat-by {
  font-size: 10px;
  font-weight: 800;
  color: #207876;
  margin-bottom: 5px;
}
.chat-msg .chat-at {
  font-size: 9px;
  color: #5d6e7e;
  margin-top: 5px;
  text-align: right;
}
.chat-compose {
  padding: 14px 18px;
  border-top: 1px solid #e9edf1;
  display: flex;
  align-items: end;
  gap: 10px;
}
.chat-compose textarea {
  flex: 1;
  border: 1px solid #e1e8ed;
  border-radius: 9px;
  padding: 11px;
  resize: none;
  font-size: 12px;
  min-width: 0;
  max-height: 90px;
}
.admin-cols {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 19px;
}
.staff-row {
  display: flex;
  gap: 11px;
  align-items: center;
  border-bottom: 1px solid #edf0f3;
  padding: 12px 0;
}
.staff-row:last-child {
  border: 0;
}
.staff-name {
  flex: 1;
  min-width: 0;
}
.staff-name strong {
  font-size: 12px;
  display: block;
}
.staff-name small {
  font-size: 11px;
  color: #606f7f;
}
.role-chip {
  font-size: 10px;
  background: #f1f4f7;
  color: #577187;
  padding: 5px 8px;
  border-radius: 6px;
}
.hint-box {
  background: #eaf8f6;
  color: #367877;
  border-radius: 10px;
  padding: 15px 17px;
  font-size: 12px;
  line-height: 1.65;
}
.quick-link {
  padding: 14px 15px;
  border: 1px solid #e9eef2;
  border-radius: 9px;
  display: flex;
  gap: 12px;
  align-items: center;
  color: #29455a;
  background: white;
  margin-bottom: 10px;
  width: 100%;
  text-align: left;
}
.quick-link:hover {
  background: #f7fafa;
}
.quick-link .quick-icon {
  background: #e7f6f3;
  color: #107b73;
  width: 35px;
  height: 35px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 18px;
}
.quick-link strong {
  font-size: 12px;
  display: block;
}
.quick-link small {
  font-size: 10px;
  color: #5f6f7c;
}
.quick-link .quick-arrow {
  margin-left: auto;
  color: #5a7081;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.detail-value {
  font-size: 13px;
  font-weight: 700;
  margin-top: 5px;
  overflow-wrap: anywhere;
}
.history-line {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid #eef1f4;
  padding: 10px 0;
  font-size: 12px;
}
.history-line span {
  color: #616f7e;
  font-size: 11px;
  margin-left: auto;
}
.message-error {
  background: #ffeded;
  border: 1px solid #f4c9c9;
  color: #a44444;
  padding: 10px;
  border-radius: 8px;
  font-size: 12px;
  margin: 8px 0;
}
.message-info {
  background: #eaf7f5;
  border: 1px solid #cfece8;
  color: #277a72;
  padding: 10px;
  border-radius: 8px;
  font-size: 12px;
  margin: 8px 0;
}
.auth-container {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 25px;
  background:
    radial-gradient(circle at 20% 10%, #294e63, transparent 42%), linear-gradient(135deg, #10253b, #17364a);
}
.auth-card {
  max-width: 440px;
  width: 100%;
  background: white;
  border-radius: 20px;
  box-shadow: 0 30px 100px #061a2e80;
  padding: 35px;
}
.auth-logo {
  width: 55px;
  height: 55px;
  display: grid;
  place-items: center;
  background: var(--pb-primary);
  color: var(--pb-on-primary);
  font-weight: 900;
  border-radius: 15px;
  font-size: 19px;
  margin-bottom: 21px;
}
.auth-card h1 {
  font-size: 24px;
  margin: 0 0 7px;
  letter-spacing: -0.5px;
}
.auth-subtitle {
  color: #75899c;
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 25px;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-footer {
  margin: 26px 0 0;
  color: #95a4b1;
  font-size: 11px;
  text-align: center;
}
#toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.toast {
  padding: 13px 17px;
  border: 1px solid #a9ded6;
  background: #124237;
  color: white;
  border-radius: 9px;
  box-shadow: 0 10px 30px #1a304a40;
  max-width: 380px;
  font-size: 12px;
  line-height: 1.5;
}
.toast.error {
  background: #8a2932;
  border-color: var(--pb-danger-border);
}
@media (max-width: 1190px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .board {
    gap: 10px;
  }
  .transport-card {
    padding: 12px;
  }
  .dashboard-cols {
    grid-template-columns: 1fr;
  }
  .time-grid,
  .admin-cols {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 950px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .mobile-overlay {
    position: fixed;
    inset: 0;
    background: #0b1a2d88;
    z-index: 15;
    display: block;
  }
  .menu-toggle {
    display: grid;
  }
  .main-wrapper {
    margin-left: 0;
    width: 100%;
  }
  .topbar {
    padding: 0 21px;
  }
  .content {
    padding: 22px;
  }
  .board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 680px) {
  .topbar {
    height: 73px;
    padding: 0 15px;
  }
  .topbar h1 {
    font-size: 20px;
  }
  .topbar-left,
  .topbar-right {
    gap: 11px;
  }
  .top-date {
    display: none;
  }
  .content {
    padding: 20px 14px 55px;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 17px;
  }
  .page-heading h2 {
    font-size: 18px;
  }
  .page-heading .heading-actions,
  .page-heading .btn {
    width: 100%;
  }
  .stat-grid {
    gap: 10px;
    margin-bottom: 16px;
  }
  .stat-card {
    padding: 14px;
    min-height: 115px;
  }
  .stat-value {
    font-size: 26px;
  }
  .board {
    grid-template-columns: 1fr;
  }
  .board-column {
    min-height: 100px;
  }
  .transport-card {
    padding: 17px;
  }
  .toolbar {
    padding: 11px;
  }
  .search-wrap {
    max-width: none;
    flex-basis: 100%;
  }
  .input-search {
    max-width: none;
  }
  .select-compact {
    flex: 1;
    min-width: 0;
  }
  .view-switch {
    margin-left: 0;
  }
  .info-grid,
  .form-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .full {
    grid-column: auto;
  }
  .form-divider {
    grid-column: auto;
  }
  .modal-backdrop {
    padding: 8px;
    align-items: flex-start;
  }
  .modal {
    max-height: calc(100dvh - 16px);
    margin: auto;
  }
  .modal-head {
    padding: 19px 17px;
  }
  .modal-body {
    padding: 17px;
  }
  .modal-footer {
    padding: 13px 17px;
  }
  .chat-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    height: calc(100dvh - 192px);
    min-height: 430px;
  }
  .chat-contacts {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid #e7edf2;
    padding: 9px;
  }
  .chat-contact {
    flex-shrink: 0;
    width: auto;
  }
  .chat-contact .contact-label {
    white-space: nowrap;
  }
  .chat-bubble-icon {
    width: 28px;
    height: 28px;
  }
  .chat-title {
    padding: 11px;
  }
  .chat-messages {
    padding: 12px;
  }
  .chat-compose {
    padding: 9px;
  }
  .chat-compose .btn {
    padding: 11px;
  }
  .time-grid {
    grid-template-columns: 1fr;
  }
  .time-filter {
    min-width: 0;
  }
  .auth-card {
    padding: 24px;
  }
  .staff-row {
    flex-wrap: wrap;
  }
}

/* PERFECT BUD v0.2 – kalendarz dostaw, tygodniowy plan, kolejność dyspozytora */
.calendar-panel {
  padding: 22px;
  margin-bottom: 20px;
  overflow: hidden;
}
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.calendar-header h3 {
  margin: 0 0 6px;
  font-size: 18px;
  color: #1d3348;
}
.calendar-header p {
  margin: 0;
  color: #5c6f81;
  font-size: 12px;
}
.calendar-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}
.calendar-nav strong {
  min-width: 162px;
  text-align: center;
  font-size: 15px;
  text-transform: capitalize;
}
.calendar-scroll {
  overflow-x: auto;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
  min-width: 665px;
}
.calendar-weekday {
  text-align: center;
  color: #5f6f81;
  font-size: 11px;
  font-weight: 800;
  padding: 7px 0;
}
.calendar-day {
  border: 1px solid #e5edf0;
  border-radius: 10px;
  background: #fbfcfd;
  min-height: 109px;
  position: relative;
  padding: 7px 7px 27px;
  transition: 0.1s;
}
.calendar-day.outside {
  border-color: transparent;
  background: #f7f8fa;
}
.calendar-day.sunday {
  background: #f7f8fa;
}
.calendar-day.selected {
  border: 2px solid #009c93;
  padding: 6px 6px 26px;
  background: #edf9f7;
  box-shadow: 0 1px 6px #009c9322;
}
.calendar-day.current .calendar-date {
  background: #12435a;
  color: white;
}
.calendar-pick {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: 0;
  text-align: left;
  padding: 0 0 5px;
  gap: 5px;
  color: inherit;
}
.calendar-date {
  width: 25px;
  height: 25px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  color: #28475c;
}
.calendar-count {
  font-size: 10px;
  color: #00786f;
  background: #dbf6ee;
  padding: 3px 5px;
  border-radius: 5px;
  font-weight: 700;
}
.calendar-tasks {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.calendar-mini {
  width: 100%;
  border: 0;
  border-left: 3px solid #d2a055;
  border-radius: 4px;
  background: #fff0d8;
  font-size: 10px;
  padding: 4px 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  color: #5f583f;
  font-weight: 700;
}
.calendar-mini.in_progress {
  background: #e5f2ff;
  border-color: #4e94d4;
  color: #315e8b;
}
.calendar-mini.done {
  background: #dff9ec;
  border-color: #35b285;
  color: #256b54;
}
.calendar-more {
  border: 0;
  background: transparent;
  text-align: left;
  color: #1a7973;
  font-size: 10px;
  padding: 2px 4px;
  font-weight: 700;
}
.calendar-add {
  position: absolute;
  bottom: 4px;
  right: 5px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid #d1e7e3;
  background: white;
  color: #007b72;
  font-size: 19px;
  line-height: 14px;
  display: grid;
  place-items: center;
  opacity: 0.7;
}
.calendar-day:hover .calendar-add,
.calendar-add:focus {
  opacity: 1;
  background: #ecfbf7;
}
.selected-day {
  border-top: 1px solid #ebeff2;
  margin-top: 16px;
  padding: 17px 3px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.selected-day strong {
  font-size: 14px;
}
.selected-day p {
  margin: 5px 0 0;
  color: #606f7f;
  font-size: 11px;
}
.selected-day-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.selected-day-jobs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.day-job {
  border: 1px solid #ebeff1;
  border-radius: 8px;
  background: #fafcfc;
  color: #30495c;
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  padding: 11px 12px;
  font-size: 12px;
  flex-wrap: wrap;
}
.day-job:hover {
  background: #edf8f5;
}
.day-job strong {
  min-width: 110px;
}
.day-job-time {
  font-weight: 800;
  color: #007b71;
}
.day-job .pill {
  margin-left: auto;
}
.calendar-no-jobs {
  font-size: 12px;
  color: #606f81;
  margin: 10px 2px 0;
}
.week-panel {
  padding: 21px;
  margin-bottom: 23px;
}
.week-panel > .panel-header {
  margin-bottom: 8px;
}
.week-day {
  border-bottom: 1px solid #ebeff2;
  padding: 12px 0;
}
.week-day:last-child {
  border-bottom: 0;
}
.week-day-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 9px;
}
.week-day-head strong {
  font-size: 12px;
  text-transform: capitalize;
}
.week-day-head small {
  margin-left: 10px;
  color: #616e7c;
  font-size: 11px;
}
.week-day-head > div:last-child {
  display: flex;
  gap: 7px;
}
.week-empty {
  font-size: 11px;
  color: #5e6f7d;
  margin: 6px 0 2px;
}
.week-transport {
  width: 100%;
  display: grid;
  grid-template-columns: 65px 130px minmax(150px, 1fr) 120px 92px;
  gap: 10px;
  align-items: center;
  background: #f9fbfc;
  border: 1px solid #edf0f2;
  border-radius: 7px;
  padding: 9px 12px;
  text-align: left;
  margin-top: 6px;
  font-size: 12px;
  color: #506375;
}
.week-transport:hover {
  background: #ebf7f4;
}
.week-transport strong {
  color: #243b4e;
}
.week-hour {
  font-weight: 800;
  color: #007b72;
}
.date-filter {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #5c6f80;
  font-size: 12px;
}
.date-filter input {
  font-size: 12px;
  border: 1px solid var(--pb-border-strong);
  padding: 8px 9px;
  border-radius: 7px;
  color: #304b60;
  max-width: 150px;
}
.order-help {
  font-size: 12px;
  color: #586f7f;
  background: #e8f3f1;
  padding: 10px 13px;
  border-radius: 8px;
  margin: -6px 0 15px;
}
.order-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  border-top: 1px solid #edf1f4;
  padding-top: 9px;
  margin: 0 0 9px;
  color: #5d7081;
  font-size: 10px;
}
.order-tools > div {
  display: flex;
  gap: 5px;
}
.order-btn {
  border: 1px solid #dce9e9;
  color: #137e7b;
  background: #f7fbfa;
  border-radius: 6px;
  min-width: 32px;
  min-height: 30px;
  font-weight: 850;
  font-size: 15px;
}
.order-btn:hover {
  background: #dbf8f0;
}
.transport-card[draggable='true'] {
  cursor: grab;
}
.transport-card.dragging {
  opacity: 0.55;
  cursor: grabbing;
}
.transport-card.drag-over {
  outline: 2px dashed #0b9c92;
  outline-offset: 2px;
  background: #f0fffa;
}
.route-estimate-box {
  background: #f1f7f8;
  border-radius: 9px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #dae9e8;
}
.estimate-result {
  font-weight: 650;
  color: #33717b;
  font-size: 12px;
  line-height: 1.55;
}
.estimate-explainer {
  font-size: 11px;
  color: #5b717a;
  line-height: 1.5;
}
@media (max-width: 1050px) {
  .week-transport {
    grid-template-columns: 58px 100px 1fr 90px;
  }
  .week-transport .pill {
    grid-column: 4;
  }
  .week-transport > span:nth-last-child(2) {
    display: none;
  }
}
@media (max-width: 680px) {
  .calendar-panel,
  .week-panel {
    padding: 14px;
  }
  .calendar-header h3 {
    font-size: 16px;
  }
  .calendar-nav {
    width: 100%;
    justify-content: space-between;
  }
  .calendar-nav strong {
    min-width: 110px;
    font-size: 12px;
  }
  .calendar-grid {
    min-width: 595px;
    gap: 5px;
  }
  .calendar-day {
    min-height: 95px;
    padding: 5px 5px 25px;
  }
  .calendar-mini {
    font-size: 9px;
  }
  .calendar-count {
    font-size: 9px;
  }
  .selected-day-actions {
    width: 100%;
  }
  .selected-day-actions .btn {
    flex: 1;
  }
  .day-job {
    gap: 8px;
  }
  .day-job .pill {
    margin-left: 0;
  }
  .week-day-head {
    align-items: start;
    flex-direction: column;
  }
  .week-day-head > div:last-child {
    width: 100%;
  }
  .week-day-head button {
    flex: 1;
  }
  .week-transport {
    grid-template-columns: 52px 1fr auto;
    gap: 6px;
    padding: 10px;
  }
  .week-transport strong {
    font-size: 11px;
  }
  .week-transport > span:nth-child(3) {
    grid-column: 1/-1;
  }
  .week-transport > span:nth-child(4) {
    display: none;
  }
  .week-transport .pill {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }
  .calendar-nav .btn {
    padding: 8px 10px;
  }
}

/* PERFECT BUD v0.3 – nieustalone zamówienia, kalendarz i sygnalizacja kierowcy */
.planning-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
  margin-bottom: 20px;
}
.planning-layout .calendar-panel {
  min-width: 0;
  margin-bottom: 0;
}
.pending-panel {
  padding: 19px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  max-height: 910px;
}
.pending-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.pending-heading h3 {
  font-size: 15px;
  color: #203a51;
  margin: 0;
  line-height: 1.45;
}
.pending-heading p {
  font-size: 11px;
  color: #5c7080;
  margin: 6px 0 0;
  line-height: 1.6;
}
.pending-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 2px 5px;
  background: #e1f7f3;
  color: #067a71;
  border-radius: 6px;
  font-size: 11px;
}
.pending-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  min-height: 96px;
  padding: 1px 3px 3px 1px;
}
.pending-card {
  padding: 13px;
  background: #f9fbfd;
  border: 1px solid #e4ebf0;
  border-radius: 10px;
  line-height: 1.45;
  box-shadow: 0 2px 3px #092c4210;
}
.pending-card[draggable='true'] {
  cursor: grab;
}
.pending-card.dragging {
  opacity: 0.46;
  cursor: grabbing;
}
.pending-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.pending-card-top strong {
  font-size: 12px;
  color: #233e55;
  overflow-wrap: anywhere;
}
.pending-route {
  color: #253e4f;
  font-size: 12px;
  font-weight: 650;
  margin: 9px 0 5px;
  overflow-wrap: anywhere;
}
.pending-vehicle {
  color: #5d6f81;
  font-size: 11px;
  margin: 6px 0;
}
.pending-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 13px;
}
.pending-actions .btn {
  flex: 1;
  white-space: nowrap;
  padding: 8px 9px;
  font-size: 11px;
}
.pending-empty {
  color: #5e707f;
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
  padding: 30px 5px;
}
.pending-foot {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  border-top: 1px solid #edf1f3;
  padding: 11px 0 0;
  color: #5a707b;
  font-size: 11px;
  line-height: 1.5;
}
.calendar-day.drop-ready {
  outline: 3px dashed #009c8e;
  background: #dbfbf3;
  border-color: #009c8e;
}
.driver-warning {
  margin: 8px 0 2px;
  padding: 9px 10px;
  border-radius: 7px;
  border: 1px solid #f1b7b7;
  background: #fff0f0;
  color: #b52230;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
}
.driver-text-alert {
  color: #b41b2b !important;
  font-weight: 850 !important;
}
.transport-card.missing-driver,
.pending-card.needs-driver,
.week-transport.missing-driver,
.day-job.missing-driver {
  border: 2px solid #e24c55 !important;
  background: #fff8f8;
}
.calendar-mini.no-driver {
  background: #ffe1e4 !important;
  border-color: #d8293e !important;
  color: #9b182d !important;
}
.pending-choice {
  padding: 12px 14px;
  background: #f0f8f6;
  border: 1px solid #cceae5;
  border-radius: 9px;
}
.pending-choice label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.pending-choice input {
  width: 19px;
  height: 19px;
  accent-color: #009c91;
  flex-shrink: 0;
}
.pending-choice small {
  display: block;
  color: #587278;
  line-height: 1.5;
  font-size: 11px;
  margin: 7px 0 0 29px;
}
.scheduling-fields {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 13px;
  border: 1px solid #e4eceb;
  background: #fbfefd;
  border-radius: 10px;
}
.field-help {
  display: block;
  font-size: 10px;
  line-height: 1.45;
  margin-top: 5px;
  color: #b53b47;
}
@media (max-width: 1240px) {
  .planning-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .pending-panel {
    max-height: none;
  }
  .pending-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 420px;
  }
  .pending-heading {
    align-items: center;
  }
}
@media (max-width: 1030px) {
  .pending-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 680px) {
  .planning-layout {
    gap: 14px;
  }
  .pending-list {
    grid-template-columns: 1fr;
    max-height: none;
  }
  .pending-panel {
    padding: 14px;
  }
  .scheduling-fields {
    grid-template-columns: 1fr;
    padding: 11px;
  }
  .pending-actions .btn {
    min-width: 120px;
  }
}

/* v0.4 - flota i rejestr aktywności kierowcy */
.finance-filters {
  display: flex;
  gap: 18px;
  align-items: flex-end;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.finance-filters .field {
  min-width: 200px;
  flex: 1;
}
.finance-kpis {
  margin: 18px 0;
}
.finance-kpis .stat-value {
  font-size: 25px;
  letter-spacing: -0.5px;
}
.bad-number {
  color: #c4293f !important;
}
.good-number {
  color: #147c60 !important;
}
.fleet-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 19px;
}
.fleet-info {
  background: #f5f9fb;
  border: 1px solid #e2ebef;
  border-radius: 9px;
  padding: 15px;
  font-size: 12px;
  color: #4d6679;
  line-height: 1.8;
}
.fleet-info strong {
  display: block;
  font-size: 14px;
  color: #213d51;
  margin-bottom: 5px;
}
.fleet-info small {
  color: #60707a;
}
.cost-fuel-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.checkline {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 12px;
}
.checkline input {
  height: 17px;
  width: 17px;
}
.activity-status {
  border-radius: 12px;
  padding: 22px;
  background: #eff5f8;
  border: 1px solid #dce6ed;
  margin-bottom: 17px;
}
.activity-status.active {
  border-color: #7dd2be;
  background: #e8faf4;
}
.activity-status span {
  font-size: 11px;
  color: #5d6f7e;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.activity-status h3 {
  font-size: 23px;
  margin: 10px 0 5px;
  color: #173d50;
}
.activity-status p {
  font-size: 12px;
  color: #57707d;
  margin: 0;
}
.driver-filter {
  max-width: 360px;
  margin-bottom: 15px;
}
.driver-actions {
  display: grid;
  gap: 12px;
}
.driver-actions > .field {
  max-width: 350px;
}
.activity-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 9px;
}
.activity-buttons .btn {
  min-height: 48px;
}
.driver-warning-box {
  margin-top: 5px;
}
.driver-warning-box h3 {
  font-size: 15px;
  margin: 0 0 13px;
}
.alert-negative {
  border: 1px solid var(--pb-danger-border);
  background: var(--pb-danger-bg);
  color: var(--pb-danger-text);
  padding: 12px;
  margin: 7px 0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 750;
}
.alert-neutral {
  border: 1px solid var(--pb-success-border);
  background: var(--pb-success-bg);
  color: var(--pb-success-text);
  padding: 12px;
  margin: 7px 0;
  border-radius: 8px;
  font-size: 12px;
}
.activity-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 5px 8px;
  border-radius: 6px;
  display: inline-block;
  white-space: nowrap;
}
.activity-driving {
  background: #dff2ff;
  color: #1b69a4;
}
.activity-other {
  background: #eae7fa;
  color: #6357a9;
}
.activity-break {
  background: #e0f7e8;
  color: #177b51;
}
.activity-available {
  background: #fff2d9;
  color: #916522;
}
.activity-rest {
  background: #e8edee;
  color: #5d6c71;
}
@media (max-width: 700px) {
  .finance-filters {
    display: block;
  }
  .finance-filters .field {
    margin-bottom: 10px;
  }
  .cost-fuel-fields {
    grid-template-columns: 1fr;
  }
  .activity-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .finance-kpis .stat-value {
    font-size: 21px;
  }
}

/* 0.5 – dostępność kierowcy */
.driver-availability-block {
  padding: 16px;
  background: var(--surface, #f6f8fb);
  border: 1px solid #c6d5e5;
  border-radius: 12px;
  margin-top: 4px;
}
.availability-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.available-driver-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 9px;
  margin-top: 10px;
}
.availability-item {
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 5px;
  border: 1px solid #d1d9e4;
  background: #fff;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  color: #203049;
}
.availability-item strong {
  display: block;
}
.availability-item small {
  display: block;
  font-size: 12px;
  margin-top: 3px;
  color: #52647a;
}
.availability-item.availability-conflict {
  border: 2px solid #d44747;
  background: #fff1f2;
}
.availability-item.availability-unknown {
  border-color: #c8993b;
  background: #fff9e9;
}
.availability-item.availability-review {
  border-color: #7794b5;
  background: #f2f7fc;
}
.availability-item.availability-selected {
  outline: 3px solid #2d6fc2;
}
.availability-arrow {
  font-size: 12px;
  color: #2e5d93;
  font-weight: 650;
}
.availability-reasons {
  font-size: 12px;
  line-height: 1.55;
  color: #546375;
  margin-top: 5px;
}
@media (max-width: 700px) {
  .availability-head {
    flex-wrap: wrap;
  }
  .available-driver-list {
    grid-template-columns: 1fr;
  }
}

/* v0.6 – kursy kierowców i przejrzysty czas transportu */
.course-type-label {
  color: #0c6d68 !important;
  background: #e5f7f2 !important;
  border-color: #c5ebe3 !important;
  font-weight: 750 !important;
}
.course-return {
  background: #f5edff !important;
  color: #704aa3 !important;
  border-color: #e3d0ff !important;
}
.return-choice {
  background: #f4f8fc;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #dce7ef;
}
.return-choice label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 12px;
}
.return-choice small,
.field-help-neutral {
  display: block;
  color: #5d6e7e;
  font-size: 11px;
  margin-top: 6px;
  line-height: 1.5;
}
.time-preview {
  background: #e8f8f3;
  border: 1px solid #b7e7d9;
  padding: 13px;
  border-radius: 9px;
  font-weight: 800;
  color: #126b59;
  font-size: 12px;
  line-height: 1.65;
}
.course-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.course-summary > div {
  border: 1px solid #e3edf0;
  background: #f7fafb;
  padding: 16px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.course-summary small {
  font-size: 12px;
  color: #5c7083;
}
.course-summary strong {
  font-size: 23px;
  color: #18384f;
}
@media (max-width: 700px) {
  .course-summary {
    grid-template-columns: 1fr;
  }
  .course-summary > div {
    padding: 11px;
  }
  .course-summary strong {
    font-size: 19px;
  }
}

/* PERFECT BUD v0.7 – plan godzinowy i szybka edycja startu */
.quick-time-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid #e5eaf0;
  padding-top: 10px;
  margin-top: 12px;
}
.quick-time-row label {
  font-weight: 650;
  font-size: 12px;
  color: #486078;
}
.quick-time-input {
  border: 1px solid #cbd9e6;
  border-radius: 9px;
  padding: 7px 8px;
  background: white;
  color: #11243b;
  min-width: 108px;
  font-weight: 700;
  font: inherit;
}
.quick-time-input:focus {
  outline: 3px solid var(--pb-focus);
  outline-offset: 2px;
}
.timeline-panel {
  margin-top: 14px;
  overflow: hidden;
}
.timeline-intro {
  display: flex;
  gap: 14px;
  align-items: start;
  justify-content: space-between;
  padding: 20px 22px 10px;
  flex-wrap: wrap;
}
.timeline-intro h3 {
  margin: 0 0 4px;
  font-size: 19px;
  color: #10253e;
}
.timeline-intro p {
  font-size: 13px;
  color: #5c6f83;
  line-height: 1.5;
  margin: 0;
  max-width: 730px;
}
.timeline-day-nav {
  display: flex;
  gap: 6px;
}
.timeline-legend {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: center;
  padding: 9px 22px 13px;
  font-size: 12px;
  color: #4b6074;
  border-bottom: 1px solid #e7edf3;
}
.timeline-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.timeline-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: #c4eef1;
  border: 1px solid #76bfc2;
}
.timeline-dot.active {
  background: #bfdbfe;
  border-color: #60a5fa;
}
.timeline-dot.completed {
  background: #d9e8df;
  border-color: #7fbea1;
}
.timeline-dot.missing {
  background: #ffe0e0;
  border-color: #e75b5b;
}
.timeline-undated {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  background: #fff9ee;
  border-bottom: 1px solid #f4dfb9;
  font-size: 12px;
}
.timeline-scroll {
  height: min(68vh, 680px);
  min-height: 400px;
  overflow: auto;
  position: relative;
  scrollbar-color: #9fb0c0 #f6f8fb;
}
.timeline-inner {
  display: grid;
  min-width: 690px;
  align-items: start;
}
.timeline-corner,
.timeline-vehicle-heading {
  height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  background: #f5f8fb;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 2px solid #cfdce6;
  color: #1b364e;
  font-size: 13px;
  font-weight: 750;
}
.timeline-corner {
  color: #5e6f82;
  font-size: 11px;
}
.timeline-vehicle-heading {
  border-left: 1px solid #e3eaf1;
}
.timeline-vehicle-heading small {
  font-size: 10px;
  font-weight: 400;
  color: #5f6e84;
}
.timeline-hours {
  position: relative;
  background: #f7f9fc;
}
.timeline-hour {
  position: absolute;
  left: 0;
  right: 0;
  height: 18px;
  padding: 0 7px 0 0;
  text-align: right;
  font-size: 11px;
  line-height: 18px;
  color: #5c6f7f;
  transform: translateY(-7px);
  pointer-events: none;
}
.timeline-vehicle-lane {
  position: relative;
  border-left: 1px solid #dce5ee;
  background: repeating-linear-gradient(
    to bottom,
    #eef3f8 0,
    #eef3f8 1px,
    white 1px,
    white 31px,
    #e5edf5 31px,
    #e5edf5 32px
  );
}
.timeline-vehicle-lane.timeline-drop-active {
  background: repeating-linear-gradient(
    to bottom,
    #ebfbf9 0,
    #ebfbf9 1px,
    #faffff 1px,
    #faffff 31px,
    #c5eee7 31px,
    #c5eee7 32px
  );
}
.timeline-drop-marker {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: #00a79f;
  z-index: 8;
  box-shadow: 0 0 0 2px white;
  pointer-events: none;
}
.timeline-job {
  position: absolute;
  box-sizing: border-box;
  z-index: 3;
  overflow: hidden;
  background: #e7f9f7;
  color: #163b47;
  border: 1px solid #63bfb5;
  border-left: 4px solid #009e94;
  border-radius: 7px;
  padding: 4px 7px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 11px;
  line-height: 1.3;
  box-shadow: 0 1px 3px #14324a16;
  user-select: none;
}
.timeline-job[draggable='true'] {
  cursor: grab;
}
.timeline-job[draggable='true']:active {
  cursor: grabbing;
}
.timeline-job strong {
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.timeline-job > span,
.timeline-job small {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.timeline-job-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 16px;
  gap: 5px;
  font-weight: 700;
}
.timeline-job-top button {
  border: 1px solid #ffffff99;
  border-radius: 5px;
  background: #ffffffb8;
  cursor: pointer;
  line-height: 13px;
  font-weight: bold;
  color: #193344;
}
.timeline-job.status-in_progress {
  background: #dceafe;
  border-color: #74a5eb;
  border-left-color: #3b82f6;
}
.timeline-job.status-done {
  background: #e7efe9;
  border-color: #a5c7ae;
  border-left-color: #5ba477;
  opacity: 0.8;
}
.timeline-job.timeline-no-driver {
  background: #fff0ee;
  border-color: #ee9999;
  border-left-color: #e54b4b;
}
.timeline-job.timeline-unestimated {
  border-style: dashed;
  background: #fff8e4;
}
.timeline-job.dragging {
  opacity: 0.45;
}
.timeline-footer {
  padding: 12px 20px 18px;
  margin: 0;
  color: #5c6f83;
  font-size: 12px;
}
@media (max-width: 720px) {
  .timeline-intro {
    padding: 15px;
  }
  .timeline-legend {
    padding: 10px 15px;
  }
  .timeline-scroll {
    height: 64vh;
  }
  .timeline-footer {
    padding: 10px 15px;
  }
  .quick-time-row {
    gap: 6px;
  }
}

.timeline-job-actions {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}
.timeline-job-actions button {
  min-width: 21px;
  min-height: 19px;
  touch-action: manipulation;
}

/* PERFECT BUD v0.8 – tydzień jak Kalendarz Google (Pon–Sob). */
.week-timeline-panel {
  margin-top: 14px;
  overflow: hidden;
}
.week-timeline-scroll {
  height: min(74vh, 790px);
  min-height: 450px;
  overflow: auto;
  scrollbar-color: #a2b2c2 #f6f8fa;
  overscroll-behavior: contain;
}
.week-timeline-inner {
  display: grid;
  min-width: 1140px;
  align-items: start;
}
.week-day-label {
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  border-left: 1px solid #dfe7ee;
  border-bottom: 2px solid #dfe7ee;
  background: #f6f9fc;
  color: #21374d;
  font-size: 13px;
}
.week-day-label span {
  font-weight: 800;
}
.week-day-label strong {
  font-size: 11px;
  color: #5f6e81;
  font-weight: 500;
}
.week-day-label.today {
  background: #e5f8f5;
  color: #007b76;
  border-bottom-color: #06a99d;
}
.week-add {
  position: absolute;
  right: 5px;
  top: 7px;
  width: 23px;
  height: 23px;
  border-radius: 6px;
  border: 1px solid #b8dad6;
  background: #fff;
  color: #078178;
  font-weight: bold;
  cursor: pointer;
}
.week-add:hover {
  background: #dff6f1;
}
.week-timeline-inner > .timeline-corner {
  height: 64px;
  z-index: 11;
}
.week-hours {
  position: relative;
  background: #f8fafc;
}
.week-hour-label {
  position: absolute;
  right: 6px;
  left: 0;
  text-align: right;
  color: #5d6e83;
  font-size: 11px;
  line-height: 20px;
  transform: translateY(-10px);
  pointer-events: none;
}
.week-timeline-day {
  position: relative;
  border-left: 1px solid #e2eaf2;
  background: repeating-linear-gradient(
    to bottom,
    #e3ebf3 0,
    #e3ebf3 1px,
    white 1px,
    white 44px,
    #edf2f7 44px,
    #edf2f7 45px,
    white 45px,
    white 89px
  );
}
.week-timeline-day.today {
  background-color: #f8fefd;
  background-image: repeating-linear-gradient(
    to bottom,
    #d2eae6 0,
    #d2eae6 1px,
    #f7fffd 1px,
    #f7fffd 44px,
    #e5f4f1 44px,
    #e5f4f1 45px,
    #f7fffd 45px,
    #f7fffd 89px
  );
}
.week-timeline-day.timeline-drop-active {
  background: #edfbf5;
  background-image: repeating-linear-gradient(to bottom, #c2e5db 0, #c2e5db 1px, #effff9 1px, #effff9 89px);
}
.week-timeline-day .timeline-drop-marker {
  z-index: 5;
}
.week-job {
  padding: 5px 7px;
  gap: 2px;
  line-height: 1.2;
  background: #d9eefb;
  border-color: #8fc3e5;
  border-left-color: #2478ae;
  transition: box-shadow 0.15s;
}
.week-job:hover {
  z-index: 6;
  box-shadow: 0 4px 13px #375b7333;
}
.week-job .timeline-job-top {
  min-height: 14px;
  align-items: flex-start;
}
.week-job .timeline-job-top span {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.week-job .timeline-job-top button {
  padding: 0 3px;
  min-height: 17px;
}
.week-job strong {
  font-size: 12px;
  letter-spacing: 0.1px;
}
.week-job-vehicle {
  font-weight: 650;
}
.week-job.status-new {
  background: #cfeafb;
  border-color: #7fbcdc;
  border-left-color: #227cbb;
}
.week-job.status-in_progress {
  background: #fcebbb;
  border-color: #dfbd62;
  border-left-color: #db9e16;
}
.week-job.status-done {
  background: #e0f0e3;
  border-color: #9dcdab;
  border-left-color: #31925a;
}
.week-job.timeline-no-driver {
  background: #ffe6e3;
  border-color: #e6a2a0;
  border-left-color: #e13737;
}
.week-job.timeline-unestimated {
  background: #fff5d9;
  border-style: dashed;
}
.week-guide {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: center;
  padding: 9px 22px;
  border-bottom: 1px solid #e5ecf2;
  color: #506579;
  font-size: 12px;
}
.week-guide span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
@media (max-width: 720px) {
  .week-timeline-scroll {
    height: 67vh;
  }
  .week-timeline-inner {
    min-width: 1140px;
  }
  .week-guide {
    padding: 8px 12px;
    gap: 9px;
  }
  .week-timeline-panel .timeline-intro {
    padding: 14px 12px;
  }
  .week-job {
    padding: 4px;
  }
}

/* v0.9 — czytelna historia realizacji, bez mylenia planu z wynikami */
.outcome-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 7px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.4;
  white-space: nowrap;
}
.outcome-success {
  background: #d7f3df;
  color: #126c37;
}
.outcome-warning {
  background: #fff0bf;
  color: #885400;
}
.outcome-failed {
  background: #ffe0e1;
  color: #a41623;
}
.outcome-planned {
  background: #dfecfb;
  color: #275d95;
}
.outcome-active {
  background: #dbeafe;
  color: #1d4ed8;
}
.task-outcome-row {
  display: flex;
  align-items: center;
  margin: -3px 0 12px;
}
.timeline-job.outcome-card-success,
.week-job.outcome-card-success {
  background: #d4f3df;
  border-color: #75c995;
  border-left-color: #14854a;
  color: #174f31;
  opacity: 1;
}
.timeline-job.outcome-card-warning,
.week-job.outcome-card-warning {
  background: #ffedb3;
  border-color: #e1b953;
  border-left-color: #c38a00;
  color: #6d4b08;
  opacity: 1;
}
.timeline-job.outcome-card-failed,
.week-job.outcome-card-failed {
  background: #ffdbdd;
  border-color: #df8d97;
  border-left-color: #ca2436;
  color: #8c1d2c;
  opacity: 1;
}
.timeline-job.outcome-card-active,
.week-job.outcome-card-active {
  background: #dbeafe;
  border-color: #83aee6;
  border-left-color: #3678d8;
  color: #193f75;
  opacity: 1;
}
.timeline-job.outcome-card-planned,
.week-job.outcome-card-planned {
  background: #d9edf9;
  border-color: #8dbcd6;
  border-left-color: #287cae;
  color: #164a73;
  opacity: 1;
}
/* Brak kierowcy pozostaje widocznym ostrzeżeniem, bez ukrywania statusu kursu */
.timeline-job.timeline-no-driver::after {
  content: '⚠ Brak kierowcy';
  font-size: 9px;
  font-weight: 750;
  color: #ad293c;
  white-space: nowrap;
}
.timeline-job.outcome-card-failed.timeline-no-driver {
  background: #ffdbdd;
}
.week-job-outcome {
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calendar-mini.outcome-success {
  background: #d8f6e1;
  border-left-color: #1e9b54;
  color: #18623b;
}
.calendar-mini.outcome-warning {
  background: #fff0b9;
  border-left-color: #d2a328;
  color: #75510b;
}
.calendar-mini.outcome-failed {
  background: #ffdedf;
  border-left-color: #dd3444;
  color: #931c31;
}
.calendar-mini.outcome-planned {
  background: #e1effa;
  border-left-color: #5796bd;
  color: #315679;
}
.calendar-mini.outcome-active {
  background: #d9e9fe;
  border-left-color: #4a90d5;
  color: #235489;
}
.calendar-mini.no-driver {
  outline: 2px dashed #e86565;
  outline-offset: -2px;
}
.outcome-card-success:not(.timeline-job) {
  border-left: 4px solid #26965f;
  background: #f4fcf6;
}
.outcome-card-warning:not(.timeline-job) {
  border-left: 4px solid #d1a02e;
  background: #fffdf1;
}
.outcome-card-failed:not(.timeline-job) {
  border-left: 4px solid #d8414d;
  background: #fff4f4;
}
.outcome-card-planned:not(.timeline-job) {
  border-left: 4px solid #83b7d7;
}
.timeline-dot.warning {
  background: #ffe4a0;
  border-color: #ddad32;
}
.timeline-dot.failed {
  background: #ffcad0;
  border-color: #d6404d;
}
.week-jump {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #5c6f84;
  font-weight: 650;
}
.week-jump input,
.week-order-heading select {
  padding: 7px 9px;
  border: 1px solid #d7e2ed;
  background: white;
  border-radius: 7px;
  color: #15344b;
  font-size: 12px;
}
.week-order-panel {
  border-top: 1px solid #e4ecf3;
  padding: 15px 20px;
  background: #fbfcfe;
}
.week-order-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.week-order-heading > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.week-order-heading > div strong {
  font-size: 14px;
  color: #17324d;
}
.week-order-heading small {
  font-size: 11px;
  color: #597085;
}
.week-order-heading label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #536d82;
}
.week-order-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.week-order-row {
  background: white;
  border: 1px solid #e3ebf1;
  border-radius: 8px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  flex-wrap: wrap;
}
.week-order-row .order-hour {
  font-weight: 800;
  color: #196e7c;
}
.week-order-row strong {
  font-size: 12px;
}
.week-order-row .week-order-actions {
  display: flex;
  gap: 5px;
  margin-left: auto;
}
.order-btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}
.btn-danger-outline {
  border: 1px solid var(--pb-danger-text);
  color: var(--pb-danger-text);
  background: #fff8f8;
}
.btn-danger-outline:hover {
  background: #ffe9ec;
}
@media (max-width: 700px) {
  .week-jump {
    width: 100%;
  }
  .week-order-panel {
    padding: 12px;
  }
  .week-order-row {
    gap: 6px;
  }
  .week-order-row .week-order-actions {
    margin-left: auto;
  }
}

/* v0.9.1 – CAŁA KARTA świeci kolorem wyniku. Nie tylko mała etykieta. */
:root {
  --pb-good-bg: #93e1b0;
  --pb-good-br: #12824a;
  --pb-good-text: #094329;
  --pb-warn-bg: #ffe084;
  --pb-warn-br: #b47800;
  --pb-warn-text: #674008;
  --pb-bad-bg: #ff9ea5;
  --pb-bad-br: #bb1c37;
  --pb-bad-text: #701020;
  --pb-plan-bg: #c3e5fb;
  --pb-plan-br: #2578ac;
  --pb-plan-text: #123f64;
  --pb-active-bg: #a9d8ff;
  --pb-active-br: #2365ad;
  --pb-active-text: #123b71;
}
:where(
  .transport-card,
  .week-transport,
  .day-job,
  .calendar-mini,
  .timeline-job,
  .week-order-row
).outcome-card-success,
:where(
  .transport-card,
  .week-transport,
  .day-job,
  .calendar-mini,
  .timeline-job,
  .week-order-row
).outcome-success {
  background: var(--pb-good-bg) !important;
  border: 2px solid var(--pb-good-br) !important;
  color: var(--pb-good-text) !important;
  opacity: 1 !important;
}
:where(
  .transport-card,
  .week-transport,
  .day-job,
  .calendar-mini,
  .timeline-job,
  .week-order-row
).outcome-card-warning,
:where(
  .transport-card,
  .week-transport,
  .day-job,
  .calendar-mini,
  .timeline-job,
  .week-order-row
).outcome-warning {
  background: var(--pb-warn-bg) !important;
  border: 2px solid var(--pb-warn-br) !important;
  color: var(--pb-warn-text) !important;
  opacity: 1 !important;
}
:where(
  .transport-card,
  .week-transport,
  .day-job,
  .calendar-mini,
  .timeline-job,
  .week-order-row
).outcome-card-failed,
:where(
  .transport-card,
  .week-transport,
  .day-job,
  .calendar-mini,
  .timeline-job,
  .week-order-row
).outcome-failed {
  background: var(--pb-bad-bg) !important;
  border: 2px solid var(--pb-bad-br) !important;
  color: var(--pb-bad-text) !important;
  opacity: 1 !important;
}
:where(
  .transport-card,
  .week-transport,
  .day-job,
  .calendar-mini,
  .timeline-job,
  .week-order-row
).outcome-card-planned,
:where(
  .transport-card,
  .week-transport,
  .day-job,
  .calendar-mini,
  .timeline-job,
  .week-order-row
).outcome-planned {
  background: var(--pb-plan-bg) !important;
  border: 2px solid var(--pb-plan-br) !important;
  color: var(--pb-plan-text) !important;
  opacity: 1 !important;
}
:where(
  .transport-card,
  .week-transport,
  .day-job,
  .calendar-mini,
  .timeline-job,
  .week-order-row
).outcome-card-active,
:where(
  .transport-card,
  .week-transport,
  .day-job,
  .calendar-mini,
  .timeline-job,
  .week-order-row
).outcome-active {
  background: var(--pb-active-bg) !important;
  border: 2px solid var(--pb-active-br) !important;
  color: var(--pb-active-text) !important;
  opacity: 1 !important;
}
/* Mocniejsza obwódka z lewej, ale bez modyfikowania wysokości wpisu. */
.timeline-job.outcome-card-success,
.timeline-job.outcome-card-warning,
.timeline-job.outcome-card-failed,
.timeline-job.outcome-card-planned,
.timeline-job.outcome-card-active {
  border-left-width: 7px !important;
}
/* Czerwony brak kierowcy ma pierwszeństwo przed kolorem planu. */
:where(.transport-card, .week-transport, .day-job, .timeline-job, .week-order-row).missing-driver,
.timeline-job.timeline-no-driver,
.calendar-mini.no-driver {
  background: var(--pb-bad-bg) !important;
  border: 2px solid var(--pb-bad-br) !important;
  color: var(--pb-bad-text) !important;
}
.timeline-job.timeline-no-driver {
  border-left-width: 7px !important;
}
/* Czytelność wypełnionych kart – jasne etykiety na ciemniejszym tle. */
.transport-card[class*='outcome-card-'] .transport-head strong,
.week-transport[class*='outcome-card-'] strong,
.day-job[class*='outcome-card-'] strong,
.timeline-job[class*='outcome-card-'] strong,
.week-order-row[class*='outcome-card-'] strong {
  color: inherit !important;
}
.transport-card[class*='outcome-card-'] .transport-date,
.transport-card[class*='outcome-card-'] .task-meta,
.transport-card[class*='outcome-card-'] .route-caption,
.week-transport[class*='outcome-card-'] span,
.timeline-job[class*='outcome-card-'] span {
  color: inherit;
}
.transport-card[class*='outcome-card-'] .outcome-pill {
  border: 1px solid currentColor;
  background: #ffffffad;
  color: inherit;
}
.timeline-dot.completed {
  background: var(--pb-good-bg);
  border-color: var(--pb-good-br);
}
.timeline-dot.warning {
  background: var(--pb-warn-bg);
  border-color: var(--pb-warn-br);
}
.timeline-dot.failed {
  background: var(--pb-bad-bg);
  border-color: var(--pb-bad-br);
}
.timeline-dot.planned {
  background: var(--pb-plan-bg);
  border-color: var(--pb-plan-br);
}
.timeline-dot.active {
  background: var(--pb-active-bg);
  border-color: var(--pb-active-br);
}
.driver-fuel-panel h4 {
  font-size: 15px;
  margin: 22px 0 10px;
}
.driver-fuel-panel .form-grid {
  margin-top: 12px;
}
@media (prefers-contrast: more) {
  .timeline-job[class*='outcome-card-'],
  .transport-card[class*='outcome-card-'] {
    border-width: 3px !important;
  }
}
/* PERFECT BUD v0.10: wygodny panel kierowcy. Nie zmienia widoku administratora. */
.driver-simple {
  max-width: 950px;
  margin: 0 auto;
  display: grid;
  gap: 17px;
  padding-bottom: 20px;
}
.driver-simple h2 {
  font-size: clamp(24px, 3vw, 31px);
  color: #10283c;
  margin: 0;
}
.driver-simple h3 {
  font-size: 17px;
  color: #142b40;
  margin: 0;
}
.driver-simple p {
  margin: 6px 0;
  color: #5d6f82;
  line-height: 1.5;
}
.driver-hello,
.driver-section-title,
.driver-trip-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.driver-hello {
  padding: 6px 0 10px;
}
.driver-kicker {
  font-size: 11px;
  letter-spacing: 0.13em;
  font-weight: 800;
  color: #097a6f;
}
.driver-user-badge {
  width: 52px;
  height: 52px;
  border-radius: 17px;
  background: #d5f4ed;
  color: #008d82;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 20px;
}
.driver-hero {
  padding: 22px;
  display: grid;
  gap: 15px;
  background: linear-gradient(135deg, #f9ffff, #effbf9);
}
.driver-hero-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: #536c7c;
}
.driver-hero-status strong {
  font-size: 16px;
  color: #0b766c;
}
.driver-start-button {
  border: 0;
  border-radius: 14px;
  background: var(--pb-primary);
  color: var(--pb-on-primary);
  padding: 21px 15px;
  min-height: 74px;
  font-size: clamp(19px, 3.5vw, 25px);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  cursor: pointer;
  box-shadow: 0 6px 16px #01958030;
}
.driver-start-button.stop {
  background: #183d50;
}
.driver-section {
  padding: 22px;
  display: grid;
  gap: 13px;
}
.driver-section-title {
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.driver-status-dot {
  font-weight: 750;
  background: #d8f4eb;
  color: #087863;
  border-radius: 99px;
  padding: 8px 13px;
  font-size: 13px;
}
.driver-activity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.driver-activity-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-height: 140px;
  padding: 16px 6px;
  border: 2px solid #e5edf2;
  border-radius: 16px;
  background: #f8fafc;
  color: #234253;
  cursor: pointer;
  text-align: center;
}
.driver-activity-tile strong {
  font-size: 16px;
  line-height: 1.1;
}
.driver-activity-tile small {
  font-size: 11px;
  color: #5a717e;
}
.driver-activity-icon {
  color: #385667;
  min-height: 39px;
  display: grid;
  place-items: center;
}
.driver-activity-tile.selected {
  background: #ddf7ec;
  border-color: #009b83;
  color: #007962;
  box-shadow: inset 0 0 0 1px #009b83;
}
.driver-activity-tile.selected .driver-activity-icon {
  color: #007b68;
}
.driver-activity-tile:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.driver-activity-tile:focus-visible,
.driver-big-btn:focus-visible,
.driver-start-button:focus-visible {
  outline: 4px solid var(--pb-focus);
  outline-offset: 3px;
}
.driver-note {
  font-size: 12px;
  color: #5d707e !important;
}
.driver-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.driver-metrics > .panel {
  padding: 19px;
  display: grid;
  gap: 5px;
  background: #f7fcfe;
}
.driver-metrics small {
  font-size: 12px;
  line-height: 1.4;
  color: #546d7e;
}
.driver-metrics strong {
  font-size: clamp(17px, 3vw, 26px);
  color: #163c55;
}
.driver-metrics span {
  font-size: 12px;
  color: #606f7e;
}
.driver-trip {
  display: grid;
  gap: 8px;
  border: 2px solid #4eaaec;
  border-radius: 16px;
  padding: 18px;
  background: #dff0ff;
  color: #0a3553;
}
.driver-trip.outcome-card-success {
  background: #dbf8e6;
  border-color: #168a50;
  color: #125c35;
}
.driver-trip.outcome-card-warning {
  background: #fff0b8;
  border-color: #bf8a00;
  color: #5d4300;
}
.driver-trip.outcome-card-failed {
  background: #ffd9de;
  border-color: #c93140;
  color: #6a151c;
}
.driver-trip.outcome-card-active {
  background: #def2f6;
  border-color: #268f9f;
  color: #15515d;
}
.driver-trip-top {
  font-size: 13px;
  align-items: flex-start;
}
.driver-trip-top strong {
  font-size: 18px;
}
.driver-trip-top strong span {
  font-size: 13px;
  font-weight: 500;
}
.driver-trip-top > span {
  font-weight: 800;
  text-align: right;
}
.driver-trip h3 {
  font-size: 21px;
  color: inherit;
}
.driver-trip p {
  font-size: 14px;
  color: inherit;
  opacity: 0.9;
  margin: 0;
}
.driver-big-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: none;
  border-radius: 13px;
  background: #fff;
  padding: 15px;
  color: #16394c;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  min-height: 54px;
}
.driver-trip .driver-big-btn {
  background: #fff;
  color: #0b455f;
  margin-top: 5px;
}
.driver-big-btn:disabled {
  opacity: 0.48;
  cursor: default;
}
.driver-quick-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.driver-quick-links button {
  border: 1px solid #cedee7;
  border-radius: 14px;
  padding: 18px 10px;
  background: #fff;
  color: #163d50;
  font-size: 15px;
  font-weight: 750;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}
.driver-text-action,
.driver-back {
  border: 0;
  background: transparent;
  color: #007a6f;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
}
.driver-day-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  background: #fff;
  border: 1px solid #e2e9ed;
  border-radius: 16px;
}
.driver-day-nav button {
  font-size: 28px;
  border: 0;
  background: #e7f7f4;
  border-radius: 11px;
  width: 48px;
  height: 50px;
  color: #087f71;
  cursor: pointer;
}
.driver-day-nav label {
  font-size: 11px;
  color: #5f707d;
  display: grid;
  gap: 1px;
  text-align: center;
}
.driver-day-nav input {
  font-size: 16px;
  border: 0;
  color: #17394d;
  background: transparent;
}
.driver-trips-list {
  display: grid;
  gap: 13px;
}
.driver-back {
  text-align: left;
  justify-self: start;
  font-size: 16px;
}
.driver-route-stop {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px 0;
}
.driver-route-stop > div {
  display: grid;
  gap: 3px;
}
.driver-route-stop small {
  color: #5c707d;
}
.driver-route-stop strong {
  font-size: 17px;
  color: #193e53;
}
.driver-route-dot {
  width: 17px;
  height: 17px;
  border: 4px solid;
  border-radius: 50%;
  flex-shrink: 0;
}
.driver-route-dot.green {
  border-color: #08a584;
}
.driver-route-dot.blue {
  border-color: #438de4;
}
.driver-job-meta {
  display: grid;
  gap: 9px;
  padding: 14px 0;
  border-top: 1px solid #e5edf0;
  font-size: 14px;
  color: #506b7b;
}
.driver-job-meta strong {
  color: #183c51;
}
.driver-map-btn,
.driver-call-btn {
  background: #e9f4ff;
  border-radius: 12px;
  padding: 16px;
  text-decoration: none;
  font-weight: 800;
  color: #135781;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  cursor: pointer;
  font-size: 15px;
}
.driver-call-btn {
  background: #dff9ee;
  color: #076d53;
}
.driver-step-buttons {
  display: grid;
  gap: 10px;
}
.driver-step-buttons .driver-big-btn {
  min-height: 65px;
  background: #e7eef3;
  color: #203d4f;
  font-size: 19px;
}
.driver-step-buttons .driver-step-primary:not(:disabled),
.driver-step-buttons .driver-big-btn:not(:disabled) {
  background: #009d83;
  color: white;
}
.driver-photo-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 12px;
  background: #00846e;
  color: white;
  padding: 17px;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
}
#driver-photo-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.driver-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.driver-photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid #d5e3e9;
  border-radius: 9px;
}
.driver-issue-text {
  padding: 12px;
  background: #fff1ba;
  color: #705200 !important;
  border-radius: 9px;
}
.driver-alert {
  border-left: 5px solid #c88200;
  background: #fff2cb;
  padding: 15px;
  border-radius: 9px;
  color: #72520b;
  margin: 8px 0;
}
.driver-history > div,
.driver-leave-row,
.driver-admin-row {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #e9eef1;
  flex-wrap: wrap;
}
.driver-history time {
  font-size: 12px;
  color: #5b707d;
}
.driver-history strong {
  flex: 1;
  color: #1a394e;
}
.driver-history span {
  font-size: 13px;
  color: #5d6f7d;
}
.driver-full-link {
  width: 100%;
}
.leave-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  text-align: center;
}
.leave-calendar > b {
  padding: 8px 2px;
  font-size: 12px;
  color: #5b6f7d;
}
.leave-day {
  display: grid;
  place-items: center;
  border-radius: 9px;
  min-height: 39px;
  font-weight: 650;
  color: #274054;
}
.leave-day.current-day {
  outline: 2px solid #00a085;
}
.leave-day.leave-pending {
  background: #ffe5ab;
  color: #825005;
}
.leave-day.leave-approved {
  background: #c8efdd;
  color: #075b33;
}
.leave-day.leave-rejected {
  background: #ffd2d8;
  color: #942735;
}
.leave-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #59707f;
}
.driver-leave-form {
  display: grid;
  gap: 15px;
}
.driver-leave-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.driver-leave-row small {
  display: block;
  color: #5e707c;
  margin-top: 5px;
}
.driver-leave-row > span {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
}
.driver-leave-row > span.leave-pending {
  background: #ffe5ab;
  color: #825005;
}
.driver-leave-row > span.leave-approved {
  background: #c8efdd;
  color: #075b33;
}
.driver-leave-row > span.leave-rejected {
  background: #ffd2d8;
  color: #942735;
}
.driver-contacts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.driver-contact-tile {
  display: grid;
  gap: 12px;
  padding: 18px;
  text-align: center;
  justify-items: center;
}
.driver-contact-icon {
  background: #e5f4f1;
  color: #007a6a;
  border-radius: 50%;
  padding: 12px;
}
.driver-contact-tile strong {
  font-size: 17px;
}
.driver-contact-tile small {
  color: #5e707d;
}
.driver-contact-tile a {
  width: 100%;
  background: #00846e;
  color: white;
}
.driver-admin-row span {
  color: #5c7081;
  font-size: 13px;
}
.driver-bottom-nav {
  display: none;
}
@media (max-width: 800px) {
  body.driver-mode .sidebar {
    display: none !important;
  }
  body.driver-mode .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
  }
  body.driver-mode #menu-toggle {
    display: none !important;
  }
  body.driver-mode .topbar {
    padding: 12px 15px;
    min-height: 68px;
  }
  body.driver-mode .content {
    padding: 16px 12px 90px !important;
  }
  body.driver-mode .top-date {
    display: none;
  }
  body.driver-mode .driver-bottom-nav {
    display: grid;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    grid-template-columns: repeat(5, 1fr);
    padding: 7px 4px calc(env(safe-area-inset-bottom) + 7px);
    background: white;
    box-shadow: 0 -4px 15px #0b254216;
    z-index: 20;
  }
  .driver-bottom-link {
    background: white;
    color: #59717f;
    border: 0;
    display: grid;
    place-items: center;
    gap: 4px;
    padding: 7px 0;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
  }
  .driver-bottom-link.selected {
    color: #007a68;
  }
  .driver-bottom-link span {
    white-space: nowrap;
  }
  .driver-section {
    padding: 15px;
  }
  .driver-hero {
    padding: 15px;
  }
  .driver-activity-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .driver-activity-tile {
    min-height: 115px;
    padding: 11px 5px;
  }
  .driver-contacts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 420px) {
  .driver-metrics {
    grid-template-columns: 1fr 1fr;
  }
  .driver-metrics > .panel {
    padding: 13px;
  }
  .driver-metrics strong {
    font-size: 18px;
  }
  .driver-contact-tile {
    padding: 12px;
  }
  .driver-contact-tile strong {
    font-size: 14px;
  }
  .driver-quick-links button {
    font-size: 13px;
    padding: 13px 5px;
  }
  .driver-hello h2 {
    font-size: 22px;
  }
}

.leave-day {
  position: relative;
}
.driver-course-dot {
  position: absolute;
  bottom: 1px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #277edf;
}

/* PERFECT BUD v0.10.1 — zaznaczanie wielodniowego urlopu i skrzynka wniosków */
.leave-day[data-date] {
  appearance: none;
  background-color: #fff;
  border: 1px solid transparent;
  font: inherit;
  color: #274054;
  cursor: pointer;
  min-width: 0;
  min-height: 45px;
  touch-action: manipulation;
  transition:
    background-color 0.1s,
    border-color 0.1s;
}
.leave-day[data-date]:hover {
  background-color: #eaf8f5;
  border-color: #36b6a8;
}
.leave-day[data-date]:focus-visible {
  outline: 3px solid var(--pb-focus);
  outline-offset: 2px;
}
.leave-day[data-date].leave-pending {
  background: #ffe5ab;
  color: #825005;
}
.leave-day[data-date].leave-approved {
  background: #c8efdd;
  color: #075b33;
}
.leave-day[data-date].leave-rejected {
  background: #ffd2d8;
  color: #942735;
}
.leave-day[data-date].leave-selected {
  background: #b7efe4;
  color: #064b42;
  border: 2px solid #008b79;
  font-weight: 900;
}
.leave-day[data-date].leave-range-first,
.leave-day[data-date].leave-range-last {
  background: #008275;
  color: #fff;
  box-shadow: inset 0 0 0 2px #075f59;
}
.leave-calendar-instruction {
  color: #304f60 !important;
  background: #f2faf8;
  border-radius: 10px;
  padding: 10px 12px;
}
.leave-selection-help {
  font-weight: 750;
  font-size: 14px;
  color: #056f62;
  background: #e8f8f3;
  padding: 12px;
  border-radius: 10px;
}
.leave-selected-legend {
  color: #087a6d;
  font-weight: 800;
}
.nav-pending-count {
  margin-left: auto;
  background: #f9a82f;
  color: #2b1f09;
  min-width: 24px;
  height: 24px;
  padding: 2px 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 20px;
  font-size: 12px;
}
.leave-inbox-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 15px 0;
  border-bottom: 1px solid #e4edf1;
}
.leave-inbox-info {
  display: grid;
  gap: 4px;
  flex: 1 1 240px;
  color: #173b4d;
}
.leave-inbox-info small {
  color: #5e707d;
}
.leave-inbox-status {
  border-radius: 20px;
  padding: 8px 10px;
  font-weight: 800;
  font-size: 12px;
}
.leave-inbox-status.leave-pending {
  background: #ffe5ab;
  color: #825005;
}
.leave-inbox-status.leave-approved {
  background: #c8efdd;
  color: #075b33;
}
.leave-inbox-status.leave-rejected {
  background: #ffd2d8;
  color: #942735;
}
.leave-inbox-actions {
  display: flex;
  gap: 8px;
}
@media (max-width: 600px) {
  .leave-inbox-actions {
    width: 100%;
  }
  .leave-inbox-actions button {
    flex: 1;
  }
  .leave-calendar {
    gap: 2px;
  }
  .leave-day[data-date] {
    min-height: 42px;
  }
}

/* PERFECT BUD 0.10.2 – karta osobowa i ewidencja urlopowa */
.hr-admin-summary {
  margin-top: 20px;
}
.hr-table-wrap {
  overflow-x: auto;
  max-width: 100%;
}
.hr-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 650px;
  font-size: 12px;
}
.hr-table th,
.hr-table td {
  padding: 12px 11px;
  border-bottom: 1px solid #e5edf1;
  text-align: left;
  vertical-align: top;
}
.hr-table th {
  background: #f2f6f7;
  color: #43596c;
  font-size: 11px;
}
.hr-table td strong {
  font-weight: 800;
  color: #173448;
}
.hr-table td small {
  display: block;
  font-size: 11px;
  color: #5f707c;
  margin-top: 4px;
}
.hr-help {
  font-size: 11px;
  line-height: 1.65;
  color: #546d7b;
  background: #f0f7f8;
  border: 1px solid #d8eceb;
  padding: 13px;
  border-radius: 10px;
  margin-top: 12px;
}
.hr-banner {
  padding: 12px;
  background: #effaf7;
  border: 1px solid #c5e6df;
  color: #266e60;
  border-radius: 10px;
  font-size: 12px;
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.hr-profile-modal {
  max-height: 65vh;
  overflow-y: auto;
}
.hr-profile-modal h3 {
  font-size: 15px;
  margin: 23px 0 11px;
  color: #193c55;
}
.hr-days-check {
  padding: 14px;
  background: #f9fbfc;
  border: 1px solid #e4edf1;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hr-days-check > div {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.hr-days-check label {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  font-size: 12px;
  background: white;
  padding: 8px 10px;
  border: 1px solid #dbe5e9;
  border-radius: 8px;
}
.hr-days-check label input {
  accent-color: #009c89;
}
.hr-days-check small {
  color: #57707c;
  line-height: 1.5;
}
.hr-balance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.hr-balance-tile {
  padding: 14px;
  background: #f6fafb;
  border: 1px solid #dfecef;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.hr-balance-tile small {
  font-size: 11px;
  color: #5b707d;
}
.hr-balance-tile strong {
  font-size: 20px;
  color: #173a53;
}
.hr-balance-tile span {
  font-size: 10px;
  color: #59717a;
  line-height: 1.5;
}
.hr-comp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: #fbfcfd;
  border: 1px solid #e1eaf0;
  border-radius: 10px;
  padding: 11px 13px;
  margin: 7px 0;
}
.hr-comp-row strong {
  display: block;
  font-size: 12px;
}
.hr-comp-row small {
  display: block;
  color: #59707f;
  font-size: 11px;
  margin-top: 5px;
}
.hr-status-green {
  color: #0a7b55;
  font-weight: 800;
  font-size: 12px;
}
.hr-alert,
.hr-comp-alert {
  border: 1px solid #e7b87d;
  background: #fff4df;
  color: #8c510b;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.6;
  margin: 12px 0;
}
.calendar-day.hr-holiday {
  background: #ffedf0 !important;
  border-color: #f6b9c2 !important;
}
.calendar-day.hr-holiday .calendar-date {
  color: #b61535 !important;
  font-weight: 900;
}
.hr-holiday-mini {
  font-size: 9px;
  color: #b61535;
  display: block;
  line-height: 1.3;
  margin-top: 3px;
  max-height: 27px;
  overflow: hidden;
}
.leave-day.hr-holiday {
  background: #ffe2e7 !important;
  color: #b11934 !important;
  font-weight: 900;
  border: 1px solid #ffb7c5 !important;
}
.leave-day.hr-sunday:not(.leave-selected):not(.hr-holiday) {
  color: #ba273e;
}
.hr-holiday-dot {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c62845;
  margin: 2px auto;
}
@media (max-width: 680px) {
  .hr-balance-grid {
    grid-template-columns: 1fr 1fr;
  }
  .hr-balance-tile {
    padding: 10px;
  }
  .hr-balance-tile strong {
    font-size: 17px;
  }
  .hr-profile-modal {
    max-height: 69vh;
  }
  .hr-comp-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .hr-table {
    min-width: 560px;
  }
}

/* v0.10.3: trzy duże przyciski aktywności również na małych ekranach */
@media (max-width: 380px) {
  .driver-activity-grid {
    gap: 6px;
  }
  .driver-activity-tile {
    padding: 10px 3px;
    min-height: 117px;
  }
  .driver-activity-tile strong {
    font-size: 13px;
  }
  .driver-activity-tile small {
    font-size: 10px;
  }
}

/* v0.10.4 — kolejne miejsca rozładunku w jednym zleceniu */
.multi-stops-block {
  border: 1px solid #b6d8e2;
  border-radius: 12px;
  padding: 16px;
  background: rgba(45, 137, 167, 0.04);
  margin-top: 8px;
}
.stop-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.stop-block-header strong {
  color: #173451;
  font-size: 14px;
}
#stops-count-label {
  color: #156379;
  font-size: 13px;
  font-weight: 800;
}
.extra-stop {
  border: 1px solid #cedbe8;
  border-left: 4px solid #298eb0;
  border-radius: 10px;
  background: #fff;
  padding: 14px;
  margin: 13px 0;
}
.extra-stop .form-grid {
  margin-top: 9px;
}
.driver-stop-card {
  border: 1px solid #d4e2ec;
  border-left: 4px solid #2e7bac;
  border-radius: 12px;
  padding: 15px;
  margin: 12px 0;
  background: #fff;
  display: grid;
  gap: 9px;
}
.driver-stop-card > strong {
  font-size: 16px;
  color: #173451;
}
.driver-stop-card p {
  margin: 0;
  color: #486276;
}
.driver-stop-finished {
  border-left-color: #138d6a;
  background: #f2fbf7;
}
.driver-stop-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.driver-stop-buttons .driver-big-btn {
  font-size: 14px;
  padding: 13px 10px;
  min-height: 50px;
}
@media (max-width: 590px) {
  .driver-stop-buttons {
    grid-template-columns: 1fr;
  }
  .multi-stops-block {
    padding: 11px;
  }
}

/* v0.10.5 — pięć typów w dotychczasowym kalendarzu; status pozostaje kolorem tła. */
.pb-type-tag {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  margin: 4px 0 5px;
  padding: 3px 7px;
  border-radius: 5px;
  border-left: 4px solid var(--pb-type-color, #2563eb);
  background: #fff;
  color: #234157;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.3;
  max-width: 100%;
  white-space: normal;
}
.pb-type-transport {
  --pb-type-color: #2563eb;
}
.pb-type-return_load {
  --pb-type-color: #0d9488;
}
.pb-type-supplier_direct {
  --pb-type-color: #9333ea;
}
.pb-type-hired_transport {
  --pb-type-color: #d97706;
}
.pb-type-customer_pickup {
  --pb-type-color: #64748b;
}
.pb-mini-type {
  font-size: 9px;
  font-weight: 850;
  display: inline-block;
  padding: 0 3px;
  border-radius: 3px;
  border-bottom: 3px solid var(--pb-type-color, #2563eb);
  background: white;
  color: #284051;
}
.pb-week-type {
  font-size: 10px;
  line-height: 1.25;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  opacity: 0.85;
  font-weight: 650;
}
.calendar-mini .pb-mini-type {
  margin-left: 3px;
}
.field-wrap > .field {
  width: 100%;
}
#task-external-fields > .field {
  margin: 0;
  min-width: 0;
}
#task-external-fields > .field > .field {
  margin: 0;
  min-width: 0;
}
#task-type-explainer {
  font-size: 12px;
  line-height: 1.5;
  padding: 9px 12px;
  background: #eaf7f6;
  border-radius: 8px;
  color: #27504f;
}

.pb-week-type {
  display: inline-block;
  align-self: flex-start;
  background: #ffffffab;
  border-radius: 3px;
  border-left: 4px solid var(--pb-type-color, #2563eb);
  padding: 1px 4px;
  font-size: 10px !important;
  letter-spacing: 0.01em;
}

/* v0.10.6 — kafle wyboru rodzaju zadania przed formularzem; kalendarz bez zmian. */
.task-kind-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.task-kind-grid .task-kind-tile:first-child {
  grid-column: 1/-1;
}
.task-kind-tile {
  position: relative;
  min-height: 110px;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 14px;
  padding: 17px;
  border: 1px solid #dce5eb;
  border-left: 6px solid var(--pb-type-color, #2563eb);
  background: #fff;
  border-radius: 12px;
  cursor: pointer;
  color: #173451;
  transition:
    border-color 0.12s,
    box-shadow 0.12s,
    background 0.12s;
}
.task-kind-tile:hover,
.task-kind-tile:focus-visible {
  border-color: var(--pb-type-color, #2563eb);
  box-shadow: 0 6px 20px rgba(15, 37, 62, 0.1);
  background: #f9fcfe;
}
.task-kind-icon {
  display: grid;
  place-items: center;
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  background: #eff5fa;
  color: var(--pb-type-color, #2563eb);
  border-radius: 11px;
}
.task-kind-content {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}
.task-kind-content strong {
  font-size: 14px;
  line-height: 1.35;
}
.task-kind-route {
  font-size: 12px;
  color: #41617a;
  font-weight: 700;
}
.task-kind-content small {
  font-size: 11px;
  color: #5e6f81;
  line-height: 1.4;
}
.task-kind-arrow {
  color: var(--pb-type-color, #2563eb);
  font-size: 24px;
  font-weight: 700;
}
.task-kind-footnote {
  color: #5c7081;
  font-size: 12px;
  line-height: 1.5;
  margin: 17px 2px 0;
}
.task-selected-type {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 15px;
  border-left: 5px solid var(--pb-type-color, #2563eb);
  border-radius: 9px;
  background: #f4f8fb;
}
.task-selected-icon {
  display: grid;
  place-items: center;
  color: var(--pb-type-color, #2563eb);
}
.task-selected-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.task-selected-copy small {
  font-size: 10px;
  letter-spacing: 0.07em;
  color: #5e6f7e;
  font-weight: 750;
}
.task-selected-copy strong {
  font-size: 13px;
  color: #173451;
}
.task-change-type {
  white-space: nowrap;
}
@media (max-width: 570px) {
  .task-kind-grid {
    grid-template-columns: 1fr;
  }
  .task-kind-grid .task-kind-tile:first-child {
    grid-column: auto;
  }
  .task-kind-tile {
    min-height: 94px;
    padding: 13px;
    gap: 10px;
  }
  .task-selected-type {
    flex-wrap: wrap;
  }
  .task-change-type {
    margin-left: auto;
  }
}

/* v0.10.9 – kontrahenci i szybki podgląd, bez ingerencji w układ kalendarza */
.client-picker {
  position: relative;
  display: block;
  min-width: 0;
}
.client-picker label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}
.client-picker-top {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.client-picker-top input[type='text'] {
  min-width: 0;
  flex: 1;
  padding: 11px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}
.client-suggestions {
  position: relative;
  z-index: 30;
  background: var(--surface, #fff);
  border: 1px solid #cbd5e1;
  box-shadow: 0 9px 18px #0f172a1a;
  border-radius: 9px;
  margin: 6px 0;
  max-height: 230px;
  overflow: auto;
}
.client-suggestion {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 13px;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  cursor: pointer;
}
.client-suggestion:hover,
.client-suggestion:focus {
  background: #e4f9f5;
}
.client-suggestion small {
  color: #5f6e84;
}
.client-inline {
  padding: 14px;
  border: 1px solid #a7dcd7;
  background: #f5fbfa;
  border-radius: 12px;
  margin-top: 12px;
}
.client-inline h4 {
  margin: 0 0 8px;
}
.client-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.pb-task-preview {
  position: fixed;
  z-index: 10005;
  width: min(335px, 85vw);
  white-space: pre-line;
  overflow-wrap: anywhere;
  pointer-events: none;
  background: #10273d;
  color: white;
  border: 1px solid #68899f;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 12px 32px #0004;
  font-size: 13px;
  line-height: 1.65;
}
.client-table {
  width: 100%;
  border-collapse: collapse;
}
.client-table td,
.client-table th {
  padding: 9px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}
.client-import-wrap {
  padding: 12px;
  border-radius: 10px;
  background: #f6f9fd;
  border: 1px solid #d2dce5;
  margin-top: 16px;
}
.client-import-mapping {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 8px;
}
.client-import-mapping label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.client-import-mapping select {
  padding: 8px;
  border: 1px solid #bccbd8;
  border-radius: 6px;
}
.client-import-preview {
  max-height: 170px;
  overflow: auto;
  font-size: 12px;
}
.client-import-preview table {
  width: 100%;
  border-collapse: collapse;
}
.client-import-preview td,
.client-import-preview th {
  border-bottom: 1px solid #e2e8f0;
  padding: 5px 8px;
}
@media (max-width: 620px) {
  .client-picker-top {
    flex-wrap: wrap;
  }
  .client-picker-top input[type='text'] {
    flex-basis: 100%;
  }
  .client-import-mapping {
    grid-template-columns: 1fr;
  }
}

/* PERFECT BUD 0.11 – dokumenty Wapro i lista przygotowania */
.pb-doc-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.pb-doc-summary > div {
  background: #fff;
  border: 1px solid #e5ebef;
  border-radius: 11px;
  padding: 17px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pb-doc-summary strong {
  font-size: 24px;
  color: #14324b;
}
.pb-doc-summary span {
  font-size: 12px;
  color: #5d6f81;
}
.pb-doc-list {
  display: grid;
  gap: 12px;
  margin-top: 19px;
}
.pb-doc-card {
  background: white;
  border: 1px solid #e2eaf0;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 2px 9px #102b4210;
}
.pb-doc-head,
.pb-doc-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pb-doc-head strong {
  font-size: 15px;
}
.pb-doc-head .small {
  margin-top: 5px;
}
.pb-doc-state {
  font-size: 11px;
  font-weight: 750;
  border-radius: 9px;
  padding: 6px 10px;
  background: #f2f5f9;
  color: #607084;
}
.pb-doc-state.to_prepare {
  background: #fff0da;
  color: #96611b;
}
.pb-doc-state.ready {
  background: #dff7ec;
  color: #167c54;
}
.pb-doc-actions {
  border-top: 1px solid #edf2f5;
  margin-top: 12px;
  padding-top: 12px;
}
.pb-doc-actions label {
  font-size: 11px;
  color: #5d6f81;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: min(320px, 100%);
  flex: 1;
}
.pb-doc-actions select {
  background: white;
  border: 1px solid #d5e2e8;
  border-radius: 7px;
  padding: 8px;
  max-width: 100%;
  font-size: 12px;
  color: #30495c;
}
.pb-doc-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pb-doc-items {
  border-top: 1px solid #edf1f4;
  margin-top: 14px;
  padding-top: 12px;
}
.pb-doc-items summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  color: #216d73;
}
.pb-doc-lines {
  display: grid;
  gap: 5px;
  padding: 12px 0;
}
.pb-doc-lines label {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 12px;
  padding: 7px 8px;
  border-radius: 7px;
  background: #f7fafb;
}
.pb-doc-lines input {
  accent-color: #08a397;
  margin-top: 2px;
}
.pb-doc-preview-lines {
  display: grid;
  gap: 8px;
  margin: 8px 0 14px;
}
.pb-doc-preview-row {
  display: grid;
  grid-template-columns: 20px minmax(120px, 1fr) 90px 85px 36px;
  align-items: center;
  gap: 6px;
}
.pb-doc-preview-row input {
  min-width: 0;
  width: 100%;
  padding: 9px 6px;
  border: 1px solid #dbe4ea;
  border-radius: 6px;
  font-size: 12px;
}
.pb-doc-alert {
  background: #fff3dc;
  color: #775419;
  font-size: 12px;
  padding: 10px;
  border-radius: 7px;
  margin-bottom: 7px;
}
.pb-doc-checkrow {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 0;
}
.pb-doc-checkrow input {
  accent-color: #04a59a;
}
.pb-task-documents {
  background: #f5faf9;
  border: 1px solid #dbece9;
  border-radius: 10px;
  padding: 15px;
  margin: 18px 0;
  color: #24435b;
}
.pb-task-documents h4 {
  margin: 0 0 11px;
  font-size: 14px;
}
.pb-task-documents strong {
  font-size: 12px;
}
.pb-task-documents ul {
  margin: 7px 0 12px 17px;
  font-size: 12px;
  line-height: 1.65;
}
@media (max-width: 700px) {
  .pb-doc-summary {
    gap: 6px;
  }
  .pb-doc-summary > div {
    padding: 10px;
  }
  .pb-doc-summary strong {
    font-size: 19px;
  }
  .pb-doc-summary span {
    font-size: 10px;
  }
  .pb-doc-preview-row {
    grid-template-columns: 15px minmax(100px, 1fr) 64px 53px 28px;
    gap: 4px;
  }
  .pb-doc-preview-row input {
    padding: 7px 3px;
    font-size: 11px;
  }
  .pb-doc-card {
    padding: 12px;
  }
}

/* Kartoteka materiałów + rozpoznawanie PDF – v0.11.1 */
.pb-material-table-wrap {
  overflow: auto;
  max-height: 580px;
  margin-top: 12px;
}
.pb-material-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.pb-material-table th,
.pb-material-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e5eaf1;
}
.pb-material-table th {
  color: #526a86;
  background: #f3f7fa;
  position: sticky;
  top: 0;
}
.pb-material-name-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 175px;
}
.pb-material-hint {
  font-size: 11px;
  line-height: 1.35;
}
.pb-material-high {
  color: #087a55;
  font-weight: 650;
}
.pb-material-check {
  color: #9f5d11;
}
.pb-use-catalog {
  max-width: max-content;
  font-size: 11px !important;
  padding: 5px 8px !important;
}
.pb-doc-preview-row {
  grid-template-columns:
    25px minmax(170px, 2.2fr) minmax(110px, 1fr) minmax(60px, 0.6fr) minmax(56px, 0.5fr)
    40px !important;
  align-items: start !important;
}
.pb-doc-preview-row > .doc-line-code {
  min-width: 80px;
}
@media (max-width: 750px) {
  .pb-doc-preview-row {
    display: grid !important;
    grid-template-columns: 22px 1fr 1fr 45px !important;
  }
  .pb-material-name-col {
    grid-column: 2/5;
  }
  .pb-doc-preview-row > .doc-line-code {
    grid-column: 2/3;
  }
  .pb-doc-preview-row > .doc-line-qty {
    grid-column: 3/4;
  }
  .pb-doc-preview-row > .doc-line-unit {
    grid-column: 2/3;
  }
}

/* Nie chowaj przycisku Zapisz przy długiej liście pozycji w PDF */
#modal-root .modal:has(#doc-preview-form) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: calc(100dvh - 30px);
}
#modal-root .modal:has(#doc-preview-form) > .modal-body {
  min-height: 0;
  overflow-y: auto;
  flex: 1;
}
#modal-root .modal:has(#doc-preview-form) > .modal-footer {
  flex-shrink: 0;
  background: #fff;
}

.pb-sync-summary {
  margin: 14px 0;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid #cce2dc;
  background: #f0faf7;
  line-height: 1.5;
}
.pb-sync-summary p {
  margin: 7px 0;
}
.pb-sync-summary .btn {
  margin-top: 12px;
}

/* v0.11.3: dokumenty magazynowe bez zmiany kalendarza */
.pb-global-upload {
  background: var(--pb-primary);
  color: var(--pb-on-primary);
  border: 0;
  border-radius: 9px;
  padding: 10px 13px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}
.pb-global-upload:hover {
  background: var(--pb-primary-hover);
}
.pb-global-upload.hidden {
  display: none;
}
.pb-doc-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 13px;
}
.pb-doc-tab {
  background: white;
  border: 1px solid #dae4eb;
  border-radius: 10px;
  padding: 12px 15px;
  color: #23405a;
  font-weight: 750;
  cursor: pointer;
}
.pb-doc-tab.active {
  border-color: #00a79b;
  background: #e9f9f6;
}
.pb-doc-tab span {
  margin-left: 8px;
  color: #5f6f7f;
}
.pb-doc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 12px 0 17px;
  font-size: 12px;
  color: #5e6f82;
}
.pb-doc-legend .work {
  color: #906614;
}
.pb-doc-legend .success {
  color: #147d55;
}
.pb-doc-legend .fail {
  color: #c33b46;
}
.pb-doc-card.pb-doc-workflow-new {
  background: #fff;
}
.pb-doc-card.pb-doc-workflow-in_progress {
  background: #fff6e3;
  border-color: #f3d89d;
}
.pb-doc-card.pb-doc-workflow-completed {
  background: #edfbf4;
  border-color: #a6e1c5;
}
.pb-doc-card.pb-doc-workflow-undelivered {
  background: #fff0f0;
  border-color: #eda9ac;
}
.pb-doc-state-in_progress {
  background: #ffe5a8;
  color: #85600e;
}
.pb-doc-state-completed {
  background: #cef5de;
  color: #17673d;
}
.pb-doc-state-undelivered {
  background: #ffd6d9;
  color: #a52a37;
}
.pb-doc-primary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}
.pb-doc-workflow-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pb-doc-bound-source {
  background: #eff9f7;
  border: 1px solid #c6e6df;
  padding: 12px 15px;
  border-radius: 9px;
}
.pb-doc-bound-source small {
  display: block;
  margin-top: 4px;
  color: #507374;
}
@media (max-width: 900px) {
  .pb-global-upload {
    max-width: 155px;
    white-space: normal;
    line-height: 1.25;
    text-align: center;
  }
  .topbar-right {
    gap: 9px;
  }
}
@media (max-width: 530px) {
  .pb-global-upload {
    font-size: 10px;
    padding: 8px;
  }
  .topbar h1 {
    font-size: 17px;
  }
  .pb-doc-tabs {
    flex-direction: column;
  }
}

/* v0.11.7: przycisk usuwania obok numeru/statusu dokumentu */
.pb-doc-head-controls {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.pb-doc-delete-visible {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
@media (max-width: 590px) {
  .pb-doc-head-controls {
    width: 100%;
    justify-content: space-between;
  }
}

/* PERFECT BUD 0.11.8 – widoczne alarmy bezpieczeństwa kierowcy */
.pb-driver-safety {
  padding: 18px 20px;
  border-radius: 13px;
  margin: 0 auto 16px;
  max-width: 1050px;
  border: 2px solid;
  box-shadow: 0 5px 18px #0000000c;
}
.pb-safety-danger {
  background: #fff0ef;
  border-color: #dc2626;
  color: #991b1b;
}
.pb-safety-warning {
  background: #fff7e0;
  border-color: #d97706;
  color: #854d0e;
}
.pb-driver-safety-top {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 18px;
  line-height: 1.4;
  margin-bottom: 11px;
}
.pb-safety-icon {
  flex: 0 0 35px;
  width: 35px;
  height: 35px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: currentColor;
  color: inherit;
  font-weight: 900;
  font-size: 23px;
}
.pb-safety-danger .pb-safety-icon {
  background: #dc2626;
  color: white;
}
.pb-safety-warning .pb-safety-icon {
  background: #af6005;
  color: white;
}
.pb-safety-entry {
  padding: 10px 0;
  border-top: 1px solid #ae6e6e38;
}
.pb-safety-entry b {
  display: block;
  font-size: 14px;
}
.pb-safety-entry p {
  font-size: 13px;
  line-height: 1.65;
  margin: 6px 0 0;
}
.pb-safety-foot {
  font-size: 12px;
  line-height: 1.5;
  font-weight: 650;
  margin: 12px 0;
}
.pb-safety-go {
  border: 1px solid currentColor;
  color: inherit;
  background: transparent;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.pb-metric-danger {
  border: 2px solid #dc2626 !important;
  background: #fff0ef !important;
}
.pb-metric-danger strong {
  color: #b91c1c !important;
}
.pb-metric-warning {
  border: 2px solid #d97706 !important;
  background: #fff7e0 !important;
}
.pb-metric-warning strong {
  color: #92400e !important;
}
@media (max-width: 650px) {
  .pb-driver-safety {
    padding: 14px 12px;
  }
  .pb-driver-safety-top {
    font-size: 15px;
  }
}

/* PERFECT BUD — Produkty v0.12.0. Zakładka desktop + mobilna (handlowcy). */
.pb-products-shell {
  --pb-prod-red: var(--pb-primary);
  --pb-prod-ink: #231f20;
  --pb-prod-muted: #69717e;
  --pb-prod-border: #e5e7eb;
  color: var(--pb-prod-ink);
}
.pb-products-shell button,
.pb-prod-import button {
  font: inherit;
  cursor: pointer;
}
.pb-products-shell button:focus-visible,
.pb-prod-import button:focus-visible {
  outline: 3px solid var(--pb-focus);
  outline-offset: 2px;
}
.pb-prod-hero {
  background: linear-gradient(112deg, #231f20, #343035);
  color: #fff;
  padding: 24px 26px;
  border-radius: 16px 16px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.pb-prod-hero h3 {
  margin: 0;
  font-size: 21px;
  font-weight: 850;
  letter-spacing: -0.4px;
}
.pb-prod-hero p {
  color: #e6e0e2;
  margin: 7px 0 0;
  font-size: 13px;
}
.pb-prod-hero-mark {
  border: 1px solid #ffffff6c;
  border-radius: 7px;
  color: #fff;
  padding: 9px 12px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  white-space: nowrap;
}
.pb-prod-search {
  background: #fff;
  border: 1px solid var(--pb-prod-border);
  border-top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 17px 22px;
}
.pb-prod-search:focus-within {
  box-shadow: inset 0 0 0 3px var(--pb-focus);
}
.pb-prod-search span {
  font-size: 26px;
  color: var(--pb-primary-text);
  line-height: 1;
}
.pb-prod-search input {
  font: inherit;
  width: 100%;
  border: 0;
  outline: 0;
  font-size: 16px;
  color: #25242b;
  background: transparent;
  min-width: 0;
}
.pb-prod-search input::placeholder {
  color: #9299a3;
}
.pb-prod-toolbar {
  background: #fff;
  padding: 12px 16px 15px;
  border: 1px solid var(--pb-prod-border);
  border-top: 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.pb-prod-tabs,
.pb-prod-warehouses {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pb-prod-tabs button,
.pb-prod-warehouses button {
  border: 1px solid #e2e4e7;
  border-radius: 9px;
  background: #f8f8f9;
  color: #4b5059;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 750;
  transition: background 0.15s;
}
.pb-prod-tabs button.active {
  background: #231f20;
  color: #fff;
  border-color: #231f20;
}
.pb-prod-warehouses button.active {
  background: var(--pb-primary-soft);
  color: var(--pb-primary-text);
  border-color: var(--pb-primary-border);
}
.pb-prod-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 17px 0;
}
.pb-prod-tile {
  border: 1px solid var(--pb-prod-border);
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 13px;
  min-height: 80px;
  text-align: left;
  color: #282629;
}
.pb-prod-tile:hover,
.pb-prod-tile.selected {
  border-color: var(--pb-primary);
  background: var(--pb-primary-soft);
}
.pb-prod-tile-icon {
  height: 39px;
  width: 39px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--pb-primary-soft);
  color: var(--pb-primary-text);
  font-size: 24px;
  font-weight: 800;
}
.pb-prod-tile strong {
  display: block;
  font-size: 13px;
  line-height: 1.35;
}
.pb-prod-tile small {
  display: block;
  color: #696d77;
  margin-top: 5px;
  font-size: 11px;
}
.pb-prod-chevron {
  margin-left: auto;
  color: #6c6c7b;
  font-size: 20px;
}
.pb-prod-cat-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 9px;
  margin: 17px 0 10px;
  padding: 0 4px;
  font-size: 16px;
}
.pb-prod-subcats {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  max-width: 100%;
  padding: 0 0 9px;
  scrollbar-width: thin;
}
.pb-prod-chip {
  border: 1px solid #e3e4e8;
  color: #555b65;
  background: #fff;
  white-space: nowrap;
  border-radius: 20px;
  padding: 8px 11px;
  font-size: 12px;
}
.pb-prod-chip.active {
  border-color: var(--pb-primary);
  background: var(--pb-primary-soft);
  color: var(--pb-primary-text);
  font-weight: 800;
}
.pb-prod-count {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 20px 4px 10px;
  color: #686e78;
  font-size: 12px;
}
.pb-prod-count strong {
  color: #242327;
}
.pb-prod-list {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 13px;
  overflow: hidden;
}
.pb-prod-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(120px, 0.9fr) minmax(105px, 0.7fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid #eceef1;
}
.pb-prod-row:last-child {
  border-bottom: 0;
}
.pb-prod-row:hover {
  background: #fcfbfb;
}
.pb-prod-row-main {
  min-width: 0;
}
.pb-prod-row-main > strong {
  font-size: 14px;
  color: #231f20;
  line-height: 1.4;
  display: block;
  overflow-wrap: anywhere;
}
.pb-prod-meta {
  display: block;
  font-size: 11px;
  color: #686d75;
  margin-top: 5px;
}
.pb-prod-tag {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 7px;
  background: #f5f5f6;
  border-radius: 7px;
  font-size: 10px;
  color: #61656d;
}
.pb-prod-row-stock,
.pb-prod-row-price {
  min-width: 0;
}
.pb-prod-row-stock > strong,
.pb-prod-row-price > strong {
  font-size: 12px;
  line-height: 1.4;
  display: block;
  margin-top: 5px;
  color: #29252b;
  overflow-wrap: anywhere;
}
.pb-prod-muted {
  font-size: 10px;
  color: #676e78;
  display: block;
}
.pb-prod-open {
  border: 1px solid var(--pb-primary-border);
  background: var(--pb-primary-soft);
  border-radius: 9px;
  padding: 10px 12px;
  color: var(--pb-primary-text);
  white-space: nowrap;
  font-size: 12px;
  font-weight: 750;
}
.pb-prod-open:hover {
  background: #fee9ed;
}
.pb-prod-more {
  margin-top: 14px;
  width: 100%;
}
.pb-prod-noresults {
  padding: 42px 20px;
  text-align: center;
  color: #6d6d75;
}
.pb-prod-import {
  margin-top: 22px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}
.pb-prod-import > summary {
  list-style: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  padding: 19px 22px;
  color: #312d2d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pb-prod-import summary::-webkit-details-marker {
  display: none;
}
.pb-prod-import summary:before {
  content: '▸';
  color: var(--pb-primary-text);
  margin-right: 7px;
}
.pb-prod-import[open] summary:before {
  content: '▾';
}
.pb-prod-import > summary span {
  font-size: 11px;
  font-weight: 650;
  color: #6a6d75;
}
.pb-prod-import-inside {
  border-top: 1px solid #e8e9ec;
  padding: 21px;
}
.pb-prod-import-inside h3 {
  font-size: 15px;
  margin: 0 0 9px;
}
.pb-prod-detail-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pb-prod-comparisons {
  display: grid;
  gap: 10px;
  margin-top: 15px;
}
.pb-prod-comparison {
  padding: 14px 17px;
  border: 1px solid #e2e6eb;
  border-radius: 11px;
  background: #fff;
  display: grid;
  gap: 9px;
}
.pb-prod-comparison.best {
  background: #f0fcf4;
  border-color: #31a86a;
  box-shadow: inset 3px 0 0 #1b9854;
}
.pb-prod-comparison > div:not(.pb-prod-comp-head) {
  display: flex;
  align-items: baseline;
  gap: 12px;
  justify-content: space-between;
  flex-wrap: wrap;
}
.pb-prod-comparison > div > span {
  font-size: 12px;
  color: #666e79;
}
.pb-prod-comparison > div > strong {
  font-size: 13px;
  color: #22262c;
  text-align: right;
}
.pb-prod-comp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pb-prod-comp-head strong {
  font-size: 15px;
}
.pb-prod-green {
  color: #127947 !important;
  background: #d6f7e3;
  border-radius: 20px;
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 800;
}
.pb-prod-comparison small {
  font-size: 11px;
  color: #656d7b;
}
.pb-prod-comparison button {
  max-width: max-content;
}
@media (max-width: 1100px) {
  .pb-prod-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .pb-prod-row {
    grid-template-columns: minmax(0, 1.7fr) minmax(110px, 0.8fr) minmax(100px, 0.7fr);
  }
  .pb-prod-open {
    grid-column: 1/-1;
    justify-self: start;
  }
}
@media (max-width: 720px) {
  .pb-prod-hero {
    padding: 19px 17px;
  }
  .pb-prod-hero h3 {
    font-size: 18px;
  }
  .pb-prod-hero-mark {
    display: none;
  }
  .pb-prod-search {
    padding: 13px 15px;
  }
  .pb-prod-search input {
    font-size: 15px;
  }
  .pb-prod-toolbar {
    padding: 12px;
  }
  .pb-prod-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .pb-prod-tabs button {
    text-align: center;
    font-size: 12px;
    padding: 10px 8px;
  }
  .pb-prod-warehouses {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 5px;
  }
  .pb-prod-warehouses button {
    white-space: nowrap;
    font-size: 12px;
    padding: 10px;
  }
  .pb-prod-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .pb-prod-tile {
    padding: 12px 10px;
    gap: 8px;
    min-height: 76px;
  }
  .pb-prod-tile-icon {
    width: 31px;
    height: 34px;
    font-size: 20px;
  }
  .pb-prod-tile strong {
    font-size: 12px;
  }
  .pb-prod-tile small {
    font-size: 10px;
  }
  .pb-prod-chevron {
    display: none;
  }
  .pb-prod-row {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 15px 14px;
  }
  .pb-prod-row-main {
    grid-column: 1/-1;
  }
  .pb-prod-open {
    grid-column: 1/-1;
    width: 100%;
  }
  .pb-prod-count {
    padding: 17px 4px 10px;
  }
  .pb-prod-import summary {
    padding: 16px;
  }
  .pb-prod-import-inside {
    padding: 15px;
  }
}
@media (max-width: 390px) {
  .pb-prod-tiles {
    grid-template-columns: 1fr;
  }
  .pb-prod-tile {
    min-height: 54px;
  }
}
/* PERFECT BUD 0.12.2 – weryfikacja dopasowania produktów i kategorii */
.pb-partner-panel {
  border-color: var(--pb-border);
}
.pb-partner-panel > summary {
  background: var(--pb-surface-alt);
  border-radius: 12px;
}
.pb-prod-import-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.pb-prod-import-controls label {
  flex: 1;
  min-width: 160px;
}
.pb-prod-import-controls input,
.pb-prod-import-controls select,
.pb-partner-config select,
.pb-match-item select {
  width: 100%;
  max-width: 100%;
  min-height: 41px;
  padding: 9px;
  border: 1px solid #d8d9de;
  border-radius: 8px;
  background: #fff;
  color: #231f20;
  font: inherit;
}
.pb-partner-config .client-import-mapping {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.pb-partner-config .client-import-mapping > label,
.pb-match-item label {
  font-size: 12px;
  color: #444;
  display: grid;
  gap: 5px;
}
.pb-partner-config input[type='number'] {
  width: 100%;
  min-height: 41px;
  padding: 10px;
  border: 1px solid #d8d9de;
  border-radius: 8px;
}
.pb-partner-review-head {
  margin: 20px 0 12px;
  border-top: 1px solid #f1eef0;
  padding-top: 17px;
}
.pb-match-list {
  max-height: 540px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  gap: 11px;
  padding: 3px 5px 5px 0;
  scrollbar-width: thin;
}
.pb-match-item {
  padding: 15px;
  border: 1px solid #e1e2e5;
  border-radius: 11px;
  background: #fafafa;
  display: grid;
  gap: 10px;
}
.pb-match-item.error {
  color: #ae1734;
  background: #fff5f6;
  border-color: #f1b4c0;
}
.pb-match-head {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}
.pb-match-head strong {
  font-size: 13px;
  max-width: 88%;
  overflow-wrap: anywhere;
}
.pb-match-item .pb-prod-tag {
  margin: 0;
}
.pb-match-item p {
  margin: 0;
  line-height: 1.5;
}
.pb-match-new {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  background: #fff;
  border: 1px dashed #e4a2ad;
  border-radius: 9px;
  padding: 12px;
}
.pb-match-new.hidden {
  display: none !important;
}
.pb-match-warning {
  color: #9d5f0b !important;
}
.pb-match-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding: 14px 0 0;
  background: linear-gradient(#fff9, #fff 25%);
}
.pb-match-footer button {
  width: 100%;
}
.pb-category-review {
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid #ebecef;
  border-radius: 10px;
  margin: 15px 0;
}
.pb-cat-proposal {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 13px;
  border-bottom: 1px solid #f1f1f2;
  cursor: pointer;
}
.pb-cat-proposal:last-child {
  border-bottom: 0;
}
.pb-cat-proposal input {
  margin-top: 3px;
  accent-color: var(--pb-primary);
}
.pb-cat-proposal strong {
  display: block;
  font-size: 12px;
  color: #231f20;
}
.pb-cat-proposal small {
  display: block;
  color: #696e76;
  font-size: 11px;
  margin-top: 3px;
}
@media (max-width: 850px) {
  .pb-partner-config .client-import-mapping {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .pb-partner-config .client-import-mapping {
    grid-template-columns: 1fr;
  }
  .pb-match-new {
    grid-template-columns: 1fr;
  }
  .pb-match-head strong {
    max-width: 100%;
  }
  .pb-match-list {
    max-height: 440px;
  }
}

.pb-match-approval {
  display: flex !important;
  align-items: center;
  gap: 9px !important;
  font-size: 12px !important;
  color: #4b4648;
}
.pb-match-approval.hidden {
  display: none !important;
}
.pb-match-approval input {
  accent-color: var(--pb-primary);
  width: auto !important;
  min-height: auto !important;
}

/* PERFECT BUD v0.12.4: współdzielone zdjęcia produktów + integracja W2B */
.pb-product-thumb {
  float: left;
  width: 58px;
  height: 58px;
  margin-right: 12px;
  object-fit: contain;
  border: 1px solid #e7e7e7;
  border-radius: 8px;
  background: #fff;
}
.pb-product-detail-photo {
  width: 144px;
  max-width: 45%;
  height: 144px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  float: right;
  margin: 0 0 12px 16px;
}
.pb-partner-sync-section {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid #e8eaed;
}
.pb-partner-sync-section input[type='file'] {
  display: block;
  margin: 8px 0 12px;
  max-width: 100%;
}
.pb-photo-upload {
  border-top: 1px solid #e8eaed;
  margin-top: 16px;
  padding-top: 14px;
}
@media (max-width: 600px) {
  .pb-product-thumb {
    width: 48px;
    height: 48px;
  }
  .pb-product-detail-photo {
    width: 112px;
    height: 112px;
  }
}

/* PERFECT BUD v0.12.5 – powiększanie zdjęcia i czytelne porównanie cen */
.pb-product-photo-trigger {
  display: flex;
  flex-direction: column;
  align-items: center;
  float: right;
  max-width: 46%;
  margin: 0 0 12px 16px;
  padding: 5px;
  border: 1px solid #dfe2e6;
  border-radius: 12px;
  background: #fff;
  cursor: zoom-in;
  color: #444852;
  font-size: 11px;
  font-weight: 700;
  gap: 4px;
}
.pb-product-photo-trigger:hover,
.pb-product-photo-trigger:focus-visible {
  border-color: var(--pb-primary);
  box-shadow: 0 0 0 3px rgba(0, 127, 120, 0.12);
}
.pb-product-photo-trigger .pb-product-detail-photo {
  float: none;
  margin: 0;
  border: 0;
  max-width: 100%;
  width: 144px;
  height: 144px;
  object-fit: contain;
}
.pb-product-photo-trigger span {
  padding: 1px 5px 5px;
}
.pb-prod-comparison.best {
  background: #e9faef;
  border: 2px solid #2caa67;
  box-shadow:
    inset 5px 0 0 #1f9856,
    0 3px 13px #1a9a4e15;
}
.pb-prod-comparison.best .pb-prod-net-price {
  font-size: 17px;
  color: #107a41;
  font-weight: 900;
}
.pb-prod-comparison.best .pb-prod-comp-head > strong {
  color: #117d45;
}
.pb-prod-green {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  border: 1px solid #72d39a;
}
.pb-price-explanation {
  display: block;
  clear: both;
  margin-top: 15px !important;
}
.pb-photo-viewer {
  --pb-photo-zoom: 1;
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  isolation: isolate;
}
.pb-photo-viewer-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  border: 0;
  background: #091219dc;
  cursor: zoom-out;
}
.pb-photo-viewer-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1100px, 100%);
  max-height: calc(100dvh - 24px);
  height: min(900px, calc(100dvh - 24px));
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 90px #0008;
  overflow: hidden;
}
.pb-photo-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  padding: 12px 15px;
  border-bottom: 1px solid #e9e9ed;
}
.pb-photo-viewer-toolbar > strong {
  font-size: 13px;
  line-height: 1.3;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pb-photo-viewer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.pb-photo-viewer-actions button {
  background: #f5f5f6;
  border: 1px solid #e0e0e3;
  border-radius: 7px;
  min-width: 33px;
  min-height: 33px;
  padding: 3px 8px;
  font-size: 16px;
  font-weight: 750;
  cursor: pointer;
}
.pb-photo-viewer-actions button:hover,
.pb-photo-viewer-actions button:focus-visible {
  background: #e7f8ed;
  border-color: #1b9854;
}
.pb-photo-viewer-actions button:focus-visible {
  outline: 3px solid var(--pb-focus);
}
.pb-photo-viewer-actions .pb-photo-close {
  background: #231f20;
  color: white;
  border-color: #231f20;
  font-size: 25px;
  line-height: 1;
}
#pb-photo-zoom-value {
  min-width: 39px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: #252525;
}
.pb-photo-viewer-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: safe center;
  justify-content: safe center;
  padding: 15px;
  background: #f8f9fa;
}
.pb-photo-viewer-scroll img {
  display: block;
  width: calc(min(85vw, 900px) * var(--pb-photo-zoom));
  max-width: none;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 1px 9px #2221;
}
.pb-photo-viewer-caption {
  border-top: 1px solid #e8e8eb;
  padding: 9px 15px;
  color: #676c75;
  font-size: 11px;
  text-align: center;
}
@media (max-width: 600px) {
  .pb-product-photo-trigger .pb-product-detail-photo {
    width: 110px;
    height: 110px;
  }
  .pb-product-photo-trigger {
    max-width: 44%;
  }
  .pb-photo-viewer {
    padding: 4px;
  }
  .pb-photo-viewer-panel {
    max-height: calc(100dvh - 8px);
    height: calc(100dvh - 8px);
  }
  .pb-photo-viewer-toolbar {
    flex-wrap: wrap;
    padding: 10px;
  }
  .pb-photo-viewer-toolbar > strong {
    width: 100%;
  }
  .pb-photo-viewer-actions {
    margin-left: auto;
  }
  .pb-photo-viewer-scroll img {
    width: calc(88vw * var(--pb-photo-zoom));
  }
}

/* 0.12.6 – pewne powiązania, zmiany / bez zmian */
.pb-auto-box,
.pb-auto-note,
.pb-match-linked,
.pb-unchanged {
  border: 1px solid #a6d7b2;
  border-radius: 10px;
  background: #f2fbf4;
  padding: 12px;
  margin: 10px 0;
  color: #18673a;
}
.pb-auto-box p {
  margin: 0 0 10px;
}
.pb-auto-box details {
  margin-top: 10px;
}
.pb-match-auto {
  background: #ecf9ee !important;
  border-color: #a6d7b2 !important;
  color: #18673a;
}
.pb-good-text {
  color: #16723f;
  font-weight: 700;
}
.pb-linked-change-box {
  margin-top: 12px;
}
.pb-linked-change-box h4 {
  margin: 10px 0;
}
.pb-linked-changes {
  max-height: 410px;
  overflow: auto;
  display: grid;
  gap: 7px;
  margin: 10px 0;
}
.pb-linked-change {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #dcdfe1;
  background: #fff;
  border-radius: 10px;
  padding: 11px;
  cursor: pointer;
}
.pb-linked-change input,
.pb-sync-selectall input {
  width: 17px;
  height: 17px;
  accent-color: var(--pb-primary);
  flex-shrink: 0;
}
.pb-linked-change span {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.pb-linked-change small {
  color: #666;
  overflow-wrap: anywhere;
}
.pb-sync-selectall {
  padding: 8px 10px;
  border-radius: 8px;
  background: #f2f3f5;
}
.pb-sync-selectall label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pb-unchanged-row {
  padding: 7px 10px;
  border-bottom: 1px solid #c7eacb;
  color: #16723f;
  font-size: 12px;
}
.pb-unchanged-row small {
  margin-left: 8px;
  color: #46775a;
}
.pb-sync-warehouse-label {
  display: block;
  margin: 9px 0;
}
.pb-sync-warehouse-label select {
  margin-left: 12px;
  padding: 7px;
  border-radius: 6px;
}

/* Produkty 0.12.7: trzeci poziom katalogu narzędzi ręcznych. */
.pb-prod-subgroup {
  margin: 2px 0 12px;
  padding: 12px;
  border: 1px solid #e9eaed;
  border-radius: 12px;
  background: #fafafa;
}
.pb-prod-subgroup > strong {
  display: block;
  font-size: 12px;
  color: #373f4b;
  margin-bottom: 9px;
}
.pb-prod-subcats-inner {
  padding-bottom: 1px;
}

/* 0.12.8 – nawigacja grup materiałów bez zmiany zatwierdzonych przypisań. */
.pb-prod-subcats {
  row-gap: 7px;
}
.pb-prod-subcats-inner {
  margin-top: 7px;
}

/* 0.12.9: informacja o automatycznym zapisywaniu decyzji */
.pb-partner-draft-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin: 10px 0;
  border-radius: 10px;
  border: 1px solid #bde3ca;
  background: rgba(46, 160, 90, 0.07);
  font-size: 13px;
  color: var(--text, #24352c);
}
.pb-partner-draft-info .btn {
  white-space: nowrap;
}
#pb-draft-restored:not(:empty) {
  margin: 8px 0;
  padding: 8px 10px;
  background: rgba(46, 160, 90, 0.07);
  border-radius: 8px;
}

/* PERFECT BUD 0.13.6 – kalendarz zadań i szybkie planowanie WZ */
.pb-wz-quick-panel {
  background: #f5fafc;
  border: 1px solid #bdd6db;
  border-radius: 12px;
  padding: 14px;
}
.pb-wz-quick-panel .pb-doc-checkrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}
.pb-work-panel {
  margin-top: 15px;
}
.pb-work-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.pb-work-view {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pb-work-weekdays,
.pb-work-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}
.pb-work-weekdays {
  margin-top: 17px;
  color: #5d7080;
  font-size: 12px;
  text-align: center;
  font-weight: 700;
}
.pb-work-calendar {
  max-width: 900px;
}
.pb-work-days {
  margin-top: 7px;
}
.pb-work-day {
  position: relative;
  min-height: 74px;
  background: #fff;
  border: 1px solid #e1e9ef;
  border-radius: 9px;
  text-align: left;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #243e55;
  cursor: pointer;
}
.pb-work-day span {
  font-size: 11px;
  color: #5b7082;
}
.pb-work-day i {
  background: #0b9986;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  position: absolute;
  right: 8px;
  top: 10px;
}
.pb-work-day.selected {
  border: 2px solid #009d8d;
  background: #edf9f6;
}
.pb-work-day.today strong {
  background: #e4ecfa;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}
.pb-work-day.muted {
  background: #f6f8fa;
  cursor: default;
  border-color: transparent;
}
.pb-work-list {
  margin-top: 11px;
  display: grid;
  gap: 9px;
}
.pb-work-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #dbe5eb;
  border-radius: 12px;
  padding: 14px;
  align-items: center;
}
.pb-work-item p {
  margin: 5px 0 0;
}
.pb-work-item.done {
  opacity: 0.62;
}
.pb-work-item-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.pb-work-reminder-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 22, 39, 0.78);
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.pb-work-reminder-box {
  background: #fff;
  color: #10243a;
  border-radius: 18px;
  max-width: 510px;
  width: 100%;
  padding: 26px;
  box-shadow: 0 20px 70px #0006;
}
.pb-work-reminder-icon {
  font-size: 32px;
}
.pb-work-reminder-box h2 {
  font-size: 23px;
  margin: 6px 0 16px;
}
.pb-work-reminder-box strong {
  font-size: 18px;
  display: block;
}
.pb-work-reminder-box p {
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.pb-work-reminder-box small {
  color: #5b7083;
}
.pb-work-reminder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}
@media (max-width: 700px) {
  .pb-work-day {
    min-height: 57px;
    padding: 5px;
  }
  .pb-work-day span {
    font-size: 9px;
  }
  .pb-work-item {
    align-items: flex-start;
    flex-direction: column;
  }
  .pb-work-item-actions {
    justify-content: flex-start;
  }
  .pb-work-reminder-box {
    max-height: 90vh;
    overflow: auto;
    padding: 18px;
  }
  .pb-work-calendar {
    width: 100%;
  }
}

/* Handlowcy – etap 1 */
.pb-sales-owner-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}
.pb-sales-staff-grid,
.pb-sales-hub {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.pb-sales-hub .panel,
.pb-sales-staff-grid .panel {
  min-width: 0;
}
.pb-sales-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 12px 0;
}
.pb-sales-metrics span {
  border-radius: 8px;
  background: #eff6ff;
  color: #184167;
  padding: 8px;
  font-size: 12px;
  font-weight: 600;
}
.pb-sales-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.pb-doc-owner-select {
  margin: 7px 0;
  padding: 9px 0;
}
.pb-doc-owner-select label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}
.pb-doc-owner-select select,
.sales-customer-owner {
  padding: 6px 8px;
  max-width: 200px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: white;
  color: #163453;
}
@media (max-width: 600px) {
  .pb-sales-owner-tabs {
    gap: 5px;
  }
  .pb-sales-owner-tabs .btn {
    font-size: 12px;
  }
  .pb-sales-metrics span {
    font-size: 11px;
  }
  .pb-sales-hub {
    grid-template-columns: 1fr;
  }
}

.pb-sales-doc-filter {
  display: flex;
  justify-content: flex-end;
  margin: 8px 0 14px;
}
.pb-sales-doc-filter label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #36536f;
  font-size: 13px;
}
.pb-sales-doc-filter select {
  border: 1px solid #c9d5e0;
  padding: 7px 9px;
  border-radius: 8px;
  background: white;
}

/* PERFECT BUD v0.13.8 – prywatne kontakty i budowy */
.pb-sales-places-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.pb-sales-places-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 14px;
}
.pb-sales-place {
  border: 1px solid var(--border, #dfe5ec);
  border-radius: 12px;
  padding: 16px;
  background: var(--panel, #fff);
  min-width: 0;
}
.pb-sales-place-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.pb-sales-place-status {
  font-size: 12px;
  border-radius: 14px;
  padding: 4px 9px;
  background: #edf4f7;
  color: #25566c;
}
.pb-sales-place-note {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  margin: 10px 0;
}
.pb-sales-place-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 14px 0 9px;
}

.pb-sales-place-archive {
  margin-top: 18px;
  padding: 12px;
  border-top: 1px solid #e3e8ef;
}
.pb-sales-place-archived {
  margin: 10px 0;
  padding: 10px;
  background: #f5f7fa;
  border-radius: 8px;
}

/* PERFECT BUD 0.13.9: lewe menu ma własny przewijany obszar; stopka konta pozostaje widoczna */
.sidebar {
  overflow: hidden;
}
.sidebar .brand,
.sidebar .sidebar-label {
  flex-shrink: 0;
}
.sidebar .navigation {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #4b6b85 #11243b;
}
.sidebar .navigation::-webkit-scrollbar {
  width: 7px;
}
.sidebar .navigation::-webkit-scrollbar-thumb {
  background: #4b6b85;
  border-radius: 8px;
}
.sidebar .sidebar-bottom {
  flex-shrink: 0;
  margin-top: 8px;
}
.pb-sales-map {
  height: 350px;
  min-height: 270px;
  background: #e8eef1;
  border: 1px solid #d8e2e8;
  border-radius: 10px;
  margin: 12px 0;
}
.pb-sales-map-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.pb-sales-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  margin-top: 14px;
}
.pb-sales-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pb-sales-legend b,
.pb-sales-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
}
.pb-sales-person {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pb-sales-person h3 {
  margin: 0;
}
.pb-sales-tabs,
.pb-sales-map-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}
.pb-sales-list-entry {
  border-bottom: 1px solid #e0e8ed;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pb-sales-list-entry:last-child {
  border-bottom: 0;
}
.pb-sales-list-entry small {
  color: #5f6f7b;
}
.pb-sales-list-entry .btn {
  align-self: flex-start;
}
.pb-sales-stops {
  max-height: 230px;
  overflow: auto;
  border: 1px solid #e0e8ed;
  border-radius: 9px;
  padding: 10px;
}
.pb-sales-stops label {
  display: block;
  padding: 6px 3px;
}
.pb-sales-calendar-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.pb-sales-calendar-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pb-sales-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-top: 16px;
}
.pb-sales-calendar-grid .pb-sales-day-title {
  font-size: 11px;
  text-align: center;
  color: #5f6f7b;
  padding: 8px 0;
}
.pb-sales-calendar-day,
.pb-sales-day-empty {
  min-height: 100px;
  background: #f7fafb;
  border: 1px solid #e0e8ed;
  border-radius: 6px;
  padding: 5px;
  font-size: 12px;
  min-width: 0;
}
.pb-sales-calendar-day.current {
  border-color: #05aaa5;
}
.pb-sales-calendar-day b {
  display: block;
  margin-bottom: 5px;
}
.pb-sales-cal-route,
.pb-sales-cal-task {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 4px;
  border-radius: 4px;
  margin-bottom: 4px;
  background: #d8edf7;
  color: #1b455b;
}
.pb-sales-cal-task {
  background: #dcf4ed;
  color: #1d5a45;
}
.pb-sales-cal-task.done {
  text-decoration: line-through;
  opacity: 0.6;
}
@media (max-width: 700px) {
  .pb-sales-calendar-day,
  .pb-sales-day-empty {
    min-height: 64px;
    font-size: 10px;
    padding: 3px;
  }
  .pb-sales-map {
    height: 270px;
  }
  .pb-sales-cal-route,
  .pb-sales-cal-task {
    font-size: 9px;
    padding: 2px;
  }
}

/* PERFECT BUD 0.14.1: plynna mapa bez CDN JavaScript */
.pb-geo-active {
  position: relative;
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  background: #e5edf3;
}
.pb-geo-tiles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.pb-geo-tile {
  position: absolute;
  width: 256px;
  height: 256px;
  max-width: none;
  user-select: none;
  pointer-events: none;
}
.pb-geo-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.pb-geo-controls {
  position: absolute;
  z-index: 5;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pb-geo-controls button {
  width: 38px;
  height: 38px;
  border: 1px solid #b8cad8;
  background: #fff;
  color: #132c43;
  font-size: 24px;
  line-height: 1;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 1px 4px #152b3f22;
}
.pb-geo-attribution {
  position: absolute;
  right: 4px;
  bottom: 4px;
  z-index: 3;
  border-radius: 3px;
  background: #fffffff0;
  color: #1b3548;
  padding: 2px 5px;
  font:
    11px Arial,
    sans-serif;
}
.pb-geo-attribution a {
  color: #1b557a;
  text-decoration: underline;
}
#pb-route-points {
  margin-bottom: 8px;
  font-weight: 600;
}

/* 0.14.1 — przybliżanie do kursora, nawigacja dotykowa, edytor rewirów */
.pb-geo-active {
  cursor: grab;
  outline-offset: 2px;
  overscroll-behavior: contain;
}
.pb-geo-active.pb-geo-picking {
  cursor: crosshair;
}
.pb-geo-active:active {
  cursor: grabbing;
}
.pb-geo-tile {
  left: 0;
  top: 0;
  will-change: transform;
}
.pb-geo-controls {
  gap: 5px;
}
.pb-geo-controls button {
  width: 42px;
  height: 42px;
  font-size: 25px;
  touch-action: manipulation;
}
.pb-geo-controls button:hover {
  background: #e8f8f6;
  border-color: #0eaaa2;
}
.pb-geo-help {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 28px;
  z-index: 4;
  max-width: calc(100% - 24px);
  pointer-events: none;
  color: #17354a;
  background: #ffffffed;
  border: 1px solid #c8d9de;
  border-radius: 7px;
  padding: 6px 10px;
  font:
    600 12px/1.4 Arial,
    sans-serif;
  box-shadow: 0 1px 4px #142d4220;
}
.pb-geo-help.pb-geo-drawing {
  background: #e7faf5ed;
  border-color: #0eaaa2;
}
.pb-geo-coords {
  position: absolute;
  top: 13px;
  right: 12px;
  z-index: 4;
  pointer-events: none;
  color: #17354a;
  background: #ffffffdf;
  padding: 4px 8px;
  border-radius: 5px;
  font:
    11px Arial,
    sans-serif;
}
.pb-sales-map-tools .pb-sales-tool-active {
  border: 2px solid #078f88;
  background: #d3faf0;
  color: #075d58;
  font-weight: 700;
}
.pb-geo-expanded {
  position: fixed !important;
  top: 4vh !important;
  left: 3vw !important;
  right: 3vw !important;
  bottom: 4vh !important;
  width: 94vw !important;
  height: 92vh !important;
  max-height: none !important;
  margin: 0 !important;
  z-index: 9999 !important;
  box-shadow:
    0 0 0 9999px #071929bb,
    0 16px 64px #07192966;
}
@media (max-width: 650px) {
  .pb-geo-help {
    font-size: 11px;
    left: 7px;
    right: 7px;
    bottom: 24px;
  }
  .pb-geo-coords {
    top: 8px;
    right: 7px;
  }
  .pb-geo-controls {
    top: 8px;
    left: 8px;
  }
  .pb-geo-controls button {
    width: 38px;
    height: 38px;
  }
}

/* ===== Biuro – UX 2026-11 ===== */
/* Menu administratora w sekcjach */
.navigation.pb-nav-grouped {
  gap: 2px;
}
.pb-nav-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}
.pb-nav-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #8fa4bc;
  padding: 6px 15px 4px;
}
.pb-nav-grouped .nav-item {
  padding: 9px 15px;
}
/* Nieprzeczytane wiadomości: kropka zamiast czerwonego obramowania pozycji menu */
.nav-item[data-pb-unread]:not([data-pb-unread='0'])::after {
  content: attr(data-pb-unread);
  margin-left: auto;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 10px;
  background: #b4233b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

/* Stan synchronizacji: błąd inny niż brak sieci */
.pb-sync-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fdecee;
  color: #7a1626;
  padding: 9px 34px;
  font-size: 12px;
  border-bottom: 1px solid #f3c6cd;
}
.pb-sync-error.hidden {
  display: none;
}

/* Stany danych: ładowanie / błąd / nieaktualne */
.pb-data-state {
  display: grid;
  justify-items: start;
  gap: 6px;
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px solid #dde4ec;
  background: #f8fafc;
  color: #293e53;
  margin: 12px 0;
}
.pb-data-state.pb-data-error {
  border-color: #f0c2c9;
  background: #fff4f5;
  color: #7a1626;
}
.pb-data-freshness {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #5b6b7d;
  margin: 0 0 10px;
}
.pb-data-freshness.is-stale {
  background: #fff6e0;
  border: 1px solid #f0d58a;
  color: #6a4a00;
  border-radius: 10px;
  padding: 8px 12px;
}
.pb-f-head.is-unknown strong {
  color: #8794a2;
}

/* Częściowy zapis WZ */
.pb-partial-summary {
  border: 1px solid #f0c2c9;
  border-left: 5px solid #b4233b;
  background: #fff7f8;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.pb-partial-summary p {
  margin: 4px 0;
}
.pb-partial-ok {
  color: #0d6b3f;
  font-weight: 700;
}
.pb-partial-fail {
  color: #9b1c31;
  font-weight: 700;
}
.pb-partial-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px solid #f0c2c9;
  border-left: 5px solid #b4233b;
  background: #fff7f8;
  border-radius: 12px;
  padding: 12px 16px;
  margin: 12px 0;
}
.pb-partial-banner > div:first-child {
  display: grid;
  gap: 3px;
  font-size: 13px;
}
.pb-partial-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Formularze: błędy przy polach, podsumowanie, szkice, rozwijane sekcje */
.pb-field-error {
  display: block;
  color: #a1192f;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}
.pb-invalid input,
.pb-invalid select,
.pb-invalid textarea,
[aria-invalid='true'] {
  border-color: #c4314b !important;
  box-shadow: 0 0 0 1px #c4314b;
}
.pb-error-summary ul {
  margin: 6px 0 0;
  padding-left: 18px;
}
.pb-error-summary p {
  margin: 0 0 6px;
}
.pb-link {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
.pb-draft-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: #eef5fb;
  border: 1px solid #c8dbee;
  color: #1d3b5a;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}
.pb-draft-actions {
  display: flex;
  gap: 8px;
}
.pb-form-more {
  border: 1px solid #e3e8ef;
  border-radius: 10px;
  padding: 10px 14px;
  background: #fbfcfd;
}
.pb-form-more > summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  color: #293e53;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pb-form-more > summary small {
  font-weight: 500;
  color: #78879a;
}
.pb-form-more[open] > summary {
  margin-bottom: 12px;
}
.pb-form-more > .form-grid {
  margin-top: 4px;
}
#multi-stops-details > summary.stop-block-header {
  margin-bottom: 0;
}
.task-kind-tile.is-current {
  outline: 2px solid #11243b;
}

/* Pulpity ról */
.pb-decisions {
  margin-bottom: 20px;
}
.pb-decision-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.pb-decision {
  border: 1px solid #e3e8ef;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff;
}
.pb-decision.has-items {
  border-color: #e8c66d;
  background: #fffaf0;
}
.pb-decision-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.pb-decision-count {
  font-size: 20px;
  font-weight: 800;
  color: #11243b;
}
.pb-decision.is-clear .pb-decision-count {
  color: #8794a2;
}
.pb-decision-list {
  margin: 0;
  padding-left: 16px;
  font-size: 12px;
  display: grid;
  gap: 4px;
}
.pb-decision .btn {
  align-self: flex-start;
  margin-top: auto;
}
.pb-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 20px;
  align-items: start;
}
.pb-plan-list {
  display: grid;
  gap: 6px;
}
.pb-plan-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  border: 1px solid #e3e8ef;
  border-radius: 10px;
  background: #fff;
  padding: 9px 12px;
  cursor: pointer;
  font: inherit;
}
.pb-plan-time {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.pb-plan-main {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
  min-width: 0;
}
.pb-plan-main small {
  width: 100%;
  color: #5b6b7d;
}
.pb-plan-who {
  font-size: 12px;
}
.pb-queue-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.pb-queue-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid #e3e8ef;
  border-radius: 10px;
  padding: 10px 12px;
}
.pb-queue-item small {
  display: block;
  color: #5b6b7d;
  margin-top: 2px;
}
.pb-queue-item.is-late {
  border-color: #f0c2c9;
  background: #fff7f8;
}
.pb-queue-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.planning-layout.pb-planning-single {
  grid-template-columns: minmax(0, 1fr);
}
@media (max-width: 1100px) {
  .pb-decision-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pb-home-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 600px) {
  .pb-decision-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .pb-plan-row {
    grid-template-columns: 48px minmax(0, 1fr);
  }
  .pb-sync-error {
    padding: 9px 16px;
    flex-wrap: wrap;
  }
}
/* Sekcje menu zastępują ogólny nagłówek „Przestrzeń robocza” */
.sidebar:has(.pb-nav-grouped) .sidebar-label {
  display: none;
}
.sidebar:has(.pb-nav-grouped) .brand {
  margin-bottom: 28px;
}
/* Powiadomienie komunikatora: krótki pasek obok przycisku komunikatora (lewy dół obszaru pracy),
   z dala od akcji i filtrów w nagłówku widoku oraz od komunikatów systemowych po prawej. */
#pb-office-alerts-root .pb-pop {
  left: 250px !important;
  right: auto !important;
  top: auto !important;
  bottom: 64px !important;
}
@media (max-width: 950px) {
  #pb-office-alerts-root .pb-pop {
    left: 12px !important;
    bottom: 124px !important;
  }
}
@media (max-width: 650px) {
  #pb-office-alerts-root .pb-pop {
    bottom: 136px !important;
  }
}

/* ==========================================================================
   Panel kierowcy – UX 2026-11
   Praca w trasie: rękawice, słońce, pośpiech. Cele dotyku min. 48 px, główne 56–64 px,
   większy tekst operacyjny, pasek stanu (zmiana / czynność / kurs / wysyłka),
   ekran bieżącego przystanku, toasty nad dolnym paskiem.
   ========================================================================== */
body.driver-mode .driver-simple {
  font-size: 16px;
}
body.driver-mode .driver-simple p {
  font-size: 15px;
  color: #3f5568;
}
body.driver-mode .offline-banner {
  display: none;
}

/* Pasek stanu */
.dr-status {
  max-width: 950px;
  margin: 0 auto 14px;
  display: grid;
  gap: 8px;
}
.dr-status-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.dr-chip {
  min-height: 56px;
  border: 2px solid #d5dee5;
  border-radius: 12px;
  background: #fff;
  color: #1c3346;
  padding: 6px 8px;
  display: grid;
  align-content: center;
  gap: 2px;
  text-align: left;
  cursor: pointer;
}
.dr-chip small {
  font-size: 11px;
  font-weight: 700;
  color: #5b6f80;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dr-chip strong {
  font-size: 14px;
  line-height: 1.2;
  overflow: hidden;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.dr-chip.is-on {
  border-color: #0b7d6f;
  background: #e6f6f2;
}
.dr-chip.is-off {
  border-color: #b45309;
  background: #fff6e5;
}
.dr-chip.is-off strong {
  color: #8a3b00;
}
.dr-sync {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 52px;
  padding: 4px 4px 4px 12px;
  border-radius: 12px;
  border: 2px solid #cfe3dc;
  background: #f1faf7;
  color: #134a3e;
  font-size: 14px;
}
.dr-sync-text {
  min-width: 0;
  line-height: 1.3;
}
.dr-sync-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.dr-sync-actions button,
.dr-sync-call {
  min-height: 44px;
  min-width: 48px;
  padding: 0 12px;
  border-radius: 10px;
  border: 0;
  background: #0b5f55;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  cursor: pointer;
}
.dr-sync-call {
  background: #12324a;
}
.dr-sync-call:hover {
  text-decoration: none;
}
.dr-sync-pending {
  border-color: #d39b16;
  background: #fff8e1;
  color: #5c3d00;
}
.dr-sync-pending .dr-sync-actions button {
  background: #8a5a00;
}
.dr-sync-offline {
  border-color: #9aa9b6;
  background: #eef2f5;
  color: #2b3e4f;
}
.dr-sync-error {
  border-color: #c8323f;
  background: #fff0f0;
  color: #6c121b;
}
.dr-sync-error .dr-sync-actions button {
  background: #a61e2b;
}
.dr-sync-list {
  font-size: 14px;
  padding: 0 4px;
}
.dr-sync-list summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
  color: #5c3d00;
}
.dr-sync-list ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}
.dr-sync-list li span {
  font-weight: 700;
}

/* Przyciski kierowcy */
.dr-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 2px solid transparent;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  width: 100%;
}
.dr-btn:hover {
  text-decoration: none;
}
.dr-btn:focus-visible,
.dr-chip:focus-visible,
.dr-choice:focus-visible {
  outline: 4px solid #ffcc33;
  outline-offset: 3px;
}
.dr-btn-primary {
  min-height: 64px;
  font-size: 19px;
  background: #00796d;
  color: #fff;
  box-shadow: 0 6px 16px #00796d33;
}
.dr-btn-primary:disabled {
  background: #9fb4b0;
  box-shadow: none;
}
.dr-btn-secondary {
  background: #fff;
  border-color: #00796d;
  color: #005d54;
}
.dr-btn-tool {
  background: #eaf2f8;
  border-color: #c6d8e6;
  color: #12324a;
  font-size: 16px;
  padding: 10px 8px;
  gap: 8px;
  white-space: nowrap;
}
.dr-btn-dark {
  background: #183d50;
  color: #fff;
}
.dr-btn-lg {
  min-height: 52px;
  font-size: 16px;
  font-weight: 800;
}
.dr-shift-stop {
  margin-top: 10px;
}

/* Start: zmiana i aktywny kurs */
.driver-hello h2 {
  font-size: 22px;
}
.dr-shift {
  display: grid;
  gap: 12px;
}
.dr-shift small,
.dr-active-course small,
.dr-stop-kicker {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #4d6475;
}
.dr-shift strong {
  display: block;
  font-size: 20px;
  color: #12324a;
}
.dr-shift-on {
  border: 2px solid #0b7d6f;
  background: #f0fbf8;
}
.dr-active-course {
  border: 2px solid #1f6fb2;
  background: #f1f8ff;
}
.dr-big-address {
  font-size: 23px !important;
  line-height: 1.25;
  font-weight: 800;
  color: #0f2638 !important;
  margin: 2px 0 !important;
  overflow-wrap: anywhere;
}
.dr-big-address span {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: #35506a;
}
.dr-warn {
  background: #fff6e5;
  border-left: 4px solid #b45309;
  padding: 10px 12px;
  border-radius: 8px;
  color: #6b3a00 !important;
  font-weight: 700;
}
.dr-done-note {
  font-weight: 800;
  color: #0b5f55 !important;
}

/* Bieżący przystanek */
.dr-stop-current {
  padding: 18px;
  display: grid;
  gap: 12px;
  border: 2px solid #00796d;
}
.dr-stop-all-done {
  border-color: #1f6fb2;
}
.dr-stop-note {
  background: #fffbe9;
  border: 1px solid #ecd58b;
  border-radius: 10px;
  padding: 10px 12px;
  color: #4a3a00 !important;
  font-size: 16px !important;
}
.dr-stop-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.dr-next {
  display: grid;
  gap: 10px;
}
.dr-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  counter-reset: drstep;
}
.dr-steps li {
  counter-increment: drstep;
  border-radius: 10px;
  background: #eef2f5;
  color: #4d6475;
  padding: 8px 6px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}
.dr-steps li::before {
  content: counter(drstep) '. ';
}
.dr-steps li.is-now {
  background: #fff3cd;
  color: #5c3d00;
  outline: 2px solid #d39b16;
}
.dr-steps li.is-done {
  background: #dcf3ea;
  color: #0b5f55;
}
.dr-steps li.is-done::before {
  content: '✓ ';
}
.dr-photo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.dr-photo-pending {
  position: relative;
  margin: 0;
}
.dr-photo-pending img {
  outline: 3px dashed #d39b16;
}
.dr-photo-pending figcaption {
  font-size: 12px;
  font-weight: 700;
  color: #5c3d00;
}
.dr-photo-preview img {
  display: block;
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 10px;
  background: #0f2638;
}

/* Trasa (pozostałe przystanki) */
.dr-route {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.dr-route li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border-radius: 12px;
  background: #f5f8fa;
}
.dr-route li small {
  display: block;
  font-size: 13px;
  color: #4d6475;
}
.dr-route li strong {
  font-size: 16px;
}
.dr-route-mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: #dfe7ee;
  color: #2b3e4f;
}
.dr-route li.is-done .dr-route-mark {
  background: #0b7d6f;
  color: #fff;
}
.dr-route li.is-problem .dr-route-mark {
  background: #b45309;
  color: #fff;
}
.dr-route li.is-current {
  background: #e6f6f2;
  outline: 2px solid #0b7d6f;
}
.dr-route li.is-current .dr-route-mark {
  background: #00796d;
  color: #fff;
}
.dr-route .driver-text-action {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}
.dr-route-photos {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #4d6475;
  margin-left: 8px;
}

/* Wybór w oknie: auto do jazdy, wynik rozładunku */
.dr-choice-list {
  display: grid;
  gap: 10px;
}
.dr-choice {
  min-height: 64px;
  border: 2px solid #c6d8e6;
  border-radius: 14px;
  background: #fff;
  color: #12324a;
  padding: 10px 14px;
  display: grid;
  gap: 2px;
  text-align: left;
  cursor: pointer;
}
.dr-choice strong {
  font-size: 18px;
}
.dr-choice small {
  font-size: 14px;
  color: #4d6475;
}
.dr-choice.is-suggested {
  border-color: #00796d;
  background: #eef9f6;
}
.dr-choice-ok {
  border-color: #0b7d6f;
  background: #e6f6f2;
}
.dr-choice-problem {
  border-color: #b45309;
  background: #fff6e5;
}

/* Liczniki: brak danych ≠ przekroczenie */
.dr-metric {
  display: grid;
  gap: 4px;
}
.dr-metric-nodata {
  border: 2px dashed #9aa9b6 !important;
  background: #f4f6f8 !important;
}
.dr-metric-nodata strong {
  color: #5b6f80 !important;
  font-size: 18px !important;
}
.dr-metric-nodata span,
.dr-nodata-note {
  color: #5b6f80 !important;
}
.dr-metric-danger span {
  color: #991b1b !important;
  font-weight: 800;
}

/* Rozwijane objaśnienia zamiast powtarzanych akapitów */
.dr-more summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
  color: #005d54;
  font-size: 15px;
}
details.panel.dr-more {
  padding: 4px 16px;
}
.driver-job-meta {
  padding-bottom: 12px;
}

/* Tankowanie */
.dr-fuel-list {
  display: grid;
  gap: 6px;
}
.dr-fuel-list > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f5f8fa;
  font-size: 15px;
}
.driver-fuel-panel input,
.driver-fuel-panel select {
  min-height: 52px;
  font-size: 17px;
}

/* Cele dotyku i większy tekst */
.driver-text-action,
.driver-back {
  min-height: 48px;
  min-width: 48px;
  padding: 0 6px;
  font-size: 16px;
}
.driver-back {
  justify-self: start;
}
.driver-big-btn {
  min-height: 56px;
  font-size: 17px;
}
.driver-quick-links button {
  min-height: 56px;
}
.driver-day-nav button {
  width: 56px;
  height: 56px;
}
.driver-day-nav input {
  min-height: 48px;
}
.driver-trip h3 {
  font-size: 22px;
}
.driver-trip p {
  font-size: 15px;
}
.driver-activity-tile small {
  font-size: 13px;
}
.driver-start-button {
  min-height: 64px;
}

/* Pozostałe ekrany kierowcy (zadania, urlopy, kontakt, okna): ten sam minimalny cel dotyku. */
body.driver-mode .content .btn,
body.driver-mode .modal .btn,
body.driver-mode .content input:not([type='checkbox']):not([type='radio']):not(.dr-photo-input),
body.driver-mode .content select,
body.driver-mode .modal input:not([type='checkbox']):not([type='radio']),
body.driver-mode .modal select {
  min-height: 48px;
  font-size: 16px;
}
body.driver-mode .content .btn,
body.driver-mode .modal .btn {
  min-width: 48px;
}
body.driver-mode .modal-close {
  width: 48px;
  height: 48px;
}
body.driver-mode .modal textarea {
  font-size: 16px;
}

@media (max-width: 800px) {
  body.driver-mode .driver-bottom-nav {
    grid-template-columns: repeat(6, 1fr);
    padding: 4px 2px calc(env(safe-area-inset-bottom) + 4px);
  }
  body.driver-mode .driver-bottom-link {
    min-height: 58px;
    font-size: 11px;
    gap: 3px;
  }
  body.driver-mode .driver-bottom-link.selected {
    color: #00695f;
    background: #e6f6f2;
    border-radius: 10px;
  }
  body.driver-mode .content {
    padding-bottom: calc(env(safe-area-inset-bottom) + 100px) !important;
  }
  /* Toasty nad dolnym paskiem, nie na nim. */
  body.driver-mode #toast-root {
    left: 10px;
    right: 10px;
    bottom: calc(env(safe-area-inset-bottom) + 78px);
    z-index: 30;
  }
  /* Jeden komunikat naraz: kolejne nie zasłaniają ekranu stosem. */
  body.driver-mode #toast-root .toast:not(:last-child) {
    display: none;
  }
  body.driver-mode .toast {
    max-width: none;
    font-size: 15px;
    padding: 14px 16px;
  }
  .dr-sync {
    font-size: 13px;
  }
  .dr-sync-call span {
    display: none;
  }
}
@media (max-width: 380px) {
  .dr-chip strong {
    font-size: 13px;
  }
  .dr-big-address {
    font-size: 21px !important;
  }
}
