/* ==========================================================================
   BAZA
   ========================================================================== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
  background: #f5f7fa;
  color: #1b2430;
}

/* ==========================================================================
   TABS
   ========================================================================== */
.tabs {
  display: flex;
  background: #eef;
  margin-bottom: 10px;
}
.tabBtn {
  flex: 1;
  padding: 10px;
  border: 0;
  background: #dde;
  cursor: pointer;
  font-size: 17px;
}
.tabBtn.active {
  background: #fff;
  font-weight: bold;
  border-bottom: 2px solid #259;
}
.tab { display: none; }
.tab.active { display: block; }

/* ==========================================================================
   KONTROLKI I FILTRY
   ========================================================================== */
.controls { display:flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.controls button { margin-right: 4px; }

.controls.panel-action-bar {
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #d6dfeb;
  border-radius: 13px;
  background: #f7f9fc;
}

.controls.panel-action-bar button {
  margin: 0;
}

.panel-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid #b9c9dc;
  border-radius: 10px;
  background: #fff;
  color: #294a6d;
  box-shadow: 0 1.5px 5px rgba(50, 70, 110, 0.08);
  font-family: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background .16s, border-color .16s, color .16s, box-shadow .16s, transform .08s;
}

.panel-action-btn:hover {
  border-color: #8faac9;
  background: #edf4fb;
  color: #173f68;
  box-shadow: 0 3px 9px rgba(50, 70, 110, 0.12);
}

.panel-action-btn:active {
  transform: translateY(1px);
}

.panel-action-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(64, 117, 227, 0.22);
}

.panel-action-btn--archive {
  border-color: #c9c1df;
  background: #f8f6fc;
  color: #51446f;
}

.panel-action-btn--archive:hover {
  border-color: #aa9bcf;
  background: #eee9f8;
  color: #3e315f;
}

.panel-action-btn--document {
  border-color: #b9cde5;
  background: #f5f9fd;
  color: #28557f;
}

.panel-action-menu {
  position: relative;
  flex: 0 0 auto;
  margin: 0;
}

.panel-action-menu > summary {
  list-style: none;
  user-select: none;
}

.panel-action-menu > summary::-webkit-details-marker {
  display: none;
}

.panel-action-menu[open] > summary {
  border-color: #7f9fc4;
  background: #e9f2fb;
  color: #173f68;
  box-shadow: 0 0 0 3px rgba(64, 117, 227, 0.13);
}

.panel-action-menu__arrow {
  margin-left: 2px;
  font-size: 11px;
  transition: transform .16s ease;
}

.panel-action-menu[open] .panel-action-menu__arrow {
  transform: rotate(180deg);
}

.panel-action-menu__list {
  position: absolute;
  z-index: 1200;
  top: calc(100% + 6px);
  left: 0;
  display: grid;
  min-width: 190px;
  padding: 6px;
  border: 1px solid #b9cde5;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(35, 62, 96, 0.18);
}

.controls.panel-action-bar .panel-action-menu__item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 38px;
  margin: 0;
  padding: 8px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #28557f;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.controls.panel-action-bar .panel-action-menu__item:hover,
.controls.panel-action-bar .panel-action-menu__item:focus-visible {
  outline: none;
  background: #edf4fb;
  color: #173f68;
}

.panel-action-btn--money {
  border-color: #b8d6bd;
  background: #f2f9f3;
  color: #28603a;
}

.panel-action-btn--money:hover {
  border-color: #8ebc97;
  background: #e5f3e8;
  color: #194e2b;
}

.panel-action-btn--valuation {
  border-color: #e2c68c;
  background: #fff8e9;
  color: #77551c;
}

.panel-action-btn--valuation:hover {
  border-color: #caa85e;
  background: #ffefca;
  color: #61420e;
}

@media (max-width: 700px) {
  .controls.panel-action-bar > button {
    flex: 1 1 155px;
    min-width: 0;
  }
  .controls.panel-action-bar > .panel-action-menu {
    flex: 1 1 155px;
    min-width: 0;
  }
  .controls.panel-action-bar > .panel-action-menu > summary {
    width: 100%;
  }
  .panel-action-menu__list {
    width: 100%;
    min-width: 190px;
  }
}
.filters {
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filters.panel-filter-bar {
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #d6dfeb;
  border-radius: 13px;
  background: #f7f9fc;
}

.panel-filter-bar__title {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 5px 0 2px;
  color: #294a6d;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.panel-filter-bar select,
.panel-filter-bar input {
  flex: 1 1 165px;
  min-width: 140px;
  min-height: 42px;
  box-sizing: border-box;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid #b9c9dc;
  border-radius: 10px;
  background: #fff;
  color: #243d67;
  box-shadow: 0 1.5px 5px rgba(50, 70, 110, 0.06);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.2;
  outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}

.panel-filter-bar input::placeholder {
  color: #7b899b;
}

.panel-filter-bar select:focus,
.panel-filter-bar input:focus {
  border-color: #4075e3;
  background: #fbfdff;
  box-shadow: 0 0 0 3px rgba(64, 117, 227, 0.18);
}

.panel-filter-bar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin: 0;
  padding: 9px 14px;
  border: 1px solid #c8bfc0;
  border-radius: 10px;
  background: #fff;
  color: #6c3d43;
  box-shadow: 0 1.5px 5px rgba(70, 50, 55, 0.06);
  font-family: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background .16s, border-color .16s, color .16s, box-shadow .16s;
}

.panel-filter-bar button:hover {
  border-color: #b69b9e;
  background: #fff1f2;
  color: #80343d;
  box-shadow: 0 3px 9px rgba(90, 50, 58, 0.1);
}

.panel-filter-bar button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(180, 74, 87, 0.18);
}

@media (max-width: 700px) {
  .panel-filter-bar__title {
    flex: 1 0 100%;
    min-height: 30px;
  }
  .panel-filter-bar select,
  .panel-filter-bar input,
  .panel-filter-bar button {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }
}

/* ========================================================================== 
   PRZYCISKI (ogólne)
   ========================================================================== */
.btn-blue, .btn-red, .btn-green, .btn-gray, .btn-orange {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: none;
  margin: 0 2px;
  cursor: pointer;
  transition: background .13s, box-shadow .13s, color .13s;
  box-shadow: 0 1.5px 4px rgba(60,70,120,.06);
  outline: none;
}
.btn-blue  { background: #e7f2ff; color: #257; }
.btn-blue:hover { background: #b8d3ff; color: #003391; }
.btn-red   { background: #ffd5d5; color: #b70000; }
.btn-red:hover { background: #ffbbbb; color: #7a0000; }
.btn-green { background: #cfffcb; color: #087200; }
.btn-green:hover { background: #aaf7a5; color: #055300; }
.btn-gray  { background: #e5e7eb; color: #4b5563; }
.btn-orange { background: #fff3d6; color: #b86900; border: 1.3px solid #f8c883; }
.restore-btn {
  width: auto;
  height: 32px;
  padding: 4px 14px;
  font-size: 14px;
  border-radius: 999px;
  margin-left: 4px;
}
.btn-orange:hover { background: #ffe7b0; color: #9a5b00; }

/* ==========================================================================
   STATYSTYKI
   ========================================================================== */
.stats { margin: 8px 0; font-weight: bold; }
.money, .bag-money { font-variant-numeric: tabular-nums; }
.blur-money { color: #aaa; filter: blur(3px); }
.small { font-size: 11px; color: #888; }

/* ==========================================================================
   TABELA - UOGÓLNIONE
   ========================================================================== */
table { border-collapse: collapse; width: 100%; background: #fff; margin-bottom: 18px; }
th, td { border: 1px solid #bbb; padding: 6px 11px; font-size: 15px; text-align: left; }
th { background: #f0f0ff; position: sticky; top: 0; z-index: 1; }
tr.gray   { background: #eee; }
tr.green  { background: #eaffea; }
tr.red    { background: #ffeaea; }
tr.orange { background: #fff8e5; }

/* ==========================================================================
   TABELA KONTENERÓW (#containersTable)
   - kolumny węższe tam gdzie trzeba
   - „Akcje” zawsze w jednym rzędzie (bez zawijania)
   - reguły tak napisane, by działały i z kolumną „Wpłacono”, i bez niej
   ========================================================================== */
#containersTable { table-layout: fixed; width: 100%; }

/* Przycinanie tekstów w komórkach: */
#containersTable th, #containersTable td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 1) Nr kontenera — wąsko */
#containersTable th:nth-child(1),
#containersTable td:nth-child(1) { width: 56px; }

/* 2) Typ — wąsko */
#containersTable th:nth-child(2),
#containersTable td:nth-child(2) { width: 68px; }

/* 7) Cena — stałe 80px (pozycja ta sama niezależnie od „Wpłacono”) */
#containersTable th:nth-child(7),
#containersTable td:nth-child(7) { width: 80px; }

/* „Pozostało” — 80px
   - z „Wpłacono”: kolumna 9
   - bez „Wpłacono”: kolumna 8 */
#containersTable th:nth-child(9),
#containersTable td:nth-child(9),
#containersTable th:nth-child(8),
#containersTable td:nth-child(8) { width: 80px; }

/* „Status” — 80px
   - z „Wpłacono”: kolumna 10
   - bez „Wpłacono”: kolumna 9 */
#containersTable th:nth-child(10),
#containersTable td:nth-child(10),
#containersTable th:nth-child(9),
#containersTable td:nth-child(9) { width: 80px; }

/* „Zafakturowano” — kompaktowo 92px
   - z „Wpłacono”: kolumna 11
   - bez „Wpłacono”: kolumna 10 */
#containersTable th:nth-child(11),
#containersTable td:nth-child(11),
#containersTable th:nth-child(10),
#containersTable td:nth-child(10) { width: 92px; }

/* OSTATNIA kolumna: „Akcje” — JEDEN RZĄD, bez zawijania */
#containersTable th:last-child,
#containersTable td:last-child {
  width: 180px;              /* ~10% węższa niż 200px */
  white-space: nowrap;       /* nie zawijaj przycisków do nowej linii */
  overflow: visible;         /* pokaż całe ikony */
  text-align: center;
  padding: 6px 6px;
}
#containersTable td:last-child {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;                  /* odstęp między ikonami */
}
#containersTable td:last-child .btn-blue,
#containersTable td:last-child .btn-red,
#containersTable td:last-child .btn-green,
#containersTable td:last-child .btn-gray,
#containersTable td:last-child .btn-orange {
  width: 30px;
  height: 30px;
  font-size: 18px;
  margin: 0;
  flex: 0 0 auto;           /* nie rozciągaj przycisków */
}

/* ==========================================================================
   TABELA PLANOWANYCH (#plannedContainersTable)
   (spójne zachowanie „Akcje” + lekkie zawężenie kolumn liczbowych)
   ========================================================================== */
#plannedContainersTable { table-layout: fixed; width: 100%; }
#plannedContainersTable th, #plannedContainersTable td {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Ceny węższe */
#plannedContainersTable th:nth-child(7),
#plannedContainersTable td:nth-child(7) { width: 90px; }
#plannedContainersTable th:nth-child(9),
#plannedContainersTable td:nth-child(9) { width: 90px; }
/* Ostatnia kolumna Akcje: jeden rząd */
#plannedContainersTable th:last-child,
#plannedContainersTable td:last-child {
  width: 160px;
  white-space: nowrap;
  overflow: visible;
  text-align: center;
}
#plannedContainersTable td:last-child {
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
#plannedContainersTable td:last-child .btn-blue,
#plannedContainersTable td:last-child .btn-red,
#plannedContainersTable td:last-child .btn-green,
#plannedContainersTable td:last-child .btn-gray {
  width: 30px; height: 30px; font-size: 18px; margin: 0; flex: 0 0 auto;
}

/* ==========================================================================
   TABELA WORKÓW (ogólnie)
   ========================================================================== */
.bag-money { font-variant-numeric: tabular-nums; }
.blur-money { filter: blur(3px); }

/* ==========================================================================
   MODALE
   ========================================================================== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background: rgba(0,0,0,0.18);
}
.modal-content {
  background: #fff;
  padding: 32px 32px 26px 32px;
  border-radius: 17px !important;
  max-width: 480px;
  width: 95vw;
  margin: 36px auto;
  box-shadow: 0 10px 32px rgba(50,60,120,0.16), 0 6px 32px rgba(60,70,120,0.17) !important;
  max-height: 92vh;
  overflow-y: auto;
}
#modal .modal-content,
#bagModal .modal-content {
  width: min(94vw, 760px);
  max-width: 760px;
  box-sizing: border-box;
}
.modal-content h3 {
  margin: 0 0 18px;
  font-size: 24px;
  text-align: center;
}
.modal-content form { display: flex; flex-direction: column; gap: 10px; }
.modal-content label { font-size: 15px; color: #1d274c; margin-bottom: 2px; }
.modal-content input, .modal-content select, .modal-content textarea {
  width: 100% !important;
  padding: 12px 14px !important;
  border: 2px solid #b6b6d6 !important;
  border-radius: 13px !important;
  font-size: 16px !important;
  margin-top: 4px !important;
  margin-bottom: 12px !important;
  background: #fafdff !important;
  transition: border 0.2s, box-shadow 0.2s !important;
  box-shadow: 0 2px 8px rgba(60,70,120,0.10) !important;
  outline: none !important;
}
.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus {
  border-color: #4075e3 !important;
  background: #f0f6ff !important;
  box-shadow: 0 0 0 3px #b7d5fa !important;
}
#form .container-invoice-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
}
#form .container-invoice-toggle input[type="checkbox"] {
  width: 18px !important;
  height: 18px;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid #9eb1c9 !important;
  border-radius: 4px !important;
  box-shadow: none !important;
}
#containerInvoiceDateField[hidden] { display: none !important; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}
.modal-actions button {
  padding: 11px 22px !important;
  border: none;
  border-radius: 11px !important;
  background: #3476e1;
  color: #fff;
  font-size: 16px !important;
  cursor: pointer;
  transition: background 0.18s, color 0.16s;
  font-weight: 500;
}
.modal-actions button[type="button"] {
  background: #fff;
  color: #277;
  border: 1.3px solid #b6cbe2;
}
.modal-actions button:hover { background: #1e56aa; }
.modal-actions button[type="button"]:hover { background: #f7fbfe; color: #036; }

/* Modal adnotacji kierowcy po pomiarze faktycznej wysokości panelu. */
#driverAnnotationModal.driver-annotation-modal--compact {
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 12px;
}

#driverAnnotationModal.driver-annotation-modal--compact .modal-content {
  box-sizing: border-box;
  width: min(calc(100vw - 24px), 480px);
  max-width: 480px;
  min-height: 0;
  margin: 0;
  align-self: center;
  flex: 0 1 480px;
  overflow-y: auto;
}

/* Powiadomienie kierowcy o zmianach w dzisiejszych zleceniach */
#driverTaskChangesModal {
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 10px;
}

#driverTaskChangesModal .driver-task-changes-modal-content {
  box-sizing: border-box;
  width: min(calc(100vw - 20px), 390px);
  max-width: 390px;
  min-height: 188px;
  height: auto !important;
  align-self: center;
  flex: 0 1 390px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  gap: 6px;
  align-items: center;
  align-content: space-between;
  justify-items: center;
  margin: 0;
  padding: 14px 18px !important;
  border-radius: 12px !important;
  overflow: visible;
  text-align: left;
}

.driver-task-changes-icon {
  margin: 0;
  font-size: 40px;
  line-height: 1;
}

.driver-task-changes-copy {
  min-width: 0;
  width: 100%;
  text-align: center;
}

.driver-task-changes-modal-content h3 {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.driver-task-changes-modal-content p {
  margin: 0;
  color: #24384f;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}

.driver-task-changes-actions {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 0;
}

.driver-task-changes-actions #driverTaskChangesConfirm {
  width: min(72%, 220px);
  min-width: 160px;
  padding: 9px 14px !important;
  border: 1px solid #83d47c !important;
  background: #cfffcb !important;
  color: #087200 !important;
  font-size: 16px !important;
  font-weight: 700;
}

.driver-task-changes-actions #driverTaskChangesConfirm:hover,
.driver-task-changes-actions #driverTaskChangesConfirm:focus-visible {
  border-color: #63b95d !important;
  background: #aaf7a5 !important;
  color: #055300 !important;
}

/* ========================================================================== 
   PODPOWIEDZI LISTY
   ========================================================================== */
.suggest-list {
  position: absolute;
  z-index: 1050;
  background: #fff;
  border: 1.2px solid #b5c6e0;
  border-radius: 9px;
  box-shadow: 0 4px 16px rgba(80,90,160,0.11);
  margin-top: 1px;
  width: 96%;
  max-height: 180px;
  overflow-y: auto;
  font-size: 15px;
}
.suggest-list li {
  padding: 7px 13px;
  cursor: pointer;
  transition: background 0.14s;
}
.suggest-list li:hover, .suggest-list li.active { background: #e6f0ff; }

::placeholder { color: #aaa; }

/* ==========================================================================
   PANEL KIEROWCY – przyciski, listy, responsywność
   ========================================================================== */
.driver-controls-row {
  display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap;
}
.driver-btn, .driver-btn-main {
  padding: 10px 17px; border-radius: 10px; border: none; font-size: 16px; font-weight: 500;
  cursor: pointer; transition: background 0.16s, color 0.16s;
  background: #e8effc; color: #1853d6; border: 1.5px solid #aac5fb; box-shadow: 0 1.5px 5px rgba(50,80,170,0.09);
  min-height: 42px;
}
.driver-btn-main { background: #1853d6; color: #fff; border-color: #1853d6; }
.driver-btn-main:hover { background: #0d326c; color: #fff; }
.driver-btn:hover, .btn-gray:hover { background: #c5ddfa; color: #0d326c; }

#driverSchedule .driver-task-row {
  display: flex; flex-direction: row; align-items: center; width: 100%;
  gap: 0; margin-bottom: 12px; background: #fff; border-radius: 13px;
  box-shadow: 0 2px 7px #b4cef73a; padding: 0 18px 0 8px; min-height: 68px;
}
#driverSchedule .driver-task-data {
  flex: 1 1 0%; min-width: 0; display: flex; flex-wrap: wrap; gap: 24px 30px; align-items: flex-start;
}
#driverSchedule .driver-field { display: flex; flex-direction: column; min-width: 75px; max-width: 230px; }
#driverSchedule .driver-field-label { font-size: 11px; color: #4871a9; font-weight: bold; margin-bottom: 2px; }
#driverSchedule .driver-field-value {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; display: block; font-size: 15px; color: #182133; font-weight: 500;
}

#driverSchedule .driver-phone-action {
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

#driverSchedule .driver-phone-action:focus-visible {
  outline: 2px solid #2457a7;
  outline-offset: 3px;
  border-radius: 3px;
}

/* Akcje w wierszu kierowcy */
#driverSchedule .driver-task-actions {
  display: flex !important; flex-direction: row; gap: 12px; align-items: center; margin-left: auto !important; min-width: 120px; justify-content: flex-end;
}
#driverSchedule .driver-task-actions button {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px;
  font-size: 22px !important; font-weight: 600; border-radius: 13px !important; border: 1.2px solid #b4cef7;
  background: #e8effc; color: #235; cursor: pointer; box-shadow: 0 1.5px 5px rgba(50,80,170,0.09);
  transition: background 0.16s, color 0.12s, box-shadow 0.15s; outline: none; position: relative;
}
#driverSchedule .driver-task-actions .btn-blue {
  background: #e7f2ff;
  color: #257;
  border-color: #b8d3ff;
}
#driverSchedule .driver-task-actions .btn-blue:hover {
  background: #b8d3ff;
  color: #003391;
}
#driverSchedule .driver-task-actions .btn-red {
  background: #ffd5d5;
  color: #b70000;
  border-color: #efb1b1;
}
#driverSchedule .driver-task-actions .btn-red:hover {
  background: #ffbbbb;
  color: #7a0000;
}
#driverSchedule .driver-task-actions .btn-green {
  background: #cfffcb;
  color: #087200;
  border-color: #83d47c;
}
#driverSchedule .driver-task-actions .btn-green:hover {
  background: #aaf7a5;
  color: #055300;
}
#driverSchedule .driver-task-actions .btn-orange {
  background: #fff3d6;
  color: #b86900;
  border-color: #f8c883;
}
#driverSchedule .driver-task-actions .btn-orange:hover {
  background: #ffe7b0;
  color: #9a5b00;
}
#driverSchedule .driver-task-actions .btn-gray {
  background: #e5e7eb;
  color: #4b5563;
  border-color: #cbd1da;
}
#driverSchedule .driver-task-actions .btn-gray:hover {
  background: #c5ddfa;
  color: #0d326c;
}
#driverSchedule .driver-task-actions button:focus { box-shadow: 0 0 0 3px #c3e2ff; }

/* Responsive */
@media (max-width: 700px) {
  th, td { font-size: 13px; }
  .modal-content { max-width: 98vw; padding: 16px 4vw; }
}
@media (max-width: 600px) {
  .driver-controls-row { flex-direction: column; align-items: stretch; gap: 7px; }
  .driver-btn, .driver-btn-main { width: 100%; min-width: 0; font-size: 15px; min-height: 38px; }
}
@media (max-width: 500px) {
  .modal-content { max-width: 99vw; padding: 7vw 1vw; }
  .modal-content form { gap: 7px; }
  .modal-actions { gap: 7px; }
  #driverSchedule .driver-task-actions button { min-width: 28px; height: 28px; font-size: 14px !important; border-radius: 7px !important; }
}

/* Akcje w tabelach */
.actions-cell {
  padding: 6px 10px;
}

.actions-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.actions-wrap button {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  font-size: 16px;
  margin: 0;
}

/* =======================
   BIEŻĄCE KONTENERY – porządek i spójność
   ======================= */
#containersTable {
  table-layout: fixed;
  width: 100%;
  background: #fff;
  border-collapse: collapse;
}

/* Nagłówek */
#containersTable thead th {
  background: #eef3ff;
  color: #23395b;
  font-weight: 700;
  border: 1px solid #cbd6ee;
  padding: 8px 10px;
  position: sticky;
  top: 0;
  z-index: 1;
}

/* Komórki */
#containersTable td {
  border: 1px solid #e0e6f2;
  padding: 10px 12px;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap; /* <br> dalej łamie wiersz w kolumnie Klient */
}

/* Delikatny hover wiersza */
#containersTable tbody tr:hover {
  background: #f7faff;
}

/* --- Szerokości kolumn (po indeksach) --- */
/* 1: Nr */
#containersTable th:nth-child(1), #containersTable td:nth-child(1) { width: 64px; }
/* 2: Typ */
#containersTable th:nth-child(2), #containersTable td:nth-child(2) { width: 74px; }
/* 3: Rodzaj odpadu */
#containersTable th:nth-child(3), #containersTable td:nth-child(3) { width: 140px; }
/* 4: Klient – reszta miejsca */
#containersTable th:nth-child(4), #containersTable td:nth-child(4) { width: auto; white-space: normal; }
/* 5: Data wstawienia */
#containersTable th:nth-child(5), #containersTable td:nth-child(5) { width: 132px; }
/* 6: Data odbioru */
#containersTable th:nth-child(6), #containersTable td:nth-child(6) { width: 132px; }
/* 7: Cena */
#containersTable th:nth-child(7), #containersTable td:nth-child(7) { width: 96px; text-align: right; font-variant-numeric: tabular-nums; }
/* 8: Pozostało */
#containersTable th:nth-child(8), #containersTable td:nth-child(8) { width: 96px; text-align: right; font-variant-numeric: tabular-nums; }
/* 9: Status (ikony) */
#containersTable th:nth-child(9), #containersTable td:nth-child(9) { width: 86px; text-align: center; }
/* 10: Zafakturowano */
#containersTable th:nth-child(10), #containersTable td:nth-child(10) { width: 118px; text-align: center; }
/* 11: Akcje – jeden rząd */
#containersTable th:nth-child(11), #containersTable td:nth-child(11) {
  width: 188px;
  white-space: nowrap;
  text-align: center;
  padding: 6px 6px;
}

/* Przyciski w „Akcje” – w jednej linii, równe odstępy */
#containersTable td:nth-child(11) {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
#containersTable td:nth-child(11) .btn-blue,
#containersTable td:nth-child(11) .btn-red,
#containersTable td:nth-child(11) .btn-green,
#containersTable td:nth-child(11) .btn-gray,
#containersTable td:nth-child(11) .btn-orange {
  width: 30px;
  height: 30px;
  font-size: 18px;
  margin: 0;
  flex: 0 0 auto;
}

/* Uspójnienie kolorystyki wierszy statusu (masz je już w bazie, tylko łagodniej) */
tr.green  { background: #eefcf0; }
tr.red    { background: #fff0f0; }
tr.orange { background: #fff8ea; }
tr.gray   { background: #f3f4f7; }

/* Małe dopieszczenie wyglądu „Klient” (druga linia i tel.) */
#containersTable td:nth-child(4) .small { color: #6d86a6; font-size: 12px; }
#containersTable td:nth-child(4) .small[style*="color:#259"] { color: #2f6ad9 !important; }

/* === FIX: kolumna Akcje nie jest „specjalną” komórką === */
#containersTable th:last-child,
#containersTable td:last-child {
  width: 176px !important;
  text-align: left !important;
  padding: 6px 8px !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
}

/* WYŁĄCZ flex na samej komórce (to był powód „odklejenia”) */
#containersTable td:last-child {
  display: table-cell !important;   /* zamiast display:flex */
}

/* Uporządkuj sam środek – tylko wrap jest flexem */
#containersTable td.actions-cell .actions-wrap {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 0;                       /* bez dodatkowych podkładek */
  border: 0;                        /* zero ramek/kapsuł – zlewa się z wierszem */
  background: transparent;
  box-shadow: none;
}

/* Spójne, mniejsze ikonki – jak tekst w innych kolumnach */
#containersTable td.actions-cell .btn-blue,
#containersTable td.actions-cell .btn-red,
#containersTable td.actions-cell .btn-green,
#containersTable td.actions-cell .btn-gray,
#containersTable td.actions-cell .btn-orange {
  width: 28px !important;
  height: 28px !important;
  font-size: 16px !important;
  margin: 0 !important;             /* usuń boczne 2px z bazowych przycisków */
  box-shadow: none !important;      /* bez dodatkowych cieni */
}

/* Drobne dopasowanie na węższych ekranach */
@media (max-width: 900px) {
  #containersTable th:last-child,
  #containersTable td:last-child { width: 156px !important; }
  #containersTable td.actions-cell .btn-blue,
  #containersTable td.actions-cell .btn-red,
  #containersTable td.actions-cell .btn-green,
  #containersTable td.actions-cell .btn-gray,
  #containersTable td.actions-cell .btn-orange {
    width: 26px !important; height: 26px !important; font-size: 15px !important;
  }
}



/* === AUTH BAR (po zalogowaniu) === */
.auth-bar {
  display: none;
  position: sticky;
  top: 0;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  z-index: 2000;
}
.auth-bar__content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.auth-bar__user { font-weight: 600; }

/* === LOGOWANIE — pełnoekranowy modal z białym tłem === */
.auth-modal { /* krytyczne właściwości w stylu inline, tu reszta dla estetyki */ }
.auth-card {
  width: min(420px, calc(100% - 32px));
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,.05);
}
.auth-title { margin: 0 0 8px; font-size: 20px; }
.auth-hint  { margin: 0 0 16px; color: #6b7280; font-size: 14px; }
.auth-row   { margin-bottom: 14px; }
.auth-label { display:block; margin-bottom:6px; font-weight:600; }
.auth-input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
  outline: none;
}
.auth-input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.auth-actions { display:flex; gap:10px; margin-top:6px; }
.auth-error {
  margin: 6px 0 10px; color:#b91c1c; background:#fee2e2; border:1px solid #fecaca;
  padding:8px 10px; border-radius:8px; font-size:14px;
}

/* Przyciski zgodne ze stylem */
.btn { appearance:none; border:1px solid #2563eb; background:#2563eb; color:#fff; padding:10px 14px; border-radius:10px; font-weight:600; cursor:pointer; }
.btn:hover { filter: brightness(0.98); }
.btn:active { transform: translateY(1px); }
.btn--secondary { border-color:#d1d5db; background:#f3f4f6; color:#111827; }
.btn--secondary:hover { background:#e5e7eb; }
.btn--ghost { border-color:#d1d5db; background:white; color:#111827; }

/* Gdy modal jest otwarty – wyłącz przewijanie tła */
body.modal-open { overflow: hidden; }

/* Tabela użytkowników - kolumny */
#usersTable th, #usersTable td { white-space: nowrap; }
#usersTable th:nth-child(1), #usersTable td:nth-child(1) { width: 180px; }
#usersTable th:last-child,  #usersTable td:last-child  { width: 160px; text-align:center; }

/* Edycja użytkownika i uprawnień */
#userModal .user-modal-content {
  width: min(920px, calc(100vw - 32px));
  max-width: 920px;
  box-sizing: border-box;
  max-height: 94vh;
  overflow-y: auto;
}

#userModal #userForm {
  gap: 16px;
}

.user-form-section,
.user-permissions-section {
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
  padding: 16px;
  border: 1px solid #cbd7e7;
  border-radius: 13px;
  background: #f7f9fc;
}

.user-form-section__header {
  margin-bottom: 13px;
}

.user-form-section__header h4,
.user-permissions-section legend {
  margin: 0;
  color: #1f3b64;
  font-size: 17px;
  font-weight: 700;
}

.user-form-section__header p {
  margin: 4px 0 0;
  color: #65758b;
  font-size: 13px;
}

.user-permissions-section legend {
  padding: 0 7px;
}

.user-account-grid,
.user-permissions-grid,
.user-vehicles-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

#userModal .user-form-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  color: #243d67;
  font-weight: 600;
}

#userModal .user-form-field > input,
#userModal .user-password-row input {
  box-sizing: border-box;
  margin-bottom: 0 !important;
}

#userModal .user-form-field > label {
  margin: 0;
  color: #243d67;
  font-weight: 600;
}

.user-password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, 48px);
  gap: 8px;
  align-items: start;
}

.user-password-note {
  display: block;
  margin-top: 5px;
  color: #6d7c90;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

#userModal .user-password-tool {
  width: 48px;
  min-width: 48px;
  height: 48px;
  margin-top: 4px;
  padding: 0;
  border-radius: 12px;
  font-size: 18px;
}

#userModal .user-password-tool[aria-pressed="true"] {
  color: #fff;
  border-color: #2563eb;
  background: #2563eb;
}

.user-password-copy-status {
  display: block;
  min-height: 17px;
  margin-top: 4px;
  color: #18733b;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.user-password-copy-status.is-error {
  color: #b42318;
}

.user-permission-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  margin: 0 !important;
  padding: 11px 12px;
  border: 1px solid #d6dfeb;
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
}

.user-permission-option:hover {
  border-color: #9db8dc;
  background: #f8fbff;
}

#userModal .user-permission-option input[type="checkbox"] {
  flex: 0 0 auto;
  width: 19px !important;
  height: 19px;
  margin: 1px 0 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  accent-color: #2563eb;
}

.user-permission-option span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.user-permission-option strong {
  color: #243d67;
  font-size: 15px;
}

.user-permission-option small,
.user-vehicles-box__header small {
  color: #65758b;
  font-size: 12px;
  line-height: 1.35;
}

.user-permission-option--admin {
  margin-top: 14px !important;
  border-color: #b9cdeb;
  background: #eef5ff;
}

.user-vehicles-box {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #d6dfeb;
}

.user-vehicles-box__header {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 10px;
  color: #1f3b64;
}

@media (max-width: 640px) {
  #userModal .user-modal-content {
    width: calc(100vw - 20px);
    padding: 24px 18px 20px;
    margin: 10px auto;
  }
  .user-account-grid,
  .user-permissions-grid,
  .user-vehicles-grid {
    grid-template-columns: 1fr;
  }
  .user-password-row {
    grid-template-columns: minmax(0, 1fr) repeat(3, 44px);
  }
  #userModal .user-password-tool {
    width: 44px;
    min-width: 44px;
  }
}
/* Ukrywanie przycisków zakładek wg uprawnień */
.tabs .tabBtn.hidden { display: none !important; }


/* ========================================================================== 
   CENTRUM DNIA
   ========================================================================== */
.global-userbar__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.global-userbar__left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}
.global-user {
  color: #34445a;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #b8c5d6;
  border-radius: 9px;
  background: #f4f6f9;
  color: #45566d;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.sync-status:hover { filter: brightness(.98); }
.sync-status:focus-visible { outline: 3px solid #b7d5fa; outline-offset: 1px; }
.sync-status-icon { width: 17px; text-align: center; font-size: 15px; line-height: 1; }

.global-stats-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid #9fc7ae;
  border-radius: 9px;
  background: #eef8f1;
  color: #24643b;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(38, 108, 64, .10);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.global-stats-open-btn[hidden] { display: none !important; }
.global-stats-open-btn:hover { border-color: #79ad8c; background: #dff2e5; color: #18532d; }
.global-stats-open-btn:focus-visible { outline: 3px solid #b9dec5; outline-offset: 1px; }

.sync-status--saved {
  border-color: #9fd0ad;
  background: #edf9f0;
  color: #176b32;
}
.sync-status--syncing {
  border-color: #9bb9e8;
  background: #edf4ff;
  color: #174f9d;
}
.sync-status--syncing .sync-status-icon { animation: syncStatusSpin 1s linear infinite; }
.sync-status--pending {
  border-color: #e4c06d;
  background: #fff8e7;
  color: #805a00;
}
.sync-status--offline {
  border-color: #e3a4a4;
  background: #fff0f0;
  color: #a51c1c;
}
@keyframes syncStatusSpin { to { transform: rotate(360deg); } }

.history-open-btn {
  border: 1px solid #c4b5df;
  border-radius: 9px;
  background: #f5f0fc;
  color: #5b3988;
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(80, 52, 125, .10);
}
.history-open-btn:hover { background: #ebe0fa; }
.history-open-btn:focus-visible { outline: 3px solid #d8c7ef; outline-offset: 1px; }

#historyModal { z-index: 1450; }
#historyModal .history-modal-content {
  max-width: 1040px;
  width: 96vw;
  max-height: 94vh;
  padding: 24px;
}
.history-header { margin-bottom: 14px; }
#historyModal .history-header h3 { margin: 0 0 3px; text-align: left; }
.history-subtitle { color: #6c7685; font-size: 13px; }

.history-tabs {
  display: flex;
  gap: 7px;
  border-bottom: 1px solid #d8e0eb;
  margin-bottom: 13px;
}
.history-tabs button {
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #5d6b7d;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.history-tabs button.active { color: #315b91; border-bottom-color: #3975bd; }
#historyTrashCount {
  display: inline-block;
  min-width: 21px;
  margin-left: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e8edf4;
  color: #43566f;
  font-size: 11px;
}

.history-filters {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(150px, .8fr) minmax(220px, 1.5fr);
  gap: 9px;
  align-items: end;
  margin-bottom: 13px;
}
#historyModal .history-filters label { font-size: 12px; font-weight: 700; color: #53647a; }
#historyModal .history-filters input,
#historyModal .history-filters select {
  margin: 4px 0 0 !important;
  padding: 9px 11px !important;
  border-radius: 9px !important;
  font-size: 14px !important;
}

.history-list {
  display: grid;
  gap: 8px;
  max-height: 57vh;
  overflow-y: auto;
  padding-right: 3px;
}
.history-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid #dce3ec;
  border-radius: 11px;
  background: #fff;
}
.history-item--delete { border-left: 5px solid #d95c5c; }
.history-item--create, .history-item--restore { border-left: 5px solid #55a66b; }
.history-item--update, .history-item--reorder { border-left: 5px solid #5588c6; }
.history-item--undo { border-left: 5px solid #ad7acb; }
.history-item-icon { width: 30px; text-align: center; font-size: 21px; }
.history-item-main { min-width: 0; display: grid; gap: 4px; }
.history-item-title { color: #24354d; font-size: 14px; font-weight: 800; overflow-wrap: anywhere; }
.history-item-meta { color: #6d7b8e; font-size: 12px; }
.history-item-details { color: #4f627a; font-size: 12px; overflow-wrap: anywhere; }
.history-undone-badge {
  display: inline-block;
  width: max-content;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eee8f4;
  color: #694a81;
  font-size: 11px;
  font-weight: 700;
}
.history-item-action {
  min-width: 86px;
  border: 1px solid #a9bdd8;
  border-radius: 9px;
  background: #eef5ff;
  color: #24558f;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.history-item-action:hover { background: #dcecff; }
.history-item-action--restore { border-color: #9ccaaa; background: #eef9f1; color: #216b36; }
.history-empty { padding: 24px; text-align: center; color: #6b7787; background: #f7f9fc; border-radius: 10px; }
.history-actions { position: sticky; bottom: -24px; padding-top: 12px; background: #fff; }

.day-center-open-btn {
  border: 1px solid #9bb9e8;
  border-radius: 9px;
  background: #eaf2ff;
  color: #174f9d;
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(45, 86, 150, .12);
}
.day-center-open-btn:hover { background: #dbeaff; }
.day-center-open-btn:focus-visible { outline: 3px solid #b7d5fa; outline-offset: 1px; }

.global-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid #e3a4a4;
  border-radius: 9px;
  background: #fff0f0;
  color: #a51c1c;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(145, 45, 45, .10);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.global-logout-btn:hover { border-color: #d48e8e; background: #ffe1e1; color: #881616; }
.global-logout-btn:focus-visible { outline: 3px solid #f2bcbc; outline-offset: 1px; }
.global-logout-btn .btn-icon { font-size: 15px; line-height: 1; }

#dayCenterModal { z-index: 1400; }
#dayCenterModal .day-center-modal-content {
  max-width: 1120px;
  width: 96vw;
  max-height: 94vh;
  padding: 24px;
}

.day-center-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
#dayCenterModal .day-center-header h3 {
  text-align: left;
  margin: 0 0 3px;
}
.day-center-date {
  color: #61728b;
  font-size: 14px;
  text-transform: capitalize;
}

.day-center-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 9px;
  margin-bottom: 16px;
}
.day-center-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 9px;
  align-items: center;
  min-height: 82px;
  padding: 11px 12px;
  text-align: left;
  border: 1px solid #cbd8e8;
  border-radius: 12px;
  background: #f7faff;
  color: #1c3150;
  cursor: pointer;
  box-shadow: 0 2px 7px rgba(49, 79, 125, .08);
}
.day-center-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(49, 79, 125, .14); }
.day-center-card--red { border-color: #efb1b1; background: #fff3f3; }
.day-center-card--orange { border-color: #efcf91; background: #fff9eb; }
.day-center-card--green { border-color: #add9ba; background: #f1fbf4; }
.day-center-card--blue { border-color: #a9c5ef; background: #f0f6ff; }
.day-center-card-icon { grid-row: 1 / 3; font-size: 27px; }
.day-center-card-count { font-size: 25px; line-height: 1; font-weight: 800; }
.day-center-card-label { margin-top: 4px; color: #56677e; font-size: 12px; font-weight: 700; }

.day-center-sections { display: grid; gap: 12px; }
.day-center-section {
  border: 1px solid #d8e0eb;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  scroll-margin-top: 14px;
}
.day-center-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  background: #eef4fc;
  border-bottom: 1px solid #d8e0eb;
}
.day-center-section-title h4 { margin: 0; color: #243d61; font-size: 16px; }
.day-center-section-count {
  min-width: 28px;
  padding: 3px 8px;
  text-align: center;
  border-radius: 999px;
  background: #d7e5f8;
  color: #234c83;
  font-weight: 800;
  font-size: 13px;
}
.day-center-list { display: grid; }
.day-center-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  border-bottom: 1px solid #edf0f4;
}
.day-center-item:last-child { border-bottom: 0; }
.day-center-item:hover { background: #fbfdff; }
.day-center-item-main { min-width: 0; display: grid; gap: 3px; }
.day-center-item-main strong { color: #1f2e44; font-size: 14px; }
.day-center-item-main > span:not(.day-center-amount) {
  color: #66778e;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.day-center-amount { color: #9d1515; font-size: 13px; font-weight: 800; }
.day-center-item-open {
  flex: 0 0 auto;
  border: 1px solid #9bb9e8;
  border-radius: 9px;
  background: #edf4ff;
  color: #174f9d;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.day-center-item-open:hover { background: #d8e8ff; }
.day-center-empty { padding: 15px; color: #5f7466; font-size: 13px; background: #f7fbf8; }
.day-center-actions { position: sticky; bottom: -24px; padding: 12px 0 0; background: #fff; }

#containersTable tr.pickup-tomorrow-row td:first-child {
  border-left: 4px solid #e1a100;
}
.container-pickup-tomorrow-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid #e0b349;
  border-radius: 999px;
  background: #fff4ce;
  color: #795300;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: .04em;
  vertical-align: middle;
}

.day-center-highlight {
  animation: dayCenterHighlight 2.8s ease-out;
  outline: 3px solid #efad22 !important;
  outline-offset: -2px;
}
@keyframes dayCenterHighlight {
  0%, 45% { background-color: #fff1bd; }
  100% { background-color: inherit; }
}

@media (max-width: 700px) {
  #historyModal .history-modal-content { width: 98vw; padding: 16px 12px; }
  .history-filters { grid-template-columns: 1fr; }
  .history-list { max-height: 54vh; }
  #dayCenterModal .day-center-modal-content { width: 98vw; padding: 16px 12px; }
  .day-center-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .day-center-card { min-height: 74px; padding: 9px; }
  .day-center-card-icon { font-size: 23px; }
  .day-center-card-count { font-size: 22px; }
  .day-center-item { align-items: flex-start; padding: 10px; }
}

@media (max-width: 480px) {
  .global-stats-open-btn span:last-child { display: none; }
  .global-stats-open-btn { padding: 7px 9px; font-size: 17px; }
  .history-open-btn span:last-child { display: none; }
  .history-open-btn { padding: 7px 9px; font-size: 17px; }
  .history-item { grid-template-columns: auto minmax(0, 1fr); }
  .history-item-action { grid-column: 1 / -1; width: 100%; }
  .day-center-open-btn span:last-child { display: none; }
  .day-center-open-btn { padding: 7px 9px; font-size: 17px; }
  .sync-status { padding: 6px 8px; font-size: 12px; }
  .global-logout-btn { padding: 7px 9px; font-size: 17px; }
  .global-logout-btn .btn-text { display: none; }
  .day-center-summary { grid-template-columns: 1fr; }
  .day-center-item { flex-direction: column; }
  .day-center-item-open { align-self: stretch; }
}



/* --- Driver: estetyczny przycisk Wyloguj z prawej strony --- */
.driver-controls-row { align-items: center; }
.driver-controls-spacer { flex: 1 1 auto; }
.driver-btn-logout /* no longer used */ {
  margin-left: auto;
  background: #ffeaea;
  color: #b70000;
  border: 1.5px solid #f3bcbc;
}
.driver-btn-logout /* no longer used */:hover {
  background: #ffd3d3;
  color: #990a0a;
}
@media (max-width: 700px) {
  .driver-controls-spacer { display: none; }
  .driver-btn-logout /* no longer used */ { width: 100%; }
}


.controls-spacer{ flex:1 1 auto; }

.panel-logout-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}
.panel-logout-top .driver-btn-logout {
  margin-left: 0;
}


/* ===== Global user bar ===== */
.global-userbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
  gap:6px;
  padding:4px 8px;
  margin-bottom:6px;
  background:#f5f5f5;
  border:1px solid #ddd;
  border-radius:6px;
}
#globalLoggedAs{
  font-size:0.95em;
  color:#333;
}
#globalLogoutBtn{
  background:#ffeaea;
  color:#b70000;
  border:1.5px solid #f3bcbc;
  padding:4px 8px;
}
#globalLogoutBtn:hover{
  background:#ffd3d3;
  color:#990a0a;
}
@media (max-width: 700px){
  #globalLogoutBtn{
    padding:4px 6px;
  }
  #globalLogoutBtn::after{
    content:"";
  }
  #globalLogoutBtn{
    font-size:1.2em;
  }
  #globalLogoutBtn span{ display:none; }
}

/* Modal: Zakres operacji JSON – estetyczny układ */
#jsonScopeModal .modal-content {
  max-width: 520px;               /* niech okno będzie zgrabne */
}

#jsonScopeModal h3 {
  margin-top: 0;
}

#jsonScopeModal .json-scope {
  display: flex;
  flex-direction: column;
  gap: 6px;                        /* odstęp między opcjami */
  margin: 12px 0 4px;
}

#jsonScopeModal .option {
  display: flex;                   /* radio i tekst obok siebie */
  align-items: center;             /* pionowe wyrównanie */
  gap: 10px;                       /* odstęp radio–tekst */
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease;
}

/* delikatny hover/focus dla lepszej dostępności */
#jsonScopeModal .option:hover,
#jsonScopeModal .option:has(input:focus-visible) {
  background: rgba(0,0,0,.04);
  box-shadow: 0 0 0 2px rgba(0,0,0,.05) inset;
}

/* lekko większe, czytelne "radio" */
#jsonScopeModal input[type="radio"] {
  transform: scale(1.1);
  margin: 0;                       /* usuń ewentualne przesunięcia */
}

/* przyciski na dole w jednej linii z odstępem */
#jsonScopeModal .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
 /* Opcje wyboru w modalu JSON — tekst po lewej, radio po prawej */
#jsonScopeModal .modal-content {
  max-width: 420px;
}

#jsonScopeModal .json-scope {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
}

#jsonScopeModal .option {
  display: flex;
  justify-content: space-between; /* tekst po lewej, radio po prawej */
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

#jsonScopeModal .option:hover {
  background: rgba(0, 0, 0, 0.05);
}

#jsonScopeModal input[type="radio"] {
  transform: scale(1.2);
  accent-color: #0077cc;
}

#jsonScopeModal .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}


/* Modal JSON – estetyczny układ: tekst po lewej, radio po prawej */
#jsonScopeModal .modal-content { max-width: 520px; }

#jsonScopeModal .json-scope {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

/* Każda opcja jako dwa kolumny: 1) tekst 2) radio */
#jsonScopeModal .option {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 8px 12px;
  border-radius: 10px;
  background: transparent;
  border: 0;
  box-shadow: none;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease;
}

/* podświetlenie na hover/focus */
#jsonScopeModal .option:hover,
#jsonScopeModal .option:has(input:focus-visible) {
  background: rgba(0,0,0,.04);
  box-shadow: 0 0 0 2px rgba(0,0,0,.05) inset;
}

/* twardy reset starych "belek" z globalnych styli */
#jsonScopeModal .option::before,
#jsonScopeModal .option::after { content: none !important; }
#jsonScopeModal .option * { box-shadow: none !important; }

/* Radio po prawej – normalne, niepełnoekranowe */
#jsonScopeModal input[type="radio"] {
  -webkit-appearance: auto;
  -moz-appearance: auto;
  appearance: auto;
  width: 18px; height: 18px;
  margin: 0;
  background: transparent;
  border: none;
  flex: 0 0 auto;
  transform: none;
}

/* Przyciski na dole */
#jsonScopeModal .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}

#toggleTaskArchive{display:none!important;}

/* ADD BTN GREEN */
#addBtn{
  background:#2e7d32 !important;
  color:#fff !important;
  border:1px solid #225d27 !important;
}
#addBtn:hover{ filter:brightness(0.95); }
.plus-red{ color:#c40000; font-weight:800; margin-right:6px; }


/* ADD BTN — style like driver main, color RAL 6010 (approx) */
#addBtn{
  padding: 10px 17px;
  border-radius: 10px;
  border: 1.5px solid #2F541F;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.16s, color 0.16s, box-shadow 0.16s;
  background: #3D6D2C;
  color: #fff;
  box-shadow: 0 1.5px 5px rgba(50,80,50,0.12);
  min-height: 42px;
}
#addBtn:hover{
  background: #365E27;
}
#addBtn .plus-white{
  color: #fff;
  font-weight: 800;
  margin-right: 6px;
}


/* === ADD BAG BTN – match #addBtn styling and ensure white plus === */
#addBagBtn{
  background:#2e7d32 !important;
  color:#fff !important;
  border:1px solid #225d27 !important;
}
#addBagBtn:hover{ filter:brightness(0.95); }

/* detailed styling (copied from #addBtn for visual parity) */
#addBagBtn{
  padding: 10px 17px;
  border-radius: 10px;
  border: 1.5px solid #2F541F;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.16s, color 0.16s, box-shadow 0.16s;
  background: #3D6D2C;
  color: #fff !important;
  box-shadow: 0 1.5px 5px rgba(50,80,50,0.12);
  min-height: 42px;
}
#addBagBtn:hover{
  background: #365E27;
}

/* force the plus to be white and bold inside the bag button */
#addBagBtn .plus-white{
  color:#fff !important;
  font-weight:800;
  margin-right:6px;
}

/* --- ETA: nie ucinaj, pozwól zawijać --- */
#driverSchedule .driver-field-value[id^="eta-"] {
  white-space: normal;     /* zawijaj */
  overflow: visible;       /* nic nie obcinaj */
  text-overflow: initial;  /* wyłącz "..." jeśli było */
  line-height: 1.25;
}



/* --- Driver day summary bar --- */
.driver-day-summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:4px 0 10px 0;
  padding:8px 10px;
  font-size:13px;
  background:#eef3fb;
  border:1px solid #cfd9ee;
  border-radius:10px;
}
.driver-day-total{
  font-weight:600;
}
.driver-recalc-btn{
  padding:4px 10px;
  font-size:12px;
  line-height:1.2;
  border-radius:10px;
  border:1px solid #bfcde6;
  background:#f7f9fd;
  color:#2d3a4b;
  cursor:pointer;
}
.driver-recalc-btn:hover{
  background:#e9f0fb;
}
.driver-recalc-btn:active{
  transform: translateY(1px);
}


/* --- Adjust driver recalc button size (slightly larger) --- */
.driver-recalc-btn{
  font-size:14px;
  padding:6px 14px;
  border-radius:12px;
  font-weight:600;
}


/* Stabilizacja wysokości etykiety i wartości w wierszu kierowcy */
#driverSchedule .driver-field-label{ line-height:1.1; min-height: 13px; }
#driverSchedule .driver-field-value{ line-height:1.25; }


/* --- DRIVER: wyrównanie 'kafelków' do górnej krawędzi i stabilne wymiary --- */
#driverSchedule .driver-task-row .driver-task-data{ align-items:flex-start !important; }
#driverSchedule .driver-field{ align-self:flex-start !important; }

/* Stała wysokość linii dla etykiet i wartości */
#driverSchedule .driver-field-label{
  display:block;
  line-height:14px;
  min-height:14px;
}
#driverSchedule .driver-field-value{
  display:block;
  line-height:20px;
}

/* Adres pod klientem – własne zasady w obrębie drivera */
#driverSchedule .driver-field-value .small{
  display:block;
  font-size:12px;
  color:#6d86a6;
  line-height:16px;
  margin-top:2px;
}


/* Wspólne przełączniki widoku: Kontenery oraz Worki Big Bag */
.panel-view-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 10px 0;
  padding: 8px;
  border: 1px solid #d6dfeb;
  border-radius: 12px;
  background: #f7f9fc;
}
.panel-view-tabs > button {
  display: inline-flex;
  flex: 0 1 220px;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  cursor: pointer;
  border: 1px solid #b8c6d8;
  border-radius: 9px;
  background: #eef3f9;
  color: #365a82;
  box-shadow: 0 1px 3px rgba(47, 78, 112, .06);
  font-family: inherit;
  font-size: 14px;
  font-weight: 750;
  transition: background .16s, border-color .16s, color .16s, box-shadow .16s;
}
.panel-view-tabs > button:hover {
  border-color: #829bb8;
  background: #e3ebf5;
  color: #234d78;
}
.panel-view-tabs > button.active {
  border-color: #2f6eae;
  background: #2f6eae;
  color: #fff;
  box-shadow: 0 2px 7px rgba(47, 110, 174, .2);
}
.panel-view-tabs > button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(47, 110, 174, .2);
}
#bagPickupSortControl {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  color: #365a82;
  font-size: 14px;
  font-weight: 700;
}
#bagPickupSortControl[hidden] {
  display: none !important;
}
#bagPickupSort {
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid #b8c6d8;
  border-radius: 6px;
  background: #fff;
  color: #24384f;
  font: inherit;
}
@media (max-width: 620px) {
  .panel-view-tabs > button {
    flex: 1 1 145px;
  }
  #bagPickupSortControl {
    width: 100%;
    margin-left: 0;
  }
  #bagPickupSort {
    flex: 1 1 auto;
    min-width: 0;
  }
}

/* ==========================================================================
   FIX: Ikony w kolumnie „Status” nie mogą się ucinać
   - dotyczy wszystkich tabel gdzie status jest renderowany jako kilka ikon
   - tylko rozszerza/odblokowuje overflow w tej kolumnie
   ========================================================================== */
#containersTable th:nth-child(9),
#containersTable td:nth-child(9),
#containersTable th:nth-child(10),
#containersTable td:nth-child(10) {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  width: 112px !important; /* miejsce na 2–3 ikonki */
  text-align: center;
}

#bagsTable th:nth-child(10),
#bagsTable td:nth-child(10),
#bagsPickupTable th:nth-child(10),
#bagsPickupTable td:nth-child(10) {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  min-width: 112px;
  text-align: center;
}

/* Modułowa trasa zlecenia */
#taskModal .task-modal-content,
.transport-modal-content {
  width: min(920px, calc(100vw - 32px));
  max-width: 920px;
  box-sizing: border-box;
  max-height: 94vh;
  overflow-y: auto;
}

#taskModal .transport-assignment-fields,
.transport-modal-content .transport-assignment-fields {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px 16px;
  margin-top: 6px;
  padding: 16px;
  border-radius: 13px;
}

#taskModal .transport-assignment-title,
.transport-modal-content .transport-assignment-title {
  grid-column: 1 / -1;
  color: #1f3b64;
  font-size: 16px;
  font-weight: 700;
}

#taskModal .transport-assignment-fields label,
.transport-modal-content .transport-assignment-fields label {
  min-width: 0;
}

#taskModal .transport-assignment-fields select,
.transport-modal-content .transport-assignment-fields select {
  min-height: 46px;
  margin: 4px 0 0 !important;
  font-size: 16px !important;
}

.task-route-builder {
  margin: 16px 0 4px;
  padding: 14px;
  border: 1px solid #cfd8e6;
  border-radius: 14px;
  background: #f7f9fc;
}

.task-route-builder__header h4 {
  margin: 0;
  color: #1f3b64;
  font-size: 17px;
}

.task-route-builder__header p {
  margin: 4px 0 0;
  color: #65758b;
  font-size: 13px;
}

.task-route-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.task-route-quick-actions button {
  padding: 7px 11px;
  border: 1px solid #aebdd2;
  border-radius: 9px;
  background: #fff;
  color: #25466f;
  font-weight: 700;
  cursor: pointer;
}

.task-route-quick-actions button:hover {
  background: #e8f0fb;
  border-color: #7794bc;
}

.task-route-steps {
  display: grid;
  gap: 9px;
}

.task-route-step {
  display: grid;
  grid-template-columns: 38px minmax(155px, .9fr) minmax(210px, 1.35fr) minmax(150px, .8fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid #d6deea;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(31,59,100,.06);
}

.task-route-step__number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #245f9e;
  color: #fff;
  font-weight: 800;
}

.task-route-step select,
.task-route-step input {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 8px;
  border: 1px solid #bdc9d9;
  border-radius: 8px;
  background: #fff;
}

.task-route-step__actions {
  display: flex;
  gap: 4px;
}

.task-route-step__actions button {
  width: 31px;
  height: 31px;
  padding: 0;
  border: 1px solid #b8c5d6;
  border-radius: 8px;
  background: #eef3f9;
  color: #294b75;
  cursor: pointer;
}

.task-route-step__actions button[data-route-remove] {
  border-color: #e2b2b2;
  background: #fff0f0;
  color: #a51d1d;
}

.task-route-step__actions button:disabled {
  opacity: .35;
  cursor: default;
}

.task-route-help {
  display: block;
  margin-top: 10px;
  color: #68788e;
  line-height: 1.35;
}

.driver-route {
  grid-column: 1 / -1;
  flex: 1 0 100%;
  width: 100%;
  box-sizing: border-box;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid #c8d7ea;
  border-radius: 12px;
  background: linear-gradient(135deg, #f5f9ff, #eef4fb);
}

.driver-route__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.driver-route__title {
  color: #193c67;
  font-weight: 800;
}

.driver-route__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.driver-route__buttons button {
  padding: 6px 9px;
  border: 1px solid #7e9fc5;
  border-radius: 8px;
  background: #fff;
  color: #1f578f;
  font-weight: 700;
  cursor: pointer;
}

.driver-route__list {
  display: grid;
  gap: 5px;
}

.driver-route__step {
  display: grid;
  grid-template-columns: 25px minmax(120px, .8fr) minmax(180px, 1.4fr) auto;
  gap: 7px;
  align-items: center;
  min-height: 34px;
}

.driver-route__step-number {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #2b6dac;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.driver-route__step-action {
  color: #27486f;
  font-weight: 750;
}

.driver-route__step-address {
  color: #26384f;
}

.driver-route__step-detail {
  color: #6b7788;
  font-size: 12px;
}

.driver-route__nav {
  padding: 4px 7px;
  border: 1px solid #a8bad1;
  border-radius: 7px;
  background: #fff;
  color: #23598f;
  cursor: pointer;
}

@media (max-width: 800px) {
  .task-route-step {
    grid-template-columns: 34px 1fr auto;
  }
  .task-route-step select,
  .task-route-step input {
    grid-column: 2 / 3;
  }
  .task-route-step__number { grid-row: 1 / 4; }
  .task-route-step__actions { grid-column: 3; grid-row: 1 / 4; flex-direction: column; }
  .driver-route__step { grid-template-columns: 25px 1fr auto; }
  .driver-route__step-address,
  .driver-route__step-detail { grid-column: 2 / 3; }
  .driver-route__nav { grid-column: 3; grid-row: 1 / 4; }
}

/* Osobny moduł Logistyka */
.driver-list-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.driver-list-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #b8c6d8;
  border-radius: 9px;
  background: #eef3f9;
  color: #365a82;
  font-family: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.driver-list-tabs button.active {
  border-color: #2f6eae;
  background: #2f6eae;
  color: #fff;
  box-shadow: 0 2px 7px rgba(47, 110, 174, .2);
}

.driver-transport-tabs {
  padding: 8px;
  border: 1px solid #d6dfeb;
  border-radius: 12px;
  background: #f7f9fc;
}

.driver-transport-tabs button {
  flex: 0 1 190px;
}

.driver-status-tabs {
  margin-top: 8px;
}

.driver-vehicle-tabs {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid #d6dfeb;
  border-radius: 12px;
  background: #f7f9fc;
}

.driver-vehicle-tabs[hidden],
.driver-vehicle-tabs button[hidden] {
  display: none !important;
}

.driver-vehicle-tabs button {
  flex: 0 1 190px;
}

.driver-date-group {
  margin-top: 10px;
}

.driver-date-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  border: 1px solid #b8c6d8;
  border-radius: 8px;
  background: #e0e6ef;
  color: #1f3b64;
  font-family: inherit;
  font-size: 14px;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.driver-date-toggle:hover {
  background: #d5dfed;
}

.driver-date-toggle__chevron {
  flex: 0 0 auto;
  font-size: 13px;
}

.driver-date-content[hidden] {
  display: none !important;
}

#showArchiveBtn[hidden] {
  display: none !important;
}

.transport-assignment-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #cbd7e7;
  border-radius: 10px;
  background: #f4f7fb;
}

.transport-assignment-fields[hidden] {
  display: none !important;
}

.transport-assignment-fields label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  color: #243d67;
  font-weight: 600;
}

.transport-assignment-fields select {
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
}

.transport-vehicle-note {
  display: block;
  color: #65758b;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.transport-assignment-title {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .transport-assignment-fields { grid-template-columns: 1fr; }
  #taskModal .task-modal-content {
    width: calc(100vw - 20px);
    padding: 24px 18px 20px;
    margin: 10px auto;
  }
  .transport-modal-content {
    width: calc(100vw - 20px);
    padding: 24px 18px 20px;
    margin: 10px auto;
  }
  #taskModal .transport-assignment-fields,
  .transport-modal-content .transport-assignment-fields {
    grid-template-columns: 1fr;
  }
}

#logisticsModal {
  z-index: 1460;
  padding: 0 !important;
  align-items: stretch !important;
  justify-content: stretch !important;
}
#logisticsModal .logistics-modal-content {
  width: 100vw !important;
  min-width: 100% !important;
  max-width: none !important;
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 100% !important;
  max-height: none !important;
  margin: 0 !important;
  box-sizing: border-box;
  border-radius: 0 !important;
  overflow-y: auto;
  padding: 22px 28px;
}

.logistics-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-right: 48px;
}
.logistics-header h3 { margin: 0; color: #243d67; }
.logistics-header p { margin: 5px 0 14px; color: #68788e; font-size: 13px; }
.logistics-top-close {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 4;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #b8c6d8;
  border-radius: 10px;
  background: #fff;
  color: #365a82;
  box-shadow: 0 2px 8px rgba(36, 61, 103, .15);
  font-family: inherit;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.logistics-top-close:hover {
  border-color: #d19a9a;
  background: #fff0f0;
  color: #9b2929;
}
.logistics-top-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(47, 110, 174, .22);
}
@media (max-width: 620px) {
  .logistics-header { padding-right: 42px; }
  .logistics-top-close {
    top: 9px;
    right: 9px;
    width: 38px;
    height: 38px;
  }
}

.logistics-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  gap: 12px;
  padding: 12px;
  border: 1px solid #d2dbea;
  border-radius: 12px;
  background: #f6f8fc;
}

.logistics-toolbar label { margin: 0; font-weight: 750; color: #314967; }
.logistics-toolbar input,
.logistics-toolbar select,
.logistics-task-add select {
  width: 100%;
  box-sizing: border-box;
  margin: 5px 0 0;
  padding: 9px 10px;
  border: 1px solid #b8c6d8;
  border-radius: 8px;
  background: #fff;
}

.logistics-view-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
  padding-bottom: 2px;
  border-bottom: 1px solid #d6dfeb;
}

.logistics-view-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  border: 1px solid #b8c6d8;
  border-bottom-color: #91a5be;
  border-radius: 9px 9px 0 0;
  background: #eef3f9;
  color: #365a82;
  font-weight: 800;
  cursor: pointer;
}

.logistics-view-tabs button.active {
  border-color: #2f6eae;
  background: #2f6eae;
  color: #fff;
}

.logistics-archive-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  box-sizing: border-box;
  border-radius: 11px;
  background: rgba(255,255,255,.88);
  color: #2f6399;
  font-size: 12px;
}

.logistics-current-view[hidden],
.logistics-archive-view[hidden] { display: none !important; }

.logistics-add-panel {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 1.1fr);
  gap: 12px;
  margin: 12px 0;
}

.logistics-fixed-buttons,
.logistics-task-add {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.logistics-task-add {
  flex-direction: column;
  align-items: stretch;
}

.logistics-order-tabs,
.logistics-task-add__controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  width: 100%;
}

.logistics-task-add .logistics-order-tabs button {
  flex: 1 1 145px;
  min-height: 38px;
  border-color: #b8c6d8;
  background: #eef3f9;
  color: #365a82;
}

.logistics-task-add .logistics-order-tabs button.active {
  border-color: #2f6eae;
  background: #2f6eae;
  color: #fff;
}

.logistics-task-add .logistics-order-tabs button:disabled {
  border-color: #d4dbe5;
  background: #f3f5f8;
  color: #9aa5b3;
  box-shadow: none;
  cursor: not-allowed;
  opacity: .72;
}

.logistics-fixed-buttons button,
.logistics-task-add button,
.logistics-map-header button {
  padding: 8px 11px;
  border: 1px solid #8ca4c2;
  border-radius: 8px;
  background: #fff;
  color: #264e7b;
  font-weight: 750;
  cursor: pointer;
}

.logistics-task-add select { flex: 1 1 220px; margin: 0; }

.driver-empty-list {
  margin-top: 12px;
  padding: 18px;
  border: 1px dashed #c2cfde;
  border-radius: 12px;
  background: #f8fafc;
  color: #68788e;
  text-align: center;
  font-size: 14px;
}

@media (max-width: 640px) {
  .driver-transport-tabs button,
  .driver-vehicle-tabs button,
  .logistics-order-tabs button,
  .logistics-task-add__controls > * {
    flex: 1 1 100%;
  }
}

.logistics-steps {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 64px;
  padding: 11px;
  border: 1px dashed #b9c7da;
  border-radius: 12px;
  background: #fbfcfe;
  max-height: none;
  overflow-y: visible;
}

.logistics-empty {
  padding: 16px;
  color: #77859a;
  text-align: center;
}

.logistics-step {
  display: grid;
  grid-template-columns: 36px 36px minmax(170px, .8fr) minmax(250px, 1.4fr) auto;
  gap: 9px;
  align-items: center;
  padding: 10px;
  border: 1px solid #d2dceb;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(35,65,110,.07);
}

.logistics-step--task { border-left: 5px solid #2677bd; }
.logistics-step--base { border-left: 5px solid #5f9b54; }
.logistics-step--dump { border-left: 5px solid #a87834; }
.logistics-step--custom { border-left: 5px solid #7d66c8; }

.logistics-step__number {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: #315f94;
  color: #fff;
  font-weight: 850;
}

.logistics-step__icon { font-size: 23px; text-align: center; }
.logistics-step__main { min-width: 0; }
.logistics-step__title { color: #243f63; font-weight: 800; line-height: 1.25; }
.logistics-step__meta { margin-top: 3px; color: #6e7d90; font-size: 12px; line-height: 1.3; }

.logistics-step input {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 8px;
  border: 1px solid #bdc9d9;
  border-radius: 8px;
}

.logistics-step__actions { display: flex; gap: 4px; }
.logistics-step__actions button {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #afbed1;
  border-radius: 8px;
  background: #edf3fa;
  color: #284f7a;
  cursor: pointer;
}
.logistics-step__actions button[data-logistics-remove] { background:#fff0f0; border-color:#e5b6b6; color:#a41f1f; }
.logistics-step__actions button:disabled { opacity:.35; cursor:default; }

.logistics-map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 16px 0 8px;
}
.logistics-map-header strong { display:block; color:#243f63; }
#logisticsRouteSummary { display:block; margin-top:3px; color:#68788e; font-size:12px; }
.logistics-map {
  width: 100%;
  height: 46vh;
  min-height: 420px;
  max-height: 650px;
  overflow: hidden;
  border: 1px solid #c8d3e2;
  border-radius: 13px;
  background: #eef2f7;
}
.logistics-map-placeholder { display:grid; place-items:center; height:100%; padding:20px; box-sizing:border-box; color:#718095; text-align:center; }
.logistics-sync-note {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  background: #eef6ff;
  color: #315c89;
  font-size: 12px;
}

.logistics-archive-view {
  margin: 12px 0 16px;
  min-height: 260px;
  padding: 14px;
  border: 1px solid #d2dbea;
  border-radius: 12px;
  background: #f7f9fc;
}

.logistics-archive-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
  color: #243f63;
}

.logistics-archive-header span {
  color: #65768d;
  font-size: 12px;
}

.logistics-archive-list { display: grid; gap: 10px; }

.logistics-archive-empty {
  padding: 36px 16px;
  border: 1px dashed #b9c7da;
  border-radius: 10px;
  background: #fff;
  color: #77859a;
  text-align: center;
}

.logistics-archive-segment {
  padding: 11px;
  border: 1px solid #cbd8e7;
  border-left: 5px solid #4b8b50;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(35,65,110,.06);
}

.logistics-archive-segment__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
  color: #285936;
}

.logistics-archive-segment__header span {
  color: #68788e;
  font-size: 12px;
}

.logistics-archive-segment__steps {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 7px;
}

.logistics-archive-step {
  display: grid;
  grid-template-columns: 25px 27px minmax(145px, 1fr);
  align-items: center;
  gap: 7px;
  flex: 1 1 235px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #d6dfeb;
  border-radius: 9px;
  background: #f9fbfd;
  color: #294566;
}

.logistics-archive-step__number {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #5c7898;
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}

.logistics-archive-step__icon { font-size: 19px; text-align: center; }
.logistics-archive-step small { display: block; margin-top: 2px; color: #718096; font-size: 11px; font-weight: 500; }
.logistics-archive-step--task { border-left: 4px solid #2677bd; }
.logistics-archive-step--base { border-left: 4px solid #5f9b54; }
.logistics-archive-step--dump { border-left: 4px solid #a87834; }
.logistics-archive-step--custom { border-left: 4px solid #7d66c8; }

.logistics-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  padding-bottom: 2px;
}
.logistics-actions .logistics-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  width: auto !important;
  min-width: 130px;
  height: auto !important;
  min-height: 42px;
  margin: 0 !important;
  padding: 10px 18px !important;
  border: 1px solid transparent !important;
  border-radius: 10px !important;
  font-size: 15px !important;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
}
.logistics-actions .logistics-action-btn--danger {
  border-color: #e3aaaa !important;
  background: #fff0f0 !important;
  color: #a51c1c !important;
}
.logistics-actions .logistics-action-btn--danger:hover { background: #ffdede !important; color: #861313 !important; }
.logistics-actions .logistics-action-btn--primary {
  border-color: #2d68c6 !important;
  background: #3476e1 !important;
  color: #fff !important;
}
.logistics-actions .logistics-action-btn--primary:hover { background: #245fbd !important; }
.logistics-actions .logistics-action-btn--secondary {
  border-color: #b6cbe2 !important;
  background: #fff !important;
  color: #315b84 !important;
}
.logistics-actions .logistics-action-btn--secondary:hover { background: #f0f5fb !important; color: #183f68 !important; }

@media (max-width: 760px) {
  .logistics-toolbar,
  .logistics-add-panel { grid-template-columns: 1fr; }
  .logistics-step { grid-template-columns: 32px 30px 1fr auto; }
  .logistics-step__address,
  .logistics-step input { grid-column: 3 / 4; }
  .logistics-step__actions { grid-column:4; grid-row:1 / 3; flex-direction:column; }
  #logisticsModal .logistics-modal-content { padding: 14px 12px; }
  .logistics-steps { max-height: none; overflow-y: visible; }
  .logistics-map { height: 38vh; min-height: 280px; }
  .logistics-map-header { align-items:flex-start; flex-direction:column; }
  .logistics-view-tabs button { flex: 1 1 165px; justify-content: center; }
  .logistics-archive-header,
  .logistics-archive-segment__header { align-items: flex-start; flex-direction: column; }
  .logistics-actions .logistics-action-btn { flex: 1 1 145px; min-width: 0; }
}
