/* ==========================================================================
   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; }
.filters {
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ==========================================================================
   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-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;
}
.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; }

/* ==========================================================================
   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;
}

/* 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 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; }
/* Ukrywanie przycisków zakładek wg uprawnień */
.tabs .tabBtn.hidden { display: none !important; }



/* --- 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;
  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;
}


/* === Worki: przełączniki (Worki / Zlecenia odbioru) jak Bieżące/Planowane kontenery === */
#bagViewButtons { margin: 10px 0; }
#bagViewButtons button {
  margin-right: 6px;
  padding: 6px 12px;
  cursor: pointer;
  border: 1px solid #007bff;
  background-color: white;
  color: #007bff;
  border-radius: 3px;
  font-weight: 600;
}
#bagViewButtons button.active {
  background-color: #007bff;
  color: white;
}

/* ==========================================================================
   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;
}
