*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #1a1a2e;
  --card: #16213e;
  --card2: #0f3460;
  --border: #1e2a4a;
  --accent: #1a73e8;
  --accent2: #58a6ff;
  --text: #eaeaea;
  --text2: #a0a0b0;
  --green: #3fb950;
  --yellow: #d29922;
  --red: #f85149;
  --orange: #e3b341;
  --radius: 12px;
  --font: 'Segoe UI', system-ui, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
}

body.login-page {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Ekran logowania */
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}
.logo { font-size: 28px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.logo span { color: var(--text); }
.subtitle { color: var(--text2); font-size: 16px; margin-bottom: 40px; }
.form-group { width: 100%; margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; color: var(--text); margin-bottom: 6px; }
.form-group input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--card2);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 18px;
  padding: 14px 16px;
  outline: none;
  transition: border-color .2s;
}
.form-group input:focus { border-color: var(--accent); }
.form-group input::placeholder { color: var(--text2); font-size: 16px; }
.btn {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  padding: 16px;
  cursor: pointer;
  transition: opacity .2s;
  margin-top: 8px;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:active:not(:disabled) { opacity: .8; }
.error-msg { color: var(--red); font-size: 14px; margin-bottom: 12px; display: none; }
.error-msg.show { display: block; }

/* Nagłówek */
.header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10000;
}
.header-logo { font-size: 20px; font-weight: 700; color: var(--accent2); letter-spacing: -.5px; }
.header-logo span { color: var(--text); }
.header-meta { font-size: 13px; color: var(--text2); }
.live-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--green);
  border-radius: 50%;
  margin-right: 6px;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

.header-nav-desktop {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 16px;
}

/* Menu hamburger + pasek statusu — mobile */
.header-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 0 4px 12px;
  margin-left: auto;
}
.header-menu-mobile {
  display: none;
  flex-direction: column;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 4px 16px 12px;
  position: fixed;
  left: 0;
  right: 0;
  z-index: 9999;
  max-height: calc(100vh - var(--header-h, 56px));
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.header-menu-mobile.open { display: flex; }
.header-menu-mobile a,
.header-menu-mobile button {
  color: var(--text2);
  text-decoration: none;
  font-size: 14px;
  text-align: left;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  padding: 12px 4px;
  cursor: pointer;
}
.header-menu-mobile a.active { color: var(--text); font-weight: 600; }
#header-user-info-mobile { display: flex; flex-direction: column; }
#header-user-info-mobile a,
#header-user-info-mobile button {
  display: block;
  width: 100%;
  margin: 0 !important;
  box-sizing: border-box;
  text-align: left;
}
@media (max-width: 700px) {
  .header { padding: 12px 16px; }
  .header-nav-desktop, .header-meta { display: none; }
  .header-toggle { display: block; }
}

/* Telefony/tablety z ekranem dotykowym — hamburger niezależnie od orientacji (portrait/landscape) */
@media (pointer: coarse) and (max-width: 1024px) {
  .header-nav-desktop, .header-meta { display: none; }
  .header-toggle { display: block; }
}

/* Layout główny */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
/* Spacer tymczasowy na dole strony — wysokość i widoczność ustawiane przez JS
   tylko na czas przewijania do kotwicy #sekcja-* (patrz dashboard.html), dokładnie
   na tyle ile brakuje do wymaganej pozycji scrolla. Bez niego na niższych viewportach
   przeglądarka nie ma dokąd przewinąć #sekcja-raporty, więc scroll-margin-top nie może
   schować nagłówka "📋 Raporty" pod fixed headerem. Musi być po footerze, bo scrollHeight
   już uwzględnia jego wysokość. Domyślnie ukryty (height:0), żeby nie zostawiać pustej
   przestrzeni na dole strony w normalnym użyciu. */
#scroll-spacer { display: none; height: 0; }

/* Liczniki statusów */
.counters {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.counter-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, transform .1s;
}
.counter-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.counter-card.active { border-color: var(--accent); background: var(--card2); }
.counter-num {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
}
.counter-label { font-size: 12px; color: var(--text2); text-transform: uppercase; letter-spacing: .5px; }
.counter-icon { font-size: 20px; margin-bottom: 4px; }

/* Sekcja mapa + feed */
.map-feed {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
  height: 480px;
}

.map-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.map-col .section-search-wrap {
  flex-shrink: 0;
  margin-bottom: 0;
}

.map-search-row,
.section-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.section-search-row { margin-bottom: 8px; }
.map-search-row .section-search-wrap,
.section-search-row .section-search-wrap {
  flex: 1;
  min-width: 160px;
  margin-bottom: 0;
}
.map-search-row .filter-select,
.section-search-row .filter-select,
.section-search-row .multiselect {
  flex-shrink: 0;
  width: auto;
}
.section-date-filter-row,
.map-filter-row { display: contents; }
.section-date-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Mapa */
.map-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  flex: 1;
  min-height: 0;
}
.map-card-title {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 500;
  background: rgba(13,17,23,.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
#map { width: 100%; height: 100%; }

/* Popup mapy */
.leaflet-popup-content-wrapper {
  background: var(--card2) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.5) !important;
}
.leaflet-popup-tip { background: var(--card2) !important; }
.popup-name { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.popup-nr { color: var(--accent2); font-size: 13px; margin-bottom: 8px; }
.popup-status { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.popup-time { color: var(--text2); font-size: 12px; margin-top: 6px; }
.popup-trasa { color: var(--text2); font-size: 12px; margin-top: 2px; }

/* Feed */
.feed-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.feed-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.feed-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.feed-item {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(48,54,61,.5);
  transition: background .2s;
  animation: slideIn .3s ease;
}
.feed-item:hover { background: var(--card2); }
.feed-item.new { background: rgba(26,115,232,.08); }
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.feed-time { font-size: 11px; color: var(--text2); margin-bottom: 3px; }
.feed-who { font-size: 13px; font-weight: 600; color: var(--accent2); }
.feed-action { font-size: 13px; color: var(--text); }
.feed-loc { font-size: 12px; color: var(--text2); margin-top: 2px; }
.feed-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}

/* Alerty */
.alerts-section { }
.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
}
.alert-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
/* Nieprzejrzane: pomarańczowy domyślnie, czerwony przy wielokrotnej eskalacji
   (liczba_eskalacji > 1) — realne rozróżnienie pilności, nie tylko "coś nie tak".
   Przejrzane wracają do neutralnej obwódki (--border), bo to już załatwiona sprawa,
   a nie nowy problem. */
.alert-card.warning { border-left-color: var(--orange); }
.alert-card.critical { border-left-color: var(--red); }
.alert-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.alert-body { flex: 1; }
.alert-title { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.alert-desc { font-size: 13px; color: var(--text2); }
.alert-time { font-size: 12px; color: var(--text2); margin-top: 4px; }

.alert-check-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.alert-check-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid var(--accent);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: border-color .15s, background .15s;
}
.alert-check-btn:hover { background: rgba(26, 115, 232, .12); }
.alert-check-btn:disabled { cursor: default; }
.alert-check-btn svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
  transition: stroke-dashoffset .25s ease-out;
}
.alert-check-btn.checked {
  background: var(--green);
  border-color: var(--green);
}
.alert-check-btn.checked svg { stroke-dashoffset: 0; }
.alert-check-label {
  font-size: 10px;
  color: var(--text2);
  white-space: nowrap;
}

/* Wyszukiwarka sekcji */
.section-search-wrap {
  position: relative;
  margin-bottom: 12px;
}
.section-search {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  padding: 8px 12px 8px 34px;
  outline: none;
  transition: border-color .2s;
}
.section-search:focus { border-color: var(--accent); }
.section-search::placeholder { color: var(--text2); }
.section-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  pointer-events: none;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.feed-item.search-hidden,
tr.search-hidden,
.alert-card.search-hidden { display: none; }

/* Tabela raportów */
.table-section { margin-top: 0; }
.filter-select {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  padding: 8px 28px 8px 12px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ctext x='8' y='12' font-size='16' font-weight='700' text-anchor='middle' fill='%238b949e'%3E%E2%96%BE%3C/text%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px 16px;
}
.filter-select:focus { border-color: var(--accent); }
/* Wymuszona ikonka kalendarza zamiast niespójnej strzałki natywnej kontrolki
   (różne przeglądarki mobilne renderują input[type=date] różnie — część pokazuje
   zwykłą strzałkę zamiast ikony kalendarza, więc rysujemy własną, spójną ikonę). */
input[type=date].filter-select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ctext x='8' y='13' font-size='14' text-anchor='middle'%3E%F0%9F%93%85%3C/text%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px 16px;
}
input[type=date].filter-select::-webkit-calendar-picker-indicator {
  opacity: 0;
  position: absolute;
  right: 0;
  width: 34px;
  height: 100%;
  cursor: pointer;
}
input[type=date].filter-select { position: relative; }

.nav-arrow-btn { background: var(--card2); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.nav-arrow-btn:disabled { opacity: .4; cursor: default; }

/* Wymusza jasny motyw natywnych kontrolek input[type=date] (w tym ikony kalendarza),
   bo aplikacja ma wyłącznie ciemne tło. Gdy pojawi się jasny motyw/przełącznik,
   ta reguła musi się przełączać dynamicznie (np. przez klasę na <html> zamiast sztywno). */
input[type=date] { color-scheme: dark; }

.multiselect { position: relative; display: inline-block; }
.multiselect-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  padding: 8px 12px;
  outline: none;
  cursor: pointer;
  white-space: nowrap;
}
.multiselect-btn:focus, .multiselect-btn:hover { border-color: var(--accent); }
.multiselect-btn-label { overflow: hidden; text-overflow: ellipsis; }
.multiselect-btn-arrow { color: var(--text2); font-size: 16px; font-weight: 700; flex-shrink: 0; line-height: 1; }
.multiselect-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 1100;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  min-width: 180px;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.multiselect-panel.hidden { display: none; }
.multiselect-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.multiselect-row:hover { background: var(--card2); }
.multiselect-row input[type="checkbox"] { cursor: pointer; accent-color: var(--accent); }
.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  overflow-y: auto;
  max-height: 70vh;
}
.table-wrap--rows7 { max-height: 460.5px; }
#sekcja-alerty, #sekcja-statusy-floty, #sekcja-raporty { scroll-margin-top: calc(var(--header-h-live, 76px) + 20px); }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--card2); }
th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .4px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card2);
  z-index: 1;
}
td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid rgba(48,54,61,.5);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--card2); }
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.badge-w-trasie { background: rgba(63,185,80,.15); color: var(--green); }
.badge-zaladunek { background: rgba(26,115,232,.15); color: var(--accent2); }
.badge-rozladunek { background: rgba(88,166,255,.15); color: #79c0ff; }
.badge-oczekiwanie { background: rgba(210,153,34,.15); color: var(--yellow); }
.badge-odpoczynek { background: rgba(139,148,158,.15); color: var(--text2); }
.badge-tankowanie { background: rgba(248,81,73,.15); color: var(--red); }
.badge-myjnia { background: rgba(63,185,80,.15); color: var(--green); }
.badge-temp { background: rgba(248,81,73,.15); color: var(--red); }
.badge-dokument { background: rgba(210,153,34,.15); color: var(--yellow); }
.badge-lokalizacja { background: rgba(26,115,232,.15); color: var(--accent2); }

/* Miniatury zdjęć w komórce tabeli */
.thumb-row { display: flex; gap: 4px; align-items: center; flex-wrap: nowrap; }
.thumb-row img {
  width: 36px; height: 28px; object-fit: cover; border-radius: 4px;
  cursor: pointer; border: 1px solid var(--border); flex-shrink: 0;
}
.thumb-row .thumb-more {
  font-size: 11px; color: var(--text2); white-space: nowrap; padding-left: 2px;
}
.thumb-row-empty { color: var(--text2); }

.split-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.split-cell .top { font-weight: 600; }
.split-cell .bottom { font-size: 12px; color: var(--text2); }
.split-cell .top.link, .split-cell .bottom.link { color: var(--accent2); cursor: pointer; text-decoration: none; }
.split-cell .top.link:hover, .split-cell .bottom.link:hover { text-decoration: underline; }
td .link { color: var(--accent2); cursor: pointer; text-decoration: none; }
td .link:hover { text-decoration: underline; }
tr.row-clickable-naczepa:hover td { background: var(--card2); }

/* Responsywność */
@media (max-width: 900px) {
  .counters { grid-template-columns: repeat(3, 1fr); }
  .map-feed { grid-template-columns: 1fr; height: auto; margin-bottom: 30px; }
  .map-col { height: auto; }
  .map-card { height: 300px; flex: none; }
  .feed-card { height: 480px; }
  .main { padding: 12px 16px; }
  .kpi-section { margin-bottom: 30px; }
  .table-section { margin-bottom: 38px; }
}
@media (max-width: 500px) {
  .counters { grid-template-columns: repeat(2, 1fr); }
  .header { padding: 12px 16px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Pasek błędu połączenia z serwerem ── */
.conn-error-bar {
  background: rgba(248,81,73,.12);
  border-bottom: 1px solid rgba(248,81,73,.3);
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 24px;
  text-align: center;
}
.conn-error-bar.hidden { display: none; }

/* ── Sekcja KPI ── */
.kpi-section {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 12px;
}
.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  min-height: 240px;
  overflow: hidden;
  transition: border-color .2s, transform .15s;
}
.kpi-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.kpi-card-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 12px;
}

/* Flota */
.kpi-fleet-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.kpi-fleet-icon  { font-size: 14px; flex-shrink: 0; }
.kpi-fleet-label { font-size: 12px; color: var(--text2); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-fleet-nums  { font-size: 13px; font-weight: 700; }
.kpi-fleet-of    { font-size: 12px; color: var(--text2); }
.kpi-fleet-pct   { font-size: 11px; color: var(--text2); min-width: 30px; text-align: right; }

/* Paski postępu */
.kpi-bar-wrap {
  width: 100%;
  height: 4px;
  background: var(--card2);
  border-radius: 2px;
  margin-bottom: 10px;
  overflow: hidden;
}
.kpi-bar {
  height: 100%;
  border-radius: 2px;
  transition: width .6s ease;
}

/* Statusy — od 03.09.2026 dwie kolumny wewnątrz tej samej ramki .kpi-card
   (lista rozbita na wszystkie realne statusy floty, za długa na jedną
   pionową kolumnę w dotychczasowej wysokości karty). Lewa kolumna = statusy
   o większym wolumenie, prawa = pozostałe. Ramka .kpi-card bez zmian. */
.kpi-statusy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 32px;
}
/* min-width:0 wymagane — bez tego grid item domyślnie nie kurczy się poniżej
   szerokości swojej zawartości (min-width:auto), co łamie ellipsis etykiet
   w węższej z dwóch kolumn na średnich szerokościach ekranu. */
.kpi-statusy-col { min-width: 0; }
.kpi-status-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) 22px minmax(30px, 60px) 30px;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
}
.kpi-status-row .kpi-bar-wrap { margin-bottom: 0; }
.kpi-status-icon  { font-size: 12px; }
.kpi-status-label { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-status-num   { font-size: 13px; font-weight: 700; text-align: right; }
.kpi-status-pct   { font-size: 10px; color: var(--text2); text-align: right; }

@media (max-width: 480px) {
  .kpi-statusy-grid { grid-template-columns: 1fr; }
}

/* Responsywność KPI */
@media (max-width: 1000px) {
  .kpi-section { grid-template-columns: 1fr; }
}

/* Sekcja Raporty — mobile: szukajka na pełną szerokość, data+filtr w drugiej linii */
@media (max-width: 700px) {
  .section-search-row { flex-direction: column; align-items: stretch; }
  .section-search-row .section-search-wrap { width: 100%; }
  .section-date-filter-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }
  .section-date-filter-row .section-date-nav { flex: 0 1 auto; min-width: 0; flex-wrap: nowrap; }
  .section-date-filter-row .filter-select,
  .section-date-filter-row .multiselect { flex-shrink: 0; }
  #date-status { display: none; }
  #date-prev, #date-next { display: none; }
  #date-picker { width: auto; }

  /* Sekcja Flota live — mobile: szukajka na pełną szerokość, filtry w drugiej linii */
  .map-search-row { flex-direction: column; align-items: stretch; }
  .map-search-row .section-search-wrap { width: 100%; }
  .map-filter-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }
  .map-filter-row .filter-select,
  .map-filter-row .multiselect { flex-shrink: 0; }
}

.sync-w-toku-item {
  background: var(--card);
  border-left: 3px solid var(--accent2);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text2);
}

/* Tabela naczep (zakładka Naczepy, etap 3) */
.naczepy-tabela-sekcja { margin: 16px; }
.naczepy-tabela-sekcja .section-search-row { flex-wrap: wrap; gap: 8px; }
.nt-przelacznik { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text2); white-space: nowrap; }
.nt-licznik { font-size: 12px; color: var(--text2); margin-left: auto; white-space: nowrap; }
.nt-komunikat { margin: 8px 0; padding: 8px 12px; border-radius: 8px; background: var(--card2); color: var(--text); font-size: 13px; }
.nt-wrap { max-height: 60vh; }
.nt-tabela tbody tr { cursor: pointer; }
.nt-tabela tbody tr:hover { background: var(--card2); }
.nt-tabela tr.nt-wybrany { outline: 2px solid var(--accent); outline-offset: -2px; }
.nt-tabela td { white-space: nowrap; }
.nt-tabela td.nt-wyposazenie { white-space: normal; min-width: 180px; }
.nt-rej { font-size: 12px; color: var(--text2); }
.nt-przyklejona { position: sticky; left: 0; background: var(--card); z-index: 1; }
thead .nt-przyklejona { background: var(--card2); z-index: 2; }
.nt-szary, .zdj-raport-stanu, .zdj-brak-wpisu { color: var(--text2); }
.nt-przygaszony { opacity: 0.6; }
.zdj-braki { color: var(--warning, #d97706); font-weight: 600; }
.nt-historia { margin: 0 0 16px; }
.nt-historia-lista { margin: 8px 0 0; padding-left: 20px; font-size: 13px; line-height: 1.6; }
.nt-historia-lista li { margin-bottom: 4px; }
